diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2025-09-30 13:06:16 -0600 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2025-09-30 13:06:16 -0600 |
| commit | 290d784950b6248782b049cd9831bd6e034fd538 (patch) | |
| tree | c231c02e92ed83a02b234a85b3c07bcc5e44b168 /fdl/ch573/gpio.fdl | |
| parent | f89f75b5616de99865448f41b068a2783cd3648e (diff) | |
| download | ch573-main.tar.gz ch573-main.tar.bz2 ch573-main.zip | |
Add many different patterns, and organize it.
Add a voltage discovery subsystem to allow the ch573 to detect if it's
on 12v or 5v lights.
Diffstat (limited to 'fdl/ch573/gpio.fdl')
| -rw-r--r-- | fdl/ch573/gpio.fdl | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/fdl/ch573/gpio.fdl b/fdl/ch573/gpio.fdl index 86ffaef..e4fbb69 100644 --- a/fdl/ch573/gpio.fdl +++ b/fdl/ch573/gpio.fdl @@ -22,15 +22,18 @@ package ch573.gpio { /** Gpio port type. */ type gpio_port_t : struct { /** Port direction register. */ - reg (32) : struct { - dir : enum(1) { - [[ c: unqualified ]] - DIR_OUT = 1, - - [[ c: unqualified ]] - DIR_IN = 0, - } [16]; - reserved(16); + union { + reg (32) : struct { + dir : enum(1) { + [[ c: unqualified ]] + DIR_OUT = 1, + + [[ c: unqualified ]] + DIR_IN = 0, + } [16]; + reserved(16); + }; + reg dir_reg(32); }; /** Pin input register. */ @@ -49,15 +52,21 @@ package ch573.gpio { reg clr(32); /** Pull-up resistor configuration. */ - reg (32) : struct { - pu : enable_t[16]; - reserved(16); + union { + reg (32) : struct { + pu : enable_t[16]; + reserved(16); + }; + reg pu_reg(32); }; /** pull-down/drive configuration register. */ - reg (32) : struct { - pd_drv : pd_drv_t[16]; - reserved(16); + union { + reg (32) : struct { + pd_drv : pd_drv_t[16]; + reserved(16); + }; + reg pd_drv_reg(32); }; }; |