37#ifndef DRIVER_ADS1118_H 
   38#define DRIVER_ADS1118_H 
  166#define DRIVER_ADS1118_LINK_INIT(HANDLE, STRUCTURE)             memset(HANDLE, 0, sizeof(STRUCTURE)) 
  174#define DRIVER_ADS1118_LINK_SPI_INIT(HANDLE, FUC)               (HANDLE)->spi_init = FUC 
  182#define DRIVER_ADS1118_LINK_SPI_DEINIT(HANDLE, FUC)             (HANDLE)->spi_deinit = FUC 
  190#define DRIVER_ADS1118_LINK_SPI_TRANSMIT(HANDLE, FUC)           (HANDLE)->spi_transmit = FUC 
  198#define DRIVER_ADS1118_LINK_DELAY_MS(HANDLE, FUC)               (HANDLE)->delay_ms = FUC 
  206#define DRIVER_ADS1118_LINK_DEBUG_PRINT(HANDLE, FUC)            (HANDLE)->debug_print = FUC 
uint8_t ads1118_stop_continuous_read(ads1118_handle_t *handle)
stop the chip reading
uint8_t ads1118_single_read(ads1118_handle_t *handle, int16_t *raw, float *v)
read data from the chip once
uint8_t ads1118_get_channel(ads1118_handle_t *handle, ads1118_channel_t *channel)
get the adc channel
uint8_t ads1118_set_channel(ads1118_handle_t *handle, ads1118_channel_t channel)
set the adc channel
uint8_t ads1118_set_range(ads1118_handle_t *handle, ads1118_range_t range)
set the adc range
uint8_t ads1118_info(ads1118_info_t *info)
get chip's information
ads1118_mode_t
ads1118 mode enumeration definition
uint8_t ads1118_continuous_read(ads1118_handle_t *handle, int16_t *raw, float *v)
read data from the chip continuously
ads1118_bool_t
ads1118 bool enumeration definition
uint8_t ads1118_get_mode(ads1118_handle_t *handle, ads1118_mode_t *mode)
get the chip mode
struct ads1118_info_s ads1118_info_t
ads1118 information structure definition
ads1118_range_t
ads1118 range enumeration definition
uint8_t ads1118_init(ads1118_handle_t *handle)
initialize the chip
uint8_t ads1118_set_dout_pull_up(ads1118_handle_t *handle, ads1118_bool_t enable)
enable or disable dout pull up
uint8_t ads1118_deinit(ads1118_handle_t *handle)
close the chip
struct ads1118_handle_s ads1118_handle_t
ads1118 handle structure definition
uint8_t ads1118_set_rate(ads1118_handle_t *handle, ads1118_rate_t rate)
set the sample rate
uint8_t ads1118_get_rate(ads1118_handle_t *handle, ads1118_rate_t *rate)
get the sample rate
ads1118_channel_t
ads1118 channel enumeration definition
uint8_t ads1118_temperature_convert(ads1118_handle_t *handle, int16_t raw, float *deg)
temperature convert
ads1118_rate_t
ads1118 channel rate enumeration definition
uint8_t ads1118_start_continuous_read(ads1118_handle_t *handle)
start the chip reading
uint8_t ads1118_set_mode(ads1118_handle_t *handle, ads1118_mode_t mode)
set the chip mode
uint8_t ads1118_get_dout_pull_up(ads1118_handle_t *handle, ads1118_bool_t *enable)
get dout pull up status
uint8_t ads1118_get_range(ads1118_handle_t *handle, ads1118_range_t *range)
get the adc range
@ ADS1118_MODE_TEMPERATURE
@ ADS1118_CHANNEL_AIN2_GND
@ ADS1118_CHANNEL_AIN0_GND
@ ADS1118_CHANNEL_AIN0_AIN1
@ ADS1118_CHANNEL_AIN0_AIN3
@ ADS1118_CHANNEL_AIN2_AIN3
@ ADS1118_CHANNEL_AIN1_GND
@ ADS1118_CHANNEL_AIN3_GND
@ ADS1118_CHANNEL_AIN1_AIN3
uint8_t ads1118_transmit(ads1118_handle_t *handle, uint8_t *tx, uint8_t *rx, uint16_t len)
chip transmit
ads1118 handle structure definition
uint8_t(* spi_init)(void)
void(* delay_ms)(uint32_t ms)
void(* debug_print)(const char *const fmt,...)
uint8_t(* spi_transmit)(uint8_t *tx, uint8_t *rx, uint16_t len)
uint8_t(* spi_deinit)(void)
ads1118 information structure definition
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v