summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBhuvanchandra DV <bhuvanchandra.dv@toradex.com>2017-02-17 21:19:07 +0530
committerStefan Agner <stefan.agner@toradex.com>2017-02-17 12:58:16 -0800
commit3ff48feae1e83761563a554a6b10faa8ebcc6356 (patch)
tree69b303d673f64cf465f64b1eebeda828f87fd1d9
parent2f818b5e1b05ee0ce5cb7073ea312bb216ec591b (diff)
vf6xx: gpio_vf6xx: correct the GPIO toggle control
Drop unnecessary parameter gpio_pin_action_t and use the port toggle register to toggle the pin. Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
-rw-r--r--examples/vf6xx_colibri_m4/demo_apps/gpio_sample/main.c2
-rw-r--r--platform/drivers/inc/gpio_vf6xx.h7
-rw-r--r--platform/drivers/src/gpio_vf6xx.c8
3 files changed, 6 insertions, 11 deletions
diff --git a/examples/vf6xx_colibri_m4/demo_apps/gpio_sample/main.c b/examples/vf6xx_colibri_m4/demo_apps/gpio_sample/main.c
index 8b29c54..8a78759 100644
--- a/examples/vf6xx_colibri_m4/demo_apps/gpio_sample/main.c
+++ b/examples/vf6xx_colibri_m4/demo_apps/gpio_sample/main.c
@@ -62,7 +62,7 @@ void switch_task(void *p)
void led_toggle_task(void *p)
{
for (;;) {
- GPIO_TogglePinOutput(GPIO(39), 39, gpioPinSet);
+ GPIO_TogglePinOutput(GPIO(39), 39);
vTaskDelay(500);
}
diff --git a/platform/drivers/inc/gpio_vf6xx.h b/platform/drivers/inc/gpio_vf6xx.h
index e420b84..c191e07 100644
--- a/platform/drivers/inc/gpio_vf6xx.h
+++ b/platform/drivers/inc/gpio_vf6xx.h
@@ -88,8 +88,6 @@ extern "C" {
*/
void GPIO_Init(GPIO_Type* base, gpio_init_t* initStruct);
-void GPIO_TogglePinOutput(GPIO_Type* base, uint32_t pin, gpio_pin_action_t pinVal);
-
/*@}*/
/*!
@@ -203,6 +201,11 @@ static inline uint8_t GPIO_ReadPadStatus(GPIO_Type* base, uint32_t pin)
return (uint8_t)((GPIO_PSOR_REG(base) >> (pin & 0x1f)) & 1U);
}
+static inline void GPIO_TogglePinOutput(GPIO_Type* base, uint32_t pin)
+{
+ GPIO_PTOR_REG(base) |= GPIO_OFFSET(pin);
+}
+
/*@}*/
#if defined(__cplusplus)
diff --git a/platform/drivers/src/gpio_vf6xx.c b/platform/drivers/src/gpio_vf6xx.c
index 5f9326c..637080a 100644
--- a/platform/drivers/src/gpio_vf6xx.c
+++ b/platform/drivers/src/gpio_vf6xx.c
@@ -86,14 +86,6 @@ void GPIO_WritePinOutput(GPIO_Type* base, uint32_t pin, gpio_pin_action_t pinVal
GPIO_PSOR_REG(base) &= ~(GPIO_OFFSET(pin)); /* Set pin output to low level.*/
}
-void GPIO_TogglePinOutput(GPIO_Type* base, uint32_t pin, gpio_pin_action_t pinVal)
-{
- if (pinVal == gpioPinSet)
- GPIO_PTOR_REG(base) |= GPIO_OFFSET(pin); /* Set pin output to high level.*/
- else
- GPIO_PTOR_REG(base) &= ~(GPIO_OFFSET(pin)); /* Set pin output to low level.*/
-}
-
/*******************************************************************************
* EOF
******************************************************************************/