diff options
| author | Kevin O'Connor <kevin@koconnor.net> | 2025-03-11 10:56:17 -0400 |
|---|---|---|
| committer | Kevin O'Connor <kevin@koconnor.net> | 2025-04-19 11:48:58 -0400 |
| commit | 0d27195fd4fa8a5e7475a9c2d3023925f19f173a (patch) | |
| tree | c0013b9d5d0c01b838b2e1390706752f623c1a37 /src/stm32/gpio.h | |
| parent | 1f5783a25056669a3d158fa0cf05271ef7f3a3fc (diff) | |
| download | kutter-0d27195fd4fa8a5e7475a9c2d3023925f19f173a.tar.gz kutter-0d27195fd4fa8a5e7475a9c2d3023925f19f173a.tar.xz kutter-0d27195fd4fa8a5e7475a9c2d3023925f19f173a.zip | |
stm32: Add optimized stm32h7_gpio.c
Add optimized gpio functions for stm32h7 - caching the ODR register
can notably improve the performance of the gpio_out_toggle() code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stm32/gpio.h')
| -rw-r--r-- | src/stm32/gpio.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/stm32/gpio.h b/src/stm32/gpio.h index 6a5f910c..0bfffc4b 100644 --- a/src/stm32/gpio.h +++ b/src/stm32/gpio.h @@ -5,7 +5,10 @@ struct gpio_out { void *regs; - uint32_t bit; + union { + struct odr_cache *oc; // stm32h7 uses 'oc'; all others use 'bit' + uint32_t bit; + }; }; struct gpio_out gpio_out_setup(uint32_t pin, uint32_t val); void gpio_out_reset(struct gpio_out g, uint32_t val); |
