|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
34 #define MS2100_DIVISOR_128 2
35 #define MS2100_DIVISOR_256 3
36 #define MS2100_DIVISOR_512 4
37 #define MS2100_DIVISOR_1024 5
39 #ifndef MS2100_DIVISOR
40 #define MS2100_DIVISOR MS2100_DIVISOR_1024
103 #define Int16FromBuf(_buf,_idx) ((int16_t)((_buf[_idx]<<8) | _buf[_idx+1]))
128 if (abs(new_val) < 2000) {
enum SPIClockDiv cdiv
prescaler of main clock to use as SPI clock
void ms2100_read(struct Ms2100 *ms)
send request to read next axis
enum SPIClockPolarity cpol
clock polarity control
uint16_t output_length
number of data words to write
#define Int16FromBuf(_buf, _idx)
volatile uint8_t req_buf[1]
SPI buffer for the command byte.
@ SPISelectUnselect
slave is selected before transaction and unselected after
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
@ SPICpolIdleLow
CPOL = 0.
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.
struct spi_periph * spi_p
uint16_t input_length
number of data words to read
void ms2100_arch_init(void)
enum SPIDataSizeSelect dss
data transfer word size
uint8_t slave_idx
slave id: SPI_SLAVE0 to SPI_SLAVE4
volatile uint8_t * input_buf
pointer to receive buffer for DMA
struct spi_transaction read_trans
volatile uint8_t read_buf[2]
SPI buffer for reading a single axis.
#define INT_VECT3_ZERO(_v)
SPICallback before_cb
NULL or function called before the transaction.
void ms2100_reset_cb(struct spi_transaction *t)
Reset callback.
void ms2100_init(struct Ms2100 *ms, struct spi_periph *spi_p, uint8_t slave_idx)
enum SPITransactionStatus status
void ms2100_event(struct Ms2100 *ms)
struct spi_transaction req_trans