#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