aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/stm32f2
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2012-06-03 02:11:07 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2012-06-03 02:15:22 -0400
commitf5c37f28fd9be3bd8e2c7159a09891d5e571bc43 (patch)
tree5a1fdc7cc45a8583df6a4b7b3412a25cfd180d23 /libmaple/stm32f2
parentff56b76d41a390ed193da180316690f6e2dcbb75 (diff)
downloadlibrambutan-f5c37f28fd9be3bd8e2c7159a09891d5e571bc43.tar.gz
librambutan-f5c37f28fd9be3bd8e2c7159a09891d5e571bc43.zip
Globally switch style for GPIO config routines.
Stupidly, spi_gpio_cfg() didn't take a spi_dev* argument on F1, because it doesn't matter there. On F2, where we need to set an alternate function when configuring GPIOs for SPI, we need to know the dev. We can't add break backwards compatibility, so we need a new function. However, we've since added a bunch of foo_gpio_cfg() routines, and we don't want confusing asymmetry in the names. So a global style change is needed. (Fortunately, the new functions weren't part of a release, so it's no problem to change their names). Change all foo_gpio_cfg() routines to foo_config_gpios() (or foo_config_gpio(), if there's only one GPIO to configure). For backwards compatibility, make spi_gpio_cfg() on F1 an __always_inline call to spi_config_gpios(). Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'libmaple/stm32f2')
-rw-r--r--libmaple/stm32f2/adc.c2
-rw-r--r--libmaple/stm32f2/usart.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/libmaple/stm32f2/adc.c b/libmaple/stm32f2/adc.c
index 0380736..a400d7b 100644
--- a/libmaple/stm32f2/adc.c
+++ b/libmaple/stm32f2/adc.c
@@ -74,7 +74,7 @@ void adc_foreach(void (*fn)(const adc_dev*)) {
fn(ADC3);
}
-void adc_gpio_cfg(gpio_dev *gdev, uint8 bit) {
+void adc_config_gpio(const adc_dev *ignored, gpio_dev *gdev, uint8 bit) {
gpio_set_modef(gdev, bit, GPIO_MODE_ANALOG, GPIO_MODEF_PUPD_NONE);
}
diff --git a/libmaple/stm32f2/usart.c b/libmaple/stm32f2/usart.c
index 2dd3afc..9a1acf3 100644
--- a/libmaple/stm32f2/usart.c
+++ b/libmaple/stm32f2/usart.c
@@ -107,10 +107,10 @@ usart_dev *USART6 = &usart6;
* Routines
*/
-void usart_async_gpio_cfg(usart_dev *udev,
- gpio_dev *rx_dev, uint8 rx,
- gpio_dev *tx_dev, uint8 tx,
- unsigned flags) {
+void usart_config_gpios_async(usart_dev *udev,
+ gpio_dev *rx_dev, uint8 rx,
+ gpio_dev *tx_dev, uint8 tx,
+ unsigned flags) {
gpio_af af;
/* TODO: break this out into a user-facing function. */
switch (udev->clk_id) {