Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
spa06.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2026 OpenUAS
3 * Thanks to Florian Sansou florian.sansou@enac.fr for initial implementation
4 *
5 * This file is part of paparazzi.
6 *
7 * paparazzi is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
10 * any later version.
11 *
12 * paparazzi is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with paparazzi; see the file COPYING. If not, see
19 * <http://www.gnu.org/licenses/>.
20 */
21
39#include "peripherals/spa06.h"
40
41/* Oversampling selection: 64x pressure (high precision, ~104ms/conversion) with
42 * 1x temperature (3.6ms; more adds nothing, it only feeds the compensation).
43 * At the 4Hz rates written in spa06_config() this uses ~430ms/s of the sensor's
44 * 1s/s conversion budget. raw_value_scale_factor() adapts automatically. */
45#define SPL06_PRESSURE_OVERSAMPLING SPL06_OVERSAMPLING_64X_P
46#define SPL06_TEMPERATURE_OVERSAMPLING SPL06_OVERSAMPLING_1X_T
47
48/* Reliability limits */
49#define SPA06_BROKEN_RETRY_US 5000000
50#define SPA06_MAX_ERROR_CNT 10
51#define SPA06_PRESSURE_MIN_PA 30000.0f
52#define SPA06_PRESSURE_MAX_PA 120000.0f
53
54/* Local functions: raw data extraction, calibration handling, compensation
55 * and bus access helpers. See the definitions below for details. */
56static void parse_sensor_data(struct spa06_t *spa, volatile uint8_t *data);
57static void parse_calib_data(struct spa06_t *spa, volatile uint8_t *coef);
58static void compensate_pressure(struct spa06_t *spa);
59static bool spa06_config(struct spa06_t *spa);
60static bool spa06_get_calib(struct spa06_t *spa);
62static void spa06_register_write(struct spa06_t *spa, uint8_t reg, uint8_t value);
63static void spa06_register_read(struct spa06_t *spa, uint8_t reg, uint16_t size);
64static int32_t getTwosComplement(uint32_t raw, uint8_t length);
65
71void spa06_init(struct spa06_t *spa)
72{
73 spa->data_available = false;
74 spa->initialized = false;
75 spa->is_broken = false;
76 spa->status = SPA06_STATUS_UNINIT;
77 spa->device = SPA06_UNKNOWN;
78 spa->reset = false;
79 spa->init_error_cnt = 0;
80 spa->config_idx = 0;
81 spa->calib_idx = 0;
82 spa->tmp_coef_srce = 0;
83 spa->timer = 0;
84
85 /* SPI setup */
86 if (spa->bus == SPA06_SPI) {
87 spa->spi.trans.cpol = SPICpolIdleHigh;
88 spa->spi.trans.cpha = SPICphaEdge2;
89 spa->spi.trans.dss = SPIDss8bit;
90 spa->spi.trans.bitorder = SPIMSBFirst;
91 spa->spi.trans.cdiv = SPIDiv16;
92
93 spa->spi.trans.select = SPISelectUnselect;
94 spa->spi.trans.slave_idx = spa->spi.slave_idx;
95 spa->spi.trans.output_length = 0;
96 spa->spi.trans.input_length = 0;
97 spa->spi.trans.before_cb = NULL;
98 spa->spi.trans.after_cb = NULL;
99 spa->spi.trans.input_buf = spa->spi.rx_buf;
100 spa->spi.trans.output_buf = spa->spi.tx_buf;
101 spa->spi.trans.status = SPITransDone;
102
103 // in SPI read, the first byte is garbage because writing the register address
104 spa->rx_buffer = (volatile uint8_t *)&spa->spi.rx_buf[1];
105 spa->tx_buffer = (volatile uint8_t *)spa->spi.tx_buf;
106 }
107 /* I2C setup */
108 else {
109
110 spa->i2c.trans.slave_addr = spa->i2c.slave_addr; // slave address
111 spa->i2c.trans.status = I2CTransDone; // set initial status: Done
112
113 spa->rx_buffer = spa->i2c.trans.buf;
114 spa->tx_buffer = spa->i2c.trans.buf;
115
116 }
117}
118
132{
133 if (spa->is_broken) {
134 // Back off, but periodically retry a full re-detection instead of giving up forever
136 return;
137 }
138 spa->is_broken = false;
139 spa->init_error_cnt = 0;
140 spa->status = SPA06_STATUS_UNINIT;
141 spa->reset = false;
142 }
143
144 /* Idle */
145 if ((spa->bus == SPA06_SPI && spa->spi.trans.status == SPITransDone) ||
146 (spa->bus == SPA06_I2C && spa->i2c.trans.status == I2CTransDone)) {
147
148 switch (spa->status) {
150 spa->data_available = false;
151 spa->initialized = false;
152 if (spa->reset == false) {
153 spa->config_idx = 0;
154 spa->calib_idx = 0;
156 spa->timer = get_sys_time_usec();
157 spa->reset = true;
158 }
159 if (spa->reset == true) {
160 // Unsigned arithmetic handles a wrap-around of the time counter
162 if (diff_val < 40000) {
163 spa->status = SPA06_STATUS_UNINIT; //Stay in uninit state for 40ms after reset
164 break;
165 }
166 spa->reset = false;
167 spa->status = SPA06_STATUS_IDLE;
168 }
169 break;
170
172 /* Request WHO_AM_I */
174 break;
175
176
179 break;
180
183 break;
184
186 // request calibration data
187 if (spa06_get_calib(spa)) {
188 spa->status = SPA06_STATUS_CONFIGURE;
189 }
190 //process in spa06_event()
191 break;
192
194 if (spa06_config(spa)) {
196 spa->initialized = true;
197 spa->init_error_cnt = 0;
198 }
199 break;
200
202 // READ THE STATUS BYTE
204 break;
205
207 // READ ALL 6 DATA REGISTERS
209 break;
210
211 default:
212 break;
213 }
214 }
215}
216
231{
232 /* Successful transfer */
233 if ((spa->bus == SPA06_SPI && spa->spi.trans.status == SPITransSuccess) ||
234 (spa->bus == SPA06_I2C && spa->i2c.trans.status == I2CTransSuccess)) {
235 switch (spa->status) {
237 spa->reset = true; // Reset command acknowledged, wait for the sensor to restart
238 break;
239
240 case SPA06_STATUS_IDLE: {
241 /* WHO_AM_I */
242 uint8_t chip_id = spa->rx_buffer[0];
243 if (chip_id == SPA06_CHIP_ID) {
244 spa->device = SPA06;
245 spa->status = SPA06_STATUS_INIT_OK;
246 spa->init_error_cnt = 0;
247 } else if (chip_id == SPL06_CHIP_ID) {
248 spa->device = SPL06;
249 spa->status = SPA06_STATUS_INIT_OK;
250 spa->init_error_cnt = 0;
251 } else {
252 // Invalid chip ID, sensor might be disconnected or corrupt
253 spa->init_error_cnt++;
254 if (spa->init_error_cnt >= SPA06_MAX_ERROR_CNT) {
255 spa->is_broken = true; // Back off, retried after SPA06_BROKEN_RETRY_US
256 spa->timer = get_sys_time_usec();
257 } else {
258 spa->status = SPA06_STATUS_UNINIT;
259 spa->reset = false;
260 }
261 }
262 break;
263 }
264
266 uint8_t status = spa->rx_buffer[0];
270 }
271 break;
272 }
273
275 // The temperature measurement must use the same sensor as was used for
276 // the factory calibration coefficients (TMP_COEF_SRCE, mirrored into TMP_CFG bit 7)
277 spa->tmp_coef_srce = spa->rx_buffer[0] & SPL06_COEF_SRCE_BIT_TMP_COEF_SRCE;
278 spa->status = SPA06_STATUS_GET_CALIB;
279 break;
280
282 // compute calib
283 parse_calib_data(spa, &spa->rx_buffer[0]);
284 break;
285
287 /* Do nothing. We let spa06_periodic() detect that the transaction
288 is I2CTransDone and submit the next config on the next tick */
289 break;
290
292 // check status byte
296 }
297 break;
298
300 // parse sensor data, compensate temperature first, then pressure
301 parse_sensor_data(spa, &spa->rx_buffer[0]);
303 spa->init_error_cnt = 0; // successful transaction, reset the consecutive failure counter
304 // Only publish values within the specified measurement range of the sensor,
305 // anything outside means the data got corrupted on its way here
306 if ((spa->pressure >= SPA06_PRESSURE_MIN_PA) && (spa->pressure <= SPA06_PRESSURE_MAX_PA)) {
307 spa->data_available = true;
308 }
310 break;
311
312 default:
313 break;
314 }
315 if (spa->bus == SPA06_I2C) {
316 spa->i2c.trans.status = I2CTransDone;
317 } else {
318 spa->spi.trans.status = SPITransDone;
319 }
320
321 } else if ((spa->bus == SPA06_SPI && spa->spi.trans.status == SPITransFailed) ||
322 (spa->bus == SPA06_I2C && spa->i2c.trans.status == I2CTransFailed)) {
323 spa->init_error_cnt++;
324 if (!spa->initialized) {
325 /* Failure during initialization: count and eventually back off */
326 if (spa->init_error_cnt >= SPA06_MAX_ERROR_CNT) {
327 spa->is_broken = true; // Back off, retried after SPA06_BROKEN_RETRY_US
328 spa->timer = get_sys_time_usec();
329 }
330 spa->status = SPA06_STATUS_UNINIT;
331 spa->reset = false; // Ensure reset sequence runs again
332 // Hot-swap address (0xEC <-> 0xEE) on init failure to prevent deadlocking the I2C queue on wrong assignments
333 if (spa->bus == SPA06_I2C && !spa->is_broken) {
334 spa->i2c.slave_addr = (spa->i2c.slave_addr == SPA06_I2C_ADDR) ? SPA06_I2C_ADDR_ALT : SPA06_I2C_ADDR;
335 }
336 } else if (spa->init_error_cnt >= SPA06_MAX_ERROR_CNT) {
337 /* Too many consecutive failures during measurements: full re-initialization */
338 spa->initialized = false;
339 spa->data_available = false;
340 spa->init_error_cnt = 0;
341 spa->status = SPA06_STATUS_UNINIT;
342 spa->reset = false;
343 }
344 /* Otherwise a transient failure simply retries the current read on the next periodic tick */
345
346 if (spa->bus == SPA06_I2C) {
347 spa->i2c.trans.status = I2CTransDone;
348 } else {
349 spa->spi.trans.status = SPITransDone;
350 }
351 }
352
353 return;
354}
355
361static void parse_sensor_data(struct spa06_t *spa, volatile uint8_t *data)
362{
363 spa->raw_pressure = getTwosComplement(((uint32_t)data[0] << 16) | ((uint32_t)data[1] << 8) | (uint32_t)data[2], 24);
364 spa->raw_temperature = getTwosComplement(((uint32_t)data[3] << 16) | ((uint32_t)data[4] << 8) | (uint32_t)data[5], 24);
365}
366
367
379static void parse_calib_data(struct spa06_t *spa, volatile uint8_t *coef)
380{
381 switch (spa->calib_idx) {
382 case 0:
383 // 0x11 c0 [3:0] + 0x10 c0 [11:4]
384 spa->calib.c0 = getTwosComplement(((uint32_t)coef[0] << 4) | (((uint32_t)coef[1] >> 4) & 0x0F), 12);
385 // 0x11 c1 [11:8] + 0x12 c1 [7:0]
386 spa->calib.c1 = getTwosComplement((((uint32_t)coef[1] & 0x0F) << 8) | (uint32_t)coef[2], 12);
387
388 // 0x13 c00 [19:12] + 0x14 c00 [11:4] + 0x15 c00 [3:0]
389 spa->calib.c00 = getTwosComplement(((uint32_t)coef[3] << 12) | ((uint32_t)coef[4] << 4) | (((
390 uint32_t)coef[5] >> 4) & 0x0F), 20);
391
392 // 0x15 c10 [19:16] + 0x16 c10 [15:8] + 0x17 c10 [7:0]
393 spa->calib.c10 = getTwosComplement((((uint32_t)coef[5] & 0x0F) << 16) | ((uint32_t)coef[6] << 8) | (uint32_t)coef[7],
394 20);
395 spa->calib_idx++;
396 break;
397 case 1:
398 // 0x18 c01 [15:8] + 0x19 c01 [7:0]
399 spa->calib.c01 = getTwosComplement(((uint32_t)coef[0] << 8) | (uint32_t)coef[1], 16);
400
401 // 0x1A c11 [15:8] + 0x1B c11 [7:0]
402 spa->calib.c11 = getTwosComplement(((uint32_t)coef[2] << 8) | (uint32_t)coef[3], 16);
403
404 // 0x1C c20 [15:8] + 0x1D c20 [7:0]
405 spa->calib.c20 = getTwosComplement(((uint32_t)coef[4] << 8) | (uint32_t)coef[5], 16);
406
407 // 0x1E c21 [15:8] + 0x1F c21 [7:0]
408 spa->calib.c21 = getTwosComplement(((uint32_t)coef[6] << 8) | (uint32_t)coef[7], 16);
409 spa->calib_idx++;
410 break;
411 case 2:
412 // 0x20 c30 [15:8] + 0x21 c30 [7:0]
413 spa->calib.c30 = getTwosComplement(((uint32_t)coef[0] << 8) | (uint32_t)coef[1], 16);
414 if (spa->device == SPA06) {
415 // 0x22 c31 [11:4] + 0x23 c31 [3:0]
416 spa->calib.c31 = getTwosComplement(((uint32_t)coef[2] << 4) | (((uint32_t)coef[3] >> 4) & 0x0F), 12);
417 // 0x23 c40 [11:8] + 0x24 c40 [7:0]
418 spa->calib.c40 = getTwosComplement((((uint32_t)coef[3] & 0x0F) << 8) | (uint32_t)coef[4], 12);
419 } else {
420 // The SPL06 has no c31 and c40 coefficients
421 spa->calib.c31 = 0;
422 spa->calib.c40 = 0;
423 }
424 spa->calib_idx++;
425 break;
426 default:
427 break;
428 }
429}
430
431
441static void compensate_pressure(struct spa06_t *spa)
442{
443 // Calculate scaled measurement results.
446
447 // Full SPA06 compensation polynomial (datasheet section 4.9.1); c31 and c40
448 // are zero on the SPL06, so this reduces exactly to the SPL06 formula
449 spa->pressure = spa->calib.c00 + Praw_sc * (spa->calib.c10 + Praw_sc * (spa->calib.c20 + Praw_sc *
450 (spa->calib.c30 + Praw_sc * spa->calib.c40))) + Traw_sc * spa->calib.c01 + Traw_sc * Praw_sc *
451 (spa->calib.c11 + Praw_sc * (spa->calib.c21 + Praw_sc * spa->calib.c31));
452
453 // See section 4.9.2, How to Calculate Compensated Temperature Values, of datasheet
454 spa->temperature = spa->calib.c0 * 0.5f + spa->calib.c1 * Traw_sc;
455}
456
469static bool spa06_config(struct spa06_t *spa)
470{
471 // Only one transaction can be made per call to the periodic function
472 switch (spa->config_idx) {
473 case 0:
474 // PRS_CFG: pressure measurement rate (4 Hz) and oversampling
476 spa->config_idx++;
477 break;
478
479 case 1:
480 // TMP_CFG: temperature measurement rate (4 Hz), oversampling and calibration temperature source
483 spa->config_idx++;
484 break;
485
486 case 2: {
488 if (SPL06_TEMPERATURE_OVERSAMPLING > 3) { //SPL06_OVERSAMPLING_8X_T = 0x03
490 }
491 if (SPL06_PRESSURE_OVERSAMPLING > 3) { // SPL06_OVERSAMPLING_8X_P = 0x03
493 }
495 spa->config_idx++;
496 break;
497 }
498
499 case 3:
501 spa->config_idx++;
502 break;
503
504 default:
505 return true;
506 }
507 return false;
508}
509
523static bool spa06_get_calib(struct spa06_t *spa)
524{
525 switch (spa->calib_idx) {
526 case 0:
528 break;
529 case 1:
531 break;
532 case 2:
533 // c30 (0x20-0x21); the SPA06 additionally has c31 and c40 (0x22-0x24).
534 // Strictly read only the registers that exist on the detected device.
535 spa06_register_read(spa, SPL06_REG_CALIB_COEFFS_START + 16, (spa->device == SPA06) ? 5 : 2);
536 break;
537 default:
538 return true;
539 }
540 return false;
541}
542
552{
553 // From the datasheet page 13
554 switch (oversampling) {
555 case 0: return 524288;
556 case 1: return 1572864;
557 case 2: return 3670016;
558 case 3: return 7864320;
559 case 4: return 253952;
560 case 5: return 516096;
561 case 6: return 1040384;
562 case 7: return 2088960;
563 default: return -1; // invalid
564 }
565}
566
567
577static void spa06_register_write(struct spa06_t *spa, uint8_t reg, uint8_t value)
578{
579
580 if (spa->bus == SPA06_SPI) {
581 /* Never touch the buffers of a transaction that is still in flight */
582 if (spa->spi.trans.status != SPITransDone) return;
583 /* SPI transaction */
584 spa->tx_buffer[0] = (reg & 0x7F); //write command (bit 7 = RW = '0')
585 spa->tx_buffer[1] = value;
586 spa->spi.trans.output_length = 2;
587 spa->spi.trans.input_length = 0;
588 spi_submit(spa->spi.p, &(spa->spi.trans));
589 } else {
590 if (spa->i2c.trans.status != I2CTransDone) return;
591 /* I2C transaction */
592 spa->tx_buffer[0] = reg;
593 spa->tx_buffer[1] = value;
594 i2c_transmit(spa->i2c.p, &(spa->i2c.trans), spa->i2c.slave_addr, 2);
595 }
596}
597
608static void spa06_register_read(struct spa06_t *spa, uint8_t reg, uint16_t size)
609{
610
611
612 if (spa->bus == SPA06_SPI) {
613 /* Never touch the buffers of a transaction that is still in flight */
614 if (spa->spi.trans.status != SPITransDone) return;
615 /* Guard against receive buffer overflow */
616 if ((size + 1u) > sizeof(spa->spi.rx_buf)) return;
617 /* SPI transaction */
618 spa->tx_buffer[0] = reg | SPL06_READ_FLAG ;
619 spa->spi.trans.output_length = 2;
620 spa->spi.trans.input_length = size + 1; // already 1 is added for the transmission of the register to read
621 spa->tx_buffer[1] = 0;
622 spi_submit(spa->spi.p, &(spa->spi.trans));
623 } else {
624 if (spa->i2c.trans.status != I2CTransDone) return;
625 /* Guard against receive buffer overflow */
626 if (size > I2C_BUF_LEN) return;
627 /* I2C transaction */
628 spa->tx_buffer[0] = reg ;
629 i2c_transceive(spa->i2c.p, &(spa->i2c.trans), spa->i2c.slave_addr, 1, size);
630 }
631}
632
640{
641 if (raw & (1U << (length - 1))) {
642 return ((int32_t)raw) - ((int32_t)1 << length);
643 }
644 return raw;
645}
static uint8_t status
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
#define I2C_BUF_LEN
I2C buffer length.
Definition i2c.h:85
bool i2c_transmit(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len)
Submit a write only transaction.
Definition i2c.c:202
bool i2c_transceive(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len_w, uint16_t len_r)
Submit a write/read transaction.
Definition i2c.c:222
@ I2CTransSuccess
transaction successfully finished by I2C driver
Definition i2c.h:58
@ I2CTransFailed
transaction failed
Definition i2c.h:59
@ I2CTransDone
transaction set to done by user level
Definition i2c.h:60
bool spi_submit(struct spi_periph *p, struct spi_transaction *t)
Submit SPI transaction.
Definition spi_arch.c:544
@ SPICphaEdge2
CPHA = 1.
Definition spi.h:71
@ SPITransFailed
Definition spi.h:96
@ SPITransSuccess
Definition spi.h:95
@ SPITransDone
Definition spi.h:97
@ SPICpolIdleHigh
CPOL = 1.
Definition spi.h:80
@ SPISelectUnselect
slave is selected before transaction and unselected after
Definition spi.h:59
@ SPIMSBFirst
Definition spi.h:108
@ SPIDiv16
Definition spi.h:119
@ SPIDss8bit
Definition spi.h:86
uint16_t foo
Definition main_demo5.c:58
static void parse_calib_data(struct spa06_t *spa, volatile uint8_t *coef)
Unpack one chunk of calibration coefficient bytes.
Definition spa06.c:379
static int32_t raw_value_scale_factor(uint8_t oversampling)
Scale factor for raw values at a given oversampling setting.
Definition spa06.c:551
static void parse_sensor_data(struct spa06_t *spa, volatile uint8_t *data)
Extract the raw 24-bit pressure and temperature measurements.
Definition spa06.c:361
void spa06_init(struct spa06_t *spa)
Initialize the spa06 sensor instance.
Definition spa06.c:71
void spa06_event(struct spa06_t *spa)
Should be called in the event thread.
Definition spa06.c:230
#define SPA06_PRESSURE_MIN_PA
specified measurement range is 300-1200 hPa,
Definition spa06.c:51
#define SPA06_BROKEN_RETRY_US
retry a failed/absent sensor every 5s instead of giving up forever
Definition spa06.c:49
static void compensate_pressure(struct spa06_t *spa)
Convert raw measurements into pressure [Pa] and temperature [deg C].
Definition spa06.c:441
static bool spa06_config(struct spa06_t *spa)
Configure the spa06 device register by register.
Definition spa06.c:469
#define SPA06_PRESSURE_MAX_PA
anything outside means the data got corrupted
Definition spa06.c:52
#define SPA06_MAX_ERROR_CNT
consecutive transaction failures before escalating
Definition spa06.c:50
static bool spa06_get_calib(struct spa06_t *spa)
Request the calibration coefficients, one chunk per call.
Definition spa06.c:523
void spa06_periodic(struct spa06_t *spa)
Should be called periodically to request sensor readings.
Definition spa06.c:131
#define SPL06_PRESSURE_OVERSAMPLING
Definition spa06.c:45
static int32_t getTwosComplement(uint32_t raw, uint8_t length)
Sign-extend a raw two's complement value of arbitrary bit length.
Definition spa06.c:639
static void spa06_register_write(struct spa06_t *spa, uint8_t reg, uint8_t value)
Write a single register over the configured bus (SPI or I2C)
Definition spa06.c:577
#define SPL06_TEMPERATURE_OVERSAMPLING
Definition spa06.c:46
static void spa06_register_read(struct spa06_t *spa, uint8_t reg, uint16_t size)
Read consecutive registers over the configured bus (SPI or I2C)
Definition spa06.c:608
Driver for the Goertek SPA06-003 / SPL06-001 barometer (I2C or SPI)
@ SPA06_UNKNOWN
not (yet) detected
Definition spa06.h:61
@ SPA06
SPA06-003, has the extra c31/c40 calibration coefficients.
Definition spa06.h:62
@ SPL06
SPL06-001.
Definition spa06.h:63
@ SPA06_STATUS_GET_CALIB
read the calibration coefficients (in chunks)
Definition spa06.h:78
@ SPA06_STATUS_READ_STATUS_REG
operational: poll until pressure and temperature are ready
Definition spa06.h:80
@ SPA06_STATUS_UNINIT
restart point: soft reset, then wait 40ms for the sensor to restart
Definition spa06.h:74
@ SPA06_STATUS_READ_DATA_REGS
operational: read the 6 result registers
Definition spa06.h:81
@ SPA06_STATUS_CONFIGURE
write the measurement configuration (register by register)
Definition spa06.h:79
@ SPA06_STATUS_IDLE
read the chip ID to detect the device type
Definition spa06.h:75
@ SPA06_STATUS_INIT_OK
wait for SENSOR_RDY and COEFFS_RDY
Definition spa06.h:76
@ SPA06_STATUS_GET_COEF_SRCE
read which temperature sensor the factory calibration used
Definition spa06.h:77
@ SPA06_SPI
Definition spa06.h:55
@ SPA06_I2C
Definition spa06.h:56
Driver instance state.
Definition spa06.h:110
#define SPL06_REG_PRESSURE_B2
Definition spa06_regs.h:47
#define SPL06_REG_INT_AND_FIFO_CFG
Definition spa06_regs.h:60
#define SPL06_REG_CHIP_ID
Definition spa06_regs.h:65
#define SPL06_PRESSURE_LEN
Definition spa06_regs.h:51
#define SPL06_RESET_BIT_SOFT_RST
Definition spa06_regs.h:64
#define SPL06_PRES_RATE_4HZ
Definition spa06_regs.h:76
#define SPL06_REG_CALIB_COEFFS_START
Definition spa06_regs.h:66
#define SPL06_TEMPERATURE_LEN
Definition spa06_regs.h:56
#define SPL06_REG_PRESSURE_CFG
Definition spa06_regs.h:57
#define SPL06_REG_RST
Definition spa06_regs.h:63
#define SPA06_CHIP_ID
Definition spa06_regs.h:43
#define SPL06_TEMP_RATE_4HZ
Definition spa06_regs.h:84
#define SPL06_REG_TEMPERATURE_CFG
Definition spa06_regs.h:58
#define SPL06_MEAS_CFG_SENSOR_RDY
Definition spa06_regs.h:96
#define SPL06_MEAS_CFG_TEMPERATURE_RDY
Definition spa06_regs.h:95
#define SPL06_READ_FLAG
Definition spa06_regs.h:45
#define SPA06_I2C_ADDR
Definition spa06_regs.h:38
#define SPL06_MEAS_CFG_PRESSURE_RDY
Definition spa06_regs.h:94
#define SPL06_TEMPERATURE_RESULT_BIT_SHIFT
Definition spa06_regs.h:101
#define SPL06_PRESSURE_RESULT_BIT_SHIFT
Definition spa06_regs.h:100
#define SPL06_CHIP_ID
Chip identifiers, register 0x0D: product ID [3:0], revision ID [7:4].
Definition spa06_regs.h:42
#define SPA06_I2C_ADDR_ALT
Definition spa06_regs.h:39
#define SPL06_REG_COEF_SRCE
Definition spa06_regs.h:69
#define SPL06_MEAS_CON_PRE_TEM
Definition spa06_regs.h:91
#define SPL06_COEF_SRCE_BIT_TMP_COEF_SRCE
Definition spa06_regs.h:70
#define SPL06_REG_MODE_AND_STATUS
Definition spa06_regs.h:59
#define SPL06_MEAS_CFG_COEFFS_RDY
Definition spa06_regs.h:97
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.