|
Nexus Embedded Platform 0.1.0
Statically assembled reusable embedded mechanisms
|
BMP280 calibration and explicit forced-conversion driver. More...
#include "nexus/core/time.h"Go to the source code of this file.
Data Structures | |
| struct | nx_bmp280_transport_port_t |
| Synchronous settled SPI transaction port. More... | |
| struct | nx_bmp280_calibration_t |
| Register calibration, owned by one device instance. More... | |
| struct | nx_bmp280_sample_t |
| Output is valid only on successful conversion/compensation. More... | |
| struct | nx_bmp280_t |
| Explicit device context, no Board pins or automatic sampling task. More... | |
Functions | |
| nx_result_t | nx_bmp280_parse_calibration (const uint8_t *bytes, size_t length, nx_bmp280_calibration_t *calibration) |
| Parse the exact 24-byte little-endian calibration block. | |
| nx_result_t | nx_bmp280_compensate (const nx_bmp280_calibration_t *calibration, uint32_t raw_temperature, uint32_t raw_pressure, nx_bmp280_sample_t *sample) |
| Compensate one raw sample using checked integer arithmetic. | |
| nx_result_t | nx_bmp280_init (nx_bmp280_t *device, nx_bmp280_transport_port_t transport, nx_time_us_t deadline) |
| Validate chip ID and load calibration, without scanning. | |
| nx_result_t | nx_bmp280_begin (nx_bmp280_t *device, nx_time_us_t deadline) |
| Start one forced temperature/pressure conversion. | |
| nx_result_t | nx_bmp280_poll (nx_bmp280_t *device, nx_bmp280_sample_t *sample) |
| Poll conversion without an implicit worker or blocking delay. | |
| void | nx_bmp280_stop (nx_bmp280_t *device) |
| Stop software use after all synchronous calls have exited. | |
BMP280 calibration and explicit forced-conversion driver.
Definition in file bmp280.h.
| nx_result_t nx_bmp280_begin | ( | nx_bmp280_t * | device, |
| nx_time_us_t | deadline ) |
Start one forced temperature/pressure conversion.
| [in,out] | device | Initialized non-measuring instance |
| [in] | deadline | Absolute deadline covering conversion and reads |
| nx_result_t nx_bmp280_compensate | ( | const nx_bmp280_calibration_t * | calibration, |
| uint32_t | raw_temperature, | ||
| uint32_t | raw_pressure, | ||
| nx_bmp280_sample_t * | sample ) |
Compensate one raw sample using checked integer arithmetic.
| [in] | calibration | Parsed calibration |
| [in] | raw_temperature | Unsigned 20-bit ADC value |
| [in] | raw_pressure | Unsigned 20-bit ADC value |
| [out] | sample | Written only on success |
| nx_result_t nx_bmp280_init | ( | nx_bmp280_t * | device, |
| nx_bmp280_transport_port_t | transport, | ||
| nx_time_us_t | deadline ) |
Validate chip ID and load calibration, without scanning.
| [out] | device | Zero-initialized unused instance |
| [in] | transport | Synchronous settled port and live monotonic clock |
| [in] | deadline | Absolute deadline for all initialization accesses |
| nx_result_t nx_bmp280_parse_calibration | ( | const uint8_t * | bytes, |
| size_t | length, | ||
| nx_bmp280_calibration_t * | calibration ) |
Parse the exact 24-byte little-endian calibration block.
| [in] | bytes | Register block beginning at 0x88 |
| [in] | length | Must be exactly 24 |
| [out] | calibration | Written only on success |
| nx_result_t nx_bmp280_poll | ( | nx_bmp280_t * | device, |
| nx_bmp280_sample_t * | sample ) |
Poll conversion without an implicit worker or blocking delay.
| [in,out] | device | Instance with a previously started conversion |
| [out] | sample | Written only on SUCCESS |
| void nx_bmp280_stop | ( | nx_bmp280_t * | device | ) |
Stop software use after all synchronous calls have exited.
| [in,out] | device | Quiesced driver instance |