aboutsummaryrefslogtreecommitdiff
path: root/fdl/ch573/gpio.fdl
diff options
context:
space:
mode:
Diffstat (limited to 'fdl/ch573/gpio.fdl')
-rw-r--r--fdl/ch573/gpio.fdl39
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);
};
};