diff options
author | Christian Pointner <equinox@helsinki.at> | 2014-05-03 15:01:36 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2014-05-03 15:01:36 (GMT) |
commit | 315660cf384f95728f99fd4028174b35c9195c56 (patch) | |
tree | 84c6e525d5e82fe61c1f39130372ad077eee44a8 /software | |
parent | b47595aa9d1ed5cbe34a1d07b6b73378423c1258 (diff) |
keypad init finished
Diffstat (limited to 'software')
-rw-r--r-- | software/rhmixxx/keypad.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/software/rhmixxx/keypad.c b/software/rhmixxx/keypad.c index 96214e8..7362ab4 100644 --- a/software/rhmixxx/keypad.c +++ b/software/rhmixxx/keypad.c @@ -19,19 +19,37 @@ * along with rhmidi. If not, see <http://www.gnu.org/licenses/>. */ +#include <avr/io.h> #include "keypad.h" +#define KEYPAD_PIN PINA +#define KEYPAD_PORT PORTA +#define KEYPAD_DDR DDRA + +#define LEDS_LOW_PORT PORTC +#define LEDS_LOW_DDR DDRC +#define LEDS_HIGH_PORT PORTD +#define LEDS_HIGH_DDR DDRD + void keypad_init(void) { + KEYPAD_DDR = 0x00; + KEYPAD_PORT = 0xFF; + LEDS_LOW_DDR = 0xFF; + LEDS_LOW_PORT = 0xFF; + LEDS_HIGH_DDR = 0xFF; + LEDS_HIGH_PORT = 0xFF; } void keypad_start_led_test(int cnt) { - + LEDS_LOW_PORT = 0x00; + LEDS_HIGH_PORT = 0x00; } void keypad_task(void) { - + // TODO: poll keypad matrix for changes (with low pass) + // control led test (if running) } |