LibDriver ADS1115
Loading...
Searching...
No Matches
ads1115 interrupt driver function

ads1115 interrupt driver modules More...

Collaboration diagram for ads1115 interrupt driver function:

Enumerations

enum  ads1115_pin_t { ADS1115_PIN_LOW = 0x00 , ADS1115_PIN_HIGH = 0x01 }
 ads1115 pin enumeration definition More...
enum  ads1115_compare_t { ADS1115_COMPARE_THRESHOLD = 0x00 , ADS1115_COMPARE_WINDOW = 0x01 }
 ads1115 compare mode enumeration definition More...
enum  ads1115_comparator_queue_t { ADS1115_COMPARATOR_QUEUE_1_CONV = 0x00 , ADS1115_COMPARATOR_QUEUE_2_CONV = 0x01 , ADS1115_COMPARATOR_QUEUE_4_CONV = 0x02 , ADS1115_COMPARATOR_QUEUE_NONE_CONV = 0x03 }
 ads1115 comparator queue enumeration definition More...

Functions

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_mode (ads1115_handle_t *handle, ads1115_compare_t compare)
 set the interrupt compare mode
uint8_t ads1115_get_compare_mode (ads1115_handle_t *handle, ads1115_compare_t *compare)
 get the interrupt compare mode
uint8_t ads1115_set_comparator_queue (ads1115_handle_t *handle, ads1115_comparator_queue_t comparator_queue)
 set the interrupt comparator queue
uint8_t ads1115_get_comparator_queue (ads1115_handle_t *handle, ads1115_comparator_queue_t *comparator_queue)
 get the interrupt comparator queue
uint8_t ads1115_set_compare (ads1115_handle_t *handle, ads1115_bool_t enable)
 enable or disable the interrupt compare
uint8_t ads1115_get_compare (ads1115_handle_t *handle, ads1115_bool_t *enable)
 get the interrupt compare status
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_get_compare_threshold (ads1115_handle_t *handle, int16_t *high_threshold, int16_t *low_threshold)
 get the interrupt compare threshold
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_convert_to_data (ads1115_handle_t *handle, int16_t reg, float *s)
 convert a register raw data to a converted adc data

Detailed Description

ads1115 interrupt driver modules

Enumeration Type Documentation

◆ ads1115_comparator_queue_t

ads1115 comparator queue enumeration definition

Enumerator
ADS1115_COMPARATOR_QUEUE_1_CONV 

comparator queue has 1 conv

ADS1115_COMPARATOR_QUEUE_2_CONV 

comparator queue has 2 conv

ADS1115_COMPARATOR_QUEUE_4_CONV 

comparator queue has 3 conv

ADS1115_COMPARATOR_QUEUE_NONE_CONV 

comparator queue has no conv

Definition at line 153 of file driver_ads1115.h.

◆ ads1115_compare_t

ads1115 compare mode enumeration definition

Enumerator
ADS1115_COMPARE_THRESHOLD 

threshold compare interrupt mode

ADS1115_COMPARE_WINDOW 

window compare interrupt mode

Definition at line 144 of file driver_ads1115.h.

◆ ads1115_pin_t

ads1115 pin enumeration definition

Enumerator
ADS1115_PIN_LOW 

set pin low

ADS1115_PIN_HIGH 

set pin high

Definition at line 135 of file driver_ads1115.h.

Function Documentation

◆ ads1115_convert_to_data()

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

Parameters
[in]*handlepointer to an ads1115 handle structure
[in]regregister raw data
[out]*spointer to a converted adc value buffer
Returns
status code
  • 0 success
  • 1 convert to data failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1328 of file driver_ads1115.c.

◆ ads1115_convert_to_register()

uint8_t ads1115_convert_to_register ( ads1115_handle_t * handle,
float s,
int16_t * reg )

convert a adc value to a register raw data

Parameters
[in]*handlepointer to an ads1115 handle structure
[in]sconverted adc value
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 1 convert to register failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1259 of file driver_ads1115.c.

◆ ads1115_get_alert_pin()

uint8_t ads1115_get_alert_pin ( ads1115_handle_t * handle,
ads1115_pin_t * pin )

get the alert pin active status

Parameters
[in]*handlepointer to an ads1115 handle structure
[out]*pinpointer to a pin alert active status buffer
Returns
status code
  • 0 success
  • 1 get alert pin failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 456 of file driver_ads1115.c.

◆ ads1115_get_comparator_queue()

uint8_t ads1115_get_comparator_queue ( ads1115_handle_t * handle,
ads1115_comparator_queue_t * comparator_queue )

get the interrupt comparator queue

Parameters
[in]*handlepointer to an ads1115 handle structure
[out]*comparator_queuepointer to an interrupt comparator queue
Returns
status code
  • 0 success
  • 1 get comparator queue failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 702 of file driver_ads1115.c.

◆ ads1115_get_compare()

uint8_t ads1115_get_compare ( ads1115_handle_t * handle,
ads1115_bool_t * enable )

get the interrupt compare status

Parameters
[in]*handlepointer to an ads1115 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get compare failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1143 of file driver_ads1115.c.

◆ ads1115_get_compare_mode()

uint8_t ads1115_get_compare_mode ( ads1115_handle_t * handle,
ads1115_compare_t * compare )

get the interrupt compare mode

Parameters
[in]*handlepointer to an ads1115 handle structure
[out]*comparepointer to an interrupt compare mode buffer
Returns
status code
  • 0 success
  • 1 get compare mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 538 of file driver_ads1115.c.

◆ ads1115_get_compare_threshold()

uint8_t ads1115_get_compare_threshold ( ads1115_handle_t * handle,
int16_t * high_threshold,
int16_t * low_threshold )

get the interrupt compare threshold

Parameters
[in]*handlepointer to an ads1115 handle structure
[out]*high_thresholdpointer to an interrupt high threshold buffer
[out]*low_thresholdpointer to an interrupt low threshold buffer
Returns
status code
  • 0 success
  • 1 get compare threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1220 of file driver_ads1115.c.

◆ ads1115_set_alert_pin()

uint8_t ads1115_set_alert_pin ( ads1115_handle_t * handle,
ads1115_pin_t pin )

set the alert pin active status

Parameters
[in]*handlepointer to an ads1115 handle structure
[in]pinalert active status pin
Returns
status code
  • 0 success
  • 1 set alert pin failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 411 of file driver_ads1115.c.

◆ ads1115_set_comparator_queue()

uint8_t ads1115_set_comparator_queue ( ads1115_handle_t * handle,
ads1115_comparator_queue_t comparator_queue )

set the interrupt comparator queue

Parameters
[in]*handlepointer to an ads1115 handle structure
[in]comparator_queueinterrupt comparator queue
Returns
status code
  • 0 success
  • 1 set comparator queue failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 657 of file driver_ads1115.c.

◆ ads1115_set_compare()

uint8_t ads1115_set_compare ( ads1115_handle_t * handle,
ads1115_bool_t enable )

enable or disable the interrupt compare

Parameters
[in]*handlepointer to an ads1115 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set compare failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1098 of file driver_ads1115.c.

◆ ads1115_set_compare_mode()

uint8_t ads1115_set_compare_mode ( ads1115_handle_t * handle,
ads1115_compare_t compare )

set the interrupt compare mode

Parameters
[in]*handlepointer to an ads1115 handle structure
[in]compareinterrupt compare mode
Returns
status code
  • 0 success
  • 1 set compare mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 493 of file driver_ads1115.c.

◆ ads1115_set_compare_threshold()

uint8_t ads1115_set_compare_threshold ( ads1115_handle_t * handle,
int16_t high_threshold,
int16_t low_threshold )

set the interrupt compare threshold

Parameters
[in]*handlepointer to an ads1115 handle structure
[in]high_thresholdinterrupt high threshold
[in]low_thresholdinterrupt low threshold
Returns
status code
  • 0 success
  • 1 set compare threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1181 of file driver_ads1115.c.