diff options
author | Christian Pointner <equinox@helsinki.at> | 2014-06-02 00:21:12 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2014-06-02 00:21:12 (GMT) |
commit | 23b29a81a9df8768ca88a8015f02fbb34f5328cb (patch) | |
tree | 66d600c77034d6d6d5e51bd2e2f57cb16e24be27 /software/rhmixxx/gpio.c | |
parent | 767786e8d6af9c21a7df0259eec17a5c79f171bd (diff) |
GPIO outputs are now MIDI controlable
Diffstat (limited to 'software/rhmixxx/gpio.c')
-rw-r--r-- | software/rhmixxx/gpio.c | 22 |
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 } |