summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2014-09-01 21:02:51 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2014-09-01 21:02:51 +0200
commit5a4b6a5e6979fa034d537a803d43c04181a5ade7 (patch)
treebcbbe758c30c55e6b4e5b70faa8cf720f3fb7e34 /firmware/drivers
parente98d39ba86142ba17b608ebf2f2880940f5621c2 (diff)
Rename LED functions to be more in thread with the rest of the code.
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/led.c20
-rw-r--r--firmware/drivers/led.h8
2 files changed, 16 insertions, 12 deletions
diff --git a/firmware/drivers/led.c b/firmware/drivers/led.c
index fe8d6f5..293d627 100644
--- a/firmware/drivers/led.c
+++ b/firmware/drivers/led.c
@@ -28,28 +28,32 @@
#include <LPC17xx.h>
-int led_state = 0;
+static int led_state = 0;
-void LED_Init()
+void led_init()
{
- LPC_SC->PCONP |= ( 1 << 15 ); // power up GPIO
+ // See table 46, pg. 63
+ uint32_t *pconp = (uint32_t*)0x400FC0C4;
+ *pconp |= (0b1 << 15); // power up GPIO
+
+ // See table 104, pg. 124
LPC_GPIO1->FIODIR |= 1 << 29; // puts P1.29 into output mode.
}
-void LED_on()
+void led_on()
{
led_state = 1;
LPC_GPIO1->FIOPIN |= 1 << 29; // make P1.29 high
}
-void LED_off()
+void led_off()
{
led_state = 0;
LPC_GPIO1->FIOPIN &= ~( 1 << 29 ); // make P1.29 low
}
-void LED_toggle()
+void led_toggle()
{
- if(led_state) LED_off();
- else LED_on();
+ if(led_state) led_off();
+ else led_on();
}
diff --git a/firmware/drivers/led.h b/firmware/drivers/led.h
index 2c81474..d2af83f 100644
--- a/firmware/drivers/led.h
+++ b/firmware/drivers/led.h
@@ -27,9 +27,9 @@
#ifndef __PEDAL2METAL_LED_H__
#define __PEDAL2METAL_LED_H__
-void LED_Init();
-void LED_on();
-void LED_off();
-void LED_toggle();
+void led_init();
+void led_on();
+void led_off();
+void led_toggle();
#endif/*__PEDAL2METAL_LED_H__*/