From af8f6044f19796825645e29e197ee7a83f2a0398 Mon Sep 17 00:00:00 2001 From: Kymkim Date: Mon, 24 Mar 2025 13:55:43 -0700 Subject: [PATCH] test module stuff --- modules/testmodule/lib/main.c | 62 +++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 modules/testmodule/lib/main.c diff --git a/modules/testmodule/lib/main.c b/modules/testmodule/lib/main.c new file mode 100644 index 00000000..45ece729 --- /dev/null +++ b/modules/testmodule/lib/main.c @@ -0,0 +1,62 @@ +#include "stm32f1xx_hal.h" + +#define NUM_COLS 2 +#define NUM_ROWS 2 + +//Stores the GPIO and the PIN location - would be useful for the matrix +typedef struct { + GPIO_TypeDef* GPIO; + uint16_t PIN; +} keyMatrix ; + +keyMatrix matrix[NUM_COLS][NUM_ROWS] = { + {{GPIOA, GPIO_PIN_0},{GPIOA, GPIO_PIN_1}}, //Column + {{GPIOA, GPIO_PIN_2},{GPIOA, GPIO_PIN_3}} //Row +}; + +int main(void){ + + HAL_Init(); //Initialize the HAL Abstraction Layer + + //Initialize a 2x2 pins + for(int col = 0; col