Bouffalo SDK
1.0
Bouffalolab Software Development Kit
|
![]() |
Data Structures | |
struct | bflb_adc_config_s |
ADC configuration structure. More... | |
struct | bflb_adc_channel_s |
ADC channel select. More... | |
struct | bflb_adc_result_s |
ADC result select. More... | |
Functions | |
void | bflb_adc_init (struct bflb_device_s *dev, const struct bflb_adc_config_s *config) |
Initialize adc. More... | |
void | bflb_adc_deinit (struct bflb_device_s *dev) |
Deinitialize adc. More... | |
void | bflb_adc_link_rxdma (struct bflb_device_s *dev, bool enable) |
Enable adc rx dma. More... | |
void | bflb_adc_set_reference_channel (int channel, int32_t millivolt) |
Select reference channel. More... | |
int | bflb_adc_channel_config (struct bflb_device_s *dev, struct bflb_adc_channel_s *chan, uint8_t channels) |
Config adc channels to sample. More... | |
void | bflb_adc_start_conversion (struct bflb_device_s *dev) |
Start adc conversion. More... | |
void | bflb_adc_stop_conversion (struct bflb_device_s *dev) |
Stop adc conversion. More... | |
uint8_t | bflb_adc_get_count (struct bflb_device_s *dev) |
Get adc number of completed conversions. More... | |
uint32_t | bflb_adc_read_raw (struct bflb_device_s *dev) |
Read adc conversion value. More... | |
void | bflb_adc_rxint_mask (struct bflb_device_s *dev, bool mask) |
Enable or disable adc conversion completion interrupt. Triggerring when a channel conversion is completed. More... | |
void | bflb_adc_errint_mask (struct bflb_device_s *dev, bool mask) |
Enable or disable adc error interrupt. More... | |
uint32_t | bflb_adc_get_intstatus (struct bflb_device_s *dev) |
Get adc interrupt instatus. More... | |
void | bflb_adc_int_clear (struct bflb_device_s *dev, uint32_t int_clear) |
Clear adc interrupt instatus. More... | |
void | bflb_adc_parse_result (struct bflb_device_s *dev, uint32_t *buffer, struct bflb_adc_result_s *result, uint16_t count) |
Parse adc conversion value into millivolt and actual numerical value. More... | |
void | bflb_adc_tsen_init (struct bflb_device_s *dev, uint8_t tsen_mod) |
Initialize adc temperature sensor. More... | |
float | bflb_adc_tsen_get_temp (struct bflb_device_s *dev) |
Get adc temperature. More... | |
void | bflb_adc_vbat_enable (struct bflb_device_s *dev) |
Enable adc vbat power. More... | |
void | bflb_adc_vbat_disable (struct bflb_device_s *dev) |
Disable adc vbat power. More... | |
int bflb_adc_channel_config | ( | struct bflb_device_s * | dev, |
struct bflb_adc_channel_s * | chan, | ||
uint8_t | channels | ||
) |
Config adc channels to sample.
[in] | dev | device handle |
[in] | chan | pointer to the channel configurations. |
[in] | channels | pair number of channels |
void bflb_adc_deinit | ( | struct bflb_device_s * | dev | ) |
Deinitialize adc.
[in] | dev | device handle |
void bflb_adc_errint_mask | ( | struct bflb_device_s * | dev, |
bool | mask | ||
) |
Enable or disable adc error interrupt.
[in] | dev | device handle |
[in] | mask | true means disable, false means enable |
uint8_t bflb_adc_get_count | ( | struct bflb_device_s * | dev | ) |
Get adc number of completed conversions.
[in] | dev | device handle |
uint32_t bflb_adc_get_intstatus | ( | struct bflb_device_s * | dev | ) |
Get adc interrupt instatus.
[in] | dev | device handle |
void bflb_adc_init | ( | struct bflb_device_s * | dev, |
const struct bflb_adc_config_s * | config | ||
) |
Initialize adc.
[in] | dev | device handle |
[in] | config | pointer to save adc configuration |
void bflb_adc_int_clear | ( | struct bflb_device_s * | dev, |
uint32_t | int_clear | ||
) |
Clear adc interrupt instatus.
[in] | dev | device handle |
[in] | int_clear | interrupt clear value, use adc interrupt clear definition |
void bflb_adc_link_rxdma | ( | struct bflb_device_s * | dev, |
bool | enable | ||
) |
Enable adc rx dma.
[in] | dev | device handle |
[in] | enable | true means enable, otherwise disable. |
void bflb_adc_parse_result | ( | struct bflb_device_s * | dev, |
uint32_t * | buffer, | ||
struct bflb_adc_result_s * | result, | ||
uint16_t | count | ||
) |
Parse adc conversion value into millivolt and actual numerical value.
[in] | dev | device handle |
[in] | buffer | pointer to adc original value from bflb_adc_read_raw api |
[out] | result | pointer to save parse result |
[in] | count | count to parse |
uint32_t bflb_adc_read_raw | ( | struct bflb_device_s * | dev | ) |
Read adc conversion value.
[in] | dev | device handle |
void bflb_adc_rxint_mask | ( | struct bflb_device_s * | dev, |
bool | mask | ||
) |
Enable or disable adc conversion completion interrupt. Triggerring when a channel conversion is completed.
[in] | dev | device handle |
[in] | mask | true means disable, false means enable |
void bflb_adc_set_reference_channel | ( | int | channel, |
int32_t | millivolt | ||
) |
Select reference channel.
[in] | channel | channel number |
[in] | millivolt | refercence millivolt |
void bflb_adc_start_conversion | ( | struct bflb_device_s * | dev | ) |
Start adc conversion.
[in] | dev | device handle |
void bflb_adc_stop_conversion | ( | struct bflb_device_s * | dev | ) |
Stop adc conversion.
[in] | dev | device handle |
float bflb_adc_tsen_get_temp | ( | struct bflb_device_s * | dev | ) |
Get adc temperature.
[in] | dev | device handle |
void bflb_adc_tsen_init | ( | struct bflb_device_s * | dev, |
uint8_t | tsen_mod | ||
) |
Initialize adc temperature sensor.
[in] | dev | device handle |
[in] | tsen_mod | temperature sensor mode, use adc tsen mode definition |
void bflb_adc_vbat_disable | ( | struct bflb_device_s * | dev | ) |
Disable adc vbat power.
[in] | dev | device handle |
void bflb_adc_vbat_enable | ( | struct bflb_device_s * | dev | ) |
Enable adc vbat power.
[in] | dev | device handle |