Add firmware for the key cluster module based on the firmware of the left keyboard half.

This commit is contained in:
László Monda
2019-05-15 22:58:05 +02:00
parent 8f98bf3d2f
commit b92bf86b99
26 changed files with 1273 additions and 0 deletions

41
keycluster/src/main.c Normal file
View File

@@ -0,0 +1,41 @@
#include "main.h"
#include "slave/init_clock.h"
#include "init_peripherals.h"
#include "bootloader.h"
#include <stdio.h>
#include "key_scanner.h"
DEFINE_BOOTLOADER_CONFIG_AREA(I2C_ADDRESS_LEFT_KEYBOARD_HALF_BOOTLOADER)
key_matrix_t keyMatrix = {
.colNum = KEYBOARD_MATRIX_COLS_NUM,
.rowNum = KEYBOARD_MATRIX_ROWS_NUM,
.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}
}
};
int main(void)
{
InitClock();
InitPeripherals();
KeyMatrix_Init(&keyMatrix);
InitKeyScanner();
while (1) {
__WFI();
}
}