103 lines
		
	
	
		
			3.7 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
		
		
			
		
	
	
			103 lines
		
	
	
		
			3.7 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| 
								 | 
							
								/****************************************************************************
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
							 | 
						||
| 
								 | 
							
								be copied by any method or incorporated into another program without
							 | 
						||
| 
								 | 
							
								the express written consent of Aerospace C.Power. This Information or any portion
							 | 
						||
| 
								 | 
							
								thereof remains the property of Aerospace C.Power. The Information contained herein
							 | 
						||
| 
								 | 
							
								is believed to be accurate and Aerospace C.Power assumes no responsibility or
							 | 
						||
| 
								 | 
							
								liability for its use in any way and conveys no license or title under
							 | 
						||
| 
								 | 
							
								any patent or copyright and makes no representation or warranty that this
							 | 
						||
| 
								 | 
							
								Information is free from patent or copyright infringement.
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								****************************************************************************/
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifndef _APP_CONFIG_H_
							 | 
						||
| 
								 | 
							
								#define _APP_CONFIG_H_
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#include "app_flash.h"
							 | 
						||
| 
								 | 
							
								#include "app_types.h"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifdef __cplusplus
							 | 
						||
| 
								 | 
							
								extern "C" {
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define APP_INVALID_MAC_ADDR     "\x00\x00\x00\x00\x00\x00"
							 | 
						||
| 
								 | 
							
								#define APP_BROADCAST_MAC_ADDR   "\xff\xff\xff\xff\xff\xff"
							 | 
						||
| 
								 | 
							
								#define APP_GRP_MAC_ADDR         "\xff\xff\xff\x00\x00\x00"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifndef APP_IO_OPERATION_ENABLE
							 | 
						||
| 
								 | 
							
								#define APP_IO_OPERATION_ENABLE  1
							 | 
						||
| 
								 | 
							
								#endif  // end of #ifndef APP_IO_OPERATION_ENABLE
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define APP_DEFAULT_WORK_MODE    APP_WORK_MODE_AT
							 | 
						||
| 
								 | 
							
								#define APP_DEFAULT_BAUND_RATE   (115200)
							 | 
						||
| 
								 | 
							
								#define APP_DEFAULT_DATA_BITS    (8)
							 | 
						||
| 
								 | 
							
								#define APP_DEFAULT_STOP_BITS    (1)
							 | 
						||
| 
								 | 
							
								#define APP_DEFAULT_PARITY       (2)
							 | 
						||
| 
								 | 
							
								#define APP_DEFAULT_THDVALUE     (IOT_UART_DEFAULT_THDVALUE)
							 | 
						||
| 
								 | 
							
								#define APP_MAX_THDVALUE         (IOT_UART_MAX_THDVALUE)
							 | 
						||
| 
								 | 
							
								#define APP_DEFAULT_JOIN_NOTIFY  (1)
							 | 
						||
| 
								 | 
							
								#define APP_DEFAULT_FREQ_BAND    PLC_LIB_FREQ_BAND_1
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define APP_BCAST_STATUS_ON      1
							 | 
						||
| 
								 | 
							
								#define APP_BCAST_STATUS_OFF     0
							 | 
						||
| 
								 | 
							
								#define APP_BCAST_LEN_MAX        BCAST_LEN_MAX
							 | 
						||
| 
								 | 
							
								#define APP_BCAST_LEN_MIN        1
							 | 
						||
| 
								 | 
							
								#define APP_BCAST_PERIOD_MAX     1200
							 | 
						||
| 
								 | 
							
								#define APP_BCAST_PERIOD_MIN     1
							 | 
						||
| 
								 | 
							
								#define APP_BCAST_SEND_DEFAULT   0
							 | 
						||
| 
								 | 
							
								#define APP_BCAST_SEND_CONNLESS  1
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* hardware model */
							 | 
						||
| 
								 | 
							
								typedef enum {
							 | 
						||
| 
								 | 
							
								    APP_HW_IPL_YY01         = 0x640B0100,   /* 100.11.1.0, yonglin */
							 | 
						||
| 
								 | 
							
								    APP_HW_IPL_YY03         = 0x640B011E,   /* 100.11.1.30 */
							 | 
						||
| 
								 | 
							
								    APP_HW_Q111N_ISC        = 0x65140100,   /* 101.20.1.0 */
							 | 
						||
| 
								 | 
							
								    APP_HW_Q111N_ISF        = 0x660A0100,   /* 102.10.1.0 */
							 | 
						||
| 
								 | 
							
								    APP_HW_Q111N_ISF03      = 0x660A011E,   /* 102.10.1.30 */
							 | 
						||
| 
								 | 
							
								    APP_HW_Q111N_H          = 0x670A0100,   /* 103.10.1.0 */
							 | 
						||
| 
								 | 
							
								    APP_HW_Q111N_HS         = 0x680A0100,   /* 104.10.1.0 */
							 | 
						||
| 
								 | 
							
								    APP_HW_Q111N_ISG        = 0x690A0100,   /* 105.10.1.0 */
							 | 
						||
| 
								 | 
							
								    APP_HW_LEDC_P           = 0x6A0A0100,   /* 106.10.1.0, ledc with psram */
							 | 
						||
| 
								 | 
							
								    APP_HW_LEDC             = 0x6A0A0108,   /* 106.10.1.8, ledc without psram */
							 | 
						||
| 
								 | 
							
								    APP_HW_HTZD_STA_1_PHASE = 0x290A0909,   /* 41.10.09.09 */
							 | 
						||
| 
								 | 
							
								    APP_HW_HTZD_CCO_3_PHASE = 0x330A0100,   /* 51.10.01.00 */
							 | 
						||
| 
								 | 
							
								    APP_HW_UNKNOW
							 | 
						||
| 
								 | 
							
								} app_hw_ver_e;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								typedef struct {
							 | 
						||
| 
								 | 
							
								    nv_ftm_factory_id factory;
							 | 
						||
| 
								 | 
							
								    nv_ftm_bcast_id   bcast;
							 | 
						||
| 
								 | 
							
								} app_config;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								uint8_t app_get_init_work_mode(void);
							 | 
						||
| 
								 | 
							
								uint16_t app_set_work_mode_to_nv(uint8_t mode);
							 | 
						||
| 
								 | 
							
								app_hw_ver_e app_get_hw_ver(void);
							 | 
						||
| 
								 | 
							
								uint8_t app_get_sta_join_notify(void);
							 | 
						||
| 
								 | 
							
								uint16_t app_set_sta_join_notify(uint8_t mode);
							 | 
						||
| 
								 | 
							
								uint8_t app_get_idf_status(void);
							 | 
						||
| 
								 | 
							
								uint16_t app_set_idf_status(uint8_t status);
							 | 
						||
| 
								 | 
							
								uint8_t app_get_lock_mac(void);
							 | 
						||
| 
								 | 
							
								uint16_t app_set_lock_mac(uint8_t status);
							 | 
						||
| 
								 | 
							
								uint8_t app_load_group_from_nv(void);
							 | 
						||
| 
								 | 
							
								uint16_t app_save_group_to_nv(void);
							 | 
						||
| 
								 | 
							
								uint16_t app_set_mac_addr_to_nv(uint8_t addr[IOT_MAC_ADDR_LEN]);
							 | 
						||
| 
								 | 
							
								uint16_t app_get_factory_from_nv(nv_ftm_factory_id *param);
							 | 
						||
| 
								 | 
							
								uint16_t app_save_factory_to_nv(void);
							 | 
						||
| 
								 | 
							
								uint16_t app_get_bcast_from_nv(nv_ftm_bcast_id *param);
							 | 
						||
| 
								 | 
							
								uint16_t app_save_bcast_to_nv(void);
							 | 
						||
| 
								 | 
							
								void app_restore_factory(void);
							 | 
						||
| 
								 | 
							
								void app_load_nv_conf(void);
							 | 
						||
| 
								 | 
							
								void app_pib_restore_factory(void);
							 | 
						||
| 
								 | 
							
								void app_pib_conf_init(void);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifdef __cplusplus
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif  /* _APP_CONFIG_H_ */
							 | 
						||
| 
								 | 
							
								
							 |