adafruit_seesaw/modules/
mod.rs1#[cfg(feature = "module_adc")]
2pub mod adc;
3#[cfg(feature = "module_encoder")]
4pub mod encoder;
5#[cfg(feature = "module_gpio")]
6pub mod gpio;
7#[cfg(feature = "module_keypad")]
8pub mod keypad;
9#[cfg(feature = "module_neopixel")]
10pub mod neopixel;
11pub mod status;
12#[cfg(feature = "module_timer")]
13pub mod timer;
14#[cfg(feature = "module_touch")]
15pub mod touch;
16
17pub type Reg = [u8; 2];
18
19#[derive(Debug, Clone, Copy, PartialEq, Eq)]
20#[cfg_attr(feature = "defmt", derive(defmt::Format))]
21pub enum HardwareId {
22 SAMD09 = 0x55,
24 ATTINY806 = 0x84,
26 ATTINY807 = 0x85,
28 ATTINY816 = 0x86,
30 ATTINY817 = 0x87,
32 ATTINY1616 = 0x88,
34 ATTINY1617 = 0x89,
36}
37
38impl From<HardwareId> for u8 {
39 fn from(value: HardwareId) -> Self {
40 value as u8
41 }
42}
43
44#[derive(Debug, Clone, Copy, PartialEq, Eq)]
45#[cfg_attr(feature = "defmt", derive(defmt::Format))]
46pub(crate) enum Modules {
47 Status = 0x00,
48 Gpio = 0x01,
49 Sercom0 = 0x02,
50 Timer = 0x08,
51 Adc = 0x09,
52 Dac = 0x0A,
54 Interrupt = 0x0B,
56 Dap = 0x0C,
58 Eeprom = 0x0D,
59 Neopixel = 0x0E,
60 Touch = 0x0F,
61 Keypad = 0x10,
62 Encoder = 0x11,
63 Spectrum = 0x12,
64}
65
66impl Modules {
67 pub const fn into_u8(self) -> u8 {
68 self as u8
69 }
70}