You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
2.7 KiB
67 lines
2.7 KiB
#pragma once
|
|
#include <stdio.h>
|
|
|
|
#include "nrf_drv_saadc.h"
|
|
#include "nrf_drv_twi.h"
|
|
#include "sys.h"
|
|
|
|
/*******************************************************************************
|
|
* DEBUG_LIGHT *
|
|
*******************************************************************************/
|
|
void debug_light_init(int io_index);
|
|
|
|
/*******************************************************************************
|
|
* zbsp_enter_sleep *
|
|
*******************************************************************************/
|
|
|
|
/**
|
|
* @brief 调用此方法前,需要确保底层协议栈已经初始化
|
|
*
|
|
* @param after_ms
|
|
* @param wakeup_io_index
|
|
*/
|
|
void zbsp_enter_sleep(int32_t after_ms, int32_t wakeup_io_index, bool mirror);
|
|
|
|
/*******************************************************************************
|
|
* gpio_io_state_monitor *
|
|
*******************************************************************************/
|
|
void zbsp_gpio_state_monitor(int dumpstate_period, uint8_t* io_index, int32_t nio);
|
|
void zbsp_gpio_state_monitor_without_initio(int dumpstate_period, uint8_t* io_index, int32_t nio);
|
|
|
|
void board_init();
|
|
|
|
/*******************************************************************************
|
|
* ADC *
|
|
*******************************************************************************/
|
|
|
|
void adc_module_init();
|
|
|
|
void adc_module_battery_channel_init(nrf_saadc_input_t channelpin);
|
|
int16_t adc_module_battery_channel_read_val();
|
|
|
|
void adc_module_heart_elect_channel_init(nrf_saadc_input_t channelpin);
|
|
int16_t adc_module_heart_elect_channel_read_val();
|
|
|
|
/*******************************************************************************
|
|
* SPI *
|
|
*******************************************************************************/
|
|
|
|
void board_spi_init();
|
|
ret_code_t board_spi_transfer(uint8_t const* p_tx_buffer, uint8_t tx_buffer_length, uint8_t* p_rx_buffer, uint8_t rx_buffer_length);
|
|
ret_code_t board_spi_transfer_test();
|
|
|
|
void board_i2c_init();
|
|
void board_i2c_write(uint8_t addr, uint8_t* data, uint8_t len);
|
|
|
|
void screen_init();
|
|
void screen_spi_translate_onebyte();
|
|
|
|
/*******************************************************************************
|
|
* FATFS *
|
|
*******************************************************************************/
|
|
void fatfs_init();
|
|
void fatfs_test_write();
|
|
void pwm_trigger();
|
|
|
|
void wd_init();
|
|
void wd_feed();
|