diff options
Diffstat (limited to 'goal.fiddle')
-rw-r--r-- | goal.fiddle | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/goal.fiddle b/goal.fiddle index b59acb4..c35e172 100644 --- a/goal.fiddle +++ b/goal.fiddle @@ -1,24 +1,31 @@ +option board stm32l432; option endian little; +option processor arm_cortex_m4; +option align 32; -// package for the GPIO system. +import "./types.fdl" (data_t); +[[ search = ".local/fiddle/libs" ]] +import "./stm32l432.fdl"; + +[[ cpp: namespace = "stm32l432::gpio" ]] +[[ rust: package = "Stm32l432.Gpio" ]] +[[ zig: package = "stm32l432.gpio" ]] +[[ c: prefix = "stm32l432_gpio_" ]] package gpio { location gpio_a_base = 0x4800_0000; location gpio_b_base = 0x4800_0400; location gpio_c_base = 0x4800_0800; - /** IO Data. This is just an expressive boolean. */ bits data_t : enum(1) { - low = 0, - high = 1, + high = 0b1, + low = 0b0, }; /** * Structure of the GPIO port on an stm32l432 - */ - type gpio_t : struct { - assert_pos(0); + reg (32) : struct { /** The mode for each pin. */ mode_r : enum(2) { @@ -45,7 +52,8 @@ package gpio { * The output type. */ assert_pos(0x04); - reg ocfg_reg(32) : struct { + [[ noexport ]] + reg ocfg_r(32) : struct { otype_r : enum(1) { /** * The GPIO pin is capable of sinking to ground (for LOW) or providing @@ -67,6 +75,8 @@ package gpio { * Sets the speed of the provided GPIO pin. */ assert_pos(0x08); + + [[ noexport ]] reg (32) : struct { ospeed_r : enum(2) { low = 0, @@ -80,6 +90,7 @@ package gpio { * Pullup/Pulldown type */ assert_pos(0x0c); + [[ noexport ]] wo reg (32) : struct { union { pupd_r : enum(2) { @@ -112,6 +123,7 @@ package gpio { assert_pos(0x10); ro reg (32) : struct { id_r : data_t[16]; + reserved(16); }; @@ -202,6 +214,7 @@ package gpio { */ reg(32) : struct { asc_r : (16); + reserved (16); }; }; |