Skip to content
Commits on Source (8)
......@@ -48,7 +48,9 @@
#include <fcntl.h>
#include <unistd.h>
#include <hn70ap/system.h>
#include <hn70ap/eeprom.h>
#include <hn70ap/radio.h>
/****************************************************************************
* Public Functions
......@@ -72,10 +74,8 @@ int main(int argc, FAR char *argv[])
int beacon_main(int argc, char *argv[])
#endif
{
char *devname = "/dev/raux";
char *data;
int ret = OK;
int fd;
int buflen = 1024;
uint32_t seqnum = 0;
char call[9];
......@@ -83,22 +83,20 @@ int beacon_main(int argc, char *argv[])
uint8_t *buf;
if(argc == 3)
{
devname = argv[1];
data = argv[2];
}
else if(argc == 2)
if(argc == 2)
{
data = argv[1];
}
else if(argc == 1)
else
{
data = "HELLO 73";
}
else
ret = hn70ap_system_init();
if(ret != 0)
{
return beacon_usage();
fprintf(stderr, "hn70ap init failed!\n");
return ERROR;
}
buf = malloc(buflen);
......@@ -110,15 +108,7 @@ int beacon_main(int argc, char *argv[])
}
fd = open(devname, O_RDWR);
if(fd<0)
{
fprintf(stderr, "open failed!\n");
ret = ERROR;
goto retfree;
}
printf("\nTX beacon using %s\n", devname);
printf("\nTX beacon using aux radio\n");
/* Define payload */
hn70ap_eeconfig_getcall("call", call);
......@@ -129,14 +119,14 @@ int beacon_main(int argc, char *argv[])
{
fprintf(stderr, "call sign not defined, see config app\n");
ret = ERROR;
goto retclose;
goto retfree;
}
while(1)
{
sprintf(buf, "DE %s/%d HN70AP TEST BEACON SEQ %u: %s\n", call, ssid, seqnum, data);
printf("%s", buf);
ret = write(fd, buf, strlen(buf));
sprintf((char*)buf, "DE %s/%d HN70AP TEST BEACON SEQ %u: %s\n", call, ssid, seqnum, data);
printf("%s", (char*)buf);
ret = hn70ap_radio_transmit(HN70AP_RADIO_AUX, buf, strlen((char*)buf));
if(ret < 0)
{
printf("write failed, errno=%d\n", errno);
......@@ -146,8 +136,6 @@ int beacon_main(int argc, char *argv[])
seqnum += 1;
}
retclose:
close(fd);
retfree:
free(buf);
done:
......
/****************************************************************************
* hn70ap/apps/export/lcd.h
*
* Copyright (C) 2018 Sebastien Lorquet. All rights reserved.
* Author: Sebastien Lorquet <sebastien@lorquet.fr>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef HN70AP_LCD_H
#define HN70AP_LCD_H
int hn70ap_lcd_init(void);
int hn70ap_lcd_drawchar(int row, int col, char *ch);
int hn70ap_lcd_drawstr(int row, int col, char *ch);
#endif
......@@ -33,10 +33,21 @@
*
****************************************************************************/
#ifndef HN70AP_TIMER
#define HN70AP_TIMER
#ifndef HN70AP_LEDS
#define HN70AP_LEDS
int leds_init(void);
int leds_state(int led, int state);
#define LED_STATE_OFF 0
#define LED_STATE_ON 1
#define LED_1A 0
#define LED_1B 1
#define LED_RED 2
#define LED_ORANGE 3
#define LED_GREEN 4
#define LED_HEARTBEAT 5
#define LED_MACLINK 6
int hn70ap_leds_init(void);
int hn70ap_leds_state(int led, int state);
#endif //HN70AP_TIMER
/****************************************************************************
* hn70ap/apps/export/radio.h
*
* Copyright (C) 2018 Sebastien Lorquet. All rights reserved.
* Author: Sebastien Lorquet <sebastien@lorquet.fr>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef HN70AP_RADIO_H
#define HN70AP_RADIO_H
#include <stdint.h>
#include <stdbool.h>
#define HN70AP_RADIO_MAIN 1
#define HN70AP_RADIO_AUX 2
int hn70ap_radio_init(void);
int hn70ap_radio_transmit(uint8_t device, uint8_t *buf, size_t len);
int hn70ap_radio_receive (uint8_t device, uint8_t *buf, size_t len);
#endif /* HN70AP_SYSTEM_H */
/****************************************************************************
* hn70ap/apps/export/system.h
*
* Copyright (C) 2018 Sebastien Lorquet. All rights reserved.
* Author: Sebastien Lorquet <sebastien@lorquet.fr>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef HN70AP_SYSTEM_H
#define HN70AP_SYSTEM_H
#include <stdint.h>
#include <stdbool.h>
int hn70ap_system_init(void);
#endif /* HN70AP_SYSTEM_H */
......@@ -36,6 +36,6 @@
#ifndef HN70AP_TIMER
#define HN70AP_TIMER
int timer_init(void);
int hn70ap_timer_init(void);
#endif //HN70AP_TIMER
......@@ -36,7 +36,7 @@
-include $(TOPDIR)/Make.defs
ASRCS =
CSRCS = eeprom.c leds.c timer.c
CSRCS = eeprom.c leds.c lcd.c timer.c system.c radio.c
CSRCS += tlv.c crc.c sha256.c hdlc.c
CSRCS += update.c
......
/****************************************************************************
* hn70ap/apps/libhn70ap/lcd.c
*
* Copyright (C) 2018 Sebastien Lorquet. All rights reserved.
* Author: Sebastien Lorquet <sebastien@lorquet.fr>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
//Manage the 128x64 LCD
//Using aligned character positions, we can write 8 lines of 16 chars
// Font: CP437.pf
// https://www.min.at/prinz/o/software/pixelfont/
unsigned char font[2048] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Char 000 (.)
0x7E, 0x81, 0xA5, 0x81, 0xBD, 0x99, 0x81, 0x7E, // Char 001 (.)
0x7E, 0xFF, 0xDB, 0xFF, 0xC3, 0xE7, 0xFF, 0x7E, // Char 002 (.)
0x6C, 0xFE, 0xFE, 0xFE, 0x7C, 0x38, 0x10, 0x00, // Char 003 (.)
0x10, 0x38, 0x7C, 0xFE, 0x7C, 0x38, 0x10, 0x00, // Char 004 (.)
0x38, 0x7C, 0x38, 0xFE, 0xFE, 0xD6, 0x10, 0x38, // Char 005 (.)
0x10, 0x38, 0x7C, 0xFE, 0xFE, 0x7C, 0x10, 0x38, // Char 006 (.)
0x00, 0x00, 0x18, 0x3C, 0x3C, 0x18, 0x00, 0x00, // Char 007 (.)
0xFF, 0xFF, 0xE7, 0xC3, 0xC3, 0xE7, 0xFF, 0xFF, // Char 008 (.)
0x00, 0x3C, 0x66, 0x42, 0x42, 0x66, 0x3C, 0x00, // Char 009 (.)
0xFF, 0xC3, 0x99, 0xBD, 0xBD, 0x99, 0xC3, 0xFF, // Char 010 (.)
0x0F, 0x07, 0x0F, 0x7D, 0xCC, 0xCC, 0xCC, 0x78, // Char 011 (.)
0x3C, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x7E, 0x18, // Char 012 (.)
0x3F, 0x33, 0x3F, 0x30, 0x30, 0x70, 0xF0, 0xE0, // Char 013 (.)
0x7F, 0x63, 0x7F, 0x63, 0x63, 0x67, 0xE6, 0xC0, // Char 014 (.)
0x18, 0xDB, 0x3C, 0xE7, 0xE7, 0x3C, 0xDB, 0x18, // Char 015 (.)
0x80, 0xE0, 0xF8, 0xFE, 0xF8, 0xE0, 0x80, 0x00, // Char 016 (.)
0x02, 0x0E, 0x3E, 0xFE, 0x3E, 0x0E, 0x02, 0x00, // Char 017 (.)
0x18, 0x3C, 0x7E, 0x18, 0x18, 0x7E, 0x3C, 0x18, // Char 018 (.)
0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x66, 0x00, // Char 019 (.)
0x7F, 0xDB, 0xDB, 0x7B, 0x1B, 0x1B, 0x1B, 0x00, // Char 020 (.)
0x3E, 0x61, 0x3C, 0x66, 0x66, 0x3C, 0x86, 0x7C, // Char 021 (.)
0x00, 0x00, 0x00, 0x00, 0x7E, 0x7E, 0x7E, 0x00, // Char 022 (.)
0x18, 0x3C, 0x7E, 0x18, 0x7E, 0x3C, 0x18, 0xFF, // Char 023 (.)
0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x00, // Char 024 (.)
0x18, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x00, // Char 025 (.)
0x00, 0x18, 0x0C, 0xFE, 0x0C, 0x18, 0x00, 0x00, // Char 026 (.)
0x00, 0x30, 0x60, 0xFE, 0x60, 0x30, 0x00, 0x00, // Char 027 (.)
0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xFE, 0x00, 0x00, // Char 028 (.)
0x00, 0x24, 0x66, 0xFF, 0x66, 0x24, 0x00, 0x00, // Char 029 (.)
0x00, 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x00, 0x00, // Char 030 (.)
0x00, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x00, 0x00, // Char 031 (.)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Char 032 ( )
0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00, 0x18, 0x00, // Char 033 (!)
0x66, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, // Char 034 (")
0x6C, 0x6C, 0xFE, 0x6C, 0xFE, 0x6C, 0x6C, 0x00, // Char 035 (#)
0x18, 0x3E, 0x60, 0x3C, 0x06, 0x7C, 0x18, 0x00, // Char 036 ($)
0x00, 0xC6, 0xCC, 0x18, 0x30, 0x66, 0xC6, 0x00, // Char 037 (%)
0x38, 0x6C, 0x38, 0x76, 0xDC, 0xCC, 0x76, 0x00, // Char 038 (&)
0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, // Char 039 (')
0x0C, 0x18, 0x30, 0x30, 0x30, 0x18, 0x0C, 0x00, // Char 040 (()
0x30, 0x18, 0x0C, 0x0C, 0x0C, 0x18, 0x30, 0x00, // Char 041 ())
0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00, // Char 042 (*)
0x00, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x00, // Char 043 (+)
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, // Char 044 (,)
0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, // Char 045 (-)
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, // Char 046 (.)
0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x80, 0x00, // Char 047 (/)
0x38, 0x6C, 0xC6, 0xD6, 0xC6, 0x6C, 0x38, 0x00, // Char 048 (0)
0x18, 0x38, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x00, // Char 049 (1)
0x7C, 0xC6, 0x06, 0x1C, 0x30, 0x66, 0xFE, 0x00, // Char 050 (2)
0x7C, 0xC6, 0x06, 0x3C, 0x06, 0xC6, 0x7C, 0x00, // Char 051 (3)
0x1C, 0x3C, 0x6C, 0xCC, 0xFE, 0x0C, 0x1E, 0x00, // Char 052 (4)
0xFE, 0xC0, 0xC0, 0xFC, 0x06, 0xC6, 0x7C, 0x00, // Char 053 (5)
0x38, 0x60, 0xC0, 0xFC, 0xC6, 0xC6, 0x7C, 0x00, // Char 054 (6)
0xFE, 0xC6, 0x0C, 0x18, 0x30, 0x30, 0x30, 0x00, // Char 055 (7)
0x7C, 0xC6, 0xC6, 0x7C, 0xC6, 0xC6, 0x7C, 0x00, // Char 056 (8)
0x7C, 0xC6, 0xC6, 0x7E, 0x06, 0x0C, 0x78, 0x00, // Char 057 (9)
0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00, // Char 058 (:)
0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x30, // Char 059 (;)
0x06, 0x0C, 0x18, 0x30, 0x18, 0x0C, 0x06, 0x00, // Char 060 (<)
0x00, 0x00, 0x7E, 0x00, 0x00, 0x7E, 0x00, 0x00, // Char 061 (=)
0x60, 0x30, 0x18, 0x0C, 0x18, 0x30, 0x60, 0x00, // Char 062 (>)
0x7C, 0xC6, 0x0C, 0x18, 0x18, 0x00, 0x18, 0x00, // Char 063 (?)
0x7C, 0xC6, 0xDE, 0xDE, 0xDE, 0xC0, 0x78, 0x00, // Char 064 (@)
0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0x00, // Char 065 (A)
0xFC, 0x66, 0x66, 0x7C, 0x66, 0x66, 0xFC, 0x00, // Char 066 (B)
0x3C, 0x66, 0xC0, 0xC0, 0xC0, 0x66, 0x3C, 0x00, // Char 067 (C)
0xF8, 0x6C, 0x66, 0x66, 0x66, 0x6C, 0xF8, 0x00, // Char 068 (D)
0xFE, 0x62, 0x68, 0x78, 0x68, 0x62, 0xFE, 0x00, // Char 069 (E)
0xFE, 0x62, 0x68, 0x78, 0x68, 0x60, 0xF0, 0x00, // Char 070 (F)
0x3C, 0x66, 0xC0, 0xC0, 0xCE, 0x66, 0x3A, 0x00, // Char 071 (G)
0xC6, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0x00, // Char 072 (H)
0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, // Char 073 (I)
0x1E, 0x0C, 0x0C, 0x0C, 0xCC, 0xCC, 0x78, 0x00, // Char 074 (J)
0xE6, 0x66, 0x6C, 0x78, 0x6C, 0x66, 0xE6, 0x00, // Char 075 (K)
0xF0, 0x60, 0x60, 0x60, 0x62, 0x66, 0xFE, 0x00, // Char 076 (L)
0xC6, 0xEE, 0xFE, 0xFE, 0xD6, 0xC6, 0xC6, 0x00, // Char 077 (M)
0xC6, 0xE6, 0xF6, 0xDE, 0xCE, 0xC6, 0xC6, 0x00, // Char 078 (N)
0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, // Char 079 (O)
0xFC, 0x66, 0x66, 0x7C, 0x60, 0x60, 0xF0, 0x00, // Char 080 (P)
0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xCE, 0x7C, 0x0E, // Char 081 (Q)
0xFC, 0x66, 0x66, 0x7C, 0x6C, 0x66, 0xE6, 0x00, // Char 082 (R)
0x3C, 0x66, 0x30, 0x18, 0x0C, 0x66, 0x3C, 0x00, // Char 083 (S)
0x7E, 0x7E, 0x5A, 0x18, 0x18, 0x18, 0x3C, 0x00, // Char 084 (T)
0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, // Char 085 (U)
0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x6C, 0x38, 0x00, // Char 086 (V)
0xC6, 0xC6, 0xC6, 0xD6, 0xD6, 0xFE, 0x6C, 0x00, // Char 087 (W)
0xC6, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0xC6, 0x00, // Char 088 (X)
0x66, 0x66, 0x66, 0x3C, 0x18, 0x18, 0x3C, 0x00, // Char 089 (Y)
0xFE, 0xC6, 0x8C, 0x18, 0x32, 0x66, 0xFE, 0x00, // Char 090 (Z)
0x3C, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3C, 0x00, // Char 091 ([)
0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x02, 0x00, // Char 092 (\)
0x3C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x3C, 0x00, // Char 093 (])
0x10, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0x00, // Char 094 (^)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, // Char 095 (_)
0x30, 0x18, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, // Char 096 (`)
0x00, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, // Char 097 (a)
0xE0, 0x60, 0x7C, 0x66, 0x66, 0x66, 0xDC, 0x00, // Char 098 (b)
0x00, 0x00, 0x7C, 0xC6, 0xC0, 0xC6, 0x7C, 0x00, // Char 099 (c)
0x1C, 0x0C, 0x7C, 0xCC, 0xCC, 0xCC, 0x76, 0x00, // Char 100 (d)
0x00, 0x00, 0x7C, 0xC6, 0xFE, 0xC0, 0x7C, 0x00, // Char 101 (e)
0x3C, 0x66, 0x60, 0xF8, 0x60, 0x60, 0xF0, 0x00, // Char 102 (f)
0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8, // Char 103 (g)
0xE0, 0x60, 0x6C, 0x76, 0x66, 0x66, 0xE6, 0x00, // Char 104 (h)
0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00, // Char 105 (i)
0x06, 0x00, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3C, // Char 106 (j)
0xE0, 0x60, 0x66, 0x6C, 0x78, 0x6C, 0xE6, 0x00, // Char 107 (k)
0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, // Char 108 (l)
0x00, 0x00, 0xEC, 0xFE, 0xD6, 0xD6, 0xD6, 0x00, // Char 109 (m)
0x00, 0x00, 0xDC, 0x66, 0x66, 0x66, 0x66, 0x00, // Char 110 (n)
0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, // Char 111 (o)
0x00, 0x00, 0xDC, 0x66, 0x66, 0x7C, 0x60, 0xF0, // Char 112 (p)
0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0x1E, // Char 113 (q)
0x00, 0x00, 0xDC, 0x76, 0x60, 0x60, 0xF0, 0x00, // Char 114 (r)
0x00, 0x00, 0x7E, 0xC0, 0x7C, 0x06, 0xFC, 0x00, // Char 115 (s)
0x30, 0x30, 0xFC, 0x30, 0x30, 0x36, 0x1C, 0x00, // Char 116 (t)
0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, // Char 117 (u)
0x00, 0x00, 0xC6, 0xC6, 0xC6, 0x6C, 0x38, 0x00, // Char 118 (v)
0x00, 0x00, 0xC6, 0xD6, 0xD6, 0xFE, 0x6C, 0x00, // Char 119 (w)
0x00, 0x00, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0x00, // Char 120 (x)
0x00, 0x00, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0xFC, // Char 121 (y)
0x00, 0x00, 0x7E, 0x4C, 0x18, 0x32, 0x7E, 0x00, // Char 122 (z)
0x0E, 0x18, 0x18, 0x70, 0x18, 0x18, 0x0E, 0x00, // Char 123 ({)
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, // Char 124 (|)
0x70, 0x18, 0x18, 0x0E, 0x18, 0x18, 0x70, 0x00, // Char 125 (})
0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Char 126 (~)
0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00, // Char 127 (.)
0x7C, 0xC6, 0xC0, 0xC0, 0xC6, 0x7C, 0x0C, 0x78, // Char 128 (.)
0xCC, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, // Char 129 (.)
0x0C, 0x18, 0x7C, 0xC6, 0xFE, 0xC0, 0x7C, 0x00, // Char 130 (.)
0x7C, 0x82, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, // Char 131 (.)
0xC6, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, // Char 132 (.)
0x30, 0x18, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, // Char 133 (.)
0x30, 0x30, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, // Char 134 (.)
0x00, 0x00, 0x7E, 0xC0, 0xC0, 0x7E, 0x0C, 0x38, // Char 135 (.)
0x7C, 0x82, 0x7C, 0xC6, 0xFE, 0xC0, 0x7C, 0x00, // Char 136 (.)
0xC6, 0x00, 0x7C, 0xC6, 0xFE, 0xC0, 0x7C, 0x00, // Char 137 (.)
0x30, 0x18, 0x7C, 0xC6, 0xFE, 0xC0, 0x7C, 0x00, // Char 138 (.)
0x66, 0x00, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00, // Char 139 (.)
0x7C, 0x82, 0x38, 0x18, 0x18, 0x18, 0x3C, 0x00, // Char 140 (.)
0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x3C, 0x00, // Char 141 (.)
0xC6, 0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, // Char 142 (.)
0x38, 0x6C, 0x7C, 0xC6, 0xFE, 0xC6, 0xC6, 0x00, // Char 143 (.)
0x18, 0x30, 0xFE, 0xC0, 0xF8, 0xC0, 0xFE, 0x00, // Char 144 (.)
0x00, 0x00, 0x7E, 0x18, 0x7E, 0xD8, 0x7E, 0x00, // Char 145 (.)
0x3E, 0x6C, 0xCC, 0xFE, 0xCC, 0xCC, 0xCE, 0x00, // Char 146 (.)
0x7C, 0x82, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, // Char 147 (.)
0xC6, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, // Char 148 (.)
0x30, 0x18, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, // Char 149 (.)
0x78, 0x84, 0x00, 0xCC, 0xCC, 0xCC, 0x76, 0x00, // Char 150 (.)
0x60, 0x30, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, // Char 151 (.)
0xC6, 0x00, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0xFC, // Char 152 (.)
0xC6, 0x38, 0x6C, 0xC6, 0xC6, 0x6C, 0x38, 0x00, // Char 153 (.)
0xC6, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, // Char 154 (.)
0x18, 0x18, 0x7E, 0xC0, 0xC0, 0x7E, 0x18, 0x18, // Char 155 (.)
0x38, 0x6C, 0x64, 0xF0, 0x60, 0x66, 0xFC, 0x00, // Char 156 (.)
0x66, 0x66, 0x3C, 0x7E, 0x18, 0x7E, 0x18, 0x18, // Char 157 (.)
0xF8, 0xCC, 0xCC, 0xFA, 0xC6, 0xCF, 0xC6, 0xC7, // Char 158 (.)
0x0E, 0x1B, 0x18, 0x3C, 0x18, 0xD8, 0x70, 0x00, // Char 159 (.)
0x18, 0x30, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00, // Char 160 (.)
0x0C, 0x18, 0x00, 0x38, 0x18, 0x18, 0x3C, 0x00, // Char 161 (.)
0x0C, 0x18, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, // Char 162 (.)
0x18, 0x30, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, // Char 163 (.)
0x76, 0xDC, 0x00, 0xDC, 0x66, 0x66, 0x66, 0x00, // Char 164 (.)
0x76, 0xDC, 0x00, 0xE6, 0xF6, 0xDE, 0xCE, 0x00, // Char 165 (.)
0x3C, 0x6C, 0x6C, 0x3E, 0x00, 0x7E, 0x00, 0x00, // Char 166 (.)
0x38, 0x6C, 0x6C, 0x38, 0x00, 0x7C, 0x00, 0x00, // Char 167 (.)
0x18, 0x00, 0x18, 0x18, 0x30, 0x63, 0x3E, 0x00, // Char 168 (.)
0x00, 0x00, 0x00, 0xFE, 0xC0, 0xC0, 0x00, 0x00, // Char 169 (.)
0x00, 0x00, 0x00, 0xFE, 0x06, 0x06, 0x00, 0x00, // Char 170 (.)
0x63, 0xE6, 0x6C, 0x7E, 0x33, 0x66, 0xCC, 0x0F, // Char 171 (.)
0x63, 0xE6, 0x6C, 0x7A, 0x36, 0x6A, 0xDF, 0x06, // Char 172 (.)
0x18, 0x00, 0x18, 0x18, 0x3C, 0x3C, 0x18, 0x00, // Char 173 (.)
0x00, 0x33, 0x66, 0xCC, 0x66, 0x33, 0x00, 0x00, // Char 174 (.)
0x00, 0xCC, 0x66, 0x33, 0x66, 0xCC, 0x00, 0x00, // Char 175 (.)
0x22, 0x88, 0x22, 0x88, 0x22, 0x88, 0x22, 0x88, // Char 176 (.)
0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, // Char 177 (.)
0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, 0x77, 0xDD, // Char 178 (.)
0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, // Char 179 (.)
0x18, 0x18, 0x18, 0x18, 0xF8, 0x18, 0x18, 0x18, // Char 180 (.)
0x18, 0x18, 0xF8, 0x18, 0xF8, 0x18, 0x18, 0x18, // Char 181 (.)
0x36, 0x36, 0x36, 0x36, 0xF6, 0x36, 0x36, 0x36, // Char 182 (.)
0x00, 0x00, 0x00, 0x00, 0xFE, 0x36, 0x36, 0x36, // Char 183 (.)
0x00, 0x00, 0xF8, 0x18, 0xF8, 0x18, 0x18, 0x18, // Char 184 (.)
0x36, 0x36, 0xF6, 0x06, 0xF6, 0x36, 0x36, 0x36, // Char 185 (.)
0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, // Char 186 (.)
0x00, 0x00, 0xFE, 0x06, 0xF6, 0x36, 0x36, 0x36, // Char 187 (.)
0x36, 0x36, 0xF6, 0x06, 0xFE, 0x00, 0x00, 0x00, // Char 188 (.)
0x36, 0x36, 0x36, 0x36, 0xFE, 0x00, 0x00, 0x00, // Char 189 (.)
0x18, 0x18, 0xF8, 0x18, 0xF8, 0x00, 0x00, 0x00, // Char 190 (.)
0x00, 0x00, 0x00, 0x00, 0xF8, 0x18, 0x18, 0x18, // Char 191 (.)
0x18, 0x18, 0x18, 0x18, 0x1F, 0x00, 0x00, 0x00, // Char 192 (.)
0x18, 0x18, 0x18, 0x18, 0xFF, 0x00, 0x00, 0x00, // Char 193 (.)
0x00, 0x00, 0x00, 0x00, 0xFF, 0x18, 0x18, 0x18, // Char 194 (.)
0x18, 0x18, 0x18, 0x18, 0x1F, 0x18, 0x18, 0x18, // Char 195 (.)
0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, // Char 196 (.)
0x18, 0x18, 0x18, 0x18, 0xFF, 0x18, 0x18, 0x18, // Char 197 (.)
0x18, 0x18, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18, // Char 198 (.)
0x36, 0x36, 0x36, 0x36, 0x37, 0x36, 0x36, 0x36, // Char 199 (.)
0x36, 0x36, 0x37, 0x30, 0x3F, 0x00, 0x00, 0x00, // Char 200 (.)
0x00, 0x00, 0x3F, 0x30, 0x37, 0x36, 0x36, 0x36, // Char 201 (.)
0x36, 0x36, 0xF7, 0x00, 0xFF, 0x00, 0x00, 0x00, // Char 202 (.)
0x00, 0x00, 0xFF, 0x00, 0xF7, 0x36, 0x36, 0x36, // Char 203 (.)
0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, // Char 204 (.)
0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, // Char 205 (.)
0x36, 0x36, 0xF7, 0x00, 0xF7, 0x36, 0x36, 0x36, // Char 206 (.)
0x18, 0x18, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, // Char 207 (.)
0x36, 0x36, 0x36, 0x36, 0xFF, 0x00, 0x00, 0x00, // Char 208 (.)
0x00, 0x00, 0xFF, 0x00, 0xFF, 0x18, 0x18, 0x18, // Char 209 (.)
0x00, 0x00, 0x00, 0x00, 0xFF, 0x36, 0x36, 0x36, // Char 210 (.)
0x36, 0x36, 0x36, 0x36, 0x3F, 0x00, 0x00, 0x00, // Char 211 (.)
0x18, 0x18, 0x1F, 0x18, 0x1F, 0x00, 0x00, 0x00, // Char 212 (.)
0x00, 0x00, 0x1F, 0x18, 0x1F, 0x18, 0x18, 0x18, // Char 213 (.)
0x00, 0x00, 0x00, 0x00, 0x3F, 0x36, 0x36, 0x36, // Char 214 (.)
0x36, 0x36, 0x36, 0x36, 0xFF, 0x36, 0x36, 0x36, // Char 215 (.)
0x18, 0x18, 0xFF, 0x18, 0xFF, 0x18, 0x18, 0x18, // Char 216 (.)
0x18, 0x18, 0x18, 0x18, 0xF8, 0x00, 0x00, 0x00, // Char 217 (.)
0x00, 0x00, 0x00, 0x00, 0x1F, 0x18, 0x18, 0x18, // Char 218 (.)
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // Char 219 (.)
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, // Char 220 (.)
0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, // Char 221 (.)
0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, // Char 222 (.)
0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, // Char 223 (.)
0x00, 0x00, 0x76, 0xDC, 0xC8, 0xDC, 0x76, 0x00, // Char 224 (.)
0x78, 0xCC, 0xCC, 0xD8, 0xCC, 0xC6, 0xCC, 0x00, // Char 225 (.)
0xFE, 0xC6, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, // Char 226 (.)
0x00, 0x00, 0xFE, 0x6C, 0x6C, 0x6C, 0x6C, 0x00, // Char 227 (.)
0xFE, 0xC6, 0x60, 0x30, 0x60, 0xC6, 0xFE, 0x00, // Char 228 (.)
0x00, 0x00, 0x7E, 0xD8, 0xD8, 0xD8, 0x70, 0x00, // Char 229 (.)
0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x7C, 0xC0, // Char 230 (.)
0x00, 0x76, 0xDC, 0x18, 0x18, 0x18, 0x18, 0x00, // Char 231 (.)
0x7E, 0x18, 0x3C, 0x66, 0x66, 0x3C, 0x18, 0x7E, // Char 232 (.)
0x38, 0x6C, 0xC6, 0xFE, 0xC6, 0x6C, 0x38, 0x00, // Char 233 (.)
0x38, 0x6C, 0xC6, 0xC6, 0x6C, 0x6C, 0xEE, 0x00, // Char 234 (.)
0x0E, 0x18, 0x0C, 0x3E, 0x66, 0x66, 0x3C, 0x00, // Char 235 (.)
0x00, 0x00, 0x7E, 0xDB, 0xDB, 0x7E, 0x00, 0x00, // Char 236 (.)
0x06, 0x0C, 0x7E, 0xDB, 0xDB, 0x7E, 0x60, 0xC0, // Char 237 (.)
0x1E, 0x30, 0x60, 0x7E, 0x60, 0x30, 0x1E, 0x00, // Char 238 (.)
0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x00, // Char 239 (.)
0x00, 0xFE, 0x00, 0xFE, 0x00, 0xFE, 0x00, 0x00, // Char 240 (.)
0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x7E, 0x00, // Char 241 (.)
0x30, 0x18, 0x0C, 0x18, 0x30, 0x00, 0x7E, 0x00, // Char 242 (.)
0x0C, 0x18, 0x30, 0x18, 0x0C, 0x00, 0x7E, 0x00, // Char 243 (.)
0x0E, 0x1B, 0x1B, 0x18, 0x18, 0x18, 0x18, 0x18, // Char 244 (.)
0x18, 0x18, 0x18, 0x18, 0x18, 0xD8, 0xD8, 0x70, // Char 245 (.)
0x00, 0x18, 0x00, 0x7E, 0x00, 0x18, 0x00, 0x00, // Char 246 (.)
0x00, 0x76, 0xDC, 0x00, 0x76, 0xDC, 0x00, 0x00, // Char 247 (.)
0x38, 0x6C, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00, // Char 248 (.)
0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, // Char 249 (.)
0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, // Char 250 (.)
0x0F, 0x0C, 0x0C, 0x0C, 0xEC, 0x6C, 0x3C, 0x1C, // Char 251 (.)
0x6C, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, // Char 252 (.)
0x78, 0x0C, 0x18, 0x30, 0x7C, 0x00, 0x00, 0x00, // Char 253 (.)
0x00, 0x00, 0x3C, 0x3C, 0x3C, 0x3C, 0x00, 0x00, // Char 254 (.)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // Char 255 (.)
};
/****************************************************************************
* hn70ap_lcd_init
****************************************************************************/
int hn70ap_lcd_init(void)
{
return 0;
}
/****************************************************************************
* hn70ap_lcd_drawchar
****************************************************************************/
int hn70ap_lcd_drawchar(int row, int col, char ch)
{
return 0;
}
/****************************************************************************
* hn70ap_lcd_drawstr
****************************************************************************/
int hn70ap_lcd_drawstr(int row, int col, char *ch)
{
int cr = row;
int cc = col;
return 0;
}
......@@ -46,18 +46,21 @@
#include <nuttx/leds/userled.h>
#include <hn70ap/timer.h>
#include <hn70ap/leds.h>
int leds_init(void)
int hn70ap_leds_init(void)
{
/* TODO open driver once and for all to speed up led update? */
return 0;
}
int leds_state(int lednum, bool state)
int hn70ap_leds_state(int lednum, int state)
{
struct userled_s led;
int fd;
int ret;
fd = open("/dev/userleds", O_RDWR);
fd = open("/dev/leds", O_WRONLY);
if(fd<0)
{
fprintf(stderr, "Failed to open LEDS device\n");
......@@ -65,12 +68,13 @@ int leds_state(int lednum, bool state)
}
led.ul_led = lednum;
led.ul_on = state;
led.ul_on = (state == LED_STATE_ON);
ret = ioctl(fd, ULEDIOC_SETLED, (unsigned long)&led);
if(ret<0)
{
fprintf(stderr, "Failed to change LED state\n");
close(fd);
return -1;
}
......
/****************************************************************************
* hn70ap/apps/libhn70ap/radio.c
*
* Copyright (C) 2018 Sebastien Lorquet. All rights reserved.
* Author: Sebastien Lorquet <sebastien@lorquet.fr>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <stdbool.h>
#include <fcntl.h>
#include <syslog.h>
#include <unistd.h>
#include <pthread.h>
#include <hn70ap/radio.h>
#include <hn70ap/leds.h>
static int g_hn70ap_fdmainradio;
static int g_hn70ap_fdauxradio;
static bool g_hn70ap_radioalive;
static pthread_t g_hn70ap_txthreadid;
/****************************************************************************
* hn70ap_radio_txthread
* This thread waits for radio transmit requests from other processes,
* and sends packets.
****************************************************************************/
void *hn70ap_radio_txthread(void *arg)
{
syslog(LOG_INFO, "Started radio RX thread\n");
while(g_hn70ap_radioalive)
{
//Wait for messages in transmit queue
//Transmit these messages
}
syslog(LOG_INFO, "Stopped radio RX thread\n");
}
/****************************************************************************
* hn70ap_radio_transmit
****************************************************************************/
int hn70ap_radio_transmit(uint8_t device, uint8_t *buf, size_t len)
{
int fd;
int ret;
if(device == HN70AP_RADIO_MAIN)
{
fd = g_hn70ap_fdmainradio;
}
else if(device == HN70AP_RADIO_AUX)
{
fd = g_hn70ap_fdauxradio;
}
else
{
return ERROR;
}
/* Turn on radio LED in transmit mode */
hn70ap_leds_state(LED_1A, LED_STATE_ON);
hn70ap_leds_state(LED_1B, LED_STATE_OFF);
/* Transmit */
ret = write(fd, buf, len);
/* Turn off radio LED */
hn70ap_leds_state(LED_1A, LED_STATE_OFF);
hn70ap_leds_state(LED_1B, LED_STATE_OFF);
return ret;
}
/****************************************************************************
* hn70ap_radio_receive
****************************************************************************/
int hn70ap_radio_receive(uint8_t device, uint8_t *buf, size_t len)
{
int fd;
int ret;
if(device == HN70AP_RADIO_MAIN)
{
fd = g_hn70ap_fdmainradio;
}
else if(device == HN70AP_RADIO_AUX)
{
fd = g_hn70ap_fdauxradio;
}
else
{
return ERROR;
}
/* Turn on radio LED in transmit mode */
hn70ap_leds_state(LED_1A, LED_STATE_OFF);
hn70ap_leds_state(LED_1B, LED_STATE_ON);
/* Transmit */
ret = read(fd, buf, len);
/* Turn off radio LED */
hn70ap_leds_state(LED_1A, LED_STATE_OFF);
hn70ap_leds_state(LED_1B, LED_STATE_OFF);
return ret;
}
/****************************************************************************
* hn70ap_radio_init
****************************************************************************/
int hn70ap_radio_init(void)
{
int ret = 0;
#ifdef CONFIG_HN70AP_MAINRADIO
syslog(LOG_INFO, "Checking main radio\n");
g_hn70ap_fdmainradio = open("/dev/rmain", O_RDWR);
if(g_hn70ap_fdmainradio<0)
{
syslog(LOG_ERR, "Failed to access main radio!\n");
ret = -1;
goto lret;
}
#endif
#ifdef CONFIG_HN70AP_AUXRADIO
syslog(LOG_INFO, "Checking aux radio\n");
g_hn70ap_fdauxradio = open("/dev/raux", O_RDWR);
if(g_hn70ap_fdauxradio<0)
{
syslog(LOG_ERR, "Failed to access aux radio!\n");
ret = -1;
goto lret;
}
#endif
g_hn70ap_radioalive = true;
ret = pthread_create(&g_hn70ap_txthreadid, NULL, hn70ap_radio_txthread, NULL);
if(ret < 0)
{
syslog(LOG_ERR, "Failed to start the transmit thread\n");
}
lret:
return ret;
}
/****************************************************************************
* hn70ap/apps/libhn70ap/system.c
*
* Copyright (C) 2018 Sebastien Lorquet. All rights reserved.
* Author: Sebastien Lorquet <sebastien@lorquet.fr>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <stdbool.h>
#include <syslog.h>
#include <hn70ap/eeprom.h>
#include <hn70ap/timer.h>
#include <hn70ap/leds.h>
#include <hn70ap/radio.h>
static bool hn70ap_system_initialized = false;
int hn70ap_system_init(void)
{
int ret;
bool defaults;
if(hn70ap_system_initialized)
{
syslog(LOG_WARNING, "System already initialized\n");
return 0;
}
/* Initialize timer thread to help us schedule delays */
ret = hn70ap_timer_init();
if(ret != 0)
{
syslog(LOG_ERR, "FATAL: Failed to initialize timers\n");
return ERROR;
}
/* Initialize the leds */
/* Requires timer for blinking */
ret = hn70ap_leds_init();
if(ret != 0)
{
syslog(LOG_ERR, "FATAL: Failed to initialize Leds\n");
return ERROR;
}
/* Initialize the EEPROM */
ret = hn70ap_eeconfig_init(&defaults);
if(ret != 0)
{
syslog(LOG_ERR, "FATAL: Failed to initialize EEPROM\n");
return ERROR;
}
if(defaults)
{
syslog(LOG_ERR, "WARNING: Default config values loaded in EEPROM\n");
}
ret = hn70ap_radio_init();
if(ret != 0)
{
syslog(LOG_ERR, "FATAL: Failed to initialize Radios\n");
return ERROR;
}
hn70ap_system_initialized = true;
return OK;
}
......@@ -36,11 +36,78 @@
#include <nuttx/config.h>
#include <stdint.h>
#include <stdbool.h>
#include <pthread.h>
#include <syslog.h>
#include <semaphore.h>
#include <time.h>
#include <hn70ap/timer.h>
#include <hn70ap/leds.h>
struct timer_s
{
struct timer_s *next; /* List link */
int id; /* Timer identifier, for deletion */
struct timespec expiration; /* Expiration date, checked in timer thread */
uint32_t repeat_delay; /* If zero, one shoot, else, reload delay */
void *arg; /* Callback argument */
void (*callback)(void *arg); /* Timer callback */
};
struct timer_s *g_timers_head;
struct timer_s *g_timers_tail;
static pthread_t g_timerthreadid;
static int heartbeat;
static void *timer_thread(void *arg)
{
sem_t sem;
struct timespec tout;
sem_init(&sem, 0, 0);
syslog(LOG_INFO, "Starting timer thread\n");
clock_gettime(CLOCK_REALTIME, &tout);
while(true)
{
tout.tv_nsec += 100000000;
if(tout.tv_nsec > 1000000000)
{
tout.tv_nsec -= 1000000000;
tout.tv_sec += 1;
}
sem_timedwait(&sem, &tout);
/* Toggle the heartbeat LED */
hn70ap_leds_state(LED_HEARTBEAT, (heartbeat<9)?LED_STATE_OFF:LED_STATE_ON);
heartbeat += 1;
if(heartbeat == 10) heartbeat = 0;
/* Look at the next timer */
}
return NULL;
}
int hn70ap_timer_init(void)
{
int ret;
g_timers_head = NULL;
g_timers_tail = NULL;
heartbeat = 0;
ret = pthread_create(&g_timerthreadid, NULL, timer_thread, NULL);
return ret;
}
int timer_init(void)
int hn70ap_timer_add(void (*callback)(void*arg), void *arg, uint32_t delay, bool repeat)
{
return 0;
return -1;
}
......@@ -48,6 +48,9 @@
#include <fcntl.h>
#include <unistd.h>
#include <hn70ap/system.h>
#include <hn70ap/radio.h>
/****************************************************************************
* Public Functions
****************************************************************************/
......@@ -62,7 +65,6 @@ int main(int argc, FAR char *argv[])
int rxt_main(int argc, char *argv[])
#endif
{
char *devname = "/dev/raux";
int ret = OK;
int fd;
int buflen = 1024;
......@@ -70,40 +72,39 @@ int rxt_main(int argc, char *argv[])
uint8_t *buf;
if(argc > 1)
{
devname = argv[1];
}
printf("RX test using %s\n", devname);
printf("RX test using aux radio\n");
fd = open(devname, O_RDWR);
if(fd<0)
{
fprintf(stderr, "open failed!\n");
ret = ERROR;
goto done;
}
hn70ap_system_init();
buf = malloc(buflen);
if(!buf)
{
fprintf(stderr, "open failed!\n");
fprintf(stderr, "malloc failed!\n");
ret = ERROR;
goto retclose;
goto done;
}
do
{
ret = read(fd, buf, buflen);
printf("read done, ret = %d, errno=%d\n", ret, errno);
ret = hn70ap_radio_receive(HN70AP_RADIO_AUX, buf, buflen);
//printf("read done, ret = %d, errno=%d\n", ret, errno);
if(ret > 0)
{
for(i=0; i<ret; i++)
/* for(i=0; i<ret; i++)
{
printf("%02X ", buf[i]);
}
printf("\n");
printf("\n");*/
for(i=0; i<ret; i++)
{
printf("%c", (buf[i]<0x20 && buf[i]!=0x0a)?'.':buf[i]);
}
}
else if(ret < 0 && errno==ETIMEDOUT)
{
printf("RX timeout\n");
// ret = 1;
// continue;
}
}
while(ret > 0);
......@@ -111,8 +112,6 @@ int rxt_main(int argc, char *argv[])
printf("Read sequence done.\n");
free(buf);
retclose:
close(fd);
done:
return ret;
}
......
......@@ -44,12 +44,14 @@
#include <sys/mount.h>
#include <hn70ap/eeprom.h>
#include <hn70ap/timer.h>
#include <hn70ap/system.h>
#include <hn70ap/leds.h>
#include <hn70ap/eeprom.h>
#include "sysdaemon_internal.h"
int nsh_main(int argc, char **argv);
/****************************************************************************
* Public Functions
****************************************************************************/
......@@ -62,7 +64,8 @@ void hn70ap_mount_storage(void)
ret = mount("/dev/smart0p1", "/data", "smartfs", 0, NULL);
if (ret < 0)
{
fprintf(stderr, "Storage could not be mounted\n");
fprintf(stderr, "WARNING Storage could not be mounted.\n"
"Try running mksmartfs /dev/smart0p1\n");
}
else
{
......@@ -82,69 +85,43 @@ int sysdaemon_main(int argc, char *argv[])
#endif
{
int ret;
bool defaults;
char call[9];
printf("\nhn70ap system daemon starting\n");
/* Initialize timer thread to help us schedule delays */
ret = timer_init();
if(ret != 0)
{
printf("FATAL: Failed to initialize timers\n");
goto lfail;
}
/* Initialize the leds */
/* Requires timer for blinking */
ret = hn70ap_system_init();
hn70ap_mount_storage();
hn70ap_netmonitor_init();
ret = leds_init();
if(ret != 0)
hn70ap_leds_state(LED_GREEN, LED_STATE_ON);
if(ret != OK)
{
printf("FATAL: Failed to initialize Leds\n");
goto lfail;
hn70ap_leds_state(LED_RED, LED_STATE_ON);
}
/* Initialize the EEPROM */
hn70ap_eeconfig_init(&defaults);
if(defaults)
hn70ap_eeconfig_getcall("call", call);
if(call[0] == 0)
{
printf("WARNING: Default config values loaded in EEPROM\n");
printf("Callsign not defined yet, please use the config tool\n");
}
else
{
hn70ap_eeconfig_getcall("call", call);
if(call[0] == 0)
{
printf("Callsign not defined yet, please use the config tool\n");
}
else
{
call[8] = 0;
printf("Hello %s, best 73's\n", call);
}
call[8] = 0;
printf("Hello %s, best 73's\n", call);
}
hn70ap_mount_storage();
hn70ap_netmonitor_init();
printf("TODO start screen management\n");
/* Try to open radio devices. */
#if defined(CONFIG_EXAMPLES_NSH)
printf("*** Launching nsh\n");
nsh_main(argc, argv);
#endif
printf("Back from nsh, now sleeping forever.\n");
hn70ap_leds_state(LED_GREEN, LED_STATE_OFF);
hn70ap_leds_state(LED_RED , LED_STATE_ON);
return 0;
lfail:
/* Panic... something could not be initialized
* Try to switch on the red LED
*/
return ERROR;
}
......@@ -56,8 +56,10 @@
#include <nuttx/net/ioctl.h>
#include <nuttx/leds/userled.h>
#include "netutils/netlib.h"
#include "netutils/dhcpc.h"
#include <netutils/netlib.h>
#include <netutils/dhcpc.h>
#include <hn70ap/leds.h>
#define NET_DEVNAME "eth0"
#define NETMONITOR_RETRYMSEC 1000
......@@ -90,7 +92,7 @@ static void dhcp_negociate(void)
if(ret != 0)
{
syslog(LOG_INFO, "DHCP request failed\n");
syslog(LOG_INFO, "DHCP request failed: %d errno %d\n", ret, errno);
goto close;
}
......@@ -141,18 +143,10 @@ close:
/*----------------------------------------------------------------------------*/
static void netmonitor_ifup(void* arg)
{
int fd;
struct userled_s led;
syslog(LOG_INFO, "Interface is going UP\n");
/* Enable the link LED */
led.ul_led = 6;
led.ul_on = true;
fd = open("/dev/leds", O_WRONLY);
ioctl(fd, ULEDIOC_SETLED, (unsigned long)&led);
close(fd);
hn70ap_leds_state(LED_MACLINK, LED_STATE_ON);
dhcp_negociate();
}
......@@ -160,18 +154,10 @@ static void netmonitor_ifup(void* arg)
/*----------------------------------------------------------------------------*/
static void netmonitor_ifdown(void)
{
int fd;
struct userled_s led;
syslog(LOG_INFO, "Interface is going DOWN\n");
/* Disable the link LED */
led.ul_led = 6;
led.ul_on = false;
fd = open("/dev/leds", O_WRONLY);
ioctl(fd, ULEDIOC_SETLED, (unsigned long)&led);
close(fd);
hn70ap_leds_state(LED_MACLINK, LED_STATE_OFF);
}
/*----------------------------------------------------------------------------*/
......@@ -459,6 +445,7 @@ int hn70ap_netmonitor_init(void)
ret = netlib_setmacaddr(NET_DEVNAME, mac);
if(ret)
{
syslog(LOG_ERR, "Set MAC on ethernet interface FAILED\n");
return ret;
}
......
......@@ -48,6 +48,9 @@
#include <fcntl.h>
#include <unistd.h>
#include <hn70ap/system.h>
#include <hn70ap/radio.h>
/****************************************************************************
* Public Functions
****************************************************************************/
......@@ -55,7 +58,7 @@
int txt_usage(void)
{
printf(
"txt [device] hexdata_nospaces\n"
"txt hexdata_nospaces\n"
);
return ERROR;
}
......@@ -114,21 +117,14 @@ int main(int argc, FAR char *argv[])
int txt_main(int argc, char *argv[])
#endif
{
char *devname = "/dev/raux";
char *data;
int ret = OK;
int fd;
int buflen = 1024;
int len;
uint8_t *buf;
if(argc == 3)
{
devname = argv[1];
data = argv[2];
}
else if(argc == 2)
if(argc == 2)
{
data = argv[1];
}
......@@ -137,6 +133,8 @@ int txt_main(int argc, char *argv[])
return txt_usage();
}
hn70ap_system_init();
buf = malloc(buflen);
if(!buf)
{
......@@ -159,20 +157,10 @@ int txt_main(int argc, char *argv[])
len += 1;
}
printf("\nTX test using %s (%d bytes)\n", devname, len);
fd = open(devname, O_RDWR);
if(fd<0)
{
fprintf(stderr, "open failed!\n");
ret = ERROR;
goto retfree;
}
ret = write(fd, buf, len);
printf("\nTX test using aux radio(%d bytes)\n", len);
ret = hn70ap_radio_transmit(HN70AP_RADIO_AUX, buf, len);
printf("write done, ret = %d, errno=%d\n", ret, errno);
close(fd);
retfree:
free(buf);
done:
......
......@@ -131,6 +131,7 @@ CONFIG_ARCH="arm"
# CONFIG_ARCH_CHIP_LPC43XX is not set
# CONFIG_ARCH_CHIP_LPC54XX is not set
# CONFIG_ARCH_CHIP_MOXART is not set
# CONFIG_ARCH_CHIP_NRF52 is not set
# CONFIG_ARCH_CHIP_NUC1XX is not set
# CONFIG_ARCH_CHIP_SAMA5 is not set
# CONFIG_ARCH_CHIP_SAMD is not set
......@@ -474,7 +475,7 @@ CONFIG_STM32_DMA2=y
# CONFIG_STM32_DAC1 is not set
# CONFIG_STM32_DAC2 is not set
# CONFIG_STM32_DCMI is not set
# CONFIG_STM32_ETHMAC is not set
CONFIG_STM32_ETHMAC=y
# CONFIG_STM32_FSMC is not set
# CONFIG_STM32_HASH is not set
# CONFIG_HRTIM is not set
......@@ -602,6 +603,27 @@ CONFIG_STM32_I2CTIMEOTICKS=500
# CONFIG_STM32_HAVE_RTC_COUNTER is not set
# CONFIG_STM32_HAVE_RTC_SUBSECONDS is not set
#
# Ethernet MAC configuration
#
CONFIG_STM32_PHYADDR=0
CONFIG_STM32_PHYINIT=y
# CONFIG_STM32_MII is not set
CONFIG_STM32_AUTONEG=y
CONFIG_STM32_PHYSR=30
CONFIG_STM32_PHYSR_ALTCONFIG=y
CONFIG_STM32_PHYSR_ALTMODE=0x0007
CONFIG_STM32_PHYSR_10HD=0x0001
CONFIG_STM32_PHYSR_100HD=0x0002
CONFIG_STM32_PHYSR_10FD=0x0005
CONFIG_STM32_PHYSR_100FD=0x0006
# CONFIG_STM32_ETH_PTP is not set
CONFIG_STM32_RMII=y
# CONFIG_STM32_RMII_MCO1 is not set
# CONFIG_STM32_RMII_MCO2 is not set
CONFIG_STM32_RMII_EXTCLK=y
CONFIG_STM32_ETHMAC_HPWORK=y
#
# USB FS Host Configuration
#
......@@ -716,7 +738,8 @@ CONFIG_ARCH_LEDS=y
CONFIG_HN70AP_EEPROM=y
CONFIG_HN70AP_SPIFLASH=y
CONFIG_HN70AP_SCREEN=y
# CONFIG_HN70AP_ETHERNET is not set
CONFIG_HN70AP_ETHERNET=y
CONFIG_HN70AP_ETHERNET_EEMAC=y
CONFIG_HN70AP_RADIO=y
# CONFIG_HN70AP_MAINRADIO is not set
CONFIG_HN70AP_AUXRADIO=y
......@@ -1054,6 +1077,36 @@ CONFIG_NETDEVICES=y
# CONFIG_ENCX24J600 is not set
# CONFIG_NET_SLIP is not set
# CONFIG_NET_FTMAC100 is not set
#
# External Ethernet PHY Device Support
#
CONFIG_ARCH_PHY_INTERRUPT=y
# CONFIG_ETH0_PHY_NONE is not set
# CONFIG_ETH0_PHY_AM79C874 is not set
# CONFIG_ETH0_PHY_KS8721 is not set
# CONFIG_ETH0_PHY_KSZ8041 is not set
# CONFIG_ETH0_PHY_KSZ8051 is not set
# CONFIG_ETH0_PHY_KSZ8061 is not set
CONFIG_ETH0_PHY_KSZ8081=y
# CONFIG_ETH0_PHY_KSZ90x1 is not set
# CONFIG_ETH0_PHY_DP83848C is not set
# CONFIG_ETH0_PHY_LAN8720 is not set
# CONFIG_ETH0_PHY_LAN8740 is not set
# CONFIG_ETH0_PHY_LAN8740A is not set
# CONFIG_ETH0_PHY_LAN8742A is not set
# CONFIG_ETH0_PHY_DM9161 is not set
CONFIG_ETH1_PHY_NONE=y
# CONFIG_ETH1_PHY_AM79C874 is not set
# CONFIG_ETH1_PHY_KS8721 is not set
# CONFIG_ETH1_PHY_KSZ8041 is not set
# CONFIG_ETH1_PHY_KSZ8051 is not set
# CONFIG_ETH1_PHY_KSZ8081 is not set
# CONFIG_ETH1_PHY_KSZ90x1 is not set
# CONFIG_ETH1_PHY_DP83848C is not set
# CONFIG_ETH1_PHY_LAN8720 is not set
# CONFIG_ETH1_PHY_DM9161 is not set
# CONFIG_NETDEV_PHY_DEBUG is not set
# CONFIG_PIPES is not set
# CONFIG_PM is not set
# CONFIG_DRIVERS_POWERLED is not set
......@@ -1138,6 +1191,7 @@ CONFIG_DRIVERS_WIRELESS=y
CONFIG_DRIVERS_GENERICRADIO=y
CONFIG_GENERICRADIO_UPPER=y
CONFIG_GENERICRADIO_SI4463=y
CONFIG_GENERICRADIO_SI4463_ANTSWITCH_ALT=y
# CONFIG_GENERICRADIO_SI4463_FRAMING_L1 is not set
CONFIG_GENERICRADIO_SI4463_FRAMING_L2B=y
# CONFIG_GENERICRADIO_SI4463_FRAMING_L2L is not set
......@@ -1165,7 +1219,7 @@ CONFIG_SYSLOG_CONSOLE=y
# Networking Support
#
CONFIG_ARCH_HAVE_NET=y
# CONFIG_ARCH_HAVE_PHY is not set
CONFIG_ARCH_HAVE_PHY=y
# CONFIG_NET_WRITE_BUFFERS is not set
CONFIG_NET_READAHEAD=y
CONFIG_NET=y
......@@ -1207,7 +1261,7 @@ CONFIG_NET_IPv4=y
CONFIG_NSOCKET_DESCRIPTORS=8
CONFIG_NET_NACTIVESOCKETS=16
CONFIG_NET_SOCKOPTS=y
CONFIG_NET_TCPPROTO_OPTIONS=y
# CONFIG_NET_TCPPROTO_OPTIONS is not set
# CONFIG_NET_SOLINGER is not set
#
......@@ -1225,7 +1279,7 @@ CONFIG_NET_TCPPROTO_OPTIONS=y
#
CONFIG_NET_TCP=y
# CONFIG_NET_TCP_NO_STACK is not set
CONFIG_NET_TCP_KEEPALIVE=y
# CONFIG_NET_TCP_KEEPALIVE is not set
# CONFIG_NET_TCPURGDATA is not set
# CONFIG_NET_TCP_REASSEMBLY is not set
CONFIG_NET_TCP_CONNS=8
......@@ -1319,6 +1373,7 @@ CONFIG_FS_MQUEUE_MPATH="/var/mqueue"
# CONFIG_NFS is not set
# CONFIG_FS_NXFFS is not set
# CONFIG_FS_ROMFS is not set
# CONFIG_FS_CROMFS is not set
# CONFIG_FS_TMPFS is not set
CONFIG_FS_SMARTFS=y
CONFIG_SMARTFS_ERASEDSTATE=0xff
......@@ -1565,6 +1620,7 @@ CONFIG_EXAMPLES_NSH=y
# CONFIG_EXAMPLES_SERIALBLASTER is not set
# CONFIG_EXAMPLES_SERIALRX is not set
# CONFIG_EXAMPLES_SERLOOP is not set
# CONFIG_EXAMPLES_SI5351 is not set
# CONFIG_EXAMPLES_SLCD is not set
# CONFIG_EXAMPLES_SMART is not set
# CONFIG_EXAMPLES_SMART_TEST is not set
......
......@@ -131,6 +131,7 @@ CONFIG_ARCH="arm"
# CONFIG_ARCH_CHIP_LPC43XX is not set
# CONFIG_ARCH_CHIP_LPC54XX is not set
# CONFIG_ARCH_CHIP_MOXART is not set
# CONFIG_ARCH_CHIP_NRF52 is not set
# CONFIG_ARCH_CHIP_NUC1XX is not set
# CONFIG_ARCH_CHIP_SAMA5 is not set
# CONFIG_ARCH_CHIP_SAMD is not set
......@@ -329,11 +330,11 @@ CONFIG_ARMV7M_HAVE_STACKCHECK=y
# CONFIG_ARCH_CHIP_STM32F407ZG is not set
# CONFIG_ARCH_CHIP_STM32F407IE is not set
# CONFIG_ARCH_CHIP_STM32F407IG is not set
# CONFIG_ARCH_CHIP_STM32F427V is not set
CONFIG_ARCH_CHIP_STM32F427V=y
# CONFIG_ARCH_CHIP_STM32F427Z is not set
# CONFIG_ARCH_CHIP_STM32F427I is not set
# CONFIG_ARCH_CHIP_STM32F429V is not set
CONFIG_ARCH_CHIP_STM32F429Z=y
# CONFIG_ARCH_CHIP_STM32F429Z is not set
# CONFIG_ARCH_CHIP_STM32F429I is not set
# CONFIG_ARCH_CHIP_STM32F429B is not set
# CONFIG_ARCH_CHIP_STM32F429N is not set
......@@ -382,8 +383,8 @@ CONFIG_STM32_STM32F4XXX=y
# CONFIG_STM32_STM32F411 is not set
# CONFIG_STM32_STM32F405 is not set
# CONFIG_STM32_STM32F407 is not set
# CONFIG_STM32_STM32F427 is not set
CONFIG_STM32_STM32F429=y
CONFIG_STM32_STM32F427=y
# CONFIG_STM32_STM32F429 is not set
# CONFIG_STM32_STM32F446 is not set
# CONFIG_STM32_STM32F469 is not set
# CONFIG_STM32_DFU is not set
......@@ -396,7 +397,7 @@ CONFIG_STM32_HAVE_CCM=y
CONFIG_STM32_HAVE_OTGFS=y
CONFIG_STM32_HAVE_FSMC=y
# CONFIG_STM32_HAVE_HRTIM1 is not set
CONFIG_STM32_HAVE_LTDC=y
# CONFIG_STM32_HAVE_LTDC is not set
CONFIG_STM32_HAVE_USART3=y
CONFIG_STM32_HAVE_UART4=y
CONFIG_STM32_HAVE_UART5=y
......@@ -481,8 +482,6 @@ CONFIG_STM32_ETHMAC=y
# CONFIG_STM32_I2C1 is not set
# CONFIG_STM32_I2C2 is not set
CONFIG_STM32_I2C3=y
# CONFIG_STM32_LTDC is not set
# CONFIG_STM32_DMA2D is not set
# CONFIG_STM32_OPAMP is not set
# CONFIG_STM32_OTGFS is not set
# CONFIG_STM32_OTGHS is not set
......@@ -740,13 +739,15 @@ CONFIG_HN70AP_SCREEN=y
CONFIG_HN70AP_ETHERNET=y
CONFIG_HN70AP_ETHERNET_EEMAC=y
CONFIG_HN70AP_RADIO=y
# CONFIG_HN70AP_MAINRADIO is not set
CONFIG_HN70AP_MAINRADIO=y
CONFIG_HN70AP_MAINRADIO_TCXO=y
CONFIG_HN70AP_AUXRADIO=y
# CONFIG_HN70AP_AUXRADIO_HIGHPOWER is not set
# CONFIG_BOARD_CRASHDUMP is not set
CONFIG_LIB_BOARDCTL=y
CONFIG_BOARDCTL_RESET=y
# CONFIG_BOARDCTL_UNIQUEID is not set
# CONFIG_BOARDCTL_APP_SYMTAB is not set
# CONFIG_BOARDCTL_IOCTL is not set
#
......@@ -1063,7 +1064,7 @@ CONFIG_NETDEVICES=y
#
# CONFIG_NETDEV_LOOPBACK is not set
# CONFIG_NETDEV_TELNET is not set
# CONFIG_ARCH_HAVE_NETDEV_STATISTICS is not set
CONFIG_ARCH_HAVE_NETDEV_STATISTICS=y
# CONFIG_NETDEV_LATEINIT is not set
# CONFIG_NET_DUMPPACKET is not set
......@@ -1109,6 +1110,7 @@ CONFIG_ETH1_PHY_NONE=y
# CONFIG_PM is not set
# CONFIG_DRIVERS_POWERLED is not set
# CONFIG_DRIVERS_SMPS is not set
# CONFIG_DRIVERS_MOTOR is not set
# CONFIG_POWER is not set
# CONFIG_SENSORS is not set
CONFIG_SERIAL=y
......@@ -1116,28 +1118,6 @@ CONFIG_SERIAL=y
# CONFIG_SERIAL_REMOVABLE is not set
CONFIG_SERIAL_CONSOLE=y
# CONFIG_16550_UART is not set
# CONFIG_UART_SERIALDRIVER is not set
# CONFIG_UART0_SERIALDRIVER is not set
# CONFIG_UART1_SERIALDRIVER is not set
# CONFIG_UART2_SERIALDRIVER is not set
# CONFIG_UART3_SERIALDRIVER is not set
CONFIG_UART4_SERIALDRIVER=y
# CONFIG_UART5_SERIALDRIVER is not set
# CONFIG_UART6_SERIALDRIVER is not set
# CONFIG_UART7_SERIALDRIVER is not set
# CONFIG_UART8_SERIALDRIVER is not set
# CONFIG_SCI0_SERIALDRIVER is not set
# CONFIG_SCI1_SERIALDRIVER is not set
# CONFIG_USART0_SERIALDRIVER is not set
# CONFIG_USART1_SERIALDRIVER is not set
# CONFIG_USART2_SERIALDRIVER is not set
# CONFIG_USART3_SERIALDRIVER is not set
# CONFIG_USART4_SERIALDRIVER is not set
# CONFIG_USART5_SERIALDRIVER is not set
# CONFIG_USART6_SERIALDRIVER is not set
# CONFIG_USART7_SERIALDRIVER is not set
# CONFIG_USART8_SERIALDRIVER is not set
# CONFIG_USART9_SERIALDRIVER is not set
# CONFIG_OTHER_UART_SERIALDRIVER is not set
CONFIG_MCU_SERIAL=y
CONFIG_STANDARD_SERIAL=y
......@@ -1151,6 +1131,16 @@ CONFIG_SERIAL_TERMIOS=y
CONFIG_UART4_SERIAL_CONSOLE=y
# CONFIG_OTHER_SERIAL_CONSOLE is not set
# CONFIG_NO_SERIAL_CONSOLE is not set
# CONFIG_UART_SERIALDRIVER is not set
# CONFIG_UART0_SERIALDRIVER is not set
# CONFIG_UART1_SERIALDRIVER is not set
# CONFIG_UART2_SERIALDRIVER is not set
# CONFIG_UART3_SERIALDRIVER is not set
CONFIG_UART4_SERIALDRIVER=y
# CONFIG_UART5_SERIALDRIVER is not set
# CONFIG_UART6_SERIALDRIVER is not set
# CONFIG_UART7_SERIALDRIVER is not set
# CONFIG_UART8_SERIALDRIVER is not set
#
# UART4 Configuration
......@@ -1164,6 +1154,28 @@ CONFIG_UART4_2STOP=0
# CONFIG_UART4_IFLOWCONTROL is not set
# CONFIG_UART4_OFLOWCONTROL is not set
# CONFIG_UART4_DMA is not set
# CONFIG_LPUART_SERIALDRIVER is not set
# CONFIG_LPUART0_SERIALDRIVER is not set
# CONFIG_LPUART1_SERIALDRIVER is not set
# CONFIG_LPUART2_SERIALDRIVER is not set
# CONFIG_LPUART3_SERIALDRIVER is not set
# CONFIG_LPUART4_SERIALDRIVER is not set
# CONFIG_LPUART5_SERIALDRIVER is not set
# CONFIG_LPUART6_SERIALDRIVER is not set
# CONFIG_LPUART7_SERIALDRIVER is not set
# CONFIG_LPUART8_SERIALDRIVER is not set
# CONFIG_USART0_SERIALDRIVER is not set
# CONFIG_USART1_SERIALDRIVER is not set
# CONFIG_USART2_SERIALDRIVER is not set
# CONFIG_USART3_SERIALDRIVER is not set
# CONFIG_USART4_SERIALDRIVER is not set
# CONFIG_USART5_SERIALDRIVER is not set
# CONFIG_USART6_SERIALDRIVER is not set
# CONFIG_USART7_SERIALDRIVER is not set
# CONFIG_USART8_SERIALDRIVER is not set
# CONFIG_USART9_SERIALDRIVER is not set
# CONFIG_SCI0_SERIALDRIVER is not set
# CONFIG_SCI1_SERIALDRIVER is not set
# CONFIG_PSEUDOTERM is not set
# CONFIG_USBDEV is not set
# CONFIG_USBHOST is not set
......@@ -1171,7 +1183,6 @@ CONFIG_UART4_2STOP=0
# CONFIG_HAVE_USBTRACE is not set
CONFIG_DRIVERS_WIRELESS=y
# CONFIG_WL_CC1101 is not set
# CONFIG_WL_CC3000 is not set
# CONFIG_WL_SPIRIT is not set
# CONFIG_SPIRIT_NETDEV is not set
# CONFIG_DRIVERS_IEEE802154 is not set
......@@ -1179,9 +1190,14 @@ CONFIG_DRIVERS_WIRELESS=y
CONFIG_DRIVERS_GENERICRADIO=y
CONFIG_GENERICRADIO_UPPER=y
CONFIG_GENERICRADIO_SI4463=y
CONFIG_GENERICRADIO_SI4463_ANTSWITCH_ALT=y
# CONFIG_GENERICRADIO_SI4463_FRAMING_L1 is not set
CONFIG_GENERICRADIO_SI4463_FRAMING_L2B=y
# CONFIG_GENERICRADIO_SI4463_FRAMING_L2L is not set
CONFIG_GENERICRADIO_SI4463_USE_WDS_CONFIG=y
# CONFIG_WL_NRF24L01 is not set
# CONFIG_DRIVERS_CONTACTLESS is not set
# CONFIG_1WIRE is not set
#
# System Logging
......@@ -1222,7 +1238,11 @@ CONFIG_NET_GUARDSIZE=2
# CONFIG_NET_USER_DEVFMT is not set
CONFIG_NET_ETHERNET=y
# CONFIG_NET_LOOPBACK is not set
# CONFIG_NET_TUN is not set
CONFIG_NET_TUN=y
CONFIG_TUN_NINTERFACES=1
CONFIG_NET_TUN_MTU=296
CONFIG_NET_TUN_TCP_RECVWNDO=256
CONFIG_TUN_HPWORK=y
# CONFIG_NET_USRSOCK is not set
#
......@@ -1245,7 +1265,7 @@ CONFIG_NET_IPv4=y
CONFIG_NSOCKET_DESCRIPTORS=8
CONFIG_NET_NACTIVESOCKETS=16
CONFIG_NET_SOCKOPTS=y
CONFIG_NET_TCPPROTO_OPTIONS=y
# CONFIG_NET_TCPPROTO_OPTIONS is not set
# CONFIG_NET_SOLINGER is not set
#
......@@ -1263,7 +1283,7 @@ CONFIG_NET_TCPPROTO_OPTIONS=y
#
CONFIG_NET_TCP=y
# CONFIG_NET_TCP_NO_STACK is not set
CONFIG_NET_TCP_KEEPALIVE=y
# CONFIG_NET_TCP_KEEPALIVE is not set
# CONFIG_NET_TCPURGDATA is not set
# CONFIG_NET_TCP_REASSEMBLY is not set
CONFIG_NET_TCP_CONNS=8
......@@ -1287,6 +1307,10 @@ CONFIG_NET_BROADCAST=y
# CONFIG_NET_UDP_READAHEAD is not set
# CONFIG_NET_UDP_WRITE_BUFFERS is not set
#
# Bluetooth socket support
#
#
# IEEE 802.15.4 socket support
#
......@@ -1357,6 +1381,7 @@ CONFIG_FS_MQUEUE_MPATH="/var/mqueue"
# CONFIG_NFS is not set
# CONFIG_FS_NXFFS is not set
# CONFIG_FS_ROMFS is not set
# CONFIG_FS_CROMFS is not set
# CONFIG_FS_TMPFS is not set
CONFIG_FS_SMARTFS=y
CONFIG_SMARTFS_ERASEDSTATE=0xff
......@@ -1498,6 +1523,7 @@ CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048
# CONFIG_LIBC_MODLIB is not set
# CONFIG_LIBC_WCHAR is not set
# CONFIG_LIBC_LOCALE is not set
# CONFIG_LIBC_LZF is not set
#
# Time/Time Zone Support
......@@ -1576,6 +1602,7 @@ CONFIG_EXAMPLES_FB_STACKSIZE=2048
# CONFIG_EXAMPLES_HIDKBD is not set
# CONFIG_EXAMPLES_IGMP is not set
# CONFIG_EXAMPLES_INA219 is not set
# CONFIG_EXAMPLES_IPFORWARD is not set
# CONFIG_EXAMPLES_JSON is not set
# CONFIG_EXAMPLES_LVGLDEMO is not set
# CONFIG_EXAMPLES_MEDIA is not set
......@@ -1602,7 +1629,6 @@ CONFIG_EXAMPLES_NSH=y
# CONFIG_EXAMPLES_SERIALBLASTER is not set
# CONFIG_EXAMPLES_SERIALRX is not set
# CONFIG_EXAMPLES_SERLOOP is not set
# CONFIG_EXAMPLES_SI5351 is not set
# CONFIG_EXAMPLES_SLCD is not set
# CONFIG_EXAMPLES_SMART is not set
# CONFIG_EXAMPLES_SMART_TEST is not set
......@@ -1656,6 +1682,9 @@ CONFIG_FSUTILS_MKSMARTFS=y
#
# hn70ap apps
#
CONFIG_HN70AP_BEACON=y
CONFIG_HN70AP_BEACON_PRIORITY=100
CONFIG_HN70AP_BEACON_STACKSIZE=2048
CONFIG_HN70AP_CONFIG=y
CONFIG_HN70AP_CONFIG_PRIORITY=100
CONFIG_HN70AP_CONFIG_STACKSIZE=2048
......
......@@ -147,7 +147,7 @@ int hn70ap_genradio_initialize(void)
/* Strobe the SDN pin to reset both devices */
stm32_configgpio(GPIO_RADIO_SDN);
stm32_gpiowrite(GPIO_RADIO_SDN, 1);
up_mdelay(1);
up_mdelay(10);
stm32_gpiowrite(GPIO_RADIO_SDN, 0);
/* Initialize radio devices */
......@@ -155,10 +155,14 @@ int hn70ap_genradio_initialize(void)
#if defined(CONFIG_HN70AP_MAINRADIO)
_info("Prepare main radio\n");
si4463_priv_main.gpio_irq = GPIO_IRQ_RADIOMAIN;
radio = si4463_init(spi4, 0, 30000000, SI4463_IO1, SI4463_IO3, &si4463_lower_main);
#if defined(CONFIG_HN70AP_MAINRADIO_TCXO)
radio = si4463_init(spi4, 0, 25000000, SI4463_IO1, SI4463_IO3, false, true, &si4463_lower_main);
#else
radio = si4463_init(spi4, 0, 30000000, SI4463_IO1, SI4463_IO3, false, false, &si4463_lower_main);
#endif
if(radio==NULL)
{
_err("Unable to initialize si4463\n");
_err("Unable to initialize main si4463\n");
}
else
{
......@@ -178,7 +182,7 @@ int hn70ap_genradio_initialize(void)
radio = RFM26_init(spi4, 1, SI4463_IO0, SI4463_IO1, &si4463_lower_aux);
if(radio==NULL)
{
_err("Unable to initialize si4463\n");
_err("Unable to initialize aux RFM26\n");
}
else
{
......