forked from akafugu/VFDDeluxe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.h
103 lines (82 loc) · 2.71 KB
/
global.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
* VFD Deluxe
* (C) 2011-12 Akafugu Corporation
*
* This program 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 2 of the License, or (at your option) any later
* version.
*
* This program 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.
*
*/
// GLOBAL include file: Should be the first file to include in all source files
#include <Arduino.h>
#include "features.h"
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>
#include <avr/eeprom.h>
#include <stdbool.h>
#include <stdlib.h>
#include "direct_pin_read.h"
#if BOARD == BOARD_VFD_MODULAR_CLOCK
struct PinMap
{
// HV518 / HV5812
static const uint8_t data = 11;
static const uint8_t clock = 13;
static const uint8_t latch = A0;
static const uint8_t blank = 6;
// Nixie anodes (not supported on VFD Modular clock)
static const uint8_t nixie_a1 = -1;
static const uint8_t nixie_a2 = -1;
static const uint8_t nixie_a3 = -1;
static const uint8_t nixie_a4 = -1;
// Input buttons
static const uint8_t button1 = -1;
static const uint8_t button2 = -1;
//static const uint8_t button1 = 4;
//static const uint8_t button2 = -1;
// other
static const uint8_t alarm_switch = 2;
static const uint8_t sig0 = 3;
static const uint8_t sig1 = 4;
static const uint8_t sig2 = 5;
static const uint8_t piezo = 10;
static const uint8_t piezo2 = 9;
};
#elif BOARD == BOARD_VFD_DELUXE
struct PinMap
{
// HV518 / HV5812
static const uint8_t data = A0;
static const uint8_t clock = A2;
static const uint8_t latch = A1;
//static const uint8_t blank = 9; // v1
static const uint8_t blank = 6;
// Nixie anodes
static const uint8_t nixie_a1 = A3;
static const uint8_t nixie_a2 = 17;
static const uint8_t nixie_a3 = A4;
static const uint8_t nixie_a4 = 16;
// Input buttons / alarm sitch
static const uint8_t button1 = 9;
static const uint8_t button2 = 7;
static const uint8_t alarm_switch = 12;
// Shield signature pins
static const uint8_t sig0 = 5;
static const uint8_t sig1 = A4;
static const uint8_t sig2 = A3;
// RTC SQW interrupt
static const uint8_t sqw = 8; // PB4 / PCINT4
// other
static const uint8_t piezo = 11;
static const uint8_t piezo2 = 10;
// iv-17 shield 6-digit support
static const uint8_t extra1 = 4;
static const uint8_t extra2 = A5;
};
#endif