summaryrefslogtreecommitdiff
path: root/software/rhmixxx/gpio.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2014-06-02 00:21:12 (GMT)
committerChristian Pointner <equinox@helsinki.at>2014-06-02 00:21:12 (GMT)
commit23b29a81a9df8768ca88a8015f02fbb34f5328cb (patch)
tree66d600c77034d6d6d5e51bd2e2f57cb16e24be27 /software/rhmixxx/gpio.c
parent767786e8d6af9c21a7df0259eec17a5c79f171bd (diff)
GPIO outputs are now MIDI controlable
Diffstat (limited to 'software/rhmixxx/gpio.c')
-rw-r--r--software/rhmixxx/gpio.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/software/rhmixxx/gpio.c b/software/rhmixxx/gpio.c
index 6edf376..bdc1378 100644
--- a/software/rhmixxx/gpio.c
+++ b/software/rhmixxx/gpio.c
@@ -29,10 +29,28 @@
void gpio_init(void)
{
GPIO_DDR = 0x0F;
- GPIO_PORT = 0xFA;
+ GPIO_PORT = 0xF0;
+}
+
+void gpio_out_on(uint8_t num)
+{
+ if(num < 4)
+ GPIO_PORT |= (1 << num);
+}
+
+void gpio_out_off(uint8_t num)
+{
+ if(num < 4)
+ GPIO_PORT &= ~(1 << num);
+}
+
+void gpio_out_toggle(uint8_t num)
+{
+ if(num < 4)
+ GPIO_PORT ^= (1 << num);
}
void gpio_task(void)
{
- GPIO_PORT ^= 0x0F;
+ // TODO generate events on change of GPI
}