56 lines
1.5 KiB
C
56 lines
1.5 KiB
C
#include "main.h"
|
|
#include "init_clock.h"
|
|
#include "init_peripherials.h"
|
|
|
|
key_matrix_t keyMatrix = {
|
|
.colNum = KEYBOARD_MATRIX_COLS_NUM,
|
|
.rowNum = KEYBOARD_MATRIX_ROWS_NUM,
|
|
#if UHK_PCB_MAJOR_VERSION >= 7
|
|
.cols = (key_matrix_pin_t[]){
|
|
{PORTB, GPIOB, kCLOCK_PortB, 11},
|
|
{PORTA, GPIOA, kCLOCK_PortA, 6},
|
|
{PORTA, GPIOA, kCLOCK_PortA, 8},
|
|
{PORTB, GPIOB, kCLOCK_PortB, 0},
|
|
{PORTB, GPIOB, kCLOCK_PortB, 6},
|
|
{PORTA, GPIOA, kCLOCK_PortA, 3},
|
|
{PORTA, GPIOA, kCLOCK_PortA, 12}
|
|
},
|
|
.rows = (key_matrix_pin_t[]){
|
|
{PORTB, GPIOB, kCLOCK_PortB, 7},
|
|
{PORTB, GPIOB, kCLOCK_PortB, 10},
|
|
{PORTA, GPIOA, kCLOCK_PortA, 5},
|
|
{PORTA, GPIOA, kCLOCK_PortA, 7},
|
|
{PORTA, GPIOA, kCLOCK_PortA, 4}
|
|
}
|
|
#else
|
|
.cols = (key_matrix_pin_t[]){
|
|
{PORTB, GPIOB, kCLOCK_PortB, 11},
|
|
{PORTA, GPIOA, kCLOCK_PortA, 6},
|
|
{PORTA, GPIOA, kCLOCK_PortA, 8},
|
|
{PORTB, GPIOB, kCLOCK_PortB, 0},
|
|
{PORTB, GPIOB, kCLOCK_PortB, 6},
|
|
{PORTA, GPIOA, kCLOCK_PortA, 3},
|
|
{PORTB, GPIOB, kCLOCK_PortB, 5}
|
|
},
|
|
.rows = (key_matrix_pin_t[]){
|
|
{PORTB, GPIOB, kCLOCK_PortB, 7},
|
|
{PORTB, GPIOB, kCLOCK_PortB, 10},
|
|
{PORTA, GPIOA, kCLOCK_PortA, 5},
|
|
{PORTA, GPIOA, kCLOCK_PortA, 7},
|
|
{PORTA, GPIOA, kCLOCK_PortA, 4}
|
|
}
|
|
#endif
|
|
};
|
|
|
|
int main(void)
|
|
{
|
|
InitClock();
|
|
InitPeripherials();
|
|
KeyMatrix_Init(&keyMatrix);
|
|
|
|
while (1) {
|
|
KeyMatrix_Scan(&keyMatrix);
|
|
asm("wfi");
|
|
}
|
|
}
|