doubao_chat/apps/demo/demo_hello/board/wl82/board.c

62 lines
1.7 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "app_config.h"
#include "system/includes.h"
#include "device/includes.h"
#include "asm/includes.h"
// *INDENT-OFF*
UART2_PLATFORM_DATA_BEGIN(uart2_data)
.baudrate = 1000000,
.port = PORT_REMAP,
.output_channel = OUTPUT_CHANNEL0,
.tx_pin = IO_PORTB_03,
.rx_pin = -1,
.max_continue_recv_cnt = 1024,
.idle_sys_clk_cnt = 500000,
.clk_src = PLL_48M,
.flags = UART_DEBUG,
UART2_PLATFORM_DATA_END();
/************************** POWER config ****************************/
static const struct low_power_param power_param = {
.config = TCFG_LOWPOWER_LOWPOWER_SEL, //系统休眠
.btosc_disable = TCFG_LOWPOWER_BTOSC_DISABLE, //进入低功耗时BTOSC是否保持
.vddiom_lev = TCFG_LOWPOWER_VDDIOM_LEVEL, //强VDDIO等级,可选:2.8V 2.9V 3.0V 3.1V 3.2V 3.3V 3.4V 3.5V
.vddiow_lev = TCFG_LOWPOWER_VDDIOW_LEVEL, //弱VDDIO等级,可选:2.1V 2.4V 2.8V 3.2V
.vdc14_dcdc = TRUE, //打开内部1.4VDCDC,关闭则用外部
.vdc14_lev = VDC14_VOL_SEL_LEVEL, //VDD1.4V配置
.sysvdd_lev = SYSVDD_VOL_SEL_LEVEL, //内核、sdram电压配置
.vlvd_enable = TRUE, //TRUE电压复位使能
.vlvd_value = VLVD_SEL_25V, //低电压复位电压值
};
REGISTER_DEVICES(device_table) = {
{"uart2", &uart_dev_ops, (void *)&uart2_data },
{"rtc", &rtc_dev_ops, NULL},
};
#ifdef CONFIG_DEBUG_ENABLE
void debug_uart_init()
{
uart_init(&uart2_data);
}
#endif
void board_early_init()
{
devices_init();
}
static void board_power_init(void)
{
power_init(&power_param);
}
void board_init()
{
board_power_init();
}