Da Vinci Firmware 1
Firmware for the DaVinci-M rocket avionics board.
Loading...
Searching...
No Matches
bmp3.h
Go to the documentation of this file.
1
44#ifndef _BMP3_H
45#define _BMP3_H
46
47/* Header includes */
48#include "bmp3_defs.h"
49
50
51
53#ifdef __cplusplus
54extern "C" {
55#endif
56
80int8_t bmp3_init(struct bmp3_dev *dev);
81
103int8_t bmp3_soft_reset(struct bmp3_dev *dev);
104
154int8_t bmp3_set_sensor_settings(uint32_t desired_settings, struct bmp3_settings *settings, struct bmp3_dev *dev);
155
174int8_t bmp3_get_sensor_settings(struct bmp3_settings *settings, struct bmp3_dev *dev);
175
211int8_t bmp3_set_op_mode(struct bmp3_settings *settings, struct bmp3_dev *dev);
212
239int8_t bmp3_get_op_mode(uint8_t *op_mode, struct bmp3_dev *dev);
240
281int8_t bmp3_get_sensor_data(uint8_t sensor_comp, struct bmp3_data *data, struct bmp3_dev *dev);
282
309int8_t bmp3_set_regs(uint8_t *reg_addr, const uint8_t *reg_data, uint32_t len, struct bmp3_dev *dev);
310
329int8_t bmp3_get_regs(uint8_t reg_addr, uint8_t *reg_data, uint32_t len, struct bmp3_dev *dev);
330
380//int8_t bmp3_set_fifo_settings(uint16_t desired_settings,
381// const struct bmp3_fifo_settings *fifo_settings,
382// struct bmp3_dev *dev);
383//
385// * \ingroup bmp3ApiFIFO
386// * \page bmp3_api_bmp3_get_fifo_settings bmp3_get_fifo_settings
387// * \code
388// * int8_t bmp3_get_fifo_settings(struct bmp3_fifo_settings *fifo_settings, struct bmp3_dev *dev);
389// * \endcode
390// * @details This API gets the fifo_config_1(fifo_mode,
391// * fifo_stop_on_full, fifo_time_en, fifo_press_en, fifo_temp_en),
392// * fifo_config_2(fifo_subsampling, data_select) and int_ctrl(fwtm_en, ffull_en)
393// * settings from the sensor.
394// *
395// * @param[in] fifo_settings : Structure instance of bmp3_fifo_settings
396// * @param[in] dev : Structure instance of bmp3_dev.
397// *
398// * @return Result of API execution status
399// * @retval 0 -> Success
400// * @retval >0 -> Warning
401// * @retval <0 -> Error
402// */
403//int8_t bmp3_get_fifo_settings(struct bmp3_fifo_settings *fifo_settings, struct bmp3_dev *dev);
404//
406// * \ingroup bmp3ApiFIFO
407// * \page bmp3_api_bmp3_get_fifo_data bmp3_get_fifo_data
408// * \code
409// * int8_t bmp3_get_fifo_data(struct bmp3_fifo_data *fifo,
410// * const struct bmp3_fifo_settings *fifo_settings,
411// * struct bmp3_dev *dev);
412// * \endcode
413// * @details This API gets the fifo data from the sensor.
414// *
415// * @param[in,out] fifo : Structure instance of bmp3_fifo_data
416// * @param[in] fifo_settings : Structure instance of bmp3_fifo_settings
417// * @param[in] dev : Structure instance of bmp3_dev
418// *
419// * @return Result of API execution status.
420// * @retval 0 -> Success
421// * @retval >0 -> Warning
422// * @retval <0 -> Error
423// */
424//int8_t bmp3_get_fifo_data(struct bmp3_fifo_data *fifo,
425// const struct bmp3_fifo_settings *fifo_settings,
426// struct bmp3_dev *dev);
427//
429// * \ingroup bmp3ApiFIFO
430// * \page bmp3_api_bmp3_get_fifo_length bmp3_get_fifo_length
431// * \code
432// * int8_t bmp3_get_fifo_length(uint16_t *fifo_length, struct bmp3_dev *dev);
433// * \endcode
434// * @details This API gets the fifo length from the sensor.
435// *
436// * @param[out] fifo_length : Variable used to store the fifo length.
437// * @param[in] dev : Structure instance of bmp3_dev.
438// *
439// * @return Result of API execution status.
440// * @retval 0 -> Success
441// * @retval >0 -> Warning
442// * @retval <0 -> Error
443// */
444//int8_t bmp3_get_fifo_length(uint16_t *fifo_length, struct bmp3_dev *dev);
445//
447// * \ingroup bmp3ApiFIFO
448// * \page bmp3_api_bmp3_extract_fifo_data bmp3_extract_fifo_data
449// * \code
450// * int8_t bmp3_extract_fifo_data(struct bmp3_data *data, struct bmp3_fifo_data *fifo, struct bmp3_dev *dev);
451// * \endcode
452// * @details This API extracts the temperature and/or pressure data from the FIFO
453// * data which is already read from the fifo.
454// *
455// * @param[out] data : Array of bmp3_data structures where the temperature
456// * and pressure frames will be stored.
457// * @param[in] fifo : Structure instance of bmp3_fifo_data
458// * @param[in] dev : Structure instance of bmp3_dev
459// *
460// * @return Result of API execution status.
461// * @retval 0 -> Success
462// * @retval <0 -> Error
463// */
464//int8_t bmp3_extract_fifo_data(struct bmp3_data *data, struct bmp3_fifo_data *fifo, struct bmp3_dev *dev);
465//
467// * \ingroup bmp3ApiFIFO
468// * \page bmp3_api_bmp3_set_fifo_watermark bmp3_set_fifo_watermark
469// * \code
470// * int8_t bmp3_set_fifo_watermark(const struct bmp3_fifo_data *fifo,
471// * const struct bmp3_fifo_settings *fifo_settings,
472// * struct bmp3_dev *dev);
473// * \endcode
474// * @details This API sets the fifo watermark length according to the frames count
475// * set by the user in the device structure. Refer below for usage.
476// *
477// * @note: fifo.req_frames = 50;
478// *
479// * @param[in] fifo : Structure instance of bmp3_fifo_data
480// * @param[in] fifo_settings : Structure instance of bmp3_fifo_settings
481// * @param[in] dev : Structure instance of bmp3_dev
482// *
483// * @return Result of API execution status.
484// * @retval 0 -> Success
485// * @retval <0 -> Error
486// */
487//int8_t bmp3_set_fifo_watermark(const struct bmp3_fifo_data *fifo,
488// const struct bmp3_fifo_settings *fifo_settings,
489// struct bmp3_dev *dev);
490//
492// * \ingroup bmp3ApiFIFO
493// * \page bmp3_api_bmp3_get_fifo_watermark bmp3_get_fifo_watermark
494// * \code
495// * int8_t bmp3_get_fifo_watermark(uint16_t *watermark_len, struct bmp3_dev *dev);
496// * \endcode
497// * @details This API gets the fifo watermark length according to the frames count
498// * set by the user in the device structure
499// *
500// * @param[in] watermark_len : Watermark level value
501// * @param[in] dev : Structure instance of bmp3_dev
502// *
503// * @return Result of API execution status.
504// * @retval 0 -> Success
505// * @retval <0 -> Error
506// */
507//int8_t bmp3_get_fifo_watermark(uint16_t *watermark_len, struct bmp3_dev *dev);
508//
510// * \ingroup bmp3ApiFIFO
511// * \page bmp3_api_bmp3_fifo_flush bmp3_fifo_flush
512// * \code
513// * int8_t bmp3_fifo_flush(const struct bmp3_dev *dev);
514// * \endcode
515// * @details This API performs fifo flush
516// *
517// * @param[in] dev : Structure instance of bmp3_dev.
518// *
519// * @return Result of API execution status
520// * @retval 0 -> Success
521// * @retval >0 -> Warning
522// * @retval <0 -> Error
523// */
524//int8_t bmp3_fifo_flush(struct bmp3_dev *dev);
525
550int8_t bmp3_get_status(struct bmp3_status *status, struct bmp3_dev *dev);
551
552#ifdef __cplusplus
553}
554#endif /* End of CPP guard */
555
556#endif /* _BMP3_H */
int8_t bmp3_get_sensor_data(uint8_t sensor_comp, struct bmp3_data *data, struct bmp3_dev *dev)
This API reads the pressure, temperature or both data from the sensor, compensates the data and store...
Definition bmp3.c:1428
int8_t bmp3_set_sensor_settings(uint32_t desired_settings, struct bmp3_settings *settings, struct bmp3_dev *dev)
This API sets the power control(pressure enable and temperature enable), over sampling,...
Definition bmp3.c:909
int8_t bmp3_set_op_mode(struct bmp3_settings *settings, struct bmp3_dev *dev)
This API sets the power mode of the sensor.
Definition bmp3.c:1350
int8_t bmp3_get_status(struct bmp3_status *status, struct bmp3_dev *dev)
This API sets the fifo_config_1(fifo_mode, fifo_stop_on_full, fifo_time_en, fifo_press_en,...
Definition bmp3.c:1204
int8_t bmp3_get_regs(uint8_t reg_addr, uint8_t *reg_data, uint32_t len, struct bmp3_dev *dev)
This API reads the data from the given register address of the sensor.
Definition bmp3.c:794
int8_t bmp3_get_op_mode(uint8_t *op_mode, struct bmp3_dev *dev)
This API gets the power mode of the sensor.
Definition bmp3.c:1403
int8_t bmp3_set_regs(uint8_t *reg_addr, const uint8_t *reg_data, uint32_t len, struct bmp3_dev *dev)
This API writes the given data to the register address of the sensor.
Definition bmp3.c:844
int8_t bmp3_soft_reset(struct bmp3_dev *dev)
This API performs the soft reset of the sensor.
Definition bmp3.c:1263
int8_t bmp3_get_sensor_settings(struct bmp3_settings *settings, struct bmp3_dev *dev)
This API gets the power control(power mode, pressure enable and temperature enable),...
Definition bmp3.c:953
int8_t bmp3_init(struct bmp3_dev *dev)
This internal API converts the no. of frames required by the user to bytes so as to write in the wate...
Definition bmp3.c:738
Sensor driver for BMP3 sensor.
bmp3 sensor structure which comprises of temperature and pressure data.
Definition bmp3_defs.h:842
bmp3 device structure
Definition bmp3_defs.h:895
bmp3 device settings
Definition bmp3_defs.h:707
bmp3 status flags
Definition bmp3_defs.h:669