mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-27 05:10:36 +08:00
Updted tests mostly for the spec overview
This commit is contained in:
+2
@@ -8,5 +8,7 @@
|
||||
board_adc start
|
||||
icm42688p -s start
|
||||
ms5611 -s start
|
||||
# Internal compass
|
||||
ist8310 -I start
|
||||
# External compass on GPS1/I2C1: standard compass puck
|
||||
ist8310 -X -b 1 start
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,59 @@
|
||||
## Specifications {#specifications}
|
||||
|
||||
- **Processor**
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
- **Sensors**
|
||||
- **IMU**: TODO: list imu(s)
|
||||
- **Barometer**: TODO: list barometer(s)
|
||||
- **Magnetometer**: TODO: list magnetometer(s)
|
||||
- **Interfaces**
|
||||
- **I2C ports**: TODO: number of I2C ports
|
||||
- **SPI buses**: TODO: number of SPI buses
|
||||
- **USB**: TODO: confirm USB connector type
|
||||
- **Analog battery inputs**: 2
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
- **Electrical Data**
|
||||
- **Operating voltage**: 7.0–55.0 (V)
|
||||
- **USB-C power input**: 4.75–5.25 (V)
|
||||
- **Servo rail**: High-voltage capable, up to 36 (V) (servo rail must be separately powered and does not power the autopilot)
|
||||
- **Power supply**: Triple redundant (POWER1, POWER2, USB-C)
|
||||
- **Mechanical Data**
|
||||
- **Dimensions**: 46 × 64 × 22 (mm)
|
||||
- **Weight**: 75.0 (g)
|
||||
|
||||
<!-- overview-source-data
|
||||
{
|
||||
"board": "test/fixture",
|
||||
"chip_model": "STM32H753",
|
||||
"has_io_board": false,
|
||||
"total_outputs": null,
|
||||
"fmu_servo_outputs": 0,
|
||||
"io_outputs": 0,
|
||||
"has_sd_card": false,
|
||||
"has_ethernet": false,
|
||||
"has_heater": false,
|
||||
"num_i2c_buses": 0,
|
||||
"num_spi_buses": 0,
|
||||
"num_can_buses": 0,
|
||||
"has_usb": false,
|
||||
"sensor_drivers": {
|
||||
"imu": [],
|
||||
"baro": [],
|
||||
"mag": [],
|
||||
"osd": []
|
||||
},
|
||||
"overview_wizard": {
|
||||
"min_voltage": "7.0",
|
||||
"max_voltage": "55.0",
|
||||
"usb_powers_fc": true,
|
||||
"usb_pwr_min_v": "4.75",
|
||||
"usb_pwr_max_v": "5.25",
|
||||
"has_servo_rail": true,
|
||||
"servo_rail_max_v": "36",
|
||||
"width_mm": "46",
|
||||
"length_mm": "64",
|
||||
"height_mm": "22",
|
||||
"weight_g": 75.0
|
||||
}
|
||||
}
|
||||
-->
|
||||
@@ -0,0 +1,55 @@
|
||||
## Specifications {#specifications}
|
||||
|
||||
- **Processor**
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
- **Sensors**
|
||||
- **IMU**: TODO: list imu(s)
|
||||
- **Barometer**: TODO: list barometer(s)
|
||||
- **Magnetometer**: TODO: list magnetometer(s)
|
||||
- **Interfaces**
|
||||
- **I2C ports**: TODO: number of I2C ports
|
||||
- **SPI buses**: TODO: number of SPI buses
|
||||
- **USB**: TODO: confirm USB connector type
|
||||
- **Analog battery inputs**: 2
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
- **Electrical Data**
|
||||
- **Operating voltage**: 4.3–5.4 (V)
|
||||
- **USB-C power input**: 4.75–5.25 (V)
|
||||
- **Servo rail**: Up to 10.5 (V) (servo rail must be separately powered and does not power the autopilot)
|
||||
- **Power supply**: Triple redundant (POWER1, POWER2, USB-C)
|
||||
- **Mechanical Data**
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
|
||||
<!-- overview-source-data
|
||||
{
|
||||
"board": "test/fixture",
|
||||
"chip_model": "STM32H753",
|
||||
"has_io_board": false,
|
||||
"total_outputs": null,
|
||||
"fmu_servo_outputs": 0,
|
||||
"io_outputs": 0,
|
||||
"has_sd_card": false,
|
||||
"has_ethernet": false,
|
||||
"has_heater": false,
|
||||
"num_i2c_buses": 0,
|
||||
"num_spi_buses": 0,
|
||||
"num_can_buses": 0,
|
||||
"has_usb": false,
|
||||
"sensor_drivers": {
|
||||
"imu": [],
|
||||
"baro": [],
|
||||
"mag": [],
|
||||
"osd": []
|
||||
},
|
||||
"overview_wizard": {
|
||||
"min_voltage": "4.3",
|
||||
"max_voltage": "5.4",
|
||||
"usb_powers_fc": true,
|
||||
"usb_pwr_min_v": "4.75",
|
||||
"usb_pwr_max_v": "5.25",
|
||||
"has_servo_rail": true,
|
||||
"servo_rail_max_v": "10.5"
|
||||
}
|
||||
}
|
||||
-->
|
||||
@@ -0,0 +1,48 @@
|
||||
## Specifications {#specifications}
|
||||
|
||||
- **Processor**
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
- **Sensors**
|
||||
- **IMU**: TODO: list imu(s)
|
||||
- **Barometer**: TODO: list barometer(s)
|
||||
- **Magnetometer**: TODO: list magnetometer(s)
|
||||
- **Interfaces**
|
||||
- **I2C ports**: 4 (3 external, 1 internal)
|
||||
- I2C1 (external, GPS1): IST8310 (magnetometer) — on GPS connector
|
||||
- I2C2 (external, POWER): INA226 (power monitor)
|
||||
- I2C3 (internal): BMP388 (barometer)
|
||||
- I2C4 (external): free (no sensor detected)
|
||||
- **SPI buses**: TODO: number of SPI buses
|
||||
- **USB**: TODO: confirm USB connector type
|
||||
- **Analog battery inputs**: 1
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
- **Electrical Data**
|
||||
- **Operating voltage**: TODO: supply voltage range
|
||||
- **Mechanical Data**
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
|
||||
<!-- overview-source-data
|
||||
{
|
||||
"board": "test/fixture",
|
||||
"chip_model": "STM32H753",
|
||||
"has_io_board": false,
|
||||
"total_outputs": null,
|
||||
"fmu_servo_outputs": 0,
|
||||
"io_outputs": 0,
|
||||
"has_sd_card": false,
|
||||
"has_ethernet": false,
|
||||
"has_heater": false,
|
||||
"num_i2c_buses": 4,
|
||||
"num_spi_buses": 0,
|
||||
"num_can_buses": 0,
|
||||
"has_usb": false,
|
||||
"sensor_drivers": {
|
||||
"imu": [],
|
||||
"baro": [],
|
||||
"mag": [],
|
||||
"osd": []
|
||||
},
|
||||
"overview_wizard": null
|
||||
}
|
||||
-->
|
||||
@@ -0,0 +1,46 @@
|
||||
## Specifications {#specifications}
|
||||
|
||||
- **Processor**
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
- **Sensors**
|
||||
- **IMU**: TODO: list imu(s)
|
||||
- **Barometer**: TODO: list barometer(s)
|
||||
- **Magnetometer**: TODO: list magnetometer(s)
|
||||
- **Interfaces**
|
||||
- **I2C ports**: 4 (3 internal, 1 external)
|
||||
- GPS1 (I2C1, external): IST8310 (magnetometer) — on GPS connector
|
||||
- Internal: BMP388 (barometer), RM3100 (magnetometer)
|
||||
- **SPI buses**: TODO: number of SPI buses
|
||||
- **USB**: TODO: confirm USB connector type
|
||||
- **Analog battery inputs**: 1
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
- **Electrical Data**
|
||||
- **Operating voltage**: TODO: supply voltage range
|
||||
- **Mechanical Data**
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
|
||||
<!-- overview-source-data
|
||||
{
|
||||
"board": "test/fixture",
|
||||
"chip_model": "STM32H753",
|
||||
"has_io_board": false,
|
||||
"total_outputs": null,
|
||||
"fmu_servo_outputs": 0,
|
||||
"io_outputs": 0,
|
||||
"has_sd_card": false,
|
||||
"has_ethernet": false,
|
||||
"has_heater": false,
|
||||
"num_i2c_buses": 4,
|
||||
"num_spi_buses": 0,
|
||||
"num_can_buses": 0,
|
||||
"has_usb": false,
|
||||
"sensor_drivers": {
|
||||
"imu": [],
|
||||
"baro": [],
|
||||
"mag": [],
|
||||
"osd": []
|
||||
},
|
||||
"overview_wizard": null
|
||||
}
|
||||
-->
|
||||
@@ -0,0 +1,46 @@
|
||||
## Specifications {#specifications}
|
||||
|
||||
- **Processor**
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
- **Sensors**
|
||||
- **IMU**: TODO: list imu(s)
|
||||
- **Barometer**: TODO: list barometer(s)
|
||||
- **Magnetometer**: TODO: list magnetometer(s)
|
||||
- **Interfaces**
|
||||
- **I2C ports**: 4 (3 internal, 1 external)
|
||||
- TODO: label for I2C bus 1 (I2C1, external): IST8310 (magnetometer)
|
||||
- Internal: BMP388 (barometer), RM3100 (magnetometer)
|
||||
- **SPI buses**: TODO: number of SPI buses
|
||||
- **USB**: TODO: confirm USB connector type
|
||||
- **Analog battery inputs**: 1
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
- **Electrical Data**
|
||||
- **Operating voltage**: TODO: supply voltage range
|
||||
- **Mechanical Data**
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
|
||||
<!-- overview-source-data
|
||||
{
|
||||
"board": "test/fixture",
|
||||
"chip_model": "STM32H753",
|
||||
"has_io_board": false,
|
||||
"total_outputs": null,
|
||||
"fmu_servo_outputs": 0,
|
||||
"io_outputs": 0,
|
||||
"has_sd_card": false,
|
||||
"has_ethernet": false,
|
||||
"has_heater": false,
|
||||
"num_i2c_buses": 4,
|
||||
"num_spi_buses": 0,
|
||||
"num_can_buses": 0,
|
||||
"has_usb": false,
|
||||
"sensor_drivers": {
|
||||
"imu": [],
|
||||
"baro": [],
|
||||
"mag": [],
|
||||
"osd": []
|
||||
},
|
||||
"overview_wizard": null
|
||||
}
|
||||
-->
|
||||
@@ -1,33 +1,24 @@
|
||||
## Specifications {#specifications}
|
||||
|
||||
### Processor
|
||||
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
|
||||
### Sensors
|
||||
|
||||
- **IMU**: TODO: list imu(s)
|
||||
- **Barometer**: TODO: list barometer(s)
|
||||
- **Magnetometer**: IST8310 (I2C, internal), IST8310 (I2C, bus 1, external)
|
||||
|
||||
### Interfaces
|
||||
|
||||
- **I2C ports**: 4
|
||||
- IST8310 (magnetometer, internal)
|
||||
- IST8310 (magnetometer, external, bus 1)
|
||||
- **SPI buses**: TODO: number of SPI buses
|
||||
- **USB**: TODO: confirm USB connector type
|
||||
- **Analog battery inputs**: 1
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
|
||||
### Electrical Data
|
||||
|
||||
- **Input voltage**: TODO: supply voltage range
|
||||
|
||||
### Mechanical Data
|
||||
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
- **Processor**
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
- **Sensors**
|
||||
- **IMU**: TODO: list imu(s)
|
||||
- **Barometer**: TODO: list barometer(s)
|
||||
- **Magnetometer**: IST8310 (I2C, internal), IST8310 (I2C, bus 1, external)
|
||||
- **Interfaces**
|
||||
- **I2C ports**: 4 (3 internal, 1 external)
|
||||
- TODO: label for I2C bus 1 (I2C1, external): IST8310 (magnetometer)
|
||||
- Internal: IST8310 (magnetometer)
|
||||
- **SPI buses**: TODO: number of SPI buses
|
||||
- **USB**: TODO: confirm USB connector type
|
||||
- **Analog battery inputs**: 1
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
- **Electrical Data**
|
||||
- **Operating voltage**: TODO: supply voltage range
|
||||
- **Mechanical Data**
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
|
||||
<!-- overview-source-data
|
||||
{
|
||||
|
||||
@@ -1,34 +1,25 @@
|
||||
## Specifications {#specifications}
|
||||
|
||||
### Processor
|
||||
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
- **IO Processor**: STM32F100 (32-bit Arm® Cortex®-M3, 24 MHz, 8KB SRAM)
|
||||
|
||||
### Sensors
|
||||
|
||||
- **IMU**: TODO: list imu(s)
|
||||
- **Barometer**: TODO: list barometer(s)
|
||||
- **Magnetometer**: TODO: list magnetometer(s)
|
||||
|
||||
### Interfaces
|
||||
|
||||
- **PWM outputs**: 8 (0 FMU + 8 IO)
|
||||
- **I2C ports**: TODO: number of I2C ports
|
||||
- **SPI buses**: TODO: number of SPI buses
|
||||
- **USB**: TODO: confirm USB connector type
|
||||
- **RC input**: SBUS, DSM/DSMX, ST24, SUMD, CRSF, GHST (via IO)
|
||||
- **Analog battery inputs**: 1
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
|
||||
### Electrical Data
|
||||
|
||||
- **Input voltage**: TODO: supply voltage range
|
||||
|
||||
### Mechanical Data
|
||||
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
- **Processor**
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
- **IO Processor**: STM32F100 (32-bit Arm® Cortex®-M3, 24 MHz, 8KB SRAM)
|
||||
- **Sensors**
|
||||
- **IMU**: TODO: list imu(s)
|
||||
- **Barometer**: TODO: list barometer(s)
|
||||
- **Magnetometer**: TODO: list magnetometer(s)
|
||||
- **Interfaces**
|
||||
- **PWM outputs**: 8 (0 FMU + 8 IO)
|
||||
- **I2C ports**: TODO: number of I2C ports
|
||||
- **SPI buses**: TODO: number of SPI buses
|
||||
- **USB**: TODO: confirm USB connector type
|
||||
- **RC input**: SBUS, DSM/DSMX, ST24, SUMD, CRSF, GHST (via IO)
|
||||
- **Analog battery inputs**: 1
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
- **Electrical Data**
|
||||
- **Operating voltage**: TODO: supply voltage range
|
||||
- **Mechanical Data**
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
|
||||
<!-- overview-source-data
|
||||
{
|
||||
|
||||
@@ -1,34 +1,25 @@
|
||||
## Specifications {#specifications}
|
||||
|
||||
### Processor
|
||||
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
- **IO Processor**: STM32F100 (32-bit Arm® Cortex®-M3, 24 MHz, 8KB SRAM)
|
||||
|
||||
### Sensors
|
||||
|
||||
- **IMU**: TODO: list imu(s)
|
||||
- **Barometer**: TODO: list barometer(s)
|
||||
- **Magnetometer**: TODO: list magnetometer(s)
|
||||
|
||||
### Interfaces
|
||||
|
||||
- **PWM outputs**: 8 (0 FMU + 8 IO)
|
||||
- **I2C ports**: TODO: number of I2C ports
|
||||
- **SPI buses**: TODO: number of SPI buses
|
||||
- **USB**: TODO: confirm USB connector type
|
||||
- **RC input**: SBUS, DSM/DSMX, ST24, SUMD, CRSF, GHST, PPM (via IO)
|
||||
- **Analog battery inputs**: 1
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
|
||||
### Electrical Data
|
||||
|
||||
- **Input voltage**: TODO: supply voltage range
|
||||
|
||||
### Mechanical Data
|
||||
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
- **Processor**
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
- **IO Processor**: STM32F100 (32-bit Arm® Cortex®-M3, 24 MHz, 8KB SRAM)
|
||||
- **Sensors**
|
||||
- **IMU**: TODO: list imu(s)
|
||||
- **Barometer**: TODO: list barometer(s)
|
||||
- **Magnetometer**: TODO: list magnetometer(s)
|
||||
- **Interfaces**
|
||||
- **PWM outputs**: 8 (0 FMU + 8 IO)
|
||||
- **I2C ports**: TODO: number of I2C ports
|
||||
- **SPI buses**: TODO: number of SPI buses
|
||||
- **USB**: TODO: confirm USB connector type
|
||||
- **RC input**: SBUS, DSM/DSMX, ST24, SUMD, CRSF, GHST, PPM (via IO)
|
||||
- **Analog battery inputs**: 1
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
- **Electrical Data**
|
||||
- **Operating voltage**: TODO: supply voltage range
|
||||
- **Mechanical Data**
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
|
||||
<!-- overview-source-data
|
||||
{
|
||||
|
||||
@@ -1,31 +1,22 @@
|
||||
## Specifications {#specifications}
|
||||
|
||||
### Processor
|
||||
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
|
||||
### Sensors
|
||||
|
||||
- **IMU**: ICM-42688P
|
||||
- **Barometer**: MS5611
|
||||
- **Magnetometer**: IST8310
|
||||
|
||||
### Interfaces
|
||||
|
||||
- **I2C ports**: TODO: number of I2C ports
|
||||
- **SPI buses**: 3
|
||||
- **USB**: TODO: confirm USB connector type
|
||||
- **Analog battery inputs**: 1
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
|
||||
### Electrical Data
|
||||
|
||||
- **Input voltage**: TODO: supply voltage range
|
||||
|
||||
### Mechanical Data
|
||||
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
- **Processor**
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
- **Sensors**
|
||||
- **IMU**: ICM-42688P
|
||||
- **Barometer**: MS5611
|
||||
- **Magnetometer**: IST8310
|
||||
- **Interfaces**
|
||||
- **I2C ports**: TODO: number of I2C ports
|
||||
- **SPI buses**: 3
|
||||
- **USB**: TODO: confirm USB connector type
|
||||
- **Analog battery inputs**: 1
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
- **Electrical Data**
|
||||
- **Operating voltage**: TODO: supply voltage range
|
||||
- **Mechanical Data**
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
|
||||
<!-- overview-source-data
|
||||
{
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
## Specifications {#specifications}
|
||||
|
||||
- **Processor**
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
- **Sensors**
|
||||
- **IMU**: TODO: list imu(s)
|
||||
- **Barometer**: MS5611 (2)
|
||||
- **Magnetometer**: TODO: list magnetometer(s)
|
||||
- **Interfaces**
|
||||
- **I2C ports**: TODO: number of I2C ports
|
||||
- **SPI buses**: 2
|
||||
- **USB**: TODO: confirm USB connector type
|
||||
- **Analog battery inputs**: 1
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
- **Electrical Data**
|
||||
- **Operating voltage**: TODO: supply voltage range
|
||||
- **Mechanical Data**
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
|
||||
<!-- overview-source-data
|
||||
{
|
||||
"board": "test/fixture",
|
||||
"chip_model": "STM32H753",
|
||||
"has_io_board": false,
|
||||
"total_outputs": null,
|
||||
"fmu_servo_outputs": 0,
|
||||
"io_outputs": 0,
|
||||
"has_sd_card": false,
|
||||
"has_ethernet": false,
|
||||
"has_heater": false,
|
||||
"num_i2c_buses": 0,
|
||||
"num_spi_buses": 2,
|
||||
"num_can_buses": 0,
|
||||
"has_usb": false,
|
||||
"sensor_drivers": {
|
||||
"imu": [],
|
||||
"baro": [
|
||||
"MS5611"
|
||||
],
|
||||
"mag": [],
|
||||
"osd": []
|
||||
},
|
||||
"overview_wizard": {
|
||||
"baro": [
|
||||
"MS5611",
|
||||
"MS5611"
|
||||
]
|
||||
}
|
||||
}
|
||||
-->
|
||||
@@ -1,33 +1,24 @@
|
||||
## Specifications {#specifications}
|
||||
|
||||
### Processor
|
||||
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
|
||||
### Sensors
|
||||
|
||||
- **IMU**: ICM-42688P (SPI)
|
||||
- **Barometer**: MS5611 (SPI)
|
||||
- **Magnetometer**: TODO: list magnetometer(s)
|
||||
|
||||
### Interfaces
|
||||
|
||||
- **I2C ports**: TODO: number of I2C ports
|
||||
- **SPI buses**: 4
|
||||
- ICM-42688P (IMU)
|
||||
- MS5611 (barometer)
|
||||
- **USB**: TODO: confirm USB connector type
|
||||
- **Analog battery inputs**: 1
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
|
||||
### Electrical Data
|
||||
|
||||
- **Input voltage**: TODO: supply voltage range
|
||||
|
||||
### Mechanical Data
|
||||
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
- **Processor**
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
- **Sensors**
|
||||
- **IMU**: ICM-42688P (SPI)
|
||||
- **Barometer**: MS5611 (SPI)
|
||||
- **Magnetometer**: TODO: list magnetometer(s)
|
||||
- **Interfaces**
|
||||
- **I2C ports**: TODO: number of I2C ports
|
||||
- **SPI buses**: 4
|
||||
- ICM-42688P (IMU)
|
||||
- MS5611 (barometer)
|
||||
- **USB**: TODO: confirm USB connector type
|
||||
- **Analog battery inputs**: 1
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
- **Electrical Data**
|
||||
- **Operating voltage**: TODO: supply voltage range
|
||||
- **Mechanical Data**
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
|
||||
<!-- overview-source-data
|
||||
{
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
## Specifications {#specifications}
|
||||
|
||||
- **Processor**
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
- **Sensors**
|
||||
- **IMU**: ICM-20649, ICM-20689, BMI088 <!-- TODO: Unnecessary driver(s) in firmware?: ICM-20948, ICM-42688P. -->
|
||||
- **Barometer**: TODO: list barometer(s)
|
||||
- **Magnetometer**: RM3100 <!-- TODO: Unnecessary driver(s) in firmware?: IST8310. -->
|
||||
- **Interfaces**
|
||||
- **I2C ports**: TODO: number of I2C ports
|
||||
- **SPI buses**: 3
|
||||
- **USB**: TODO: confirm USB connector type
|
||||
- **Analog battery inputs**: 1
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
- **Electrical Data**
|
||||
- **Operating voltage**: TODO: supply voltage range
|
||||
- **Mechanical Data**
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
|
||||
<!-- overview-source-data
|
||||
{
|
||||
"board": "test/fixture",
|
||||
"chip_model": "STM32H753",
|
||||
"has_io_board": false,
|
||||
"total_outputs": null,
|
||||
"fmu_servo_outputs": 0,
|
||||
"io_outputs": 0,
|
||||
"has_sd_card": false,
|
||||
"has_ethernet": false,
|
||||
"has_heater": false,
|
||||
"num_i2c_buses": 0,
|
||||
"num_spi_buses": 3,
|
||||
"num_can_buses": 0,
|
||||
"has_usb": false,
|
||||
"sensor_drivers": {
|
||||
"imu": [
|
||||
"ICM-20649",
|
||||
"ICM-20689",
|
||||
"BMI088",
|
||||
"ICM-20948",
|
||||
"ICM-42688P"
|
||||
],
|
||||
"baro": [],
|
||||
"mag": [
|
||||
"RM3100",
|
||||
"IST8310"
|
||||
],
|
||||
"osd": []
|
||||
},
|
||||
"overview_wizard": {
|
||||
"imu": [
|
||||
"ICM-20649",
|
||||
"ICM-20689",
|
||||
"BMI088"
|
||||
],
|
||||
"mag": [
|
||||
"RM3100"
|
||||
]
|
||||
}
|
||||
}
|
||||
-->
|
||||
@@ -0,0 +1,53 @@
|
||||
## Specifications {#specifications}
|
||||
|
||||
- **Processor**
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
- **Sensors**
|
||||
- **IMU**: TODO: list imu(s)
|
||||
- **Barometer**: TODO: list barometer(s)
|
||||
- **Magnetometer**: TODO: list magnetometer(s)
|
||||
- **Interfaces**
|
||||
- **I2C ports**: TODO: number of I2C ports
|
||||
- **SPI buses**: TODO: number of SPI buses
|
||||
- **USB**: USB (USB-C), Debug USB (Micro-USB)
|
||||
- **Analog battery inputs**: 1
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
- **Electrical Data**
|
||||
- **Operating voltage**: TODO: supply voltage range
|
||||
- **Mechanical Data**
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
|
||||
<!-- overview-source-data
|
||||
{
|
||||
"board": "test/fixture",
|
||||
"chip_model": "STM32H753",
|
||||
"has_io_board": false,
|
||||
"total_outputs": null,
|
||||
"fmu_servo_outputs": 0,
|
||||
"io_outputs": 0,
|
||||
"has_sd_card": false,
|
||||
"has_ethernet": false,
|
||||
"has_heater": false,
|
||||
"num_i2c_buses": 0,
|
||||
"num_spi_buses": 0,
|
||||
"num_can_buses": 0,
|
||||
"has_usb": true,
|
||||
"sensor_drivers": {
|
||||
"imu": [],
|
||||
"baro": [],
|
||||
"mag": [],
|
||||
"osd": []
|
||||
},
|
||||
"overview_wizard": {
|
||||
"usb_connectors": [
|
||||
"USB-C",
|
||||
"Micro-USB"
|
||||
],
|
||||
"usb_labels": [
|
||||
"USB",
|
||||
"Debug USB"
|
||||
]
|
||||
}
|
||||
}
|
||||
-->
|
||||
@@ -0,0 +1,51 @@
|
||||
## Specifications {#specifications}
|
||||
|
||||
- **Processor**
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
- **Sensors**
|
||||
- **IMU**: TODO: list imu(s)
|
||||
- **Barometer**: TODO: list barometer(s)
|
||||
- **Magnetometer**: TODO: list magnetometer(s)
|
||||
- **Interfaces**
|
||||
- **I2C ports**: TODO: number of I2C ports
|
||||
- **SPI buses**: TODO: number of SPI buses
|
||||
- **USB**: USB-C
|
||||
- **Analog battery inputs**: 1
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
- **Electrical Data**
|
||||
- **Operating voltage**: TODO: supply voltage range
|
||||
- **Mechanical Data**
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
|
||||
<!-- overview-source-data
|
||||
{
|
||||
"board": "test/fixture",
|
||||
"chip_model": "STM32H753",
|
||||
"has_io_board": false,
|
||||
"total_outputs": null,
|
||||
"fmu_servo_outputs": 0,
|
||||
"io_outputs": 0,
|
||||
"has_sd_card": false,
|
||||
"has_ethernet": false,
|
||||
"has_heater": false,
|
||||
"num_i2c_buses": 0,
|
||||
"num_spi_buses": 0,
|
||||
"num_can_buses": 0,
|
||||
"has_usb": true,
|
||||
"sensor_drivers": {
|
||||
"imu": [],
|
||||
"baro": [],
|
||||
"mag": [],
|
||||
"osd": []
|
||||
},
|
||||
"overview_wizard": {
|
||||
"usb_connectors": [
|
||||
"USB-C"
|
||||
],
|
||||
"usb_labels": [
|
||||
"USB"
|
||||
]
|
||||
}
|
||||
}
|
||||
-->
|
||||
@@ -1,35 +1,26 @@
|
||||
## Specifications {#specifications}
|
||||
|
||||
### Processor
|
||||
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
|
||||
### Sensors
|
||||
|
||||
- **IMU**: ICM-42688P (SPI); BMI088 (SPI, hardware revision Rev 1.0), ICM-20602 (SPI, hardware revision Rev 1.1)
|
||||
- **Barometer**: MS5611 (SPI)
|
||||
- **Magnetometer**: IST8310 (I2C, internal), IST8310 (I2C, bus 1, external)
|
||||
|
||||
### Interfaces
|
||||
|
||||
- **I2C ports**: 4
|
||||
- IST8310 (magnetometer, internal)
|
||||
- IST8310 (magnetometer, external, bus 1)
|
||||
- **SPI buses**: 5
|
||||
- ICM-42688P (IMU)
|
||||
- MS5611 (barometer)
|
||||
- **USB**: TODO: confirm USB connector type
|
||||
- **Analog battery inputs**: 1
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
|
||||
### Electrical Data
|
||||
|
||||
- **Input voltage**: TODO: supply voltage range
|
||||
|
||||
### Mechanical Data
|
||||
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
- **Processor**
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
- **Sensors**
|
||||
- **IMU**: ICM-42688P (SPI); BMI088 (SPI, hardware revision Rev 1.0), ICM-20602 (SPI, hardware revision Rev 1.1)
|
||||
- **Barometer**: MS5611 (SPI)
|
||||
- **Magnetometer**: IST8310 (I2C, internal), IST8310 (I2C, bus 1, external)
|
||||
- **Interfaces**
|
||||
- **I2C ports**: 4 (3 internal, 1 external)
|
||||
- TODO: label for I2C bus 1 (I2C1, external): IST8310 (magnetometer)
|
||||
- Internal: IST8310 (magnetometer)
|
||||
- **SPI buses**: 5
|
||||
- ICM-42688P (IMU)
|
||||
- MS5611 (barometer)
|
||||
- **USB**: TODO: confirm USB connector type
|
||||
- **Analog battery inputs**: 1
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
- **Electrical Data**
|
||||
- **Operating voltage**: TODO: supply voltage range
|
||||
- **Mechanical Data**
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
|
||||
<!-- overview-source-data
|
||||
{
|
||||
|
||||
@@ -1,35 +1,26 @@
|
||||
## Specifications {#specifications}
|
||||
|
||||
### Processor
|
||||
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
|
||||
### Sensors
|
||||
|
||||
- **IMU**: ICM-42688P (SPI); BMI088 (SPI, variant HW000001), ICM-20602 (SPI, other variants)
|
||||
- **Barometer**: MS5611 (SPI)
|
||||
- **Magnetometer**: IST8310 (I2C, internal), IST8310 (I2C, bus 1, external)
|
||||
|
||||
### Interfaces
|
||||
|
||||
- **I2C ports**: 4
|
||||
- IST8310 (magnetometer, internal)
|
||||
- IST8310 (magnetometer, external, bus 1)
|
||||
- **SPI buses**: 5
|
||||
- ICM-42688P (IMU)
|
||||
- MS5611 (barometer)
|
||||
- **USB**: TODO: confirm USB connector type
|
||||
- **Analog battery inputs**: 1
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
|
||||
### Electrical Data
|
||||
|
||||
- **Input voltage**: TODO: supply voltage range
|
||||
|
||||
### Mechanical Data
|
||||
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
- **Processor**
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
- **Sensors**
|
||||
- **IMU**: ICM-42688P (SPI); BMI088 (SPI, variant HW000001), ICM-20602 (SPI, other variants)
|
||||
- **Barometer**: MS5611 (SPI)
|
||||
- **Magnetometer**: IST8310 (I2C, internal), IST8310 (I2C, bus 1, external)
|
||||
- **Interfaces**
|
||||
- **I2C ports**: 4 (3 internal, 1 external)
|
||||
- TODO: label for I2C bus 1 (I2C1, external): IST8310 (magnetometer)
|
||||
- Internal: IST8310 (magnetometer)
|
||||
- **SPI buses**: 5
|
||||
- ICM-42688P (IMU)
|
||||
- MS5611 (barometer)
|
||||
- **USB**: TODO: confirm USB connector type
|
||||
- **Analog battery inputs**: 1
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
- **Electrical Data**
|
||||
- **Operating voltage**: TODO: supply voltage range
|
||||
- **Mechanical Data**
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
|
||||
<!-- overview-source-data
|
||||
{
|
||||
|
||||
@@ -1,32 +1,23 @@
|
||||
## Specifications {#specifications}
|
||||
|
||||
### Processor
|
||||
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
|
||||
### Sensors
|
||||
|
||||
- **IMU**: ICM-42688P
|
||||
- **Barometer**: TODO: list barometer(s)
|
||||
- **Magnetometer**: TODO: list magnetometer(s)
|
||||
|
||||
### Interfaces
|
||||
|
||||
- **I2C ports**: TODO: number of I2C ports
|
||||
- **SPI buses**: 3
|
||||
- ICM-42688P (IMU)
|
||||
- **USB**: TODO: confirm USB connector type
|
||||
- **Analog battery inputs**: 1
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
|
||||
### Electrical Data
|
||||
|
||||
- **Input voltage**: TODO: supply voltage range
|
||||
|
||||
### Mechanical Data
|
||||
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
- **Processor**
|
||||
- **Main FMU Processor**: STM32H753 (32-bit Arm® Cortex®-M7, 480 MHz, 2MB flash, 1MB RAM)
|
||||
- **Sensors**
|
||||
- **IMU**: ICM-42688P
|
||||
- **Barometer**: TODO: list barometer(s)
|
||||
- **Magnetometer**: TODO: list magnetometer(s)
|
||||
- **Interfaces**
|
||||
- **I2C ports**: TODO: number of I2C ports
|
||||
- **SPI buses**: 3
|
||||
- ICM-42688P (IMU)
|
||||
- **USB**: TODO: confirm USB connector type
|
||||
- **Analog battery inputs**: 1
|
||||
- **Additional analog inputs**: TODO: number of additional analog inputs
|
||||
- **Electrical Data**
|
||||
- **Operating voltage**: TODO: supply voltage range
|
||||
- **Mechanical Data**
|
||||
- **Dimensions**: TODO: dimensions (mm)
|
||||
- **Weight**: TODO: weight (g)
|
||||
|
||||
<!-- overview-source-data
|
||||
{
|
||||
|
||||
@@ -721,6 +721,25 @@ def _spec_base_entry():
|
||||
}
|
||||
|
||||
|
||||
def _entry_i2c_detailed():
|
||||
"""Entry with mixed internal/external I2C sensors and a wizard label for the external bus."""
|
||||
e = _spec_base_entry()
|
||||
e.update({
|
||||
"num_i2c_buses": 4,
|
||||
"sensor_bus_info": {
|
||||
"imu": [],
|
||||
"baro": [{"name": "BMP388", "bus_type": "I2C", "bus_num": None, "external": False}],
|
||||
"mag": [
|
||||
{"name": "IST8310", "bus_type": "I2C", "bus_num": 1, "external": True},
|
||||
{"name": "RM3100", "bus_type": "I2C", "bus_num": None, "external": False},
|
||||
],
|
||||
"osd": [],
|
||||
},
|
||||
"i2c_buses_wizard": [{"bus_num": 1, "label": "GPS1"}],
|
||||
})
|
||||
return e
|
||||
|
||||
|
||||
class TestGenerateSpecificationsSection:
|
||||
def test_spi_sensors_with_subbullets(self, snapshot):
|
||||
"""SPI-flagged sensors produce bus annotations and SPI sub-bullets."""
|
||||
@@ -786,6 +805,211 @@ class TestGenerateSpecificationsSection:
|
||||
result = fcdg.generate_specifications_section(BOARD_KEY, entry)
|
||||
snapshot("spec_wizard_override.md", result)
|
||||
|
||||
def test_duplicate_sensors_counted(self, snapshot):
|
||||
"""Duplicate sensor names in wizard list collapse to Name (N) format."""
|
||||
entry = _spec_base_entry()
|
||||
entry.update({
|
||||
"num_spi_buses": 2,
|
||||
"sensor_baro_drivers": ["MS5611"],
|
||||
"overview_wizard": {
|
||||
"baro": ["MS5611", "MS5611"],
|
||||
},
|
||||
})
|
||||
result = fcdg.generate_specifications_section(BOARD_KEY, entry)
|
||||
snapshot("spec_sensor_counted.md", result)
|
||||
|
||||
def test_unused_driver_todo_inline(self, snapshot):
|
||||
"""Drivers detected but not in wizard list get an inline TODO comment."""
|
||||
entry = _spec_base_entry()
|
||||
entry.update({
|
||||
"num_spi_buses": 3,
|
||||
"sensor_imu_drivers": ["ICM-20649", "ICM-20689", "BMI088", "ICM-20948", "ICM-42688P"],
|
||||
"sensor_mag_drivers": ["RM3100", "IST8310"],
|
||||
"overview_wizard": {
|
||||
"imu": ["ICM-20649", "ICM-20689", "BMI088"],
|
||||
"mag": ["RM3100"],
|
||||
},
|
||||
})
|
||||
result = fcdg.generate_specifications_section(BOARD_KEY, entry)
|
||||
snapshot("spec_unused_driver_todo.md", result)
|
||||
|
||||
def test_electrical_full(self, snapshot):
|
||||
"""Full electrical data: operating voltage, USB power, high-voltage servo rail, triple redundancy."""
|
||||
entry = _spec_base_entry()
|
||||
entry.update({
|
||||
"num_power_inputs": 2,
|
||||
"has_redundant_power": True,
|
||||
"power_ports_wizard": [
|
||||
{"label": "POWER1", "connector_type": "6-pin Molex CLIK-Mate"},
|
||||
{"label": "POWER2", "connector_type": "6-pin Molex CLIK-Mate"},
|
||||
],
|
||||
"overview_wizard": {
|
||||
"min_voltage": "7.0",
|
||||
"max_voltage": "55.0",
|
||||
"usb_powers_fc": True,
|
||||
"usb_pwr_min_v": "4.75",
|
||||
"usb_pwr_max_v": "5.25",
|
||||
"has_servo_rail": True,
|
||||
"servo_rail_max_v": "36",
|
||||
"width_mm": "46",
|
||||
"length_mm": "64",
|
||||
"height_mm": "22",
|
||||
"weight_g": 75.0,
|
||||
},
|
||||
})
|
||||
result = fcdg.generate_specifications_section(BOARD_KEY, entry)
|
||||
snapshot("spec_electrical_full.md", result)
|
||||
|
||||
def test_electrical_normal_servo_rail(self, snapshot):
|
||||
"""Servo rail ≤12 V gets 'Up to' label (not High-voltage)."""
|
||||
entry = _spec_base_entry()
|
||||
entry.update({
|
||||
"num_power_inputs": 2,
|
||||
"has_redundant_power": True,
|
||||
"overview_wizard": {
|
||||
"min_voltage": "4.3",
|
||||
"max_voltage": "5.4",
|
||||
"usb_powers_fc": True,
|
||||
"usb_pwr_min_v": "4.75",
|
||||
"usb_pwr_max_v": "5.25",
|
||||
"has_servo_rail": True,
|
||||
"servo_rail_max_v": "10.5",
|
||||
},
|
||||
})
|
||||
result = fcdg.generate_specifications_section(BOARD_KEY, entry)
|
||||
snapshot("spec_electrical_normal_servo.md", result)
|
||||
|
||||
def test_usb_multi_labels(self, snapshot):
|
||||
"""Multiple USB ports with distinct labels show Label (ConnectorType) pairs."""
|
||||
entry = _spec_base_entry()
|
||||
entry.update({
|
||||
"has_usb": True,
|
||||
"overview_wizard": {
|
||||
"usb_connectors": ["USB-C", "Micro-USB"],
|
||||
"usb_labels": ["USB", "Debug USB"],
|
||||
},
|
||||
})
|
||||
result = fcdg.generate_specifications_section(BOARD_KEY, entry)
|
||||
snapshot("spec_usb_multi_labels.md", result)
|
||||
|
||||
def test_usb_single_default_label(self, snapshot):
|
||||
"""Single USB port with default label 'USB' shows connector type only."""
|
||||
entry = _spec_base_entry()
|
||||
entry.update({
|
||||
"has_usb": True,
|
||||
"overview_wizard": {
|
||||
"usb_connectors": ["USB-C"],
|
||||
"usb_labels": ["USB"],
|
||||
},
|
||||
})
|
||||
result = fcdg.generate_specifications_section(BOARD_KEY, entry)
|
||||
snapshot("spec_usb_single_label.md", result)
|
||||
|
||||
def test_i2c_external_with_label(self, snapshot):
|
||||
"""External I2C bus with wizard label shows label + sensor; internal summarised."""
|
||||
result = fcdg.generate_specifications_section(BOARD_KEY, _entry_i2c_detailed())
|
||||
snapshot("spec_i2c_external_label.md", result)
|
||||
|
||||
def test_i2c_external_no_label(self, snapshot):
|
||||
"""External I2C bus without wizard label shows TODO placeholder."""
|
||||
e = _entry_i2c_detailed()
|
||||
del e['i2c_buses_wizard']
|
||||
result = fcdg.generate_specifications_section(BOARD_KEY, e)
|
||||
snapshot("spec_i2c_external_no_label.md", result)
|
||||
|
||||
def test_i2c_count_line_split(self):
|
||||
"""Count line shows internal/external split when external buses are detected."""
|
||||
result = fcdg.generate_specifications_section(BOARD_KEY, _entry_i2c_detailed())
|
||||
assert '**I2C ports**: 4 (3 internal, 1 external)' in result
|
||||
|
||||
def test_i2c_external_sub_bullet(self):
|
||||
"""External bus sub-bullet shows wizard label, bus number, and sensor purpose."""
|
||||
result = fcdg.generate_specifications_section(BOARD_KEY, _entry_i2c_detailed())
|
||||
assert 'GPS1 (I2C1, external): IST8310 (magnetometer)' in result
|
||||
|
||||
def test_i2c_gps_connector_note(self):
|
||||
"""External I2C bus labelled GPS1 appends '— on GPS connector' note."""
|
||||
result = fcdg.generate_specifications_section(BOARD_KEY, _entry_i2c_detailed())
|
||||
assert 'GPS1 (I2C1, external): IST8310 (magnetometer) — on GPS connector' in result
|
||||
|
||||
def test_i2c_internal_summary_line(self):
|
||||
"""Internal sensors appear on a single summary sub-bullet."""
|
||||
result = fcdg.generate_specifications_section(BOARD_KEY, _entry_i2c_detailed())
|
||||
assert ' - Internal: BMP388 (barometer), RM3100 (magnetometer)' in result
|
||||
|
||||
def test_i2c_port_label_auto_fill_from_source(self):
|
||||
"""port_label in sensor_bus_info auto-fills label when no wizard label is set."""
|
||||
e = _entry_i2c_detailed()
|
||||
del e['i2c_buses_wizard']
|
||||
# Add port_label to the external sensor entry
|
||||
e['sensor_bus_info']['mag'][0]['port_label'] = 'GPS1'
|
||||
result = fcdg.generate_specifications_section(BOARD_KEY, e)
|
||||
# Should use auto-detected label instead of TODO placeholder
|
||||
assert 'GPS1 (I2C1, external): IST8310 (magnetometer) — on GPS connector' in result
|
||||
assert 'TODO: label for I2C bus 1' not in result
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Specifications section — I2C bus config (detailed) path
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
def _entry_i2c_bus_config():
|
||||
"""Entry with i2c_bus_config: buses 1/2/4 external, bus 3 internal."""
|
||||
e = _spec_base_entry()
|
||||
e.update({
|
||||
"num_i2c_buses": 4,
|
||||
"i2c_bus_config": {"external": [1, 2, 4], "internal": [3]},
|
||||
"sensor_bus_info": {
|
||||
"imu": [],
|
||||
"baro": [{"name": "BMP388", "bus_type": "I2C", "bus_num": None,
|
||||
"external": False, "port_label": None}],
|
||||
"mag": [{"name": "IST8310", "bus_type": "I2C", "bus_num": 1,
|
||||
"external": True, "port_label": None}],
|
||||
"osd": [],
|
||||
"power_monitor": [{"name": "INA226", "bus_type": "I2C", "bus_num": 2,
|
||||
"external": True, "port_label": None}],
|
||||
},
|
||||
"i2c_buses_wizard": [
|
||||
{"bus_num": 1, "label": "GPS1"},
|
||||
{"bus_num": 2, "label": "POWER"},
|
||||
],
|
||||
})
|
||||
return e
|
||||
|
||||
|
||||
class TestI2cBusConfigPath:
|
||||
def test_count_line_external_internal_split(self):
|
||||
result = fcdg.generate_specifications_section(BOARD_KEY, _entry_i2c_bus_config())
|
||||
assert '**I2C ports**: 4 (3 external, 1 internal)' in result
|
||||
|
||||
def test_free_external_bus_marked(self):
|
||||
result = fcdg.generate_specifications_section(BOARD_KEY, _entry_i2c_bus_config())
|
||||
assert 'I2C4 (external): free (no sensor detected)' in result
|
||||
|
||||
def test_external_bus_with_sensor_and_gps_note(self):
|
||||
result = fcdg.generate_specifications_section(BOARD_KEY, _entry_i2c_bus_config())
|
||||
assert 'I2C1 (external, GPS1): IST8310 (magnetometer) — on GPS connector' in result
|
||||
|
||||
def test_external_bus_with_power_monitor(self):
|
||||
result = fcdg.generate_specifications_section(BOARD_KEY, _entry_i2c_bus_config())
|
||||
assert 'I2C2 (external, POWER): INA226 (power monitor)' in result
|
||||
|
||||
def test_internal_bus_with_internal_sensor(self):
|
||||
"""Single internal bus gets the internal sensor list retrofitted onto it."""
|
||||
result = fcdg.generate_specifications_section(BOARD_KEY, _entry_i2c_bus_config())
|
||||
assert 'I2C3 (internal): BMP388 (barometer)' in result
|
||||
|
||||
def test_fallback_path_unchanged(self):
|
||||
"""Entry without i2c_bus_config uses existing format."""
|
||||
result = fcdg.generate_specifications_section(BOARD_KEY, _entry_i2c_detailed())
|
||||
assert '**I2C ports**: 4 (3 internal, 1 external)' in result
|
||||
assert 'GPS1 (I2C1, external): IST8310 (magnetometer) — on GPS connector' in result
|
||||
|
||||
def test_snapshot(self, snapshot):
|
||||
"""Full snapshot of i2c_bus_config present path."""
|
||||
result = fcdg.generate_specifications_section(BOARD_KEY, _entry_i2c_bus_config())
|
||||
snapshot("spec_i2c_bus_config.md", result)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Specifications section — IO board RC input
|
||||
@@ -888,7 +1112,7 @@ class TestGenerateSpecSectionVariants:
|
||||
result = fcdg.generate_specifications_section(BOARD_KEY, _spec_variant_entry())
|
||||
lines = result.splitlines()
|
||||
spi_idx = next(i for i, l in enumerate(lines) if '**SPI buses**' in l)
|
||||
subbullets = [l for l in lines[spi_idx+1:] if l.startswith(' -')]
|
||||
subbullets = [l for l in lines[spi_idx+1:] if l.startswith(' -')]
|
||||
sub_names = [l.strip('- ').split(' ')[0] for l in subbullets]
|
||||
assert 'ICM-42688P' in sub_names # unconditional IMU
|
||||
assert 'MS5611' in sub_names # unconditional baro
|
||||
|
||||
@@ -466,7 +466,7 @@ class TestParseRcBoardSensorBus:
|
||||
|
||||
def test_missing_file_returns_empty(self, tmp_path):
|
||||
result = fcdg.parse_rc_board_sensor_bus(tmp_path)
|
||||
assert result == {'imu': [], 'baro': [], 'mag': [], 'osd': []}
|
||||
assert result == {'imu': [], 'baro': [], 'mag': [], 'osd': [], 'power_monitor': []}
|
||||
|
||||
def test_skips_variant_block(self, board_stm32h7_variant):
|
||||
"""Sensors inside if ver hwtypecmp blocks must not appear in sensor_bus_info."""
|
||||
@@ -478,6 +478,147 @@ class TestParseRcBoardSensorBus:
|
||||
# icm42688p is unconditional → must be present
|
||||
assert 'ICM-42688P' in imu_names
|
||||
|
||||
def test_external_port_label_detected_from_comment(self, board_stm32h7_all_dshot):
|
||||
"""External sensor preceded by 'GPS1/I2C1' comment gets port_label='GPS1'."""
|
||||
result = fcdg.parse_rc_board_sensor_bus(board_stm32h7_all_dshot)
|
||||
external = [e for e in result['mag'] if e['external']]
|
||||
assert len(external) == 1
|
||||
assert external[0]['port_label'] == 'GPS1'
|
||||
|
||||
def test_internal_sensor_port_label_none(self, board_stm32h7_all_dshot):
|
||||
"""Internal sensor preceded by 'Internal compass' comment gets port_label=None."""
|
||||
result = fcdg.parse_rc_board_sensor_bus(board_stm32h7_all_dshot)
|
||||
internal = [e for e in result['mag'] if not e['external']]
|
||||
assert len(internal) == 1
|
||||
assert internal[0]['port_label'] is None
|
||||
|
||||
def test_spi_sensor_port_label_none(self, board_stm32h7_all_dshot):
|
||||
"""SPI sensor with no GPS/I2C comment gets port_label=None."""
|
||||
result = fcdg.parse_rc_board_sensor_bus(board_stm32h7_all_dshot)
|
||||
assert result['imu'][0]['port_label'] is None
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# parse_i2c_bus_config
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
class TestParseI2cBusConfig:
|
||||
def test_missing_file_returns_empty_dict(self, tmp_path):
|
||||
"""No src/i2c.cpp → empty dict."""
|
||||
assert fcdg.parse_i2c_bus_config(tmp_path) == {}
|
||||
|
||||
def test_external_buses_parsed(self, tmp_path):
|
||||
(tmp_path / 'src').mkdir(parents=True)
|
||||
(tmp_path / 'src' / 'i2c.cpp').write_text(
|
||||
'constexpr px4_i2c_bus_t buses[] = {\n'
|
||||
' initI2CBusExternal(1),\n'
|
||||
' initI2CBusExternal(2),\n'
|
||||
'};\n'
|
||||
)
|
||||
result = fcdg.parse_i2c_bus_config(tmp_path)
|
||||
assert result['external'] == [1, 2]
|
||||
assert result['internal'] == []
|
||||
|
||||
def test_internal_buses_parsed(self, tmp_path):
|
||||
(tmp_path / 'src').mkdir(parents=True)
|
||||
(tmp_path / 'src' / 'i2c.cpp').write_text(
|
||||
'constexpr px4_i2c_bus_t buses[] = {\n'
|
||||
' initI2CBusInternal(3),\n'
|
||||
'};\n'
|
||||
)
|
||||
result = fcdg.parse_i2c_bus_config(tmp_path)
|
||||
assert result['external'] == []
|
||||
assert result['internal'] == [3]
|
||||
|
||||
def test_mixed_buses_parsed_and_sorted(self, tmp_path):
|
||||
(tmp_path / 'src').mkdir(parents=True)
|
||||
(tmp_path / 'src' / 'i2c.cpp').write_text(
|
||||
'constexpr px4_i2c_bus_t buses[] = {\n'
|
||||
' initI2CBusExternal(1),\n'
|
||||
' initI2CBusExternal(2),\n'
|
||||
' initI2CBusInternal(3),\n'
|
||||
' initI2CBusExternal(4),\n'
|
||||
'};\n'
|
||||
)
|
||||
result = fcdg.parse_i2c_bus_config(tmp_path)
|
||||
assert result['external'] == [1, 2, 4]
|
||||
assert result['internal'] == [3]
|
||||
|
||||
def test_whitespace_in_args(self, tmp_path):
|
||||
(tmp_path / 'src').mkdir(parents=True)
|
||||
(tmp_path / 'src' / 'i2c.cpp').write_text(
|
||||
'initI2CBusExternal( 1 );\ninitI2CBusInternal( 2 );\n'
|
||||
)
|
||||
result = fcdg.parse_i2c_bus_config(tmp_path)
|
||||
assert 1 in result['external']
|
||||
assert 2 in result['internal']
|
||||
|
||||
def test_empty_file_returns_empty_dict(self, tmp_path):
|
||||
(tmp_path / 'src').mkdir(parents=True)
|
||||
(tmp_path / 'src' / 'i2c.cpp').write_text('// no bus entries\n')
|
||||
assert fcdg.parse_i2c_bus_config(tmp_path) == {}
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# power_monitor category in parse_rc_board_sensor_bus
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
class TestPowerMonitorSensorBus:
|
||||
def test_ina226_classified_as_power_monitor(self, tmp_path):
|
||||
(tmp_path / 'init').mkdir(parents=True)
|
||||
(tmp_path / 'init' / 'rc.board_sensors').write_text(
|
||||
'ina226 -X -b 2 -t 1 -k start\n'
|
||||
)
|
||||
result = fcdg.parse_rc_board_sensor_bus(tmp_path)
|
||||
assert len(result['power_monitor']) == 1
|
||||
pm = result['power_monitor'][0]
|
||||
assert pm['name'] == 'INA226'
|
||||
assert pm['bus_type'] == 'I2C'
|
||||
assert pm['bus_num'] == 2
|
||||
assert pm['external'] is True
|
||||
|
||||
def test_ina228_classified_as_power_monitor(self, tmp_path):
|
||||
(tmp_path / 'init').mkdir(parents=True)
|
||||
(tmp_path / 'init' / 'rc.board_sensors').write_text(
|
||||
'ina228 -X -b 1 start\n'
|
||||
)
|
||||
result = fcdg.parse_rc_board_sensor_bus(tmp_path)
|
||||
assert result['power_monitor'][0]['name'] == 'INA228'
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# _extract_port_label_from_comment
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
class TestExtractPortLabelFromComment:
|
||||
def test_gps_port_extracted(self):
|
||||
assert fcdg._extract_port_label_from_comment(
|
||||
'External compass on GPS1/I2C1: standard puck') == 'GPS1'
|
||||
|
||||
def test_gps2_extracted(self):
|
||||
assert fcdg._extract_port_label_from_comment('compass on GPS2') == 'GPS2'
|
||||
|
||||
def test_telem_extracted_when_no_gps(self):
|
||||
assert fcdg._extract_port_label_from_comment('sensor on TELEM1') == 'TELEM1'
|
||||
|
||||
def test_i2c_numbered_extracted_when_no_gps_or_telem(self):
|
||||
assert fcdg._extract_port_label_from_comment('I2C2 ist8310 magnetometer') == 'I2C2'
|
||||
|
||||
def test_i2c_without_digit_returns_none(self):
|
||||
# "Internal magnetometer on I2C" — no digit suffix
|
||||
assert fcdg._extract_port_label_from_comment('Internal magnetometer on I2C') is None
|
||||
|
||||
def test_none_input_returns_none(self):
|
||||
assert fcdg._extract_port_label_from_comment(None) is None
|
||||
|
||||
def test_empty_comment_returns_none(self):
|
||||
assert fcdg._extract_port_label_from_comment('') is None
|
||||
|
||||
def test_gps_takes_priority_over_i2c(self):
|
||||
# Comment mentions both GPS1 and I2C1 — GPS should win
|
||||
assert fcdg._extract_port_label_from_comment(
|
||||
'External compass on GPS1/I2C1 (the 3rd external bus)') == 'GPS1'
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# parse_sensor_variant_blocks
|
||||
@@ -527,7 +668,7 @@ class TestParseSensorVariantBlocks:
|
||||
def test_missing_file_returns_has_variants_false(self, tmp_path):
|
||||
result = fcdg.parse_sensor_variant_blocks(tmp_path)
|
||||
assert result['has_variants'] is False
|
||||
assert result['unconditional'] == {'imu': [], 'baro': [], 'mag': [], 'osd': []}
|
||||
assert result['unconditional'] == {'imu': [], 'baro': [], 'mag': [], 'osd': [], 'power_monitor': []}
|
||||
assert result['variants'] == {}
|
||||
|
||||
def test_graceful_fail_sensors_moved_to_variant(self, board_stm32h7_graceful_fail):
|
||||
|
||||
Reference in New Issue
Block a user