Paparazzi UAS
v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for the ADS1220 24-bits ADC from TI SPI communication. More...
#include "peripherals/ads1220.h"
Go to the source code of this file.
Macros | |
#define | ADS1220_WREG(_reg, _nb) ((1<<6)|(_reg<<2)|(_nb-1)) |
#define | ADS1220_RREG(_reg, _nb) ((1<<5)|(_reg<<2)|(_nb-1)) |
#define | ADS1220_RESET 0x06 |
#define | ADS1220_START_SYNC 0x08 |
#define | ADS1220_POWERDOWN 0x02 |
#define | ADS1220_RDATA 0x10 |
#define | ADS1220_CONF0 0x0 |
#define | ADS1220_CONF1 0x1 |
#define | ADS1220_CONF2 0x2 |
#define | ADS1220_CONF3 0x3 |
Functions | |
void | ads1220_init (struct Ads1220 *ads, struct spi_periph *spi_p, uint8_t slave_idx) |
static void | ads1220_send_config (struct Ads1220 *ads) |
void | ads1220_configure (struct Ads1220 *ads) |
void | ads1220_read (struct Ads1220 *ads) |
void | ads1220_event (struct Ads1220 *ads) |
Driver for the ADS1220 24-bits ADC from TI SPI communication.
Definition in file ads1220.c.
#define ADS1220_CONF0 0x0 |
Definition at line 42 of file ads1220.c.
Referenced by ads1220_send_config().
#define ADS1220_RESET 0x06 |
Definition at line 36 of file ads1220.c.
Referenced by ads1220_configure().
#define ADS1220_RREG | ( | _reg, | |
_nb | |||
) | ((1<<5)|(_reg<<2)|(_nb-1)) |
#define ADS1220_WREG | ( | _reg, | |
_nb | |||
) | ((1<<6)|(_reg<<2)|(_nb-1)) |
Definition at line 34 of file ads1220.c.
Referenced by ads1220_send_config().
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().
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 80 of file ads1220.c.
References ADS1220_CONF0, ADS1220_WREG, Ads1220::config, Ads1220Config::conv, Ads1220Config::gain, Ads1220Config::i1mux, Ads1220Config::i2mux, Ads1220Config::idac, spi_transaction::input_length, Ads1220Config::mux, spi_transaction::output_length, Ads1220Config::pga_bypass, Ads1220Config::rate, Ads1220::spi_p, spi_submit(), Ads1220::spi_trans, Ads1220::tx_buf, and Ads1220Config::vref.
Referenced by ads1220_configure().