From 22ea72ef67347089b11a3c0dd5e5a0f12d8f11cf Mon Sep 17 00:00:00 2001 From: unicod Date: Thu, 31 Jul 2025 21:44:51 +0200 Subject: [PATCH] Pinconfig types draft --- pincfg.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 pincfg.h diff --git a/pincfg.h b/pincfg.h new file mode 100644 index 0000000..7779f64 --- /dev/null +++ b/pincfg.h @@ -0,0 +1,36 @@ +#ifndef __PINCFG_H__ +#define __PINCFG_H__ + +typedef enum: uint8_t { + PIN_MODE_DIG_IN, + PIN_MODE_ANA_IN, + PIN_MODE_DIG_OUT, + PIN_MODE_ANA_OUT +} PIN_MODES; + +typedef enum: uint8_t { + PULLUP_OFF, + PULLUP_ON +} PULLUP_MODES; + +struct PinCfg { + PIN_MODES Mode; + union { + struct { + PULLUP_MODES Pullup; + } CfgDigIn; + struct { + uint8_t todo; + } CfgAnaIn; + struct { + uint8_t todo; + } CfgDigOut; + struct { + uint8_t todo; + } CfgAnaOut; + }; +}; + + + +#endif