54 int16_t high_threshold;
55 int16_t low_threshold;
56 int16_t high_threshold_before;
57 int16_t low_threshold_before;
818 high_threshold_before = rand() % 8196;
819 low_threshold_before = -rand() % 8196;
895 f_reg = -(rand() % 6144) / 1000.0f;
916 f_reg = (rand() % 4096) / 1000.0f;
937 f_reg = -(rand() % 2048) / 1000.0f;
958 f_reg = (rand() % 1024) / 1000.0f;
979 f_reg = -(rand() % 512) / 1000.0f;
1000 f_reg = (rand() % 256) / 1000.0f;
driver ads1115 register test header file
uint8_t ads1115_get_channel(ads1115_handle_t *handle, ads1115_channel_t *channel)
get the adc channel
uint8_t ads1115_set_addr_pin(ads1115_handle_t *handle, ads1115_address_t addr_pin)
set the iic address pin
uint8_t ads1115_get_addr_pin(ads1115_handle_t *handle, ads1115_address_t *addr_pin)
get the iic address pin
ads1115_channel_t
ads1115 channel enumeration definition
uint8_t ads1115_init(ads1115_handle_t *handle)
initialize the chip
uint8_t ads1115_set_rate(ads1115_handle_t *handle, ads1115_rate_t rate)
set the sample rate
ads1115_address_t
ads1115 address enumeration definition
uint8_t ads1115_get_rate(ads1115_handle_t *handle, ads1115_rate_t *rate)
get the sample rate
uint8_t ads1115_deinit(ads1115_handle_t *handle)
close the chip
uint8_t ads1115_set_range(ads1115_handle_t *handle, ads1115_range_t range)
set the adc range
struct ads1115_info_s ads1115_info_t
ads1115 information structure definition
ads1115_rate_t
ads1115 channel rate enumeration definition
uint8_t ads1115_get_range(ads1115_handle_t *handle, ads1115_range_t *range)
get the adc range
ads1115_bool_t
ads1115 bool enumeration definition
struct ads1115_handle_s ads1115_handle_t
ads1115 handle structure definition
uint8_t ads1115_info(ads1115_info_t *info)
get chip's information
ads1115_range_t
ads1115 range enumeration definition
uint8_t ads1115_set_channel(ads1115_handle_t *handle, ads1115_channel_t channel)
set the adc channel
@ ADS1115_CHANNEL_AIN1_GND
@ ADS1115_CHANNEL_AIN1_AIN3
@ ADS1115_CHANNEL_AIN0_AIN1
@ ADS1115_CHANNEL_AIN0_GND
@ ADS1115_CHANNEL_AIN3_GND
@ ADS1115_CHANNEL_AIN2_GND
@ ADS1115_CHANNEL_AIN0_AIN3
@ ADS1115_CHANNEL_AIN2_AIN3
uint8_t ads1115_interface_iic_init(void)
interface iic bus init
void ads1115_interface_delay_ms(uint32_t ms)
interface delay ms
void ads1115_interface_debug_print(const char *const fmt,...)
interface print format data
uint8_t ads1115_interface_iic_deinit(void)
interface iic bus deinit
uint8_t ads1115_interface_iic_read(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus read
uint8_t ads1115_interface_iic_write(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus write
uint8_t ads1115_set_alert_pin(ads1115_handle_t *handle, ads1115_pin_t pin)
set the alert pin active status
uint8_t ads1115_get_alert_pin(ads1115_handle_t *handle, ads1115_pin_t *pin)
get the alert pin active status
uint8_t ads1115_set_compare(ads1115_handle_t *handle, ads1115_bool_t enable)
enable or disable the interrupt compare
uint8_t ads1115_get_comparator_queue(ads1115_handle_t *handle, ads1115_comparator_queue_t *comparator_queue)
get the interrupt comparator queue
uint8_t ads1115_convert_to_register(ads1115_handle_t *handle, float s, int16_t *reg)
convert a adc value to a register raw data
uint8_t ads1115_set_compare_threshold(ads1115_handle_t *handle, int16_t high_threshold, int16_t low_threshold)
set the interrupt compare threshold
uint8_t ads1115_set_compare_mode(ads1115_handle_t *handle, ads1115_compare_t compare)
set the interrupt compare mode
ads1115_comparator_queue_t
ads1115 comparator queue enumeration definition
uint8_t ads1115_set_comparator_queue(ads1115_handle_t *handle, ads1115_comparator_queue_t comparator_queue)
set the interrupt comparator queue
ads1115_compare_t
ads1115 compare mode enumeration definition
uint8_t ads1115_get_compare_threshold(ads1115_handle_t *handle, int16_t *high_threshold, int16_t *low_threshold)
get the interrupt compare threshold
uint8_t ads1115_get_compare_mode(ads1115_handle_t *handle, ads1115_compare_t *compare)
get the interrupt compare mode
uint8_t ads1115_get_compare(ads1115_handle_t *handle, ads1115_bool_t *enable)
get the interrupt compare status
uint8_t ads1115_convert_to_data(ads1115_handle_t *handle, int16_t reg, float *s)
convert a register raw data to a converted adc data
ads1115_pin_t
ads1115 pin enumeration definition
@ ADS1115_COMPARATOR_QUEUE_NONE_CONV
@ ADS1115_COMPARATOR_QUEUE_2_CONV
@ ADS1115_COMPARATOR_QUEUE_1_CONV
@ ADS1115_COMPARATOR_QUEUE_4_CONV
@ ADS1115_COMPARE_THRESHOLD
#define DRIVER_ADS1115_LINK_IIC_INIT(HANDLE, FUC)
link iic_init function
#define DRIVER_ADS1115_LINK_INIT(HANDLE, STRUCTURE)
initialize ads1115_handle_t structure
#define DRIVER_ADS1115_LINK_IIC_DEINIT(HANDLE, FUC)
link iic_deinit function
#define DRIVER_ADS1115_LINK_DELAY_MS(HANDLE, FUC)
link delay_ms function
#define DRIVER_ADS1115_LINK_DEBUG_PRINT(HANDLE, FUC)
link debug_print function
#define DRIVER_ADS1115_LINK_IIC_READ(HANDLE, FUC)
link iic_read function
#define DRIVER_ADS1115_LINK_IIC_WRITE(HANDLE, FUC)
link iic_write function
uint8_t ads1115_register_test(ads1115_address_t addr)
register test
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v