cu-ist8310
Copper source component for the iSentek IST8310 magnetometer.
Output
cu_ist8310::Ist8310Source emits cu_sensor_payloads::MagnetometerPayload
(magnetic flux density in microtesla) at 100 Hz.
How To Use
- Add the crate dependency:
= { = "../../components/sources/cu_ist8310", = false, = ["defmt"] }
- Define the task type alias in your app:
pub type Ist8310Source = Ist8310Source;
MyIst8310Bus is your board/resource type that implements cu_ist8310::Ist8310Bus.
- Add the source task in
copperconfig.ron:
(
id: "ist8310",
type: "tasks::Ist8310Source",
logging: (enabled: true),
resources: {"i2c": "fc.i2c2_ist8310"},
)
- Connect it to a consumer:
(
src: "ist8310",
dst: "mag_logger",
msg: "cu_sensor_payloads::MagnetometerPayload",
)
The source has no component-specific config fields; wiring the resource and connection is enough.