Paparazzi UAS
v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for the ADS1220 24-bits ADC from TI SPI communication. More...
Go to the source code of this file.
Data Structures | |
struct | Ads1220Config |
ADS1220 configuration options. More... | |
struct | Ads1220 |
Macros | |
#define | ADS1220_BUFFER_LEN 5 |
Functions | |
void | ads1220_init (struct Ads1220 *ads, struct spi_periph *spi_p, uint8_t slave_idx) |
void | ads1220_configure (struct Ads1220 *ads) |
void | ads1220_read (struct Ads1220 *ads) |
void | ads1220_event (struct Ads1220 *ads) |
static void | ads1220_periodic (struct Ads1220 *ads) |
convenience function: read or start configuration if not already initialized More... | |
Variables | |
static const float | Ads1220GainTable [] |
Driver for the ADS1220 24-bits ADC from TI SPI communication.
Definition in file ads1220.h.
struct Ads1220Config |
Data Fields | ||
---|---|---|
enum Ads1220ConvMode | conv | conversion mode |
enum Ads1220Gain | gain | gain |
enum Ads1220Imux | i1mux | IDAC routing 1. |
enum Ads1220Imux | i2mux | IDAC routing 2. |
enum Ads1220Idac | idac | IDAC config. |
enum Ads1220Mux | mux | input multiplexer |
bool | pga_bypass | bypass PGA (PGA enabled = 0) |
enum Ads1220SampleRate | rate | data output rate |
enum Ads1220ConfStatus | status | config status |
enum Ads1220VRef | vref | voltage ref |
struct Ads1220 |
Data Fields | ||
---|---|---|
struct Ads1220Config | config | configuration |
uint32_t | data | raw ADC value |
volatile bool | data_available | data ready flag |
volatile uint8_t | rx_buf[ADS1220_BUFFER_LEN] | receive buffer |
struct spi_periph * | spi_p | spi peripheral |
struct spi_transaction | spi_trans | spi transaction |
volatile uint8_t | tx_buf[ADS1220_BUFFER_LEN] | transmit buffer |
enum Ads1220ConfStatus |
enum Ads1220ConvMode |
enum Ads1220Gain |
enum Ads1220Idac |
enum Ads1220Imux |
enum Ads1220Mux |
enum Ads1220SampleRate |
enum Ads1220VRef |
void ads1220_configure | ( | struct Ads1220 * | ads | ) |
Definition at line 102 of file ads1220.c.
References ADS1220_INITIALIZING, ADS1220_RESET, ads1220_send_config(), ADS1220_SEND_RESET, ADS1220_UNINIT, Ads1220::config, spi_transaction::input_length, spi_transaction::output_length, Ads1220::spi_p, spi_submit(), Ads1220::spi_trans, SPITransDone, SPITransSuccess, spi_transaction::status, Ads1220Config::status, and Ads1220::tx_buf.
Referenced by ads1220_periodic().
void ads1220_event | ( | struct Ads1220 * | ads | ) |
Definition at line 130 of file ads1220.c.
References ADS1220_INITIALIZED, ADS1220_INITIALIZING, ADS1220_SEND_RESET, ADS1220_UNINIT, Ads1220::config, Ads1220::data, Ads1220::data_available, Ads1220::rx_buf, Ads1220::spi_trans, SPITransDone, SPITransFailed, SPITransSuccess, spi_transaction::status, and Ads1220Config::status.
Referenced by meteo_stick_event().
void ads1220_init | ( | struct Ads1220 * | ads, |
struct spi_periph * | spi_p, | ||
uint8_t | slave_idx | ||
) |
Definition at line 49 of file ads1220.c.
References ADS1220_UNINIT, spi_transaction::after_cb, spi_transaction::before_cb, spi_transaction::bitorder, spi_transaction::cdiv, Ads1220::config, spi_transaction::cpha, spi_transaction::cpol, Ads1220::data, Ads1220::data_available, spi_transaction::dss, spi_transaction::input_buf, spi_transaction::input_length, spi_transaction::output_buf, spi_transaction::output_length, Ads1220::rx_buf, spi_transaction::select, spi_transaction::slave_idx, Ads1220::spi_p, Ads1220::spi_trans, SPICphaEdge2, SPICpolIdleLow, SPIDiv128, SPIDss8bit, SPIMSBFirst, SPISelectUnselect, SPITransDone, spi_transaction::status, Ads1220Config::status, and Ads1220::tx_buf.
Referenced by meteo_stick_init().
|
inlinestatic |
convenience function: read or start configuration if not already initialized
Definition at line 171 of file ads1220.h.
References ads1220_configure(), ADS1220_INITIALIZED, ads1220_read(), Ads1220::config, and Ads1220Config::status.
Referenced by meteo_stick_periodic().
void ads1220_read | ( | struct Ads1220 * | ads | ) |
Definition at line 120 of file ads1220.c.
References ADS1220_INITIALIZED, Ads1220::config, spi_transaction::input_length, spi_transaction::output_length, Ads1220::spi_p, spi_submit(), Ads1220::spi_trans, SPITransDone, spi_transaction::status, and Ads1220Config::status.
Referenced by ads1220_periodic().
|
static |
Definition at line 78 of file ads1220.h.
Referenced by get_diff(), and get_temp().