diff options
author | jaseg <git@jaseg.de> | 2023-09-25 23:57:36 +0200 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2023-09-25 23:57:36 +0200 |
commit | 8cc05c79cea62609d02231492c054a0cca2b2289 (patch) | |
tree | e39d40456adefe9bb70bcd77ebdf97be1dcdc028 /center_fw/include/iomacros.h | |
parent | 583ac10d1450610a4110849c26cc16f03154d26e (diff) | |
download | 8seg-8cc05c79cea62609d02231492c054a0cca2b2289.tar.gz 8seg-8cc05c79cea62609d02231492c054a0cca2b2289.tar.bz2 8seg-8cc05c79cea62609d02231492c054a0cca2b2289.zip |
Center firmware WIP
Diffstat (limited to 'center_fw/include/iomacros.h')
-rw-r--r-- | center_fw/include/iomacros.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/center_fw/include/iomacros.h b/center_fw/include/iomacros.h new file mode 100644 index 0000000..8d84c9e --- /dev/null +++ b/center_fw/include/iomacros.h @@ -0,0 +1,14 @@ +#ifndef __IOMACROS_H__ +#define __IOMACROS_H__ + +#define IN(pin) (0) +#define OUT(pin) (1<<(2*(pin))) +#define AF(pin) (2<<(2*(pin))) +#define ANALOG(pin) (3<<(2*(pin))) + +#define CLEAR(pin) (~(3<<(2*(pin)))) + +#define AFRL(pin, val) ((val) << ((pin)*4)) +#define AFRH(pin, val) ((val) << (((pin)-8)*4)) + +#endif __IOMACROS_H__ |