first
This commit is contained in:
66
apps/earphone/board/br28/app.ld
Normal file
66
apps/earphone/board/br28/app.ld
Normal file
@ -0,0 +1,66 @@
|
||||
#include "app_config.h"
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text : ALIGN(4)
|
||||
{
|
||||
gsensor_dev_begin = .;
|
||||
KEEP(*(.gsensor_dev))
|
||||
gsensor_dev_end = .;
|
||||
|
||||
fm_dev_begin = .;
|
||||
KEEP(*(.fm_dev))
|
||||
fm_dev_end = .;
|
||||
|
||||
fm_emitter_dev_begin = .;
|
||||
KEEP(*(.fm_emitter_dev))
|
||||
fm_emitter_dev_end = .;
|
||||
|
||||
storage_device_begin = .;
|
||||
KEEP(*(.storage_device))
|
||||
storage_device_end = .;
|
||||
|
||||
imusensor_dev_begin = .;
|
||||
KEEP(*(.imusensor_dev))
|
||||
imusensor_dev_end = .;
|
||||
|
||||
#if TCFG_APP_PC_EN
|
||||
aac_dec_code_begin = .;
|
||||
*(.bt_aac_dec_code)
|
||||
*(.bt_aac_dec_sparse_code)
|
||||
aac_dec_code_end = .;
|
||||
aac_dec_code_size = aac_dec_code_end - aac_dec_code_begin ;
|
||||
|
||||
. = ALIGN(4);
|
||||
bt_aac_dec_const_begin = .;
|
||||
*(.bt_aac_dec_const)
|
||||
*(.bt_aac_dec_sparse_const)
|
||||
bt_aac_dec_const_end = .;
|
||||
bt_aac_dec_const_size = bt_aac_dec_const_end - bt_aac_dec_const_begin ;
|
||||
|
||||
*(.bt_aac_dec_data)
|
||||
*(.bt_aac_dec_bss)
|
||||
|
||||
. = ALIGN(4);
|
||||
*(.aac_mem)
|
||||
*(.aac_ctrl_mem)
|
||||
/* . += 0x5fe8 ; */
|
||||
/* . += 0xef88 ; */
|
||||
#endif
|
||||
|
||||
. = ALIGN(32);
|
||||
}
|
||||
|
||||
.data ALIGN(32):
|
||||
{
|
||||
} > ram0
|
||||
|
||||
.bss ALIGN(32):
|
||||
{
|
||||
} > ram0
|
||||
|
||||
.data_code ALIGN(32):
|
||||
{
|
||||
} > ram0
|
||||
|
||||
}
|
||||
164
apps/earphone/board/br28/app_overlay.ld
Normal file
164
apps/earphone/board/br28/app_overlay.ld
Normal file
@ -0,0 +1,164 @@
|
||||
|
||||
OVERLAY : AT(0x200000) SUBALIGN(4)
|
||||
{
|
||||
.overlay_aec
|
||||
{
|
||||
aec_code_begin = . ;
|
||||
*(.text._*)
|
||||
*(.data._*)
|
||||
*(.aec_code)
|
||||
*(.aec_const)
|
||||
*(.res_code)
|
||||
*(.res_const)
|
||||
*(.ns_code)
|
||||
*(.ns_const)
|
||||
*(.bark_const)
|
||||
*(.fft_code)
|
||||
*(.fft_const)
|
||||
*(.agc_code)
|
||||
*(.dms_code)
|
||||
*(.dms_const)
|
||||
*(.dms_sparse_code)
|
||||
aec_code_end = . ;
|
||||
aec_code_size = aec_code_end - aec_code_begin ;
|
||||
|
||||
*(.msbc_enc)
|
||||
*(.cvsd_codec)
|
||||
*(.aec_bss)
|
||||
*(.aec_data)
|
||||
*(.res_data)
|
||||
*(.ns_data)
|
||||
*(.dns_common_data)
|
||||
*(.dns_param_data_single)
|
||||
*(.dns_param_data_dual)
|
||||
*(.jlsp_nlp_code)
|
||||
*(.jlsp_nlp_const)
|
||||
*(.jlsp_aec_code)
|
||||
*(.jlsp_aec_const)
|
||||
*(.jlsp_prep_code)
|
||||
*(.jlsp_prep_const)
|
||||
*(.jlsp_enc_code)
|
||||
*(.jlsp_enc_const)
|
||||
*(.jlsp_wn_code)
|
||||
*(.jlsp_wn_const)
|
||||
*(.jlsp_tri_code)
|
||||
*(.jlsp_tri_const)
|
||||
*(.jlsp_agc_code)
|
||||
*(.jlsp_agc_const)
|
||||
*(.res_bss)
|
||||
*(.ns_bss)
|
||||
*(.aec_mem)
|
||||
}
|
||||
.overlay_aac
|
||||
{
|
||||
#if !TCFG_APP_PC_EN
|
||||
aac_dec_code_begin = .;
|
||||
*(.bt_aac_dec_code)
|
||||
*(.bt_aac_dec_sparse_code)
|
||||
aac_dec_code_end = .;
|
||||
aac_dec_code_size = aac_dec_code_end - aac_dec_code_begin ;
|
||||
|
||||
. = ALIGN(4);
|
||||
bt_aac_dec_const_begin = .;
|
||||
*(.bt_aac_dec_const)
|
||||
*(.bt_aac_dec_sparse_const)
|
||||
bt_aac_dec_const_end = .;
|
||||
bt_aac_dec_const_size = bt_aac_dec_const_end - bt_aac_dec_const_begin ;
|
||||
|
||||
*(.bt_aac_dec_data)
|
||||
*(.bt_aac_dec_bss)
|
||||
|
||||
. = ALIGN(4);
|
||||
*(.aac_mem)
|
||||
*(.aac_ctrl_mem)
|
||||
/* . += 0x5fe8 ; */
|
||||
/* . += 0xef88 ; */
|
||||
#endif
|
||||
}
|
||||
/*
|
||||
.overlay_lc3
|
||||
{
|
||||
lc3_dec_code_begin = .;
|
||||
*(.lc3_dec_code)
|
||||
lc3_dec_code_end = .;
|
||||
lc3_dec_code_size = lc3_dec_code_end - lc3_dec_code_begin;
|
||||
|
||||
. = ALIGN(4);
|
||||
lc3_dec_const_begin = .;
|
||||
*(.lc3_dec_const)
|
||||
lc3_dec_const_end = .;
|
||||
lc3_dec_const_size = lc3_dec_const_end - lc3_dec_const_begin;
|
||||
*(.lc3_dec_data)
|
||||
*(.lc3_dec_bss)
|
||||
}
|
||||
*/
|
||||
|
||||
.overlay_mp3
|
||||
{
|
||||
*(.mp3_mem)
|
||||
*(.mp3_ctrl_mem)
|
||||
*(.mp3pick_mem)
|
||||
*(.mp3pick_ctrl_mem)
|
||||
*(.dec2tws_mem)
|
||||
}
|
||||
.overlay_wma
|
||||
{
|
||||
*(.wma_mem)
|
||||
*(.wma_ctrl_mem)
|
||||
*(.wmapick_mem)
|
||||
*(.wmapick_ctrl_mem)
|
||||
}
|
||||
.overlay_wav
|
||||
{
|
||||
*(.wav_mem)
|
||||
*(.wav_ctrl_mem)
|
||||
}
|
||||
.overlay_ape
|
||||
{
|
||||
*(.ape_mem)
|
||||
*(.ape_ctrl_mem)
|
||||
}
|
||||
.overlay_flac
|
||||
{
|
||||
*(.flac_mem)
|
||||
*(.flac_ctrl_mem)
|
||||
}
|
||||
.overlay_m4a
|
||||
{
|
||||
*(.m4a_mem)
|
||||
*(.m4a_ctrl_mem)
|
||||
}
|
||||
.overlay_amr
|
||||
{
|
||||
*(.amr_mem)
|
||||
*(.amr_ctrl_mem)
|
||||
}
|
||||
.overlay_dts
|
||||
{
|
||||
*(.dts_mem)
|
||||
*(.dts_ctrl_mem)
|
||||
}
|
||||
.overlay_fm
|
||||
{
|
||||
*(.fm_mem)
|
||||
}
|
||||
.overlay_pc
|
||||
{
|
||||
*(.usb_audio_play_dma)
|
||||
*(.usb_audio_rec_dma)
|
||||
*(.uac_rx)
|
||||
*(.mass_storage)
|
||||
|
||||
*(.usb_ep0)
|
||||
*(.usb_msd_dma)
|
||||
*(.usb_hid_dma)
|
||||
*(.usb_iso_dma)
|
||||
*(.usb_cdc_dma)
|
||||
*(.uac_var)
|
||||
*(.usb_config_var)
|
||||
*(.cdc_var)
|
||||
}
|
||||
|
||||
} > ram0
|
||||
|
||||
|
||||
27
apps/earphone/board/br28/board_config.h
Normal file
27
apps/earphone/board/br28/board_config.h
Normal file
@ -0,0 +1,27 @@
|
||||
#ifndef BOARD_CONFIG_H
|
||||
#define BOARD_CONFIG_H
|
||||
|
||||
|
||||
/*
|
||||
* 板级配置选择
|
||||
*/
|
||||
#define CONFIG_BOARD_JL701N_DEMO //编译正常 2025-4-29
|
||||
// #define CONFIG_BOARD_JL701N_BTEMITTER
|
||||
// #define CONFIG_BOARD_JL701N_ANC
|
||||
// #define CONFIG_BOARD_JL7016G_HYBRID
|
||||
// #define CONFIG_BOARD_JL7018F_DEMO //编译不过 2025-4-29
|
||||
|
||||
#include "media/audio_def.h"
|
||||
#include "board_jl701n_demo_cfg.h"
|
||||
#include "board_jl701n_btemitter_cfg.h"
|
||||
#include "board_jl701n_anc_cfg.h"
|
||||
#include "board_jl7016g_hybrid_cfg.h"
|
||||
#include "board_jl7018f_demo_cfg.h"
|
||||
|
||||
#define DUT_AUDIO_DAC_LDO_VOLT DACVDD_LDO_1_25V
|
||||
|
||||
#ifdef CONFIG_NEW_CFG_TOOL_ENABLE
|
||||
#define CONFIG_ENTRY_ADDRESS 0x6000100
|
||||
#endif
|
||||
|
||||
#endif
|
||||
1025
apps/earphone/board/br28/board_jl7016g_hybrid.c
Normal file
1025
apps/earphone/board/br28/board_jl7016g_hybrid.c
Normal file
File diff suppressed because it is too large
Load Diff
1111
apps/earphone/board/br28/board_jl7016g_hybrid_cfg.h
Normal file
1111
apps/earphone/board/br28/board_jl7016g_hybrid_cfg.h
Normal file
File diff suppressed because it is too large
Load Diff
123
apps/earphone/board/br28/board_jl7016g_hybrid_global_build_cfg.h
Normal file
123
apps/earphone/board/br28/board_jl7016g_hybrid_global_build_cfg.h
Normal file
@ -0,0 +1,123 @@
|
||||
#ifndef CONFIG_BOARD_JL7016G_HYBRID_POST_BUILD_CFG_H
|
||||
#define CONFIG_BOARD_JL7016G_HYBRID_POST_BUILD_CFG_H
|
||||
|
||||
/* 改文件只添加和isd_config.ini相关的配置,用以生成isd_config.ini */
|
||||
/* 其他不相关的配置请勿添加在改文件 */
|
||||
|
||||
#ifdef CONFIG_BOARD_JL7016G_HYBRID
|
||||
|
||||
/* Following Macros Affect Periods Of Both Code Compiling And Post-build */
|
||||
|
||||
#define CONFIG_DOUBLE_BANK_ENABLE 0 //单双备份选择(若打开了改宏,FLASH结构变为双备份结构,适用于接入第三方协议的OTA, PS: JL-OTA同样支持双备份升级, 需要根据实际FLASH大小同时配置CONFIG_FLASH_SIZE)
|
||||
#define CONFIG_APP_OTA_ENABLE 0 //是否支持RCSP升级(JL-OTA)
|
||||
|
||||
#define CONFIG_UPDATE_JUMP_TO_MASK 0 //配置升级到loader的方式0为直接reset,1为跳转(适用于芯片电源由IO口KEEP住的方案,需要注意检查跳转前是否将使用DMA的硬件模块全部关闭)
|
||||
|
||||
#define CONFIG_IO_KEY_EN 0 //配置是否使用IO按键,配合RESET1
|
||||
#define CONFIG_UPDATE_WITH_MD5_CHECK_EN 0 //配置升级是否支持MD5校验
|
||||
|
||||
#define CONFIG_ANC_ENABLE 1 //配置是否支持ANC
|
||||
|
||||
//flash size vaule definition
|
||||
#define FLASH_SIZE_256K 0x40000
|
||||
#define FLASH_SIZE_512K 0x80000
|
||||
#define FLASH_SIZE_1M 0x100000
|
||||
#define FLASH_SIZE_2M 0x200000
|
||||
#define FLASH_SIZE_4M 0x400000
|
||||
|
||||
#define CONFIG_FLASH_SIZE FLASH_SIZE_1M //配置FLASH大小
|
||||
|
||||
|
||||
/* Above Macros Affect Periods Of Both Code Compiling And Post-build */
|
||||
|
||||
/* Following Macros Only For Post Bulid Configuaration */
|
||||
|
||||
#define CONFIG_DB_UPDATE_DATA_GENERATE_EN 0 //是否生成db_data.bin(用于第三方协议接入使用)
|
||||
#define CONFIG_ONLY_GRENERATE_ALIGN_4K_CODE 0 //ufw只生成1份4K对齐的代码
|
||||
|
||||
//config for supported chip version
|
||||
#ifdef CONFIG_BR30_C_VERSION
|
||||
#define CONFIG_SUPPORTED_CHIP_VERSION C
|
||||
#else
|
||||
#define CONFIG_SUPPORTED_CHIP_VERSION B,D,E,M,N,O,P
|
||||
#endif
|
||||
|
||||
//DON'T MODIFY THIS CONFIG EXCEPT SDK PUBLISHER
|
||||
#define CONFIG_CHIP_NAME AC701N //除了SDK发布者,请不要修改
|
||||
//it can be modified before first programming,but keep the same as the original version
|
||||
#define CONFIG_PID AC701N //烧写或强制升级之前可以修改,之后升级要保持一致
|
||||
//it can be modified before first programming,but keep the same as the original version
|
||||
#define CONFIG_VID 0.01 //烧写或强制升级之前可以修改,之后升级要保持一致
|
||||
|
||||
//Project with bluetooth,it must use OSC as PLL_SOURCE;
|
||||
#define CONFIG_PLL_SOURCE_USING_LRC 0 //PLL时钟源选择 1:LRC 2:OSC
|
||||
|
||||
//config alignment size unit
|
||||
#ifdef CONFIG_256K_FLASH
|
||||
#define ALIGN_UNIT_256B 1 //FLASH对齐方式选择,如果是256K的FLASH,选择256BYTE对齐方式
|
||||
#else
|
||||
#define ALIGN_UNIT_256B 0
|
||||
#endif
|
||||
|
||||
//partial platform check this config to select the uart IO for wired update
|
||||
#define CONFIG_UART_UPDATE_PIN PP00
|
||||
|
||||
//isd_download loader/uboot/update_loader debug io config
|
||||
//#define CONFIG_UBOOT_DEBUG_PIN PA05
|
||||
//#define CONFIG_UBOOT_DEBUG_BAUD_RATE 1000000
|
||||
|
||||
//config long-press reset io pin,time,trigger level
|
||||
#define CONFIG_RESET_PIN LDO //io pin
|
||||
#define CONFIG_RESET_TIME 04 //unit:second
|
||||
#define CONFIG_RESET_LEVEL 1 //tigger level(0/1)
|
||||
|
||||
#if CONFIG_IO_KEY_EN
|
||||
#define CONFIG_SUPPORT_RESET1
|
||||
#define CONFIG_RESET1_PIN PB01 //io pin
|
||||
#define CONFIG_RESET1_TIME 08 //unit:second
|
||||
#define CONFIG_RESET1_LEVEL 0 //tigger level(0/1)
|
||||
#endif
|
||||
|
||||
//reserved three custom cfg item for the future definition
|
||||
//#define CONFIG_CUSTOM_CFG1_TYPE POWER_PIN
|
||||
//#define CONFIG_CUSTOM_CFG1_VALUE PC01_1
|
||||
|
||||
//#define CONFIG_CUSTOM_CFG2_TYPE
|
||||
//#define CONFIG_CUSTOM_CFG2_VALUE
|
||||
|
||||
//#define CONFIG_CUSTOM_CFG3_TYPE
|
||||
//#define CONFIG_CUSTOM_CFG3_VALUE
|
||||
|
||||
|
||||
//#define CONFIG_VDDIO_LVD_LEVEL 4 ////VDDIO_LVD挡位,0: 1.9V 1: 2.0V 2: 2.1V 3: 2.2V 4: 2.3V 5: 2.4V 6: 2.5V 7: 2.6V
|
||||
|
||||
//with single-bank mode,actual vm size should larger this VM_LEAST_SIZE,and dual bank mode,actual vm size equals this;
|
||||
#define CONFIG_VM_LEAST_SIZE 8K
|
||||
//config whether erased this area when do a update,1-No Operation,0-Erase
|
||||
#define CONFIG_VM_OPT 1
|
||||
|
||||
//config whether erased this area when do a update,1-No Operation,0-Erase
|
||||
#define CONFIG_BTIF_OPT 1
|
||||
|
||||
//reserved two custom cfg area for the future definition
|
||||
//#define CONFIG_RESERVED_AREA1 EXIF1
|
||||
#ifdef CONFIG_RESERVED_AREA1
|
||||
#define CONFIG_RESERVED_AREA1_ADDR AUTO
|
||||
#define CONFIG_RESERVED_AREA1_LEN 0x1000
|
||||
#define CONFIG_RESERVED_AREA1_OPT 1
|
||||
//#define CONFIG_RESERVED_AREA1_FILE anc_gains.bin
|
||||
#endif
|
||||
|
||||
//#define CONFIG_RESERVED_AREA2 EXIF2
|
||||
#ifdef CONFIG_RESERVED_AREA2
|
||||
#define CONFIG_RESERVED_AREA2_ADDR AUTO
|
||||
#define CONFIG_RESERVED_AREA2_LEN 0x1000
|
||||
#define CONFIG_RESERVED_AREA2_OPT 1
|
||||
//#define CONFIG_RESERVED_AREA2_FILE anc_gains.bin
|
||||
#endif
|
||||
|
||||
/* Above Macros Only For Post Bulid Configuaration */
|
||||
#endif /* #ifdef CONFIG_BOARD_JL7016G_HYBRID */
|
||||
|
||||
#endif /* #ifndef CONFIG_BOARD_JL701N_ANC_POST_BUILD_CFG_H */
|
||||
|
||||
1038
apps/earphone/board/br28/board_jl7018f_demo.c
Normal file
1038
apps/earphone/board/br28/board_jl7018f_demo.c
Normal file
File diff suppressed because it is too large
Load Diff
1119
apps/earphone/board/br28/board_jl7018f_demo_cfg.h
Normal file
1119
apps/earphone/board/br28/board_jl7018f_demo_cfg.h
Normal file
File diff suppressed because it is too large
Load Diff
123
apps/earphone/board/br28/board_jl7018f_demo_global_build_cfg.h
Normal file
123
apps/earphone/board/br28/board_jl7018f_demo_global_build_cfg.h
Normal file
@ -0,0 +1,123 @@
|
||||
#ifndef CONFIG_BOARD_JL7018F_DEMO_POST_BUILD_CFG_H
|
||||
#define CONFIG_BOARD_JL7018F_DEMO_POST_BUILD_CFG_H
|
||||
|
||||
/* 改文件只添加和isd_config.ini相关的配置,用以生成isd_config.ini */
|
||||
/* 其他不相关的配置请勿添加在改文件 */
|
||||
|
||||
#ifdef CONFIG_BOARD_JL7018F_DEMO
|
||||
|
||||
/* Following Macros Affect Periods Of Both Code Compiling And Post-build */
|
||||
|
||||
#define CONFIG_DOUBLE_BANK_ENABLE 0 //单双备份选择(若打开了改宏,FLASH结构变为双备份结构,适用于接入第三方协议的OTA, PS: JL-OTA同样支持双备份升级, 需要根据实际FLASH大小同时配置CONFIG_FLASH_SIZE)
|
||||
#define CONFIG_APP_OTA_ENABLE 0 //是否支持RCSP升级(JL-OTA)
|
||||
|
||||
#define CONFIG_UPDATE_JUMP_TO_MASK 0 //配置升级到loader的方式0为直接reset,1为跳转(适用于芯片电源由IO口KEEP住的方案,需要注意检查跳转前是否将使用DMA的硬件模块全部关闭)
|
||||
|
||||
#define CONFIG_IO_KEY_EN 0 //配置是否使用IO按键,配合RESET1
|
||||
#define CONFIG_UPDATE_WITH_MD5_CHECK_EN 0 //配置升级是否支持MD5校验
|
||||
|
||||
#define CONFIG_ANC_ENABLE 1 //配置是否支持ANC
|
||||
|
||||
//flash size vaule definition
|
||||
#define FLASH_SIZE_256K 0x40000
|
||||
#define FLASH_SIZE_512K 0x80000
|
||||
#define FLASH_SIZE_1M 0x100000
|
||||
#define FLASH_SIZE_2M 0x200000
|
||||
#define FLASH_SIZE_4M 0x400000
|
||||
|
||||
#define CONFIG_FLASH_SIZE FLASH_SIZE_1M //配置FLASH大小
|
||||
|
||||
|
||||
/* Above Macros Affect Periods Of Both Code Compiling And Post-build */
|
||||
|
||||
/* Following Macros Only For Post Bulid Configuaration */
|
||||
|
||||
#define CONFIG_DB_UPDATE_DATA_GENERATE_EN 0 //是否生成db_data.bin(用于第三方协议接入使用)
|
||||
#define CONFIG_ONLY_GRENERATE_ALIGN_4K_CODE 0 //ufw只生成1份4K对齐的代码
|
||||
|
||||
//config for supported chip version
|
||||
#ifdef CONFIG_BR30_C_VERSION
|
||||
#define CONFIG_SUPPORTED_CHIP_VERSION C
|
||||
#else
|
||||
#define CONFIG_SUPPORTED_CHIP_VERSION B,D,E,M,N,O,P
|
||||
#endif
|
||||
|
||||
//DON'T MODIFY THIS CONFIG EXCEPT SDK PUBLISHER
|
||||
#define CONFIG_CHIP_NAME AC701N //除了SDK发布者,请不要修改
|
||||
//it can be modified before first programming,but keep the same as the original version
|
||||
#define CONFIG_PID AC701N //烧写或强制升级之前可以修改,之后升级要保持一致
|
||||
//it can be modified before first programming,but keep the same as the original version
|
||||
#define CONFIG_VID 0.01 //烧写或强制升级之前可以修改,之后升级要保持一致
|
||||
|
||||
//Project with bluetooth,it must use OSC as PLL_SOURCE;
|
||||
#define CONFIG_PLL_SOURCE_USING_LRC 0 //PLL时钟源选择 1:LRC 2:OSC
|
||||
|
||||
//config alignment size unit
|
||||
#ifdef CONFIG_256K_FLASH
|
||||
#define ALIGN_UNIT_256B 1 //FLASH对齐方式选择,如果是256K的FLASH,选择256BYTE对齐方式
|
||||
#else
|
||||
#define ALIGN_UNIT_256B 0
|
||||
#endif
|
||||
|
||||
//partial platform check this config to select the uart IO for wired update
|
||||
#define CONFIG_UART_UPDATE_PIN PP00
|
||||
|
||||
//isd_download loader/uboot/update_loader debug io config
|
||||
//#define CONFIG_UBOOT_DEBUG_PIN PA05
|
||||
//#define CONFIG_UBOOT_DEBUG_BAUD_RATE 1000000
|
||||
|
||||
//config long-press reset io pin,time,trigger level
|
||||
#define CONFIG_RESET_PIN LDO //io pin
|
||||
#define CONFIG_RESET_TIME 04 //unit:second
|
||||
#define CONFIG_RESET_LEVEL 1 //tigger level(0/1)
|
||||
|
||||
#if CONFIG_IO_KEY_EN
|
||||
#define CONFIG_SUPPORT_RESET1
|
||||
#define CONFIG_RESET1_PIN PB01 //io pin
|
||||
#define CONFIG_RESET1_TIME 08 //unit:second
|
||||
#define CONFIG_RESET1_LEVEL 0 //tigger level(0/1)
|
||||
#endif
|
||||
|
||||
//reserved three custom cfg item for the future definition
|
||||
//#define CONFIG_CUSTOM_CFG1_TYPE POWER_PIN
|
||||
//#define CONFIG_CUSTOM_CFG1_VALUE PC01_1
|
||||
|
||||
//#define CONFIG_CUSTOM_CFG2_TYPE
|
||||
//#define CONFIG_CUSTOM_CFG2_VALUE
|
||||
|
||||
//#define CONFIG_CUSTOM_CFG3_TYPE
|
||||
//#define CONFIG_CUSTOM_CFG3_VALUE
|
||||
|
||||
|
||||
//#define CONFIG_VDDIO_LVD_LEVEL 4 ////VDDIO_LVD挡位,0: 1.9V 1: 2.0V 2: 2.1V 3: 2.2V 4: 2.3V 5: 2.4V 6: 2.5V 7: 2.6V
|
||||
|
||||
//with single-bank mode,actual vm size should larger this VM_LEAST_SIZE,and dual bank mode,actual vm size equals this;
|
||||
#define CONFIG_VM_LEAST_SIZE 8K
|
||||
//config whether erased this area when do a update,1-No Operation,0-Erase
|
||||
#define CONFIG_VM_OPT 1
|
||||
|
||||
//config whether erased this area when do a update,1-No Operation,0-Erase
|
||||
#define CONFIG_BTIF_OPT 1
|
||||
|
||||
//reserved two custom cfg area for the future definition
|
||||
//#define CONFIG_RESERVED_AREA1 EXIF1
|
||||
#ifdef CONFIG_RESERVED_AREA1
|
||||
#define CONFIG_RESERVED_AREA1_ADDR AUTO
|
||||
#define CONFIG_RESERVED_AREA1_LEN 0x1000
|
||||
#define CONFIG_RESERVED_AREA1_OPT 1
|
||||
//#define CONFIG_RESERVED_AREA1_FILE anc_gains.bin
|
||||
#endif
|
||||
|
||||
//#define CONFIG_RESERVED_AREA2 EXIF2
|
||||
#ifdef CONFIG_RESERVED_AREA2
|
||||
#define CONFIG_RESERVED_AREA2_ADDR AUTO
|
||||
#define CONFIG_RESERVED_AREA2_LEN 0x1000
|
||||
#define CONFIG_RESERVED_AREA2_OPT 1
|
||||
//#define CONFIG_RESERVED_AREA2_FILE anc_gains.bin
|
||||
#endif
|
||||
|
||||
/* Above Macros Only For Post Bulid Configuaration */
|
||||
#endif /* #ifdef CONFIG_BOARD_JL7018F_DEMO */
|
||||
|
||||
#endif /* #ifndef CONFIG_BOARD_JL7018F_DEMO_POST_BUILD_CFG_H */
|
||||
|
||||
992
apps/earphone/board/br28/board_jl701n_anc.c
Normal file
992
apps/earphone/board/br28/board_jl701n_anc.c
Normal file
@ -0,0 +1,992 @@
|
||||
#include "app_config.h"
|
||||
|
||||
#ifdef CONFIG_BOARD_JL701N_ANC
|
||||
|
||||
#include "system/includes.h"
|
||||
#include "media/includes.h"
|
||||
#include "asm/sdmmc.h"
|
||||
#include "asm/chargestore.h"
|
||||
#include "asm/umidigi_chargestore.h"
|
||||
#include "asm/charge.h"
|
||||
#include "asm/pwm_led.h"
|
||||
#include "tone_player.h"
|
||||
#include "audio_config.h"
|
||||
#include "gSensor/gSensor_manage.h"
|
||||
#include "key_event_deal.h"
|
||||
#include "asm/lp_touch_key_api.h"
|
||||
#include "user_cfg.h"
|
||||
#include "norflash_sfc.h"
|
||||
#include "asm/power/power_port.h"
|
||||
#include "app_umidigi_chargestore.h"
|
||||
#include "audio_link.h"
|
||||
#if TCFG_AUDIO_ANC_ENABLE
|
||||
#include "audio_anc.h"
|
||||
#endif/*TCFG_AUDIO_ANC_ENABLE*/
|
||||
|
||||
#define LOG_TAG_CONST BOARD
|
||||
#define LOG_TAG "[BOARD]"
|
||||
#define LOG_ERROR_ENABLE
|
||||
#define LOG_DEBUG_ENABLE
|
||||
#define LOG_INFO_ENABLE
|
||||
/* #define LOG_DUMP_ENABLE */
|
||||
#define LOG_CLI_ENABLE
|
||||
#include "debug.h"
|
||||
|
||||
void board_power_init(void);
|
||||
|
||||
/*各个状态下默认的闪灯方式和提示音设置,如果USER_CFG中设置了USE_CONFIG_STATUS_SETTING为1,则会从配置文件读取对应的配置来填充改结构体*/
|
||||
STATUS_CONFIG status_config = {
|
||||
//灯状态设置
|
||||
.led = {
|
||||
.charge_start = PWM_LED1_ON,
|
||||
.charge_full = PWM_LED0_ON,
|
||||
.power_on = PWM_LED0_ON,
|
||||
.power_off = PWM_LED1_FLASH_THREE,
|
||||
.lowpower = PWM_LED1_SLOW_FLASH,
|
||||
.max_vol = PWM_LED_NULL,
|
||||
.phone_in = PWM_LED_NULL,
|
||||
.phone_out = PWM_LED_NULL,
|
||||
.phone_activ = PWM_LED_NULL,
|
||||
.bt_init_ok = PWM_LED0_LED1_SLOW_FLASH,
|
||||
.bt_connect_ok = PWM_LED0_ONE_FLASH_5S,
|
||||
.bt_disconnect = PWM_LED0_LED1_FAST_FLASH,
|
||||
.tws_connect_ok = PWM_LED0_LED1_FAST_FLASH,
|
||||
.tws_disconnect = PWM_LED0_LED1_SLOW_FLASH,
|
||||
},
|
||||
//提示音设置
|
||||
.tone = {
|
||||
.charge_start = IDEX_TONE_NONE,
|
||||
.charge_full = IDEX_TONE_NONE,
|
||||
.power_on = IDEX_TONE_POWER_ON,
|
||||
.power_off = IDEX_TONE_POWER_OFF,
|
||||
.lowpower = IDEX_TONE_LOW_POWER,
|
||||
.max_vol = IDEX_TONE_MAX_VOL,
|
||||
.phone_in = IDEX_TONE_NONE,
|
||||
.phone_out = IDEX_TONE_NONE,
|
||||
.phone_activ = IDEX_TONE_NONE,
|
||||
.bt_init_ok = IDEX_TONE_BT_MODE,
|
||||
.bt_connect_ok = IDEX_TONE_BT_CONN,
|
||||
.bt_disconnect = IDEX_TONE_BT_DISCONN,
|
||||
.tws_connect_ok = IDEX_TONE_TWS_CONN,
|
||||
.tws_disconnect = IDEX_TONE_TWS_DISCONN,
|
||||
}
|
||||
};
|
||||
|
||||
#define __this (&status_config)
|
||||
|
||||
/************************** KEY MSG****************************/
|
||||
/*各个按键的消息设置,如果USER_CFG中设置了USE_CONFIG_KEY_SETTING为1,则会从配置文件读取对应的配置来填充改结构体*/
|
||||
#if CLIENT_BOARD == CUSTOM10_CFG
|
||||
u8 key_table[KEY_NUM_MAX][KEY_EVENT_MAX] = {
|
||||
// SHORT LONG HOLD UP DOUBLE TRIPLE
|
||||
{KEY_MUSIC_PP, KEY_NULL, KEY_NULL, KEY_NULL, KEY_ANC_SWITCH, KEY_NULL}, //KEY_0
|
||||
{KEY_MUSIC_NEXT, KEY_VOL_UP, KEY_VOL_UP, KEY_NULL, KEY_OPEN_SIRI, KEY_NULL}, //KEY_1
|
||||
{KEY_MUSIC_PREV, KEY_VOL_DOWN, KEY_VOL_DOWN, KEY_NULL, KEY_HID_CONTROL, KEY_NULL}, //KEY_2
|
||||
};
|
||||
#else
|
||||
u8 key_table[KEY_NUM_MAX][KEY_EVENT_MAX] = {
|
||||
// SHORT LONG HOLD UP DOUBLE TRIPLE
|
||||
{KEY_MUSIC_PP, KEY_ANC_SWITCH, KEY_NULL, KEY_NULL, KEY_CALL_LAST_NO, KEY_NULL}, //KEY_0
|
||||
{KEY_MUSIC_NEXT, KEY_VOL_UP, KEY_VOL_UP, KEY_NULL, KEY_OPEN_SIRI, KEY_NULL}, //KEY_1
|
||||
{KEY_MUSIC_PREV, KEY_VOL_DOWN, KEY_VOL_DOWN, KEY_NULL, KEY_HID_CONTROL, KEY_NULL}, //KEY_2
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
// *INDENT-OFF*
|
||||
/************************** UART config****************************/
|
||||
#if TCFG_UART0_ENABLE
|
||||
UART0_PLATFORM_DATA_BEGIN(uart0_data)
|
||||
.tx_pin = TCFG_UART0_TX_PORT, //串口打印TX引脚选择
|
||||
.rx_pin = TCFG_UART0_RX_PORT, //串口打印RX引脚选择
|
||||
.baudrate = TCFG_UART0_BAUDRATE, //串口波特率
|
||||
|
||||
.flags = UART_DEBUG, //串口用来打印需要把改参数设置为UART_DEBUG
|
||||
UART0_PLATFORM_DATA_END()
|
||||
#endif //TCFG_UART0_ENABLE
|
||||
|
||||
/************************** CHARGE config****************************/
|
||||
#if TCFG_CHARGE_ENABLE
|
||||
CHARGE_PLATFORM_DATA_BEGIN(charge_data)
|
||||
.charge_en = TCFG_CHARGE_ENABLE, //内置充电使能
|
||||
.charge_poweron_en = TCFG_CHARGE_POWERON_ENABLE, //是否支持充电开机
|
||||
.charge_full_V = TCFG_CHARGE_FULL_V, //充电截止电压
|
||||
.charge_full_mA = TCFG_CHARGE_FULL_MA, //充电截止电流
|
||||
.charge_mA = TCFG_CHARGE_MA, //恒流充电电流
|
||||
.charge_trickle_mA = TCFG_CHARGE_TRICKLE_MA, //涓流充电电流
|
||||
/*ldo5v拔出过滤值,过滤时间 = (filter*2 + 20)ms,ldoin<0.6V且时间大于过滤时间才认为拔出
|
||||
对于充满直接从5V掉到0V的充电仓,该值必须设置成0,对于充满由5V先掉到0V之后再升压到xV的
|
||||
充电仓,需要根据实际情况设置该值大小*/
|
||||
.ldo5v_off_filter = 100,
|
||||
.ldo5v_on_filter = 50,
|
||||
.ldo5v_keep_filter = 220,
|
||||
.ldo5v_pulldown_lvl = CHARGE_PULLDOWN_200K, //下拉电阻档位选择
|
||||
.ldo5v_pulldown_keep = 0,
|
||||
//1、对于自动升压充电舱,若充电舱需要更大的负载才能检测到插入时,请将该变量置1,并且根据需求配置下拉电阻档位
|
||||
//2、对于按键升压,并且是通过上拉电阻去提供维持电压的舱,请将该变量设置1,并且根据舱的上拉配置下拉需要的电阻挡位
|
||||
//3、对于常5V的舱,可将改变量设为0,省功耗
|
||||
//4、为LDOIN防止被误触发唤醒,可设置为200k下拉
|
||||
.ldo5v_pulldown_en = 1,
|
||||
CHARGE_PLATFORM_DATA_END()
|
||||
#endif//TCFG_CHARGE_ENABLE
|
||||
|
||||
/************************** chargestore config****************************/
|
||||
#if TCFG_CHARGESTORE_ENABLE || TCFG_TEST_BOX_ENABLE || TCFG_ANC_BOX_ENABLE
|
||||
CHARGESTORE_PLATFORM_DATA_BEGIN(chargestore_data)
|
||||
.io_port = TCFG_CHARGESTORE_PORT,
|
||||
CHARGESTORE_PLATFORM_DATA_END()
|
||||
#endif
|
||||
|
||||
/************************** DAC ****************************/
|
||||
#if TCFG_AUDIO_DAC_ENABLE
|
||||
struct dac_platform_data dac_data = {
|
||||
.mode = TCFG_AUDIO_DAC_MODE, //dac输出模式
|
||||
.ldo_id = TCFG_AUDIO_DAC_LDO_SEL, //保留位
|
||||
.pa_mute_port = TCFG_AUDIO_DAC_PA_PORT, //暂时无作用
|
||||
.vcmo_en = 0, //是否打开VCOMO
|
||||
.pa_mute_value = 1, //暂时无作用
|
||||
.output = TCFG_AUDIO_DAC_CONNECT_MODE, //DAC输出配置,和具体硬件连接有关,需根据硬件来设置
|
||||
.lpf_isel = 0xf,
|
||||
.sys_vol_type = SYS_VOL_TYPE, //系统音量选择:模拟音量/数字音量,调节时调节对应的音量
|
||||
.max_ana_vol = MAX_ANA_VOL, //模拟音量最大等级
|
||||
.max_dig_vol = MAX_DIG_VOL, //数字音量最大等级
|
||||
/* .dig_vol_tab = (s16 *)dig_vol_table, //数字音量表 */
|
||||
.vcm_cap_en = 1, //配1代表走外部通路,vcm上有电容时,可以提升电路抑制电源噪声能力,提高ADC的性能,配0相当于vcm上无电容,抑制电源噪声能力下降,ADC性能下降
|
||||
#if (SYS_VOL_TYPE == VOL_TYPE_AD)
|
||||
.digital_gain_limit = 16384,
|
||||
#endif // #if (SYS_VOL_TYPE == VOL_TYPE_AD)
|
||||
|
||||
.power_on_mode = 0,
|
||||
};
|
||||
#endif
|
||||
|
||||
/************************** ADC ****************************/
|
||||
#if TCFG_AUDIO_ADC_ENABLE
|
||||
#ifndef TCFG_AUDIO_MIC0_BIAS_EN
|
||||
#define TCFG_AUDIO_MIC0_BIAS_EN 0
|
||||
#endif/*TCFG_AUDIO_MIC0_BIAS_EN*/
|
||||
#ifndef TCFG_AUDIO_MIC1_BIAS_EN
|
||||
#define TCFG_AUDIO_MIC1_BIAS_EN 0
|
||||
#endif/*TCFG_AUDIO_MIC1_BIAS_EN*/
|
||||
#ifndef TCFG_AUDIO_MIC2_BIAS_EN
|
||||
#define TCFG_AUDIO_MIC2_BIAS_EN 0
|
||||
#endif/*TCFG_AUDIO_MIC2_BIAS_EN*/
|
||||
#ifndef TCFG_AUDIO_MIC3_BIAS_EN
|
||||
#define TCFG_AUDIO_MIC3_BIAS_EN 0
|
||||
#endif/*TCFG_AUDIO_MIC3_BIAS_EN*/
|
||||
#ifndef TCFG_AUDIO_MIC_LDO_EN
|
||||
#define TCFG_AUDIO_MIC_LDO_EN 0
|
||||
#endif/*TCFG_AUDIO_MIC_LDO_EN*/
|
||||
|
||||
struct adc_platform_data adc_data = {
|
||||
|
||||
/*MIC LDO电流档位设置:
|
||||
0:0.625ua 1:1.25ua 2:1.875ua 3:2.5ua*/
|
||||
.mic_ldo_isel = TCFG_AUDIO_ADC_LD0_SEL,
|
||||
|
||||
/*mic_mode 工作模式定义
|
||||
#define AUDIO_MIC_CAP_MODE 0 //单端隔直电容模式
|
||||
#define AUDIO_MIC_CAP_DIFF_MODE 1 //差分隔直电容模式
|
||||
#define AUDIO_MIC_CAPLESS_MODE 2 //单端省电容模式
|
||||
*/
|
||||
.mic_mode = TCFG_AUDIO_MIC_MODE,
|
||||
.mic1_mode = TCFG_AUDIO_MIC1_MODE,
|
||||
.mic2_mode = TCFG_AUDIO_MIC2_MODE,
|
||||
.mic3_mode = TCFG_AUDIO_MIC3_MODE,
|
||||
|
||||
.mic_bias_inside = TCFG_AUDIO_MIC0_BIAS_EN,
|
||||
.mic1_bias_inside = TCFG_AUDIO_MIC1_BIAS_EN,
|
||||
.mic2_bias_inside = TCFG_AUDIO_MIC2_BIAS_EN,
|
||||
.mic3_bias_inside = TCFG_AUDIO_MIC3_BIAS_EN,
|
||||
|
||||
/*MICLDO供电输出到PAD(PA0)控制使能*/
|
||||
.mic_ldo_pwr = TCFG_AUDIO_MIC_LDO_EN, // MIC LDO 输出到 PA0
|
||||
|
||||
/*MIC免电容方案需要设置,影响MIC的偏置电压
|
||||
0b0001~0b1001 : 0.5k ~ 4.5k step = 0.5k
|
||||
0b1010~0b1111 : 5k ~ 10k step = 1k */
|
||||
.mic_bias_res = 4,
|
||||
.mic1_bias_res = 4,
|
||||
.mic2_bias_res = 4,
|
||||
.mic3_bias_res = 4,
|
||||
/*MIC LDO电压档位设置,也会影响MIC的偏置电压
|
||||
3:2.0v 4:2.2v 5:2.4v 6:2.6v 7:2.8v */
|
||||
.mic_ldo_vsel = 5,
|
||||
//mic的去直流dcc寄存器配置值,可配0到15,数值越大,其高通转折点越低
|
||||
.mic_dcc = 8,
|
||||
/*ADC低功耗等级,越大功耗越低,对应影响THD和底噪, 范围 (0 - 2)*/
|
||||
.lowpower_lvl = 0,
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
const struct vad_mic_platform_data vad_mic_data = {
|
||||
.mic_data = { //
|
||||
.mic_mode = TCFG_AUDIO_MIC_MODE,
|
||||
.mic_ldo_isel = 2,
|
||||
.mic_ldo_vsel = 5,
|
||||
.mic_ldo2PAD_en = 1,
|
||||
.mic_bias_en = 0,
|
||||
.mic_bias_res = 0,
|
||||
.mic_bias_inside = TCFG_AUDIO_MIC0_BIAS_EN,
|
||||
/* ADC偏置电阻配置*/
|
||||
.adc_rbs = 3,
|
||||
/* ADC输入电阻配置*/
|
||||
.adc_rin = 3,
|
||||
/*.adc_test = 1,*/
|
||||
},
|
||||
.power_data = {
|
||||
/*VADLDO电压档位:0~7*/
|
||||
.ldo_vs = 3,
|
||||
/*VADLDO误差运放电流档位:0~3*/
|
||||
#if TCFG_VAD_LOWPOWER_CLOCK == VAD_CLOCK_USE_PMU_STD12M
|
||||
.ldo_is = 1,
|
||||
#else
|
||||
.ldo_is = 2,
|
||||
#endif
|
||||
.clock = TCFG_VAD_LOWPOWER_CLOCK, /*VAD时钟选项*/
|
||||
.acm_select = 8,
|
||||
},
|
||||
};
|
||||
/* struct audio_pf_data audio_pf_d = { */
|
||||
/* #if TCFG_AUDIO_DAC_ENABLE */
|
||||
/* .adc_pf_data = &adc_data, */
|
||||
/* #endif */
|
||||
|
||||
/* #if TCFG_AUDIO_ADC_ENABLE */
|
||||
/* .dac_pf_data = &dac_data, */
|
||||
/* #endif */
|
||||
/* }; */
|
||||
|
||||
/* struct audio_platform_data audio_data = { */
|
||||
/* .private_data = (void *) &audio_pf_d, */
|
||||
/* }; */
|
||||
|
||||
|
||||
/************************** IO KEY ****************************/
|
||||
#if TCFG_IOKEY_ENABLE
|
||||
const struct iokey_port iokey_list[] = {
|
||||
|
||||
{
|
||||
.connect_way = TCFG_IOKEY_POWER_CONNECT_WAY, //IO按键的连接方式
|
||||
.key_type.one_io.port = TCFG_IOKEY_POWER_ONE_PORT, //IO按键对应的引脚
|
||||
.key_value = 0, //按键值
|
||||
},
|
||||
};
|
||||
const struct iokey_platform_data iokey_data = {
|
||||
.enable = TCFG_IOKEY_ENABLE, //是否使能IO按键
|
||||
.num = ARRAY_SIZE(iokey_list), //IO按键的个数
|
||||
.port = iokey_list, //IO按键参数表
|
||||
};
|
||||
|
||||
#if MULT_KEY_ENABLE
|
||||
//组合按键消息映射表
|
||||
//配置注意事项:单个按键按键值需要按照顺序编号,如power:0, prev:1, next:2
|
||||
//bit_value = BIT(0) | BIT(1) 指按键值为0和按键值为1的两个按键被同时按下,
|
||||
//remap_value = 3指当这两个按键被同时按下后重新映射的按键值;
|
||||
const struct key_remap iokey_remap_table[] = {
|
||||
{.bit_value = BIT(0) | BIT(1), .remap_value = 3},
|
||||
{.bit_value = BIT(0) | BIT(2), .remap_value = 4},
|
||||
{.bit_value = BIT(1) | BIT(2), .remap_value = 5},
|
||||
};
|
||||
|
||||
const struct key_remap_data iokey_remap_data = {
|
||||
.remap_num = ARRAY_SIZE(iokey_remap_table),
|
||||
.table = iokey_remap_table,
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/*********************** LP TOUCH KEY ****************************/
|
||||
#if TCFG_LP_TOUCH_KEY_ENABLE
|
||||
const struct lp_touch_key_platform_data lp_touch_key_config = {
|
||||
/*触摸按键*/
|
||||
.ch[0].enable = TCFG_LP_TOUCH_KEY0_EN,
|
||||
.ch[0].wakeup_enable = TCFG_LP_TOUCH_KEY0_WAKEUP_EN,
|
||||
.ch[0].port = IO_PORTB_00,
|
||||
.ch[0].sensitivity = TCFG_LP_TOUCH_KEY0_SENSITIVITY,
|
||||
.ch[0].key_value = 0,
|
||||
|
||||
.ch[1].enable = TCFG_LP_TOUCH_KEY1_EN,
|
||||
.ch[1].wakeup_enable = TCFG_LP_TOUCH_KEY1_WAKEUP_EN,
|
||||
.ch[1].port = IO_PORTB_01,
|
||||
.ch[1].sensitivity = TCFG_LP_TOUCH_KEY1_SENSITIVITY,
|
||||
.ch[1].key_value = 0,
|
||||
|
||||
.ch[2].enable = TCFG_LP_TOUCH_KEY2_EN,
|
||||
.ch[2].wakeup_enable = TCFG_LP_TOUCH_KEY2_WAKEUP_EN,
|
||||
.ch[2].port = IO_PORTB_02,
|
||||
.ch[2].sensitivity = TCFG_LP_TOUCH_KEY2_SENSITIVITY,
|
||||
.ch[2].key_value = 1,
|
||||
|
||||
.ch[3].enable = TCFG_LP_TOUCH_KEY3_EN,
|
||||
.ch[3].wakeup_enable = TCFG_LP_TOUCH_KEY3_WAKEUP_EN,
|
||||
.ch[3].port = IO_PORTB_04,
|
||||
.ch[3].sensitivity = TCFG_LP_TOUCH_KEY3_SENSITIVITY,
|
||||
.ch[3].key_value = 2,
|
||||
|
||||
.ch[4].enable = TCFG_LP_TOUCH_KEY4_EN,
|
||||
.ch[4].wakeup_enable = TCFG_LP_TOUCH_KEY4_WAKEUP_EN,
|
||||
.ch[4].port = IO_PORTB_05,
|
||||
.ch[4].sensitivity = TCFG_LP_TOUCH_KEY4_SENSITIVITY,
|
||||
.ch[4].key_value = 3,
|
||||
|
||||
//把触摸按键之间的滑动也当做按键处理,有上滑,下滑,左滑,右滑
|
||||
.slide_mode_en = TCFG_LP_SLIDE_KEY_ENABLE,
|
||||
.slide_mode_key_value = 3,
|
||||
|
||||
//入耳检测相关的配置
|
||||
.eartch_en = TCFG_LP_EARTCH_KEY_ENABLE,
|
||||
.eartch_ch = TCFG_LP_EARTCH_KEY_CH,
|
||||
.eartch_ref_ch = TCFG_LP_EARTCH_KEY_REF_CH,
|
||||
.eartch_soft_inear_val = TCFG_LP_EARTCH_SOFT_INEAR_VAL,
|
||||
.eartch_soft_outear_val = TCFG_LP_EARTCH_SOFT_OUTEAR_VAL,
|
||||
};
|
||||
#endif /* #if TCFG_LP_TOUCH_KEY_ENABLE */
|
||||
|
||||
/************************** PLCNT TOUCH_KEY ****************************/
|
||||
#if TCFG_TOUCH_KEY_ENABLE
|
||||
const const struct touch_key_port touch_key_list[] = {
|
||||
{
|
||||
.press_delta = TCFG_TOUCH_KEY0_PRESS_DELTA,
|
||||
.port = TCFG_TOUCH_KEY0_PORT,
|
||||
.key_value = TCFG_TOUCH_KEY0_VALUE,
|
||||
},
|
||||
{
|
||||
.press_delta = TCFG_TOUCH_KEY1_PRESS_DELTA,
|
||||
.port = TCFG_TOUCH_KEY1_PORT,
|
||||
.key_value = TCFG_TOUCH_KEY1_VALUE,
|
||||
},
|
||||
};
|
||||
|
||||
const struct touch_key_platform_data touch_key_data = {
|
||||
.num = ARRAY_SIZE(touch_key_list),
|
||||
.port_list = touch_key_list,
|
||||
};
|
||||
#endif /* #if TCFG_TOUCH_KEY_ENABLE */
|
||||
|
||||
/************************** AD KEY ****************************/
|
||||
#if TCFG_ADKEY_ENABLE
|
||||
const struct adkey_platform_data adkey_data = {
|
||||
.enable = TCFG_ADKEY_ENABLE, //AD按键使能
|
||||
.adkey_pin = TCFG_ADKEY_PORT, //AD按键对应引脚
|
||||
.ad_channel = TCFG_ADKEY_AD_CHANNEL, //AD通道值
|
||||
.extern_up_en = TCFG_ADKEY_EXTERN_UP_ENABLE, //是否使用外接上拉电阻
|
||||
.ad_value = { //根据电阻算出来的电压值
|
||||
TCFG_ADKEY_VOLTAGE0,
|
||||
TCFG_ADKEY_VOLTAGE1,
|
||||
TCFG_ADKEY_VOLTAGE2,
|
||||
TCFG_ADKEY_VOLTAGE3,
|
||||
TCFG_ADKEY_VOLTAGE4,
|
||||
TCFG_ADKEY_VOLTAGE5,
|
||||
TCFG_ADKEY_VOLTAGE6,
|
||||
TCFG_ADKEY_VOLTAGE7,
|
||||
TCFG_ADKEY_VOLTAGE8,
|
||||
TCFG_ADKEY_VOLTAGE9,
|
||||
},
|
||||
.key_value = { //AD按键各个按键的键值
|
||||
TCFG_ADKEY_VALUE0,
|
||||
TCFG_ADKEY_VALUE1,
|
||||
TCFG_ADKEY_VALUE2,
|
||||
TCFG_ADKEY_VALUE3,
|
||||
TCFG_ADKEY_VALUE4,
|
||||
TCFG_ADKEY_VALUE5,
|
||||
TCFG_ADKEY_VALUE6,
|
||||
TCFG_ADKEY_VALUE7,
|
||||
TCFG_ADKEY_VALUE8,
|
||||
TCFG_ADKEY_VALUE9,
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
||||
/************************** RDEC_KEY ****************************/
|
||||
#if TCFG_RDEC_KEY_ENABLE
|
||||
const struct rdec_device rdeckey_list[] = {
|
||||
{
|
||||
.index = RDEC0 ,
|
||||
.sin_port0 = TCFG_RDEC0_ECODE1_PORT,
|
||||
.sin_port1 = TCFG_RDEC0_ECODE2_PORT,
|
||||
.key_value0 = TCFG_RDEC0_KEY0_VALUE | BIT(7),
|
||||
.key_value1 = TCFG_RDEC0_KEY1_VALUE | BIT(7),
|
||||
},
|
||||
|
||||
{
|
||||
.index = RDEC1 ,
|
||||
.sin_port0 = TCFG_RDEC1_ECODE1_PORT,
|
||||
.sin_port1 = TCFG_RDEC1_ECODE2_PORT,
|
||||
.key_value0 = TCFG_RDEC1_KEY0_VALUE | BIT(7),
|
||||
.key_value1 = TCFG_RDEC1_KEY1_VALUE | BIT(7),
|
||||
},
|
||||
|
||||
{
|
||||
.index = RDEC2 ,
|
||||
.sin_port0 = TCFG_RDEC2_ECODE1_PORT,
|
||||
.sin_port1 = TCFG_RDEC2_ECODE2_PORT,
|
||||
.key_value0 = TCFG_RDEC2_KEY0_VALUE | BIT(7),
|
||||
.key_value1 = TCFG_RDEC2_KEY1_VALUE | BIT(7),
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
const struct rdec_platform_data rdec_key_data = {
|
||||
.enable = 1, //TCFG_RDEC_KEY_ENABLE, //是否使能RDEC按键
|
||||
.num = ARRAY_SIZE(rdeckey_list), //RDEC按键的个数
|
||||
.rdec = rdeckey_list, //RDEC按键参数表
|
||||
};
|
||||
#endif
|
||||
|
||||
/************************** IIS config ****************************/
|
||||
#if (TCFG_AUDIO_INPUT_IIS || TCFG_AUDIO_OUTPUT_IIS)
|
||||
ALINK_PARM alink0_platform_data = {
|
||||
.module = ALINK0,
|
||||
.mclk_io = TCFG_IIS_MCLK_IO,
|
||||
.sclk_io = TCFG_SCLK_IO,
|
||||
.lrclk_io = TCFG_LRCLK_IO,
|
||||
.ch_cfg[0].data_io = TCFG_DATA0_IO,
|
||||
.ch_cfg[1].data_io = TCFG_DATA1_IO,
|
||||
.ch_cfg[2].data_io = TCFG_DATA2_IO,
|
||||
.ch_cfg[3].data_io = TCFG_DATA3_IO,
|
||||
.mode = ALINK_MD_IIS,
|
||||
#if TCFG_IIS_MODE
|
||||
.role = ALINK_ROLE_SLAVE,
|
||||
#else
|
||||
.role = ALINK_ROLE_MASTER,
|
||||
#endif /*TCFG_IIS_MODE*/
|
||||
.clk_mode = ALINK_CLK_FALL_UPDATE_RAISE_SAMPLE,
|
||||
.bitwide = ALINK_LEN_16BIT,
|
||||
.sclk_per_frame = ALINK_FRAME_32SCLK,
|
||||
.dma_len = 4 * 1024,
|
||||
.sample_rate = TCFG_IIS_SR,
|
||||
.buf_mode = ALINK_BUF_CIRCLE,
|
||||
/*.iperiod = 64, //配置该项可以控制输入的延时*/
|
||||
};
|
||||
#endif
|
||||
|
||||
/************************** PWM_LED ****************************/
|
||||
#if TCFG_PWMLED_ENABLE
|
||||
LED_PLATFORM_DATA_BEGIN(pwm_led_data)
|
||||
.io_mode = TCFG_PWMLED_IOMODE, //推灯模式设置:支持单个IO推两个灯和两个IO推两个灯
|
||||
.io_cfg.one_io.pin = TCFG_PWMLED_PIN, //单个IO推两个灯的IO口配置
|
||||
LED_PLATFORM_DATA_END()
|
||||
#endif
|
||||
|
||||
const struct soft_iic_config soft_iic_cfg[] = {
|
||||
#if 0
|
||||
//iic0 data
|
||||
{
|
||||
.scl = TCFG_SW_I2C0_CLK_PORT, //IIC CLK脚
|
||||
.sda = TCFG_SW_I2C0_DAT_PORT, //IIC DAT脚
|
||||
.delay = TCFG_SW_I2C0_DELAY_CNT, //软件IIC延时参数,影响通讯时钟频率
|
||||
.io_pu = 1, //是否打开上拉电阻,如果外部电路没有焊接上拉电阻需要置1
|
||||
},
|
||||
#endif
|
||||
#if 0
|
||||
//iic1 data
|
||||
{
|
||||
.scl = IO_PORTA_05,
|
||||
.sda = IO_PORTA_06,
|
||||
.delay = 50,
|
||||
.io_pu = 1,
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
const struct hw_iic_config hw_iic_cfg[] = {
|
||||
#if 0
|
||||
//iic0 data
|
||||
{
|
||||
/*硬件IIC端口下选择
|
||||
SCL SDA
|
||||
{IO_PORT_DP, IO_PORT_DM}, //group a
|
||||
{IO_PORTC_04, IO_PORTC_05}, //group b
|
||||
{IO_PORTC_02, IO_PORTC_03}, //group c
|
||||
{IO_PORTA_05, IO_PORTA_06}, //group d
|
||||
*/
|
||||
.port = TCFG_HW_I2C0_PORTS,
|
||||
.baudrate = TCFG_HW_I2C0_CLK, //IIC通讯波特率
|
||||
.hdrive = 0, //是否打开IO口强驱
|
||||
.io_filter = 1, //是否打开滤波器(去纹波)
|
||||
.io_pu = 1, //是否打开上拉电阻,如果外部电路没有焊接上拉电阻需要置1
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
||||
#if TCFG_SD0_ENABLE
|
||||
SD0_PLATFORM_DATA_BEGIN(sd0_data)
|
||||
.port = {
|
||||
TCFG_SD0_PORT_CMD,
|
||||
TCFG_SD0_PORT_CLK,
|
||||
TCFG_SD0_PORT_DA0,
|
||||
TCFG_SD0_PORT_DA1,
|
||||
TCFG_SD0_PORT_DA2,
|
||||
TCFG_SD0_PORT_DA3,
|
||||
},
|
||||
.data_width = TCFG_SD0_DAT_MODE,
|
||||
.speed = TCFG_SD0_CLK,
|
||||
.detect_mode = TCFG_SD0_DET_MODE,
|
||||
.priority = 3,
|
||||
|
||||
#if (TCFG_SD0_DET_MODE == SD_IO_DECT)
|
||||
.detect_io = TCFG_SD0_DET_IO,
|
||||
.detect_io_level = TCFG_SD0_DET_IO_LEVEL,
|
||||
.detect_func = sdmmc_0_io_detect,
|
||||
.power = sd_set_power,
|
||||
/* .power = NULL, */
|
||||
#elif (TCFG_SD0_DET_MODE == SD_CLK_DECT)
|
||||
.detect_io_level = TCFG_SD0_DET_IO_LEVEL,
|
||||
.detect_func = sdmmc_0_clk_detect,
|
||||
.power = sd_set_power,
|
||||
/* .power = NULL, */
|
||||
#else
|
||||
.detect_func = sdmmc_cmd_detect,
|
||||
.power = NULL,
|
||||
#endif
|
||||
|
||||
SD0_PLATFORM_DATA_END()
|
||||
#endif /* #if TCFG_SD0_ENABLE */
|
||||
|
||||
REGISTER_DEVICES(device_table) = {
|
||||
/* { "audio", &audio_dev_ops, (void *) &audio_data }, */
|
||||
|
||||
#if TCFG_CHARGE_ENABLE
|
||||
{ "charge", &charge_dev_ops, (void *)&charge_data },
|
||||
#endif
|
||||
#if TCFG_SD0_ENABLE
|
||||
{ "sd0", &sd_dev_ops, (void *) &sd0_data},
|
||||
#endif
|
||||
};
|
||||
|
||||
/************************** power_param ****************************/
|
||||
const struct low_power_param power_param = {
|
||||
.config = TCFG_LOWPOWER_LOWPOWER_SEL, //低功耗使能,蓝牙&&系统空闲可进入低功耗
|
||||
.btosc_hz = TCFG_CLOCK_OSC_HZ, //蓝牙晶振频率
|
||||
.delay_us = TCFG_CLOCK_SYS_HZ / 1000000L, //提供给低功耗模块的延时(不需要需修改)
|
||||
.vddiom_lev = TCFG_LOWPOWER_VDDIOM_LEVEL, //vddiom等级
|
||||
.osc_type = TCFG_LOWPOWER_OSC_TYPE, //低功耗晶振类型,btosc/lrc
|
||||
#if (TCFG_LOWPOWER_RAM_SIZE)
|
||||
.mem_init_con = MEM_PWR_RAM_SET(TCFG_LOWPOWER_RAM_SIZE),
|
||||
#else
|
||||
.mem_init_con = 0,
|
||||
#endif
|
||||
#if (TCFG_LP_TOUCH_KEY_ENABLE && \
|
||||
(TCFG_LP_TOUCH_KEY0_WAKEUP_EN || \
|
||||
TCFG_LP_TOUCH_KEY1_WAKEUP_EN || \
|
||||
TCFG_LP_TOUCH_KEY2_WAKEUP_EN || \
|
||||
TCFG_LP_TOUCH_KEY3_WAKEUP_EN || \
|
||||
TCFG_LP_TOUCH_KEY4_WAKEUP_EN ))
|
||||
.lpctmu_en = 1,
|
||||
#else
|
||||
.lpctmu_en = 0,
|
||||
#endif
|
||||
};
|
||||
|
||||
/************************** wk_param ****************************/
|
||||
struct port_wakeup port0 = {
|
||||
.pullup_down_enable = ENABLE, //配置I/O 内部上下拉是否使能
|
||||
.edge = FALLING_EDGE, //唤醒方式选择,可选:上升沿\下降沿
|
||||
.filter = PORT_FLT_8ms,
|
||||
.iomap = TCFG_IOKEY_POWER_ONE_PORT, //唤醒口选择
|
||||
};
|
||||
|
||||
#if (TCFG_TEST_BOX_ENABLE || TCFG_CHARGESTORE_ENABLE || TCFG_ANC_BOX_ENABLE || TCFG_UMIDIGI_BOX_ENABLE)
|
||||
struct port_wakeup port1 = {
|
||||
.pullup_down_enable = DISABLE, //配置I/O 内部上下拉是否使能
|
||||
.edge = FALLING_EDGE, //唤醒方式选择,可选:上升沿\下降沿
|
||||
.filter = PORT_FLT_1ms,
|
||||
.iomap = TCFG_CHARGESTORE_PORT, //唤醒口选择
|
||||
};
|
||||
#endif
|
||||
|
||||
#if TCFG_CHARGE_ENABLE
|
||||
struct port_wakeup charge_port = {
|
||||
.edge = RISING_EDGE, //唤醒方式选择,可选:上升沿\下降沿\双边沿
|
||||
.filter = PORT_FLT_16ms,
|
||||
.iomap = IO_CHGFL_DET, //唤醒口选择
|
||||
};
|
||||
|
||||
struct port_wakeup vbat_port = {
|
||||
.edge = BOTH_EDGE, //唤醒方式选择,可选:上升沿\下降沿\双边沿
|
||||
.filter = PORT_FLT_16ms,
|
||||
.iomap = IO_VBTCH_DET, //唤醒口选择
|
||||
};
|
||||
|
||||
struct port_wakeup ldoin_port = {
|
||||
.edge = BOTH_EDGE, //唤醒方式选择,可选:上升沿\下降沿\双边沿
|
||||
.filter = PORT_FLT_16ms,
|
||||
.iomap = IO_LDOIN_DET, //唤醒口选择
|
||||
};
|
||||
#endif
|
||||
|
||||
const struct wakeup_param wk_param = {
|
||||
#if (!(TCFG_LP_TOUCH_KEY_ENABLE && TCFG_LP_TOUCH_KEY1_EN))
|
||||
.port[1] = &port0,
|
||||
#endif
|
||||
#if (TCFG_TEST_BOX_ENABLE || TCFG_CHARGESTORE_ENABLE || TCFG_ANC_BOX_ENABLE || TCFG_UMIDIGI_BOX_ENABLE)
|
||||
.port[2] = &port1,
|
||||
#endif
|
||||
#if TCFG_CHARGE_ENABLE
|
||||
.aport[0] = &charge_port,
|
||||
.aport[1] = &vbat_port,
|
||||
.aport[2] = &ldoin_port,
|
||||
#endif
|
||||
};
|
||||
|
||||
void gSensor_wkupup_disable(void)
|
||||
{
|
||||
log_info("gSensor wkup disable\n");
|
||||
power_wakeup_index_enable(1, 0);
|
||||
}
|
||||
|
||||
void gSensor_wkupup_enable(void)
|
||||
{
|
||||
log_info("gSensor wkup enable\n");
|
||||
power_wakeup_index_enable(1, 1);
|
||||
}
|
||||
|
||||
void debug_uart_init(const struct uart_platform_data *data)
|
||||
{
|
||||
#if TCFG_UART0_ENABLE
|
||||
if (data) {
|
||||
uart_init(data);
|
||||
} else {
|
||||
uart_init(&uart0_data);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
STATUS *get_led_config(void)
|
||||
{
|
||||
return &(__this->led);
|
||||
}
|
||||
|
||||
STATUS *get_tone_config(void)
|
||||
{
|
||||
return &(__this->tone);
|
||||
}
|
||||
|
||||
u8 get_sys_default_vol(void)
|
||||
{
|
||||
return 21;
|
||||
}
|
||||
|
||||
u8 get_power_on_status(void)
|
||||
{
|
||||
#if TCFG_IOKEY_ENABLE
|
||||
struct iokey_port *power_io_list = NULL;
|
||||
power_io_list = iokey_data.port;
|
||||
|
||||
if (iokey_data.enable) {
|
||||
if (gpio_read(power_io_list->key_type.one_io.port) == power_io_list->connect_way){
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TCFG_ADKEY_ENABLE
|
||||
if (adkey_data.enable) {
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TCFG_LP_TOUCH_KEY_ENABLE
|
||||
return lp_touch_key_power_on_status();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void board_devices_init(void)
|
||||
{
|
||||
#if TCFG_PWMLED_ENABLE
|
||||
pwm_led_init(&pwm_led_data);
|
||||
#endif
|
||||
|
||||
#if (TCFG_IOKEY_ENABLE || TCFG_ADKEY_ENABLE || TCFG_RDEC_KEY_ENABLE || TCFG_TOUCH_KEY_ENABLE)
|
||||
key_driver_init();
|
||||
#endif
|
||||
|
||||
#if TCFG_UART_KEY_ENABLE
|
||||
extern int uart_key_init(void);
|
||||
uart_key_init();
|
||||
#endif /* #if TCFG_UART_KEY_ENABLE */
|
||||
|
||||
#if TCFG_LP_TOUCH_KEY_ENABLE
|
||||
lp_touch_key_init(&lp_touch_key_config);
|
||||
#endif /* #if TCFG_LP_TOUCH_KEY_ENABLE */
|
||||
|
||||
#if (!TCFG_CHARGE_ENABLE)
|
||||
CHARGE_EN(0);
|
||||
CHGGO_EN(0);
|
||||
#endif
|
||||
|
||||
#if TCFG_CHARGESTORE_ENABLE || TCFG_TEST_BOX_ENABLE || TCFG_ANC_BOX_ENABLE
|
||||
chargestore_api_init(&chargestore_data);
|
||||
#endif
|
||||
}
|
||||
|
||||
//外置触摸电源控制 1:输出高 0:输出地
|
||||
static void pwr_set_external_touch(u8 high_low)
|
||||
{
|
||||
if(TCFG_EXTERNAL_TOUCH_KEY_POWER_PORT == NO_CONFIG_PORT){
|
||||
return;
|
||||
}
|
||||
gpio_set_pull_up(TCFG_EXTERNAL_TOUCH_KEY_POWER_PORT, 1);
|
||||
gpio_set_pull_down(TCFG_EXTERNAL_TOUCH_KEY_POWER_PORT, 0);
|
||||
gpio_set_direction(TCFG_EXTERNAL_TOUCH_KEY_POWER_PORT, 0);
|
||||
gpio_set_output_value(TCFG_EXTERNAL_TOUCH_KEY_POWER_PORT, high_low);
|
||||
}
|
||||
|
||||
#if CLIENT_BOARD == CUSTOM9_CFG
|
||||
#define TCFG_TALKING_FB_MIC_IO IO_PORTB_02
|
||||
/*
|
||||
0:MIC0 作为FB MIC,引脚输出低电平。
|
||||
1:MIC0 作为通话MIC,引脚输出高电平。
|
||||
*/
|
||||
void TALKING_FB_MIC_sel(u8 mic_type)
|
||||
{
|
||||
gpio_set_pull_up(TCFG_TALKING_FB_MIC_IO , 0);
|
||||
gpio_set_pull_down(TCFG_TALKING_FB_MIC_IO , 0);
|
||||
gpio_set_direction(TCFG_TALKING_FB_MIC_IO , 0);
|
||||
gpio_set_die(TCFG_TALKING_FB_MIC_IO , 1);
|
||||
switch (mic_type)
|
||||
{
|
||||
case 0:
|
||||
gpio_set_output_value(TCFG_TALKING_FB_MIC_IO , 0);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
gpio_set_output_value(TCFG_TALKING_FB_MIC_IO , 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static u8 dcda_en_state = 0;
|
||||
#define DCDC_EN_PORT IO_PORTC_02
|
||||
static void dcdc_en(u8 en)
|
||||
{
|
||||
if (dcda_en_state == en)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
dcda_en_state = en;
|
||||
|
||||
gpio_set_die(DCDC_EN_PORT, 0);
|
||||
gpio_set_direction(IO_PORTB_04, 0);
|
||||
gpio_set_pull_up(DCDC_EN_PORT, 0);
|
||||
gpio_set_pull_down(DCDC_EN_PORT, 0);
|
||||
|
||||
switch (en)
|
||||
{
|
||||
case 0:
|
||||
printf("external dcdc disable \n");
|
||||
gpio_direction_output(DCDC_EN_PORT, 0);
|
||||
break;
|
||||
case 1:
|
||||
printf("external dcdc enable \n");
|
||||
gpio_direction_output(DCDC_EN_PORT, 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void dcdc_init(void)
|
||||
{
|
||||
gpio_set_die(DCDC_EN_PORT, 0);
|
||||
gpio_set_direction(IO_PORTB_04, 0);
|
||||
gpio_set_pull_up(DCDC_EN_PORT, 0);
|
||||
gpio_set_pull_down(DCDC_EN_PORT, 0);
|
||||
gpio_direction_output(DCDC_EN_PORT, 0);
|
||||
dcda_en_state = 0;
|
||||
}
|
||||
|
||||
/*dcdc switch*/
|
||||
void audio_dac_power_state(u8 state)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case DAC_ANALOG_OPEN_PREPARE:
|
||||
dcdc_en(1);
|
||||
break;
|
||||
case DAC_ANALOG_OPEN_FINISH:
|
||||
break;
|
||||
case DAC_ANALOG_CLOSE_PREPARE:
|
||||
break;
|
||||
case DAC_ANALOG_CLOSE_FINISH:
|
||||
dcdc_en(0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
extern void cfg_file_parse(u8 idx);
|
||||
void board_init()
|
||||
{
|
||||
|
||||
pwr_set_external_touch(1);
|
||||
board_power_init();
|
||||
//adc_vbg_init();
|
||||
adc_init();
|
||||
#if CLIENT_BOARD == CUSTOM9_CFG
|
||||
dcdc_init();
|
||||
TALKING_FB_MIC_sel(0);
|
||||
#endif
|
||||
cfg_file_parse(0);
|
||||
devices_init();
|
||||
#if TCFG_AUDIO_ANC_ENABLE
|
||||
anc_init();
|
||||
#endif/*TCFG_AUDIO_ANC_ENABLE*/
|
||||
|
||||
board_devices_init();
|
||||
|
||||
#if TCFG_CHARGE_ENABLE
|
||||
if(get_charge_online_flag())
|
||||
#else
|
||||
if (0)
|
||||
#endif
|
||||
{
|
||||
power_set_mode(PWR_LDO15);
|
||||
}else{
|
||||
power_set_mode(TCFG_LOWPOWER_POWER_SEL);
|
||||
}
|
||||
|
||||
//针对硅mic要输出1给mic供电
|
||||
/* gpio_set_pull_up(IO_PORTA_04, 0); */
|
||||
/* gpio_set_pull_down(IO_PORTA_04, 0); */
|
||||
/* gpio_set_direction(IO_PORTA_04, 0); */
|
||||
/* gpio_set_output_value(IO_PORTA_04,1); */
|
||||
|
||||
#if TCFG_UART0_ENABLE
|
||||
if (uart0_data.rx_pin < IO_MAX_NUM) {
|
||||
gpio_set_die(uart0_data.rx_pin, 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TCFG_SMART_VOICE_ENABLE
|
||||
int audio_smart_voice_detect_init(struct vad_mic_platform_data *mic_data);
|
||||
audio_smart_voice_detect_init((struct vad_mic_platform_data *)&vad_mic_data);
|
||||
#endif /* #if TCFG_SMART_VOICE_ENABLE */
|
||||
|
||||
#ifdef CONFIG_BOARD_AISPEECH_VAD_ASR
|
||||
extern int audio_ais_platform_asr_init(struct vad_mic_platform_data *mic_data);
|
||||
audio_ais_platform_asr_init((struct vad_mic_platform_data *)&vad_mic_data);
|
||||
#endif /*CONFIG_BOARD_AISPEECH_VAD_ASR*/
|
||||
|
||||
#ifdef AUDIO_PCM_DEBUG
|
||||
extern void uartSendInit();
|
||||
uartSendInit();
|
||||
#endif/*AUDIO_PCM_DEBUG*/
|
||||
}
|
||||
|
||||
/*进软关机之前默认将IO口都设置成高阻状态,需要保留原来状态的请修改该函数*/
|
||||
extern void dac_power_off(void);
|
||||
void board_set_soft_poweroff(void)
|
||||
{
|
||||
//power按键
|
||||
#if TCFG_IOKEY_ENABLE
|
||||
soff_gpio_protect(TCFG_IOKEY_POWER_ONE_PORT);
|
||||
#endif
|
||||
|
||||
soff_gpio_protect(TCFG_EXTERNAL_TOUCH_KEY_POWER_PORT);//软关机KEEP外置触摸供电
|
||||
|
||||
#if (!(TCFG_LP_TOUCH_KEY_ENABLE && TCFG_LP_TOUCH_KEY1_EN))
|
||||
//默认唤醒io
|
||||
soff_gpio_protect(IO_PORTB_01);
|
||||
#endif
|
||||
|
||||
#if (TCFG_TEST_BOX_ENABLE || TCFG_CHARGESTORE_ENABLE || TCFG_ANC_BOX_ENABLE || TCFG_UMIDIGI_BOX_ENABLE)
|
||||
power_wakeup_index_enable(2, 0);
|
||||
#endif
|
||||
|
||||
board_set_soft_poweroff_common(NULL);
|
||||
|
||||
dac_power_off();
|
||||
}
|
||||
|
||||
#define APP_IO_DEBUG_0(i,x) {JL_PORT##i->DIR &= ~BIT(x), JL_PORT##i->OUT &= ~BIT(x);}
|
||||
#define APP_IO_DEBUG_1(i,x) {JL_PORT##i->DIR &= ~BIT(x), JL_PORT##i->OUT |= BIT(x);}
|
||||
|
||||
void sleep_exit_callback(u32 usec)
|
||||
{
|
||||
sleep_exit_callback_common(NULL);
|
||||
|
||||
putchar('>');
|
||||
}
|
||||
void sleep_enter_callback(u8 step)
|
||||
{
|
||||
/* 此函数禁止添加打印 */
|
||||
if (step == 1) {
|
||||
putchar('<');
|
||||
} else {
|
||||
//外置触摸供电
|
||||
pwr_set_external_touch(1);
|
||||
|
||||
sleep_enter_callback_common(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void port_wakeup_callback(u8 index, u8 gpio)
|
||||
{
|
||||
log_info("%s:%d,%d",__FUNCTION__,index,gpio);
|
||||
#if TCFG_UMIDIGI_BOX_ENABLE
|
||||
if (index == 2) {
|
||||
ldo_port_wakeup_to_cmessage();
|
||||
}
|
||||
#endif
|
||||
switch (index) {
|
||||
#if (TCFG_TEST_BOX_ENABLE || TCFG_CHARGESTORE_ENABLE || TCFG_ANC_BOX_ENABLE)
|
||||
case 2:
|
||||
extern void chargestore_ldo5v_fall_deal(void);
|
||||
chargestore_ldo5v_fall_deal();
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
static void aport_wakeup_callback(u8 index, u8 gpio, u8 edge)
|
||||
{
|
||||
log_info("%s:%d,%d",__FUNCTION__,index,gpio);
|
||||
#if TCFG_CHARGE_ENABLE
|
||||
switch (gpio) {
|
||||
case IO_CHGFL_DET://charge port
|
||||
charge_wakeup_isr();
|
||||
break;
|
||||
case IO_VBTCH_DET://vbat port
|
||||
case IO_LDOIN_DET://ldoin port
|
||||
ldoin_wakeup_isr();
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void board_power_init(void)
|
||||
{
|
||||
log_info("Power init : %s", __FILE__);
|
||||
|
||||
power_init(&power_param);
|
||||
|
||||
power_set_callback(TCFG_LOWPOWER_LOWPOWER_SEL, sleep_enter_callback, sleep_exit_callback, board_set_soft_poweroff);
|
||||
|
||||
#if TCFG_UMIDIGI_BOX_ENABLE
|
||||
gpio_set_die(TCFG_CHARGESTORE_PORT, 1);
|
||||
umidigi_chargestore_message_callback(app_umidigi_chargetore_message_deal);
|
||||
#endif
|
||||
|
||||
power_keep_dacvdd_en(0);
|
||||
|
||||
power_wakeup_init(&wk_param);
|
||||
|
||||
power_awakeup_set_callback(aport_wakeup_callback);
|
||||
power_wakeup_set_callback(port_wakeup_callback);
|
||||
}
|
||||
#endif /* #ifdef CONFIG_BOARD_JL701N_ANC */
|
||||
1382
apps/earphone/board/br28/board_jl701n_anc_cfg.h
Normal file
1382
apps/earphone/board/br28/board_jl701n_anc_cfg.h
Normal file
File diff suppressed because it is too large
Load Diff
123
apps/earphone/board/br28/board_jl701n_anc_global_build_cfg.h
Normal file
123
apps/earphone/board/br28/board_jl701n_anc_global_build_cfg.h
Normal file
@ -0,0 +1,123 @@
|
||||
#ifndef CONFIG_BOARD_JL701N_ANC_POST_BUILD_CFG_H
|
||||
#define CONFIG_BOARD_JL701N_ANC_POST_BUILD_CFG_H
|
||||
|
||||
/* 改文件只添加和isd_config.ini相关的配置,用以生成isd_config.ini */
|
||||
/* 其他不相关的配置请勿添加在改文件 */
|
||||
|
||||
#ifdef CONFIG_BOARD_JL701N_ANC
|
||||
|
||||
/* Following Macros Affect Periods Of Both Code Compiling And Post-build */
|
||||
|
||||
#define CONFIG_DOUBLE_BANK_ENABLE 0 //单双备份选择(若打开了改宏,FLASH结构变为双备份结构,适用于接入第三方协议的OTA, PS: JL-OTA同样支持双备份升级, 需要根据实际FLASH大小同时配置CONFIG_FLASH_SIZE)
|
||||
#define CONFIG_APP_OTA_ENABLE 0 //是否支持RCSP升级(JL-OTA)
|
||||
|
||||
#define CONFIG_UPDATE_JUMP_TO_MASK 0 //配置升级到loader的方式0为直接reset,1为跳转(适用于芯片电源由IO口KEEP住的方案,需要注意检查跳转前是否将使用DMA的硬件模块全部关闭)
|
||||
|
||||
#define CONFIG_IO_KEY_EN 0 //配置是否使用IO按键,配合RESET1
|
||||
#define CONFIG_UPDATE_WITH_MD5_CHECK_EN 0 //配置升级是否支持MD5校验
|
||||
|
||||
#define CONFIG_ANC_ENABLE 1 //配置是否支持ANC
|
||||
|
||||
//flash size vaule definition
|
||||
#define FLASH_SIZE_256K 0x40000
|
||||
#define FLASH_SIZE_512K 0x80000
|
||||
#define FLASH_SIZE_1M 0x100000
|
||||
#define FLASH_SIZE_2M 0x200000
|
||||
#define FLASH_SIZE_4M 0x400000
|
||||
|
||||
#define CONFIG_FLASH_SIZE FLASH_SIZE_1M //配置FLASH大小
|
||||
|
||||
|
||||
/* Above Macros Affect Periods Of Both Code Compiling And Post-build */
|
||||
|
||||
/* Following Macros Only For Post Bulid Configuaration */
|
||||
|
||||
#define CONFIG_DB_UPDATE_DATA_GENERATE_EN 0 //是否生成db_data.bin(用于第三方协议接入使用)
|
||||
#define CONFIG_ONLY_GRENERATE_ALIGN_4K_CODE 0 //ufw只生成1份4K对齐的代码
|
||||
|
||||
//config for supported chip version
|
||||
#ifdef CONFIG_BR30_C_VERSION
|
||||
#define CONFIG_SUPPORTED_CHIP_VERSION C
|
||||
#else
|
||||
#define CONFIG_SUPPORTED_CHIP_VERSION B,D,E,M,N,O,P
|
||||
#endif
|
||||
|
||||
//DON'T MODIFY THIS CONFIG EXCEPT SDK PUBLISHER
|
||||
#define CONFIG_CHIP_NAME AC701N //除了SDK发布者,请不要修改
|
||||
//it can be modified before first programming,but keep the same as the original version
|
||||
#define CONFIG_PID AC701N //烧写或强制升级之前可以修改,之后升级要保持一致
|
||||
//it can be modified before first programming,but keep the same as the original version
|
||||
#define CONFIG_VID 0.01 //烧写或强制升级之前可以修改,之后升级要保持一致
|
||||
|
||||
//Project with bluetooth,it must use OSC as PLL_SOURCE;
|
||||
#define CONFIG_PLL_SOURCE_USING_LRC 0 //PLL时钟源选择 1:LRC 2:OSC
|
||||
|
||||
//config alignment size unit
|
||||
#ifdef CONFIG_256K_FLASH
|
||||
#define ALIGN_UNIT_256B 1 //FLASH对齐方式选择,如果是256K的FLASH,选择256BYTE对齐方式
|
||||
#else
|
||||
#define ALIGN_UNIT_256B 0
|
||||
#endif
|
||||
|
||||
//partial platform check this config to select the uart IO for wired update
|
||||
#define CONFIG_UART_UPDATE_PIN PP00
|
||||
|
||||
//isd_download loader/uboot/update_loader debug io config
|
||||
//#define CONFIG_UBOOT_DEBUG_PIN PA05
|
||||
//#define CONFIG_UBOOT_DEBUG_BAUD_RATE 1000000
|
||||
|
||||
//config long-press reset io pin,time,trigger level
|
||||
#define CONFIG_RESET_PIN LDO //io pin
|
||||
#define CONFIG_RESET_TIME 04 //unit:second
|
||||
#define CONFIG_RESET_LEVEL 1 //tigger level(0/1)
|
||||
|
||||
#if CONFIG_IO_KEY_EN
|
||||
#define CONFIG_SUPPORT_RESET1
|
||||
#define CONFIG_RESET1_PIN PB01 //io pin
|
||||
#define CONFIG_RESET1_TIME 08 //unit:second
|
||||
#define CONFIG_RESET1_LEVEL 0 //tigger level(0/1)
|
||||
#endif
|
||||
|
||||
//reserved three custom cfg item for the future definition
|
||||
//#define CONFIG_CUSTOM_CFG1_TYPE POWER_PIN
|
||||
//#define CONFIG_CUSTOM_CFG1_VALUE PC01_1
|
||||
|
||||
//#define CONFIG_CUSTOM_CFG2_TYPE
|
||||
//#define CONFIG_CUSTOM_CFG2_VALUE
|
||||
|
||||
//#define CONFIG_CUSTOM_CFG3_TYPE
|
||||
//#define CONFIG_CUSTOM_CFG3_VALUE
|
||||
|
||||
|
||||
//#define CONFIG_VDDIO_LVD_LEVEL 4 ////VDDIO_LVD挡位,0: 1.9V 1: 2.0V 2: 2.1V 3: 2.2V 4: 2.3V 5: 2.4V 6: 2.5V 7: 2.6V
|
||||
|
||||
//with single-bank mode,actual vm size should larger this VM_LEAST_SIZE,and dual bank mode,actual vm size equals this;
|
||||
#define CONFIG_VM_LEAST_SIZE 8K
|
||||
//config whether erased this area when do a update,1-No Operation,0-Erase
|
||||
#define CONFIG_VM_OPT 1
|
||||
|
||||
//config whether erased this area when do a update,1-No Operation,0-Erase
|
||||
#define CONFIG_BTIF_OPT 1
|
||||
|
||||
//reserved two custom cfg area for the future definition
|
||||
//#define CONFIG_RESERVED_AREA1 EXIF1
|
||||
#ifdef CONFIG_RESERVED_AREA1
|
||||
#define CONFIG_RESERVED_AREA1_ADDR AUTO
|
||||
#define CONFIG_RESERVED_AREA1_LEN 0x1000
|
||||
#define CONFIG_RESERVED_AREA1_OPT 1
|
||||
//#define CONFIG_RESERVED_AREA1_FILE anc_gains.bin
|
||||
#endif
|
||||
|
||||
//#define CONFIG_RESERVED_AREA2 EXIF2
|
||||
#ifdef CONFIG_RESERVED_AREA2
|
||||
#define CONFIG_RESERVED_AREA2_ADDR AUTO
|
||||
#define CONFIG_RESERVED_AREA2_LEN 0x1000
|
||||
#define CONFIG_RESERVED_AREA2_OPT 1
|
||||
//#define CONFIG_RESERVED_AREA2_FILE anc_gains.bin
|
||||
#endif
|
||||
|
||||
/* Above Macros Only For Post Bulid Configuaration */
|
||||
#endif /* #ifdef CONFIG_BOARD_JL701N_ANC */
|
||||
|
||||
#endif /* #ifndef CONFIG_BOARD_JL701N_ANC_POST_BUILD_CFG_H */
|
||||
|
||||
1042
apps/earphone/board/br28/board_jl701n_btemitter.c
Normal file
1042
apps/earphone/board/br28/board_jl701n_btemitter.c
Normal file
File diff suppressed because it is too large
Load Diff
1215
apps/earphone/board/br28/board_jl701n_btemitter_cfg.h
Normal file
1215
apps/earphone/board/br28/board_jl701n_btemitter_cfg.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,123 @@
|
||||
#ifndef CONFIG_BOARD_JL701N_BTEMITTER_BUILD_CFG_H
|
||||
#define CONFIG_BOARD_JL701N_BTEMITTER_BUILD_CFG_H
|
||||
|
||||
/* 改文件只添加和isd_config.ini相关的配置,用以生成isd_config.ini */
|
||||
/* 其他不相关的配置请勿添加在改文件 */
|
||||
|
||||
#ifdef CONFIG_BOARD_JL701N_BTEMITTER
|
||||
|
||||
/* Following Macros Affect Periods Of Both Code Compiling And Post-build */
|
||||
|
||||
#define CONFIG_DOUBLE_BANK_ENABLE 0 //单双备份选择(若打开了改宏,FLASH结构变为双备份结构,适用于接入第三方协议的OTA, PS: JL-OTA同样支持双备份升级, 需要根据实际FLASH大小同时配置CONFIG_FLASH_SIZE)
|
||||
#define CONFIG_APP_OTA_ENABLE 0 //是否支持RCSP升级(JL-OTA)
|
||||
|
||||
#define CONFIG_UPDATE_JUMP_TO_MASK 0 //配置升级到loader的方式0为直接reset,1为跳转(适用于芯片电源由IO口KEEP住的方案,需要注意检查跳转前是否将使用DMA的硬件模块全部关闭)
|
||||
|
||||
#define CONFIG_IO_KEY_EN 0 //配置是否使用IO按键,配合RESET1
|
||||
#define CONFIG_UPDATE_WITH_MD5_CHECK_EN 0 //配置升级是否支持MD5校验
|
||||
|
||||
#define CONFIG_ANC_ENABLE 0 //配置是否支持ANC
|
||||
|
||||
//flash size vaule definition
|
||||
#define FLASH_SIZE_256K 0x40000
|
||||
#define FLASH_SIZE_512K 0x80000
|
||||
#define FLASH_SIZE_1M 0x100000
|
||||
#define FLASH_SIZE_2M 0x200000
|
||||
#define FLASH_SIZE_4M 0x400000
|
||||
|
||||
#define CONFIG_FLASH_SIZE FLASH_SIZE_1M //配置FLASH大小
|
||||
|
||||
|
||||
/* Above Macros Affect Periods Of Both Code Compiling And Post-build */
|
||||
|
||||
/* Following Macros Only For Post Bulid Configuaration */
|
||||
|
||||
#define CONFIG_DB_UPDATE_DATA_GENERATE_EN 0 //是否生成db_data.bin(用于第三方协议接入使用)
|
||||
#define CONFIG_ONLY_GRENERATE_ALIGN_4K_CODE 0 //ufw只生成1份4K对齐的代码
|
||||
|
||||
//config for supported chip version
|
||||
#ifdef CONFIG_BR30_C_VERSION
|
||||
#define CONFIG_SUPPORTED_CHIP_VERSION C
|
||||
#else
|
||||
#define CONFIG_SUPPORTED_CHIP_VERSION B,D,E,M,N,O,P
|
||||
#endif
|
||||
|
||||
//DON'T MODIFY THIS CONFIG EXCEPT SDK PUBLISHER
|
||||
#define CONFIG_CHIP_NAME AC701N //除了SDK发布者,请不要修改
|
||||
//it can be modified before first programming,but keep the same as the original version
|
||||
#define CONFIG_PID AC701N //烧写或强制升级之前可以修改,之后升级要保持一致
|
||||
//it can be modified before first programming,but keep the same as the original version
|
||||
#define CONFIG_VID 0.01 //烧写或强制升级之前可以修改,之后升级要保持一致
|
||||
|
||||
//Project with bluetooth,it must use OSC as PLL_SOURCE;
|
||||
#define CONFIG_PLL_SOURCE_USING_LRC 0 //PLL时钟源选择 1:LRC 2:OSC
|
||||
|
||||
//config alignment size unit
|
||||
#ifdef CONFIG_256K_FLASH
|
||||
#define ALIGN_UNIT_256B 1 //FLASH对齐方式选择,如果是256K的FLASH,选择256BYTE对齐方式
|
||||
#else
|
||||
#define ALIGN_UNIT_256B 0
|
||||
#endif
|
||||
|
||||
//partial platform check this config to select the uart IO for wired update
|
||||
#define CONFIG_UART_UPDATE_PIN PP00
|
||||
|
||||
//isd_download loader/uboot/update_loader debug io config
|
||||
//#define CONFIG_UBOOT_DEBUG_PIN PA05
|
||||
//#define CONFIG_UBOOT_DEBUG_BAUD_RATE 1000000
|
||||
|
||||
//config long-press reset io pin,time,trigger level
|
||||
#define CONFIG_RESET_PIN LDO //io pin
|
||||
#define CONFIG_RESET_TIME 04 //unit:second
|
||||
#define CONFIG_RESET_LEVEL 1 //tigger level(0/1)
|
||||
|
||||
#if CONFIG_IO_KEY_EN
|
||||
#define CONFIG_SUPPORT_RESET1
|
||||
#define CONFIG_RESET1_PIN PB01 //io pin
|
||||
#define CONFIG_RESET1_TIME 08 //unit:second
|
||||
#define CONFIG_RESET1_LEVEL 0 //tigger level(0/1)
|
||||
#endif
|
||||
|
||||
//reserved three custom cfg item for the future definition
|
||||
//#define CONFIG_CUSTOM_CFG1_TYPE POWER_PIN
|
||||
//#define CONFIG_CUSTOM_CFG1_VALUE PC01_1
|
||||
|
||||
//#define CONFIG_CUSTOM_CFG2_TYPE
|
||||
//#define CONFIG_CUSTOM_CFG2_VALUE
|
||||
|
||||
//#define CONFIG_CUSTOM_CFG3_TYPE
|
||||
//#define CONFIG_CUSTOM_CFG3_VALUE
|
||||
|
||||
|
||||
//#define CONFIG_VDDIO_LVD_LEVEL 4 ////VDDIO_LVD挡位,0: 1.9V 1: 2.0V 2: 2.1V 3: 2.2V 4: 2.3V 5: 2.4V 6: 2.5V 7: 2.6V
|
||||
|
||||
//with single-bank mode,actual vm size should larger this VM_LEAST_SIZE,and dual bank mode,actual vm size equals this;
|
||||
#define CONFIG_VM_LEAST_SIZE 8K
|
||||
//config whether erased this area when do a update,1-No Operation,0-Erase
|
||||
#define CONFIG_VM_OPT 1
|
||||
|
||||
//config whether erased this area when do a update,1-No Operation,0-Erase
|
||||
#define CONFIG_BTIF_OPT 1
|
||||
|
||||
//reserved two custom cfg area for the future definition
|
||||
//#define CONFIG_RESERVED_AREA1 EXIF1
|
||||
#ifdef CONFIG_RESERVED_AREA1
|
||||
#define CONFIG_RESERVED_AREA1_ADDR AUTO
|
||||
#define CONFIG_RESERVED_AREA1_LEN 0x1000
|
||||
#define CONFIG_RESERVED_AREA1_OPT 1
|
||||
//#define CONFIG_RESERVED_AREA1_FILE anc_gains.bin
|
||||
#endif
|
||||
|
||||
//#define CONFIG_RESERVED_AREA2 EXIF2
|
||||
#ifdef CONFIG_RESERVED_AREA2
|
||||
#define CONFIG_RESERVED_AREA2_ADDR AUTO
|
||||
#define CONFIG_RESERVED_AREA2_LEN 0x1000
|
||||
#define CONFIG_RESERVED_AREA2_OPT 1
|
||||
//#define CONFIG_RESERVED_AREA2_FILE anc_gains.bin
|
||||
#endif
|
||||
|
||||
/* Above Macros Only For Post Bulid Configuaration */
|
||||
#endif /* #ifdef CONFIG_BOARD_JL701N_BTEMITTER */
|
||||
|
||||
#endif /* #ifndef CONFIG_BOARD_JL701N_BTEMITTER_BUILD_CFG_H */
|
||||
|
||||
1087
apps/earphone/board/br28/board_jl701n_demo.c
Normal file
1087
apps/earphone/board/br28/board_jl701n_demo.c
Normal file
File diff suppressed because it is too large
Load Diff
1240
apps/earphone/board/br28/board_jl701n_demo_cfg.h
Normal file
1240
apps/earphone/board/br28/board_jl701n_demo_cfg.h
Normal file
File diff suppressed because it is too large
Load Diff
123
apps/earphone/board/br28/board_jl701n_demo_global_build_cfg.h
Normal file
123
apps/earphone/board/br28/board_jl701n_demo_global_build_cfg.h
Normal file
@ -0,0 +1,123 @@
|
||||
#ifndef CONFIG_BOARD_JL701N_DEMO_POST_BUILD_CFG_H
|
||||
#define CONFIG_BOARD_JL701N_DEMO_POST_BUILD_CFG_H
|
||||
|
||||
/* 改文件只添加和isd_config.ini相关的配置,用以生成isd_config.ini */
|
||||
/* 其他不相关的配置请勿添加在改文件 */
|
||||
|
||||
#ifdef CONFIG_BOARD_JL701N_DEMO
|
||||
|
||||
/* Following Macros Affect Periods Of Both Code Compiling And Post-build */
|
||||
|
||||
#define CONFIG_DOUBLE_BANK_ENABLE 0 //单双备份选择(若打开了改宏,FLASH结构变为双备份结构,适用于接入第三方协议的OTA, PS: JL-OTA同样支持双备份升级, 需要根据实际FLASH大小同时配置CONFIG_FLASH_SIZE)
|
||||
#define CONFIG_APP_OTA_ENABLE 0 //是否支持RCSP升级(JL-OTA)
|
||||
|
||||
#define CONFIG_UPDATE_JUMP_TO_MASK 0 //配置升级到loader的方式0为直接reset,1为跳转(适用于芯片电源由IO口KEEP住的方案,需要注意检查跳转前是否将使用DMA的硬件模块全部关闭)
|
||||
|
||||
#define CONFIG_IO_KEY_EN 0 //配置是否使用IO按键,配合RESET1
|
||||
#define CONFIG_UPDATE_WITH_MD5_CHECK_EN 0 //配置升级是否支持MD5校验
|
||||
|
||||
#define CONFIG_ANC_ENABLE 0 //配置是否支持ANC
|
||||
|
||||
//flash size vaule definition
|
||||
#define FLASH_SIZE_256K 0x40000
|
||||
#define FLASH_SIZE_512K 0x80000
|
||||
#define FLASH_SIZE_1M 0x100000
|
||||
#define FLASH_SIZE_2M 0x200000
|
||||
#define FLASH_SIZE_4M 0x400000
|
||||
|
||||
#define CONFIG_FLASH_SIZE FLASH_SIZE_1M //配置FLASH大小
|
||||
|
||||
|
||||
/* Above Macros Affect Periods Of Both Code Compiling And Post-build */
|
||||
|
||||
/* Following Macros Only For Post Bulid Configuaration */
|
||||
|
||||
#define CONFIG_DB_UPDATE_DATA_GENERATE_EN 0 //是否生成db_data.bin(用于第三方协议接入使用)
|
||||
#define CONFIG_ONLY_GRENERATE_ALIGN_4K_CODE 0 //ufw只生成1份4K对齐的代码
|
||||
|
||||
//config for supported chip version
|
||||
#ifdef CONFIG_BR30_C_VERSION
|
||||
#define CONFIG_SUPPORTED_CHIP_VERSION C
|
||||
#else
|
||||
#define CONFIG_SUPPORTED_CHIP_VERSION B,D,E,M,N,O,P
|
||||
#endif
|
||||
|
||||
//DON'T MODIFY THIS CONFIG EXCEPT SDK PUBLISHER
|
||||
#define CONFIG_CHIP_NAME AC701N //除了SDK发布者,请不要修改
|
||||
//it can be modified before first programming,but keep the same as the original version
|
||||
#define CONFIG_PID AC701N //烧写或强制升级之前可以修改,之后升级要保持一致
|
||||
//it can be modified before first programming,but keep the same as the original version
|
||||
#define CONFIG_VID 0.01 //烧写或强制升级之前可以修改,之后升级要保持一致
|
||||
|
||||
//Project with bluetooth,it must use OSC as PLL_SOURCE;
|
||||
#define CONFIG_PLL_SOURCE_USING_LRC 0 //PLL时钟源选择 1:LRC 2:OSC
|
||||
|
||||
//config alignment size unit
|
||||
#ifdef CONFIG_256K_FLASH
|
||||
#define ALIGN_UNIT_256B 1 //FLASH对齐方式选择,如果是256K的FLASH,选择256BYTE对齐方式
|
||||
#else
|
||||
#define ALIGN_UNIT_256B 0
|
||||
#endif
|
||||
|
||||
//partial platform check this config to select the uart IO for wired update
|
||||
#define CONFIG_UART_UPDATE_PIN PP00
|
||||
|
||||
//isd_download loader/uboot/update_loader debug io config
|
||||
//#define CONFIG_UBOOT_DEBUG_PIN PA05
|
||||
//#define CONFIG_UBOOT_DEBUG_BAUD_RATE 1000000
|
||||
|
||||
//config long-press reset io pin,time,trigger level
|
||||
#define CONFIG_RESET_PIN LDO //io pin
|
||||
#define CONFIG_RESET_TIME 04 //unit:second
|
||||
#define CONFIG_RESET_LEVEL 1 //tigger level(0/1)
|
||||
|
||||
#if CONFIG_IO_KEY_EN
|
||||
#define CONFIG_SUPPORT_RESET1
|
||||
#define CONFIG_RESET1_PIN PB01 //io pin
|
||||
#define CONFIG_RESET1_TIME 08 //unit:second
|
||||
#define CONFIG_RESET1_LEVEL 0 //tigger level(0/1)
|
||||
#endif
|
||||
|
||||
//reserved three custom cfg item for the future definition
|
||||
//#define CONFIG_CUSTOM_CFG1_TYPE POWER_PIN
|
||||
//#define CONFIG_CUSTOM_CFG1_VALUE PC01_1
|
||||
|
||||
//#define CONFIG_CUSTOM_CFG2_TYPE
|
||||
//#define CONFIG_CUSTOM_CFG2_VALUE
|
||||
|
||||
//#define CONFIG_CUSTOM_CFG3_TYPE
|
||||
//#define CONFIG_CUSTOM_CFG3_VALUE
|
||||
|
||||
|
||||
//#define CONFIG_VDDIO_LVD_LEVEL 4 ////VDDIO_LVD挡位,0: 1.9V 1: 2.0V 2: 2.1V 3: 2.2V 4: 2.3V 5: 2.4V 6: 2.5V 7: 2.6V
|
||||
|
||||
//with single-bank mode,actual vm size should larger this VM_LEAST_SIZE,and dual bank mode,actual vm size equals this;
|
||||
#define CONFIG_VM_LEAST_SIZE 8K
|
||||
//config whether erased this area when do a update,1-No Operation,0-Erase
|
||||
#define CONFIG_VM_OPT 1
|
||||
|
||||
//config whether erased this area when do a update,1-No Operation,0-Erase
|
||||
#define CONFIG_BTIF_OPT 1
|
||||
|
||||
//reserved two custom cfg area for the future definition
|
||||
//#define CONFIG_RESERVED_AREA1 EXIF1
|
||||
#ifdef CONFIG_RESERVED_AREA1
|
||||
#define CONFIG_RESERVED_AREA1_ADDR AUTO
|
||||
#define CONFIG_RESERVED_AREA1_LEN 0x1000
|
||||
#define CONFIG_RESERVED_AREA1_OPT 1
|
||||
//#define CONFIG_RESERVED_AREA1_FILE anc_gains.bin
|
||||
#endif
|
||||
|
||||
//#define CONFIG_RESERVED_AREA2 EXIF2
|
||||
#ifdef CONFIG_RESERVED_AREA2
|
||||
#define CONFIG_RESERVED_AREA2_ADDR AUTO
|
||||
#define CONFIG_RESERVED_AREA2_LEN 0x1000
|
||||
#define CONFIG_RESERVED_AREA2_OPT 1
|
||||
//#define CONFIG_RESERVED_AREA2_FILE anc_gains.bin
|
||||
#endif
|
||||
|
||||
/* Above Macros Only For Post Bulid Configuaration */
|
||||
#endif /* #ifdef CONFIG_BOARD_JL701N_DEMO */
|
||||
|
||||
#endif /* #ifndef CONFIG_BOARD_JL701N_DEMO_POST_BUILD_CFG_H */
|
||||
|
||||
Reference in New Issue
Block a user