aboutsummaryrefslogtreecommitdiffstats
path: root/src/matrix.h
blob: c49bc197b42dd9177e0045c2c1b67e9029711a29 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#pragma once

#include "util.h"

#include <stdint.h>

#define KEY_ROWS 4
#define KEY_COLS 6
#define KEY_COUNT (KEY_ROWS * KEY_COLS)

#define MAT_OFFSET(side) ((side) == LEFT ? 0 : KEY_COUNT)

void matrix_init(void);
void scan_matrix(void);
uint32_t matrix_encode_half(int side);
void matrix_decode_half(int side, uint32_t);

extern bool prev_state_matrix[KEY_COUNT * 2];
extern bool state_matrix[KEY_COUNT * 2];