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