-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Complete rewrite of STM32 gpio driver #836
Conversation
a0bcd8b
to
90c1974
Compare
TEMPORARY: SUBMITTED IN atomvm#836. Complete rewrite of the stm32 gpio driver using updated APIs. Signed-off-by: Winford <[email protected]>
TEMPORARY: SUBMITTED IN atomvm#836. Add support for interrupts to stm32 gpio port driver. Signed-off-by: Winford <[email protected]>
TEMPORARY: SUBMITTED IN atomvm#836. Updates the types and edoc entries for gpio.erl, and the "Programmers Guide" with details about the updated STM32 gpio driver. Signed-off-by: Winford <[email protected]>
TEMPORARY: SUBMITTED IN atomvm#836. Complete rewrite of the stm32 gpio driver using updated APIs. Signed-off-by: Winford <[email protected]>
TEMPORARY: SUBMITTED IN atomvm#836. Add support for interrupts to stm32 gpio port driver. Signed-off-by: Winford <[email protected]>
TEMPORARY: SUBMITTED IN atomvm#836. Updates the types and edoc entries for gpio.erl, and the "Programmers Guide" with details about the updated STM32 gpio driver. Signed-off-by: Winford <[email protected]>
9b3c67f
to
87b6a67
Compare
87b6a67
to
b143d46
Compare
TEMPORARY: SUBMITTED IN atomvm#836. Complete rewrite of the stm32 gpio driver using updated APIs. Signed-off-by: Winford <[email protected]>
TEMPORARY: SUBMITTED IN atomvm#836. Add support for interrupts to stm32 gpio port driver. Signed-off-by: Winford <[email protected]>
TEMPORARY: SUBMITTED IN atomvm#836. Updates the types and edoc entries for gpio.erl, and the "Programmers Guide" with details about the updated STM32 gpio driver. Signed-off-by: Winford <[email protected]>
b143d46
to
b1c60ba
Compare
TEMPORARY: SUBMITTED IN atomvm#836. Complete rewrite of the stm32 gpio driver using updated APIs. Moves all GPIO related atoms from `platform_defaultatoms.{c,h}` into `gpio_driver.c` Improved input validation. Adds read support port driver. Adds nif functions to support read and write. Adds cmake configuration options to disable nifs and/or port driver when building the VM. Signed-off-by: Winford <[email protected]>
TEMPORARY: SUBMITTED IN atomvm#836. To prevent accidental reset, or configuration of pins currently in use by system peripherals on the stm32 platform, reserved pins (such as the CONSOLE) may be locked using `sys_lock_pin`, and unlocked with `sys_unlock_pin` so they are not unintentionally reset later when other peripherals such as gpio are configured. This is also intended to support other drivers that consume gpio pins, such as SPI and I2C, to avoid inadvertent resets or re-configuration by other drivers. The libopencm3 libraries on the stm32 platform provide no protection from re-confuguring a gpio pin that is in active use. Signed-off-by: Winford <[email protected]>
TEMPORARY: SUBMITTED IN atomvm#836. Add support for interrupts to stm32 gpio port driver. Signed-off-by: Winford <[email protected]>
TEMPORARY: SUBMITTED IN atomvm#836. Updates the types and edoc entries for gpio.erl, and the "Programmers Guide" with details about the updated STM32 gpio driver. Signed-off-by: Winford <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM. A few small doc/type nits, but also found some potential memory leaks in error conditions that will need attention.
0a76a11
to
31ca8d6
Compare
31ca8d6
to
4f64617
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few more to hit!
Complete rewrite of the stm32 gpio driver using updated APIs. Moves all GPIO related atoms from `platform_defaultatoms.{c,h}` into `gpio_driver.c` Improved input validation. Adds read support port driver. Adds nif functions to support read and write. Adds cmake configuration options to disable nifs and/or port driver when building the VM. Closes atomvm#571 Addresses atomvm#894 on STM32 platform. Signed-off-by: Winford <[email protected]>
To prevent accidental reset, or configuration of pins currently in use by system peripherals on the stm32 platform, reserved pins (such as the CONSOLE) may be locked using `sys_lock_pin`, and unlocked with `sys_unlock_pin` so they are not unintentionally reset later when other peripherals such as gpio are configured. This is also intended to support other drivers that consume gpio pins, such as SPI and I2C, to avoid inadvertent resets or re-configuration by other drivers. The libopencm3 libraries on the stm32 platform provide no protection from re-confuguring a gpio pin that is in active use. Signed-off-by: Winford <[email protected]>
Add support for interrupts to stm32 gpio port driver. Signed-off-by: Winford <[email protected]>
Updates the types and edoc entries for gpio.erl, and the "Programmers Guide" with details about the updated STM32 gpio driver. Signed-off-by: Winford <[email protected]>
4f64617
to
cee9209
Compare
STM32 GPIO driver fixes This PR fixes few issues introduced with #836. These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
platform_defaultatoms.c (& .h)
intogpio_driver.c
digital_read/1
,digital_write/2
, andset_pin_mode/2
(used to set all configuration options).Closes #571
Addresses #894 on STM32 platform.
These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).
SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later