Archive STM32 firmware to legacy/stm32/: - src/, include/, lib/USB_CDC/, platformio.ini, test stubs, flash_firmware.py - test/test_battery_adc.c, test_hw_button.c, test_pid_schedule.c, test_vesc_can.c, test_can_watchdog.c - USB_CDC_BUG.md Rename: stm32_protocol → esp32_protocol, mamba_protocol → balance_protocol, stm32_cmd_node → esp32_cmd_node, stm32_cmd_params → esp32_cmd_params, stm32_cmd.launch.py → esp32_cmd.launch.py, test_stm32_protocol → test_esp32_protocol, test_stm32_cmd_node → test_esp32_cmd_node Content cleanup across all files: - Mamba F722S → ESP32-S3 BALANCE - BlackPill → ESP32-S3 IO - STM32F722/F7xx → ESP32-S3 - stm32Mode/Version/Port → esp32Mode/Version/Port - STM32 State/Mode labels → ESP32 State/Mode - Jetson Nano → Jetson Orin Nano Super - /dev/stm32 → /dev/esp32 - stm32_bridge → esp32_bridge - STM32 HAL → ESP-IDF docs/SALTYLAB.md: - Update "Drone FC Details" to describe ESP32-S3 BALANCE board (Waveshare ESP32-S3 Touch LCD 1.28) - Replace verbose "Self-Balancing Control" STM32 section with brief note pointing to SAUL-TEE-SYSTEM-REFERENCE.md TEAM.md: Update Embedded Firmware Engineer role to ESP32-S3 / ESP-IDF No new functionality — cleanup only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
29 lines
846 B
C
29 lines
846 B
C
#ifndef BMP280_H
|
||
#define BMP280_H
|
||
|
||
#include <stdint.h>
|
||
|
||
/*
|
||
* BMP280 / BME280 barometer driver.
|
||
*
|
||
* Probes I2C1 at 0x76 then 0x77.
|
||
* Returns chip_id (0x58=BMP280, 0x60=BME280) on success, negative if not found.
|
||
* Requires i2c1_init() to have been called first.
|
||
*
|
||
* All I2C operations use 100ms timeouts — init will not hang on missing hardware.
|
||
*/
|
||
int bmp280_init(void);
|
||
void bmp280_read(int32_t *pressure_pa, int16_t *temp_x10);
|
||
|
||
/*
|
||
* BME280-only humidity readout. Call AFTER bmp280_read() (uses cached t_fine).
|
||
* Returns humidity in %RH × 10 (e.g. 500 = 50.0 %RH).
|
||
* Returns -1 if chip is BMP280 (no humidity) or not initialised.
|
||
*/
|
||
int16_t bmp280_read_humidity(void);
|
||
|
||
/* Convert pressure (Pa) to altitude above sea level (cm), ISA p0=101325 Pa. */
|
||
int32_t bmp280_pressure_to_alt_cm(int32_t pressure_pa);
|
||
|
||
#endif /* BMP280_H */
|