LibDriver ADS1110
Loading...
Searching...
No Matches
ads1110 base driver function

ads1110 base driver modules More...

Collaboration diagram for ads1110 base driver function:

Data Structures

struct  ads1110_handle_s
 ads1110 handle structure definition More...
struct  ads1110_info_s
 ads1110 information structure definition More...

Typedefs

typedef struct ads1110_handle_s ads1110_handle_t
 ads1110 handle structure definition
typedef struct ads1110_info_s ads1110_info_t
 ads1110 information structure definition

Enumerations

enum  ads1110_address_t {
  ADS1110_ADDRESS0 = 0x90 , ADS1110_ADDRESS1 = 0x92 , ADS1110_ADDRESS2 = 0x94 , ADS1110_ADDRESS3 = 0x96 ,
  ADS1110_ADDRESS4 = 0x98 , ADS1110_ADDRESS5 = 0x9A , ADS1110_ADDRESS6 = 0x9C , ADS1110_ADDRESS7 = 0x9E
}
 ads1110 address enumeration definition More...
enum  ads1110_gain_t { ADS1110_GAIN_1 = 0x00 , ADS1110_GAIN_2 = 0x01 , ADS1110_GAIN_4 = 0x02 , ADS1110_GAIN_8 = 0x03 }
 ads1110 gain enumeration definition More...
enum  ads1110_rate_t { ADS1110_RATE_15SPS = 0x03 , ADS1110_RATE_30SPS = 0x02 , ADS1110_RATE_60SPS = 0x01 , ADS1110_RATE_240SPS = 0x00 }
 ads1110 rate enumeration definition More...

Functions

uint8_t ads1110_info (ads1110_info_t *info)
 get chip's information
uint8_t ads1110_set_addr_pin (ads1110_handle_t *handle, ads1110_address_t addr_pin)
 set the iic address pin
uint8_t ads1110_get_addr_pin (ads1110_handle_t *handle, ads1110_address_t *addr_pin)
 get the iic address pin
uint8_t ads1110_init (ads1110_handle_t *handle)
 initialize the chip
uint8_t ads1110_deinit (ads1110_handle_t *handle)
 close the chip
uint8_t ads1110_single_read (ads1110_handle_t *handle, int16_t *raw, float *v)
 read data from the chip once
uint8_t ads1110_continuous_read (ads1110_handle_t *handle, int16_t *raw, float *v)
 read data from the chip continuously
uint8_t ads1110_start_continuous_read (ads1110_handle_t *handle)
 start the chip reading
uint8_t ads1110_stop_continuous_read (ads1110_handle_t *handle)
 stop the chip reading
uint8_t ads1110_set_rate (ads1110_handle_t *handle, ads1110_rate_t rate)
 set the sample rate
uint8_t ads1110_get_rate (ads1110_handle_t *handle, ads1110_rate_t *rate)
 get the sample rate
uint8_t ads1110_set_gain (ads1110_handle_t *handle, ads1110_gain_t gain)
 set adc gain
uint8_t ads1110_get_gain (ads1110_handle_t *handle, ads1110_gain_t *gain)
 get adc gain

Detailed Description

ads1110 base driver modules

Typedef Documentation

◆ ads1110_handle_t

ads1110 handle structure definition

◆ ads1110_info_t

ads1110 information structure definition

Enumeration Type Documentation

◆ ads1110_address_t

ads1110 address enumeration definition

Enumerator
ADS1110_ADDRESS0 

A2A1A0 000

ADS1110_ADDRESS1 

A2A1A0 001

ADS1110_ADDRESS2 

A2A1A0 010

ADS1110_ADDRESS3 

A2A1A0 011

ADS1110_ADDRESS4 

A2A1A0 100

ADS1110_ADDRESS5 

A2A1A0 101

ADS1110_ADDRESS6 

A2A1A0 110

ADS1110_ADDRESS7 

A2A1A0 111

Definition at line 62 of file driver_ads1110.h.

◆ ads1110_gain_t

ads1110 gain enumeration definition

Enumerator
ADS1110_GAIN_1 

gain 1

ADS1110_GAIN_2 

gain 2

ADS1110_GAIN_4 

gain 4

ADS1110_GAIN_8 

gain 8

Definition at line 77 of file driver_ads1110.h.

◆ ads1110_rate_t

ads1110 rate enumeration definition

Enumerator
ADS1110_RATE_15SPS 

15 samples per second

ADS1110_RATE_30SPS 

30 samples per second

ADS1110_RATE_60SPS 

60 samples per second

ADS1110_RATE_240SPS 

240 samples per second

Definition at line 88 of file driver_ads1110.h.

Function Documentation

◆ ads1110_continuous_read()

uint8_t ads1110_continuous_read ( ads1110_handle_t * handle,
int16_t * raw,
float * v )

read data from the chip continuously

Parameters
[in]*handlepointer to an ads1110 handle structure
[out]*rawpointer to a raw adc buffer
[out]*vpointer to a converted adc buffer
Returns
status code
  • 0 success
  • 1 continuous read failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
this function can be used only after run ads1110_start_continuous_read and can be stopped by ads1110_stop_continuous_read

Definition at line 558 of file driver_ads1110.c.

◆ ads1110_deinit()

uint8_t ads1110_deinit ( ads1110_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to an ads1110 handle structure
Returns
status code
  • 0 success
  • 1 iic deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 power down failed
Note
none

Definition at line 186 of file driver_ads1110.c.

◆ ads1110_get_addr_pin()

uint8_t ads1110_get_addr_pin ( ads1110_handle_t * handle,
ads1110_address_t * addr_pin )

get the iic address pin

Parameters
[in]*handlepointer to an ads1110 handle structure
[out]*addr_pinpointer to a chip iic address pin buffer
Returns
status code
  • 0 success
  • 1 get addr pin failed
  • 2 handle is NULL
Note
none

Definition at line 424 of file driver_ads1110.c.

◆ ads1110_get_gain()

uint8_t ads1110_get_gain ( ads1110_handle_t * handle,
ads1110_gain_t * gain )

get adc gain

Parameters
[in]*handlepointer to an ads1110 handle structure
[out]*gainpointer to an adc gain buffer
Returns
status code
  • 0 success
  • 1 get gain failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 366 of file driver_ads1110.c.

◆ ads1110_get_rate()

uint8_t ads1110_get_rate ( ads1110_handle_t * handle,
ads1110_rate_t * rate )

get the sample rate

Parameters
[in]*handlepointer to an ads1110 handle structure
[out]*ratepointer to an adc sample rate buffer
Returns
status code
  • 0 success
  • 1 get rate failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 284 of file driver_ads1110.c.

◆ ads1110_info()

uint8_t ads1110_info ( ads1110_info_t * info)

get chip's information

Parameters
[out]*infopointer to an ads1110 info structure
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 768 of file driver_ads1110.c.

◆ ads1110_init()

uint8_t ads1110_init ( ads1110_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to an ads1110 handle structure
Returns
status code
  • 0 success
  • 1 iic initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
Note
none

Definition at line 101 of file driver_ads1110.c.

◆ ads1110_set_addr_pin()

uint8_t ads1110_set_addr_pin ( ads1110_handle_t * handle,
ads1110_address_t addr_pin )

set the iic address pin

Parameters
[in]*handlepointer to an ads1110 handle structure
[in]addr_piniic address pin
Returns
status code
  • 0 success
  • 1 set addr pin failed
  • 2 handle is NULL
Note
none

Definition at line 402 of file driver_ads1110.c.

◆ ads1110_set_gain()

uint8_t ads1110_set_gain ( ads1110_handle_t * handle,
ads1110_gain_t gain )

set adc gain

Parameters
[in]*handlepointer to an ads1110 handle structure
[in]gainadc gain
Returns
status code
  • 0 success
  • 1 set gain failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 321 of file driver_ads1110.c.

◆ ads1110_set_rate()

uint8_t ads1110_set_rate ( ads1110_handle_t * handle,
ads1110_rate_t rate )

set the sample rate

Parameters
[in]*handlepointer to an ads1110 handle structure
[in]rateadc sample rate
Returns
status code
  • 0 success
  • 1 set rate failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 239 of file driver_ads1110.c.

◆ ads1110_single_read()

uint8_t ads1110_single_read ( ads1110_handle_t * handle,
int16_t * raw,
float * v )

read data from the chip once

Parameters
[in]*handlepointer to an ads1110 handle structure
[out]*rawpointer to a raw adc buffer
[out]*vpointer to a converted adc buffer
Returns
status code
  • 0 success
  • 1 single read failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 448 of file driver_ads1110.c.

◆ ads1110_start_continuous_read()

uint8_t ads1110_start_continuous_read ( ads1110_handle_t * handle)

start the chip reading

Parameters
[in]*handlepointer to an ads1110 handle structure
Returns
status code
  • 0 success
  • 1 start continuous read failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 631 of file driver_ads1110.c.

◆ ads1110_stop_continuous_read()

uint8_t ads1110_stop_continuous_read ( ads1110_handle_t * handle)

stop the chip reading

Parameters
[in]*handlepointer to an ads1110 handle structure
Returns
status code
  • 0 success
  • 1 stop continuous read failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 674 of file driver_ads1110.c.