80 lines
2.3 KiB
Rust
80 lines
2.3 KiB
Rust
//! Declarative support for the GEPRC TAKER F722 BLS 60A V2 stack.
|
|
|
|
use platform_stm32f7::{
|
|
F7Board, F722Hardware, F722ImmutableConfig as ImmutableConfig, Icm42688, ImuMount, LevelFilter,
|
|
Mavlink, Pa13ActiveHigh, Pb0Pb1Pb4Pb5Low, Pc3, VerticalSensor,
|
|
};
|
|
|
|
/// User-writable MAVLink endpoint policy.
|
|
#[derive(Clone, kaptan_config::Config)]
|
|
struct MavlinkConfig {
|
|
#[config(id = 101, key = "mavlink.system_id", unit = "id", range(min = 1))]
|
|
system_id: u8,
|
|
#[config(id = 102, key = "mavlink.component_id", unit = "id", range(min = 1))]
|
|
component_id: u8,
|
|
#[config(
|
|
enum,
|
|
id = 105,
|
|
key = "mavlink.logging.level_filter",
|
|
unit = "log_level"
|
|
)]
|
|
log_level_filter: LevelFilter,
|
|
}
|
|
|
|
/// User-writable telemetry publication policy.
|
|
#[derive(Clone, kaptan_config::Config)]
|
|
struct TelemetryConfig {
|
|
#[config(
|
|
id = 103,
|
|
key = "telemetry.imu_hz",
|
|
unit = "Hz",
|
|
range(min = 1, max = 100)
|
|
)]
|
|
imu_hz: u8,
|
|
#[config(
|
|
id = 104,
|
|
key = "telemetry.heartbeat_hz",
|
|
unit = "Hz",
|
|
range(min = 1, max = 10)
|
|
)]
|
|
heartbeat_hz: u8,
|
|
}
|
|
|
|
/// Complete user-writable configuration advertised by this board.
|
|
#[derive(Clone, kaptan_config::Config)]
|
|
pub struct UserConfig {
|
|
mavlink: MavlinkConfig,
|
|
telemetry: TelemetryConfig,
|
|
}
|
|
|
|
/// ICM-42688-P-based GEP-F722-HD V2 paired with the 60 A stack.
|
|
pub struct GeprcF722V2;
|
|
|
|
impl F7Board for GeprcF722V2 {
|
|
type UserConfig = UserConfig;
|
|
type ImmutableConfig = ImmutableConfig;
|
|
|
|
const FACTORY_USER_CONFIG: UserConfig = UserConfig {
|
|
mavlink: MavlinkConfig {
|
|
system_id: 1,
|
|
component_id: 1,
|
|
log_level_filter: LevelFilter::Info,
|
|
},
|
|
telemetry: TelemetryConfig {
|
|
imu_hz: 20,
|
|
heartbeat_hz: 2,
|
|
},
|
|
};
|
|
const IMMUTABLE_CONFIG: ImmutableConfig = ImmutableConfig {
|
|
name: "GEPRC TAKER F722 V2 (ICM-42688-P)",
|
|
service_hz: 100,
|
|
hardware: F722Hardware::new()
|
|
.output_inhibit(Pb0Pb1Pb4Pb5Low)
|
|
.imu(Icm42688::on_spi3().with_drdy(Pc3).mounted(ImuMount::Yaw180))
|
|
.mavlink(Mavlink::on_usart2().baud(115_200))
|
|
.vertical_sensor(VerticalSensor::none())
|
|
.status_led(Pa13ActiveHigh)
|
|
.telemetry_only(),
|
|
};
|
|
}
|