fs3000_rs/address.rs
1/// The I2C address of the FS3000.
2#[derive(Copy, Clone, Debug, Default)]
3#[cfg_attr(feature = "defmt", derive(defmt::Format))]
4pub enum DeviceAddr {
5 /// The default address, 0x28.
6 #[default]
7 Default,
8 /// Any other I2C address, e.g. when using a mux.
9 Custom(u8),
10}
11
12impl From<DeviceAddr> for u8 {
13 fn from(addr: DeviceAddr) -> u8 {
14 match addr {
15 DeviceAddr::Default => 0x28,
16 DeviceAddr::Custom(addr) => addr,
17 }
18 }
19}