diff options
| author | Yuval Adam <_@yuv.al> | 2018-07-29 17:27:27 +0300 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2018-07-29 17:27:27 +0300 |
| commit | 59e2ae68353648364ba128ca6079157794eae1fc (patch) | |
| tree | fff5326a2e567aad5a1e8bba2bc85d1d2640bb1f /src/devices/fc0013.rs | |
| parent | e3f2a44ed678bc8de6748fc0af3540f881871e1f (diff) | |
Refactor DeviceInfo struct and impls
Diffstat (limited to 'src/devices/fc0013.rs')
| -rw-r--r-- | src/devices/fc0013.rs | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/devices/fc0013.rs b/src/devices/fc0013.rs index 6482eee..2af58fb 100644 --- a/src/devices/fc0013.rs +++ b/src/devices/fc0013.rs @@ -1,8 +1,27 @@ -use super::Device; +use super::{DeviceInfo, Actions}; -pub const FC0013: Device = Device { +pub struct FC0013 { + device: DeviceInfo +} + +pub const DEVICE_INFO: DeviceInfo = DeviceInfo { + id: "fc0013", name: "Fitipower FC0013", i2c_addr: 0xc6, check_addr: 0x00, check_val: 0xa3 }; + +impl FC0013 { + fn new() -> FC0013 { + FC0013 { + device: DEVICE_INFO + } + } +} + +impl Actions for FC0013 { + fn init(&self) { + println!("Init {}", self.device.name); + } +} |
