enum SPIClockPolarity cpol
clock polarity control
bool ms5611_calc(struct Ms5611Data *ms)
Calculate temperature and compensated pressure for MS5611.
enum SPIClockDiv cdiv
prescaler of main clock to use as SPI clock
uint16_t output_length
number of data words to write
Measurement Specialties (Intersema) MS5611-01BA and MS5607-02BA03 pressure/temperature sensor interfa...
bool ms5607_calc(struct Ms5611Data *ms)
Calculate temperature and compensated pressure for MS5607.
volatile bool data_available
data ready flag
volatile uint8_t rx_buf[4]
volatile uint8_t tx_buf[1]
bool spi_submit(struct spi_periph *p, struct spi_transaction *t)
Submit SPI transaction.
void ms5611_spi_start_conversion(struct Ms5611_Spi *ms)
enum SPIBitOrder bitorder
MSB/LSB order.
volatile uint8_t * output_buf
pointer to transmit buffer for DMA
enum SPISlaveSelect select
slave selection behavior
bool ms5611_prom_crc_ok(uint16_t *prom)
Check if CRC of PROM data is OK.
#define MS5611_START_CONV_D1
enum SPIClockPhase cpha
clock phase control
SPI peripheral structure.
struct spi_periph * spi_p
void ms5611_spi_event(struct Ms5611_Spi *ms)
int32_t prom_cnt
number of bytes read from PROM
void ms5611_spi_start_configure(struct Ms5611_Spi *ms)
SPICallback after_cb
NULL or function called after the transaction.
bool initialized
config done flag
uint16_t input_length
number of data words to read
bool is_ms5607
TRUE if MS5607, FALSE if MS5611.
struct spi_transaction spi_trans
void ms5611_spi_periodic_check(struct Ms5611_Spi *ms)
Periodic function to ensure proper delay after triggering reset or conversion.
void ms5611_spi_init(struct Ms5611_Spi *ms, struct spi_periph *spi_p, uint8_t slave_idx, bool is_ms5607)
slave is selected before transaction and unselected after
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
SPICallback before_cb
NULL or function called before the transaction.
#define MS5611_SOFT_RESET
#define MS5611_START_CONV_D2
enum SPITransactionStatus status