spl06_01.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef SPL06_01_H
  2. #define SPL06_01_H
  3. #define CONTINUOUS_PRESSURE 1
  4. #define CONTINUOUS_TEMPERATURE 2
  5. #define CONTINUOUS_P_AND_T 3
  6. #define PRESSURE_SENSOR 0
  7. #define TEMPERATURE_SENSOR 1
  8. #include <stdint.h>
  9. struct spl0601_calib_param_t {
  10. int16_t c0;
  11. int16_t c1;
  12. int32_t c00;
  13. int32_t c10;
  14. int16_t c01;
  15. int16_t c11;
  16. int16_t c20;
  17. int16_t c21;
  18. int16_t c30;
  19. };
  20. typedef struct spl0601_t {
  21. struct spl0601_calib_param_t calib_param;/**<calibration data*/
  22. uint8_t chip_id; /**<chip id*/
  23. int32_t i32rawPressure;
  24. int32_t i32rawTemperature;
  25. int32_t i32kP;
  26. int32_t i32kT;
  27. struct rt_i2c_bus_device *bus;
  28. } spl0601_t;
  29. int spl0601_init(spl0601_t *hdev, const char *busname);
  30. void spl0601_rateset(spl0601_t *hdev, uint8_t iSensor, uint8_t u8OverSmpl, uint8_t u8SmplRate);
  31. void spl0601_start_temperature(spl0601_t *hdev);
  32. void spl0601_start_pressure(spl0601_t *hdev);
  33. void spl0601_start_continuous(spl0601_t *hdev, uint8_t mode);
  34. void spl0601_get_raw_temp(spl0601_t *hdev);
  35. void spl0601_get_raw_pressure(spl0601_t *hdev);
  36. float spl0601_get_temperature(spl0601_t *hdev);
  37. float spl0601_get_pressure(spl0601_t *hdev);
  38. #endif