|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
34 #define ADS1220_WREG(_reg, _nb) ((1<<6)|(_reg<<2)|(_nb-1))
35 #define ADS1220_RREG(_reg, _nb) ((1<<5)|(_reg<<2)|(_nb-1))
36 #define ADS1220_RESET 0x06
37 #define ADS1220_START_SYNC 0x08
38 #define ADS1220_POWERDOWN 0x02
39 #define ADS1220_RDATA 0x10
42 #define ADS1220_CONF0 0x0
43 #define ADS1220_CONF1 0x1
44 #define ADS1220_CONF2 0x2
45 #define ADS1220_CONF3 0x3
enum SPIClockDiv cdiv
prescaler of main clock to use as SPI clock
void ads1220_configure(struct Ads1220 *ads)
enum SPIClockPolarity cpol
clock polarity control
volatile bool data_available
data ready flag
enum Ads1220Mux mux
input multiplexer
volatile uint8_t tx_buf[ADS1220_BUFFER_LEN]
transmit buffer
uint16_t output_length
number of data words to write
void ads1220_event(struct Ads1220 *ads)
struct Ads1220Config config
configuration
enum Ads1220Imux i2mux
IDAC routing 2.
struct spi_periph * spi_p
spi peripheral
@ SPISelectUnselect
slave is selected before transaction and unselected after
static void ads1220_send_config(struct Ads1220 *ads)
bool pga_bypass
bypass PGA (PGA enabled = 0)
enum SPIBitOrder bitorder
MSB/LSB order.
volatile uint8_t * output_buf
pointer to transmit buffer for DMA
SPI peripheral structure.
enum SPISlaveSelect select
slave selection behavior
enum Ads1220Gain gain
gain
volatile uint8_t rx_buf[ADS1220_BUFFER_LEN]
receive buffer
@ SPICpolIdleLow
CPOL = 0.
struct spi_transaction spi_trans
spi transaction
enum SPIClockPhase cpha
clock phase control
SPICallback after_cb
NULL or function called after the transaction.
bool spi_submit(struct spi_periph *p, struct spi_transaction *t)
Submit SPI transaction.
enum Ads1220VRef vref
voltage ref
uint16_t input_length
number of data words to read
enum SPIDataSizeSelect dss
data transfer word size
void ads1220_init(struct Ads1220 *ads, struct spi_periph *spi_p, uint8_t slave_idx)
uint8_t slave_idx
slave id: SPI_SLAVE0 to SPI_SLAVE4
enum Ads1220SampleRate rate
data output rate
#define ADS1220_WREG(_reg, _nb)
enum Ads1220ConfStatus status
config status
volatile uint8_t * input_buf
pointer to receive buffer for DMA
enum Ads1220Idac idac
IDAC config.
void ads1220_read(struct Ads1220 *ads)
SPICallback before_cb
NULL or function called before the transaction.
uint32_t data
raw ADC value
enum Ads1220Imux i1mux
IDAC routing 1.
enum SPITransactionStatus status
enum Ads1220ConvMode conv
conversion mode