-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.h
More file actions
81 lines (75 loc) · 4.15 KB
/
user.h
File metadata and controls
81 lines (75 loc) · 4.15 KB
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
/******************************************************************************/
/* MatrixEncoderDecoder v1.03 */
/* main.c */
/* John Kinkennon */
/* 11/2/2013 */
/* */
/* 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. */
/* */
/* You should have received a copy of the GNU General Public License along */
/* with this program; if not, write to the Free Software Foundation, Inc., */
/* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
/* */
/* John Kinkennon, 4307 NE 65th Ct, Vancouver, WA 98661 USA */
/* email: john@kinkennon.com */
/* */
/* This program uses Microchip USB software. Refer to the included header */
/* files for Microchip licensing restrictions. */
/******************************************************************************/
/******************************************************************************/
/* User Level #define Macros */
/******************************************************************************/
//#define USE_LCD /* Comment out if no LCD is connected */
//#define USE_I2C /* Comment out if no Centipede Shields used */
#define USE_11x6_MATRIX /* Comment out for 8x8 matrix size */
//#define USE_8x4_PEDAL /* Uncomment to use an 8x4 pedalboard (some ADCs) */
#define USE_PICKIT3 /* Comment out to use bootloader */
#define SIZEOF_MSG_BUF 64
#define SIZEOF_RX_BUF 64
#define SIZEOF_TX_BUF 4
#define NUM_SWITCHES 512 // default total keys and pistons
/** NVM definitions ***********************************************************/
#define NVM_PROGRAM_PAGE 0xbd010000 // new value for use with UBW32 bootloader
#define NVM_ADDRESS_PAGE (NVM_PROGRAM_PAGE & 0x9fffffff)
/******************************************************************************/
/* User Function Prototypes /
/******************************************************************************/
void InitApp(void); /* I/O and Peripheral Initialization */
void putNvmTable(void);
void getNvmTable(void);
void getNvmTableRow(int tableRow);
void initPorts(void);
void initBuffers(void);
void initTranslateTable(void);
void initADC(void);
void initTimer2(void);
void initTimer3(void);
void initTimer4(void);
void resetTimer2(void);
void resetTimer3(void);
void resetTimer4(void);
void delayTimer1(int preset);
void initI2C(void);
void setMatrixColumn(int matrixColumn);
void clrMatrixColumn(int matrixColumn);
void getTwelveBits(int matrixColumn);
void getSixteenBits(int matrixColumn);
void updateKeyTable(int matrix);
void eraseRxBuffer(void);
void eraseMidiTxMsg(void);
void eraseMidiRxMsg(void);
void putMidiMsg(void);
void sendMidiMsg(void);
void getPots(int numPots);
void BlinkUSBStatus(void);
static void InitializeSystem(void);
void ProcessIO(void);
void UserInit(void);