-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.h
68 lines (49 loc) · 1.21 KB
/
config.h
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
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef __CONFIG_H__
#define __CONFIG_H__
#define F_CPU 16000000UL
#include <stdint.h>
#define LCD_DATA_PORT PORTB
#define LCD_DATA_DDR DDRB
#define LCD_AUX_PORT PORTE
#define LCD_AUX_DDR DDRE
#define LCD_RS PE5
#define LCD_RW PE6
#define LCD_ENA PE7
#define LCD_LINES 4
#define LCD_CHARS 20
#define OUTPUT_DDR DDRE
#define OUTPUT_PORT PORTE
#define OUTPUT_PIN PE3
#define DEBOUNCE_WAIT_LOOPS 16
#define DEBOUNCE_CALLS 16
// this is in clock cycles (with clk/8 prescaler)
// that effectively means 0.5us with 16MHz osc
#define ONTIME_MIN 20
#define ONTIME_MAX 1000
// we want max rep. at 1kHz
// that means 1ms
// and that means at 16MHz CPU / 256
// (in clock oscillator cycles)
//
#define PERIOD_MIN 255
#define PERIOD_MAX 65535
#define IDLE_PERIOD 1000
#define IDLE_PERIOD_8 255
#define ROTARYDDR DDRD
#define ROTARYPORT PORTD
#define ROTARYPIN PIND
#define ROTARYA PD4
#define ROTARYB PD5
#define LCD_REFRESH 10000
#define BTNDDR DDRD
#define BTNPORT PORTD
#define BTNPIN PIND
#define LED_SHOOT 0x01
#define BTN_CANCEL 0x02
#define BTN_CONFIRM 0x40
#define BTN_SHOOT 0x80
#define NULL 0
uint8_t midi_velocity;
uint8_t noteMaxInc;
uint8_t noteMaxDec;
#endif