summaryrefslogtreecommitdiff
path: root/software/rhmixxx/keypad.c
blob: 7362ab43bd37f34b56352920f3821a431e62be49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
 *  rhmidi
 *
 *  Copyright (C) 2014 Christian Pointner <equinox@helsinki.at>
 *
 *  This file is part of rhmidi.
 *
 *  rhmidi is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  any later version.
 *
 *  rhmidi is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  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)
}