Bouffalo SDK  1.0
Bouffalolab Software Development Kit
bflb_acomp.h File Reference
#include "bflb_core.h"
Include dependency graph for bflb_acomp.h:

Go to the source code of this file.

Data Structures

struct  bflb_acomp_config_s
 ACOMP configuration structure. More...
 

Macros

#define AON_ACOMP0_ID   0
 
#define AON_ACOMP1_ID   1
 
#define AON_ACOMP_SCALING_FACTOR_0P25   0x00
 
#define AON_ACOMP_SCALING_FACTOR_0P5   0x10
 
#define AON_ACOMP_SCALING_FACTOR_0P75   0x20
 
#define AON_ACOMP_SCALING_FACTOR_1   0x30
 
#define AON_ACOMP_CHAN_ADC0   0
 
#define AON_ACOMP_CHAN_ADC1   1
 
#define AON_ACOMP_CHAN_ADC2   2
 
#define AON_ACOMP_CHAN_ADC3   3
 
#define AON_ACOMP_CHAN_ADC4   4
 
#define AON_ACOMP_CHAN_ADC5   5
 
#define AON_ACOMP_CHAN_ADC6   6
 
#define AON_ACOMP_CHAN_ADC7   7
 
#define AON_ACOMP_CHAN_DACA   8
 
#define AON_ACOMP_CHAN_DACB   9
 
#define AON_ACOMP_CHAN_VREF_1P25V   10
 
#define AON_ACOMP_CHAN_VIO_X_SCALING_FACTOR_1   11
 
#define AON_ACOMP_CHAN_VIO_X_SCALING_FACTOR_2   12
 
#define AON_ACOMP_CHAN_VIO_X_SCALING_FACTOR_3   13
 
#define AON_ACOMP_CHAN_VIO_X_SCALING_FACTOR_4   14
 
#define AON_ACOMP_CHAN_VSS   15
 
#define AON_ACOMP_BIAS_POWER_MODE1   0
 
#define AON_ACOMP_BIAS_POWER_MODE2   1
 
#define AON_ACOMP_BIAS_POWER_MODE3   2
 
#define AON_ACOMP_BIAS_POWER_NONE   3
 
#define AON_ACOMP_HYSTERESIS_VOLT_NONE   0
 
#define AON_ACOMP_HYSTERESIS_VOLT_10MV   1
 
#define AON_ACOMP_HYSTERESIS_VOLT_20MV   2
 
#define AON_ACOMP_HYSTERESIS_VOLT_30MV   3
 
#define AON_ACOMP_HYSTERESIS_VOLT_40MV   4
 
#define AON_ACOMP_HYSTERESIS_VOLT_50MV   5
 
#define AON_ACOMP_HYSTERESIS_VOLT_60MV   6
 
#define AON_ACOMP_HYSTERESIS_VOLT_70MV   7
 

Functions

void bflb_acomp_init (uint8_t acomp_id, const struct bflb_acomp_config_s *config)
 Initialize acomp. More...
 
void bflb_acomp_enable (uint8_t acomp_id)
 Enable acomp. More...
 
void bflb_acomp_disable (uint8_t acomp_id)
 Disable acomp. More...
 
uint32_t bflb_acomp_get_result (uint8_t acomp_id)
 Get acomp result. More...
 
uint32_t bflb_acomp_gpio_2_chanid (uint32_t pin, uint32_t *channel)
 gpio change adc_chan_id. More...
 
uint32_t bflb_acomp_chanid_2_gpio (uint32_t channel, uint32_t *pin)
 adc_chan_id change gpio index. More...