Skip to content

Commit

Permalink
first version
Browse files Browse the repository at this point in the history
  • Loading branch information
matteriot committed Jan 4, 2020
1 parent 72c3718 commit 0a288ef
Show file tree
Hide file tree
Showing 30 changed files with 8,956 additions and 8,562 deletions.
115 changes: 89 additions & 26 deletions projects/LPT230_gcc.uvguix.Farry

Large diffs are not rendered by default.

983 changes: 493 additions & 490 deletions projects/LPT230_gcc_LPT230.dep

Large diffs are not rendered by default.

Binary file modified projects/app_main.o
Binary file not shown.
Binary file modified projects/cjson.o
Binary file not shown.
3 changes: 2 additions & 1 deletion projects/httpd.d
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,5 @@ httpd.o: ../src/httpd.c ../sdk/4.13/include/mbed_config.h \
c:\program\ files\ (x86)\gnu\ tools\ arm\ embedded\5.4\ 2016q3\arm-none-eabi\include\sys\string.h \
c:\program\ files\ (x86)\gnu\ tools\ arm\ embedded\5.4\ 2016q3\arm-none-eabi\include\time.h \
c:\program\ files\ (x86)\gnu\ tools\ arm\ embedded\5.4\ 2016q3\arm-none-eabi\include\machine\time.h \
../src/httpd.h
../src/appmain.h ../src/httpd.h ../src/cJSON/cJSON.h \
../src/user_function.h
Binary file modified projects/httpd.o
Binary file not shown.
Binary file modified projects/lpt230_gcc.bin
Binary file not shown.
25 changes: 16 additions & 9 deletions projects/lpt230_gcc.build_log.htm
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,26 @@ <h2>Output:</h2>
Rebuild target 'LPT230'
assembling startup_LPBX3GCC.S...
compiling user_mdns.c...
compiling httpd.c...
../src/httpd.c: In function 'httpd_init':
../src/httpd.c(149): warning: implicit declaration of function 'hfhttpd_url_callback_register' [-Wimplicit-function-declaration]
compiling user_flash.c...
../src/user_flash.c(8): warning: 'upadateConfigData' defined but not used [-Wunused-function]
compiling user_function.c...
compiling app_main.c...
../src/user_mdns.c(11): warning: 'txt_record' defined but not used [-Wunused-variable]
static char txt_record[] = "name=TC1_A2:model=com.iotserv.devices.phicomm_tc1_a1:mac=GHS00GG:id=GHS00GG";//max len is 255
compiling user_gpio.c...
../src/user_gpio.c: In function 'key_timeout_handler':
../src/user_gpio.c(178): warning: implicit declaration of function 'user_function_cmd_received' [-Wimplicit-function-declaration]
user_function_cmd_received(1,"{\"cmd\":\"device report\"}");
../src/user_gpio.c(146): warning: variable 'key_last' set but not used [-Wunused-but-set-variable]
../src/user_gpio.c(145): warning: unused variable 'key_trigger' [-Wunused-variable]
compiling app_main.c...
compiling user_flash.c...
../src/user_flash.c(8): warning: 'upadateConfigData' defined but not used [-Wunused-function]
compiling httpd.c...
../src/httpd.c: In function 'switch_cbk':
../src/httpd.c(206): warning: implicit declaration of function 'json_plug_analysis' [-Wimplicit-function-declaration]
../src/httpd.c(203): warning: variable 'update_user_config_flag' set but not used [-Wunused-but-set-variable]
../src/httpd.c: In function 'httpd_init':
../src/httpd.c(238): warning: implicit declaration of function 'hfhttpd_url_callback_register' [-Wimplicit-function-declaration]
../src/httpd.c: At top level:
../src/httpd.c(41): warning: 'convert_ascii' defined but not used [-Wunused-function]
compiling user_function.c...
compiling user_power.c...
compiling user_udp.c...
../src/user_udp.c: In function 'udp_thread':
Expand All @@ -52,14 +59,14 @@ <h2>Output:</h2>
linking...
After Build - User command #1: ../tools/arm-none-eabi-objcopy -O binary ./lpt230_gcc.elf ./lpt230_gcc.bin
After Build - User command #2: ../tools/LPB100_IMG_Tools.exe LPB230 lzma ../tools/bootloader.bin lpt230_gcc.bin ./lpt230_gcc_image.bin ./lpt230_gcc_upgrade.bin
".\lpt230_gcc.elf" - 0 Error(s), 8 Warning(s).
".\lpt230_gcc.elf" - 0 Error(s), 12 Warning(s).

<h2>Collection of Component include folders:</h2>
C:\Users\Farry\Documents\KeilProject\LPx30-HSF_v4.13.20\projects\RTE
C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\Device\ARM\ARMCM4\Include

<h2>Collection of Component Files used:</h2>
Build Time Elapsed: 00:00:06
Build Time Elapsed: 00:00:16
</pre>
</body>
</html>
Binary file modified projects/lpt230_gcc.elf
Binary file not shown.
16,010 changes: 8,006 additions & 8,004 deletions projects/lpt230_gcc.map

Large diffs are not rendered by default.

Binary file modified projects/lpt230_gcc_image.bin
Binary file not shown.
Binary file modified projects/user_flash.o
Binary file not shown.
Binary file modified projects/user_gpio.o
Binary file not shown.
Binary file modified projects/user_mdns.o
Binary file not shown.
4 changes: 3 additions & 1 deletion sdk/4.13/include/hsf/hfconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,9 @@ enum ENNETSETPRO
NETSETPRO_UDP,
NETSETPRO_MQTT,
NETSETPRO_ALIOT,
NETSETPRO_HTTP
NETSETPRO_HTTP,
NETSETPRO_HTTP_TLS,
NETSETPRO_TCP_TLS
};

typedef enum ENBAUDRATE
Expand Down
2 changes: 1 addition & 1 deletion sdk/4.13/include/hsf/hfflashlayout.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


#define CONFIG_FLASH_SIZE_1MB

//#define CONFIG_FLASH_SIZE_2MB

#ifdef CONFIG_FLASH_SIZE_1MB

Expand Down
1 change: 1 addition & 0 deletions sdk/4.13/include/hsf/hfsys.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ void HSF_API hfsys_stop_watchdog(void);
*/
unsigned int HSF_API hfsys_random(void);


#ifdef __cplusplus
}
#endif
Expand Down
6 changes: 3 additions & 3 deletions sdk/4.13/include/hsf/hsf.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ typedef unsigned char bool;
#define GLOBAL_VER "4.13"

#ifdef CONFIG_FLASH_SIZE_1MB
#define GLOBAL_LVER "24 (2019-09-24 10:00 1M)"
#define GLOBAL_LVER "26 (2019-12-17 19:00 1M)"
#elif defined CONFIG_FLASH_SIZE_2MB
#define GLOBAL_LVER "24 (2019-09-24 10:00 2M)"
#define GLOBAL_LVER "26 (2019-12-17 19:00 2M)"
#elif defined CONFIG_FLASH_SIZE_4MB
#define GLOBAL_LVER "24 (2019-09-24 10:00 4M)"
#define GLOBAL_LVER "26 (2019-12-17 19:00 4M)"
#endif


Expand Down
1 change: 1 addition & 0 deletions sdk/4.13/include/hsf/wm-tls.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ typedef enum {
TLS_CHECK_CLIENT_CERT = 0x02,

/* TLS Client mode */
TLS_NO_SERVER_CERT = 0x00,
TLS_CHECK_SERVER_CERT = 0x04,
} tls_session_flags_t;

Expand Down
136 changes: 136 additions & 0 deletions sdk/4.13/include/lwip-wifi/arch/csl_mbed.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
/*****************************************************************************/
/* */
/* File Name : csl_mbed.h */
/* */
/* Description : This file contains all declarations and functions */
/* related to the chip support library. */
/* */
/* MbedOS Usage : Call maclib_get_funcs_struct() to get MACLib funcs; */
/* Define mbed_reg_func_t var, Register it by ml_init; */
/* */
/*****************************************************************************/

#ifndef CSL_MBED_H
#define CSL_MBED_H

#ifdef __cplusplus
extern "C" {
#endif

/*****************************************************************************/
/* Constants */
/*****************************************************************************/
#define RDA_EXT_INT_MAC_HW_INDEX 8
#define RDA_EXT_INT_MAC_HW_PRI 0x80

/*****************************************************************************/
/* Enums */
/*****************************************************************************/
typedef enum {
MACLIB_EVENT_PEND = 0,
MACLIB_EVENT_PROCESS = 1,
MACLIB_EVENT_CLEANUP = 2
} MACLIB_EVENT_HANDLE_T;

/*****************************************************************************/
/* Data Types */
/*****************************************************************************/
typedef struct
{
unsigned int ml_id; /* Buffer identification */
unsigned char* ml_data; /* Pkt start address */
unsigned short ml_len; /* Pkt length */
} maclib_buf_t;

/* Structure that contains functions provided by MACLib */
typedef struct {
/* Initialize MAC Library, input param: mbed_reg_func_t *reg_funcs */
int (*ml_init)(void *reg_funcs);

/* As a peroid task to process MAC Library background event */
void (*ml_tasklet)(void);

/* Get a new packet buffer, output param: maclib_buf_t *buf */
void (*ml_get_pkt_buf)(void *buf);

/* Mbed stack send packet to MAC Library, input param: maclib_buf_t *buf*/
int (*ml_xmit_pkt)(void *buf);

/* Mbed receive and processing packet done, input param: unsigned int buf_id */
void (*ml_recv_pkt_comp)(unsigned int buf_id);
} maclib_func_t;

/* Structure that contains functions provided by MbedOS */
typedef struct {
/* MAC Library send packet to mbed stack, input param: maclib_buf_t *buf */
void (*mbed_recv_pkt)(void *buf);

/* Critical section start realized in mbed */
void (*mbed_critical_sec_start)(void);

/* Critical section end realized in mbed */
void (*mbed_critical_sec_end)(void);

/* Create interrupt in mbed, input param: vector/priority/isr(function), */
/* return: interrupt handle, non-zero is valid */
void * (*mbed_create_interrupt)(unsigned int vec, unsigned int pri, void *isr);

/* Delete interrupt in mbed, input param: vector */
void (*mbed_delete_interrupt)(unsigned int vec);

/* Enable interrupt in mbed, input param: vector */
void (*mbed_enable_interrupt)(unsigned int vec);

/* Disable interrupt in mbed, input param: vector */
void (*mbed_disable_interrupt)(unsigned int vec);

/* Get current time realized in mbed, return time in units of micro second */
unsigned long (*mbed_get_cur_time_ms)(void);

/* Create alarm in mbed, input param: func(callback)/data(pass to func), */
/* return: alarm handle, non-zero is valid */
void * (*mbed_create_alarm)(void *func, unsigned int data);

/* Delete alarm in mbed, input param: alarm handle */
void (*mbed_delete_alarm)(void **handle);

/* Start alarm in mbed, input param: alarm handle/timeout(micro second) */
void (*mbed_start_alarm)(void *handle, unsigned int timeout_ms);

/* Stop alarm in mbed, input param: alarm handle */
void (*mbed_stop_alarm)(void *handle);

#if defined(MBED_MUTEX_INTERFACE)
/* Create mutex */
void (*mbed_mutex_create)(void);

/* Delete mutex */
unsigned int (*mbed_mutex_delete)(void *rdamutex);

/* Wait mutex, timer unit : millisec */
unsigned int (*mbed_mutex_wait)(void *rdamutex, unsigned int millisec);

/* Release mutex */
unsigned int (*mbed_mutex_release)(void *rdamutex);
#endif /* MBED_MUTEX_INTERFACE */

/* Event post/get callback function, input param: event_type */
void (*mbed_event_hdl_cb)(unsigned int event);

/* maclib task sleep callback function */
void (*mbed_task_sleep_cb)(void);

/* maclib task wakeup callback function */
void (*mbed_task_wakeup_cb)(void);
} maclib_import_func_t;

/*****************************************************************************/
/* Extern Function Declarations */
/*****************************************************************************/
extern void maclib_get_funcs_struct(maclib_func_t *func_str);

#ifdef __cplusplus
}
#endif

#endif /* CSL_MBED_H */
1 change: 1 addition & 0 deletions sdk/4.13/include/lwip-wifi/arch/rda5981_flash.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ typedef struct {
#define RDA5991H_USER_DATA_FLAG_PHY BIT16
#define RDA5991H_USER_DATA_FLAG_PHY_CHANNELS BIT17
#define RDA5991H_USER_DATA_FLAG_TX_POWER_OFFSET BIT18
#define RDA5991H_USER_DATA_FLAG_CAL BIT19

#define RDA5981_VBAT_CAL BIT0
#define RDA5981_GPADC0_CAL BIT1
Expand Down
1 change: 1 addition & 0 deletions sdk/4.13/include/lwip-wifi/arch/rda5991h_wland.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ extern int rda5981_enter_CE_MODE(unsigned char enable);
extern int rda5981_set_data_rate(unsigned char mode, unsigned char rate);
extern void rda5981_set_mode(unsigned char bgn_enable);// 1~bgn mode, 0~bg mode
extern void rda5981_set_auth_timeout(unsigned char timeout_enable);
extern void rda5981_set_ap_eapol_delay(unsigned int ms);
typedef struct {
char BSSID[ETH_ALEN];
char SSID[32+1];
Expand Down
47 changes: 47 additions & 0 deletions sdk/4.13/include/lwip-wifi/arch/wland_dbg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#ifndef _WLAND_DBG_H_
#define _WLAND_DBG_H_
#include <stdio.h>
#include "rda5991h_wland.h"
#include "wland_types.h"

extern int wland_dbg_dump;
extern int wland_dbg_level;

#define RDA_WLAND_DBG

#ifdef RDA_WLAND_DBG
#define WLAND_DBG(level, fmt, ...) do {\
int dbg_level = D_##level##_LEVEL;\
if((dbg_level <= wland_dbg_level)){\
printf("%s,"fmt, __func__, ##__VA_ARGS__);\
} \
} while (0)
/*
#define WLAND_ERR(fmt, ...) do {\
printf("[RDAWLAN_ERR]: " fmt, ##__VA_ARGS__);\
} while (0)
*/
//if frmae_len is zero, get len from frame header
static inline void wland_dump_frame(const char* msg, u8 *data, u32 frame_len)
{

u32 len,i;

if(wland_dbg_dump == 1){
if(frame_len != 0)
len = frame_len;
else
len = data[0] | ((data[1]&0x0f) << 8);
printf("%s : ",msg);
for(i=0; i<len; i++)
printf("%02x ", *(data+i));
printf("\r\nframe_len=%d\r\n", len);
}
return;
}
#else
#define WLAND_DBG(level, fmt, ...)
static inline void wland_dump_frame(const char* msg, u8 *data, u32 frame_len)
{}
#endif
#endif /*_WLAND_DBG_H_*/
4 changes: 3 additions & 1 deletion sdk/4.13/include/lwip-wifi/arch/wland_flash.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ typedef struct
RDA5991H_USER_DATA_FLAG_RF_CHANNELS | \
RDA5991H_USER_DATA_FLAG_PHY | \
RDA5991H_USER_DATA_FLAG_PHY_CHANNELS | \
RDA5991H_USER_DATA_FLAG_TX_POWER_OFFSET)))
RDA5991H_USER_DATA_FLAG_TX_POWER_OFFSET | \
RDA5991H_USER_DATA_FLAG_CAL)))

#define RDA5991H_USER_DATA_IP_LENGTH 8

Expand Down Expand Up @@ -94,6 +95,7 @@ typedef struct
wland_rf_channels_t rf_channels;
wland_phy_t phy;
wland_phy_channels_t phy_channels;
u32 cal_flag;
}rda5991h_user_data;

#define SECTOR_SIZE 4096
Expand Down
23 changes: 23 additions & 0 deletions sdk/4.13/include/lwip-wifi/arch/wland_ota.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#ifndef _WLAND_OTA_H_
#define _WLAND_OTA_H_
#include "wland_types.h"
#include "rda_ccfg_api.h"

extern u32 flash_size;

#define CRC32_TABLE_ADDR 0xbb5c
#define CRC32_ADDR 0x8dff//u32 crc32(const u8 *p, size_t len)

#define CRC32_TABLE_ADDR_4 0xbbd8
#define CRC32_ADDR_4 0x8e33//u32 crc32(const u8 *p, size_t len)

static inline unsigned int bootrom_crc32(unsigned char *p, unsigned int len)
{
unsigned int func = CRC32_ADDR;
if (rda_ccfg_hwver() >= 4) {
func = CRC32_ADDR_4;
}
return ((unsigned int(*)(unsigned char *, unsigned int))func)(p, len);
}

#endif /*_WLAND_OTA_H_*/
2 changes: 1 addition & 1 deletion sdk/4.13/include/lwip/dhcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ extern "C" {
#endif

/** period (in seconds) of the application calling dhcp_coarse_tmr() */
#define DHCP_COARSE_TIMER_SECS 15
#define DHCP_COARSE_TIMER_SECS 5
/** period (in milliseconds) of the application calling dhcp_coarse_tmr() */
#define DHCP_COARSE_TIMER_MSECS (DHCP_COARSE_TIMER_SECS * 1000UL)
/** period (in milliseconds) of the application calling dhcp_fine_tmr() */
Expand Down
Binary file modified sdk/4.13/libs/libLPBX3Kernel.a
Binary file not shown.
Loading

0 comments on commit 0a288ef

Please sign in to comment.