Changed SHAL_Peripheral to take in a void* of any peripheral struct, and added SHAL_Peripheral_Register for individual registers

This commit is contained in:
2025-08-30 16:57:52 -07:00
parent 2da3413329
commit 33fc098dfc
11 changed files with 139 additions and 78 deletions

View File

@@ -8,6 +8,38 @@
#include "SHAL_CORE.h"
#include <cassert>
#include <stm32f072xb.h>
#include "SHAL_GPIO_REG_F072xB.h"
enum class PinMode {
INPUT_MODE = 0b00,
OUTPUT_MODE = 0b01,
ALTERNATE_FUNCTION_MODE = 0b10,
ANALOG_MODE = 0b11
};
enum class PinValue {
HI = 1,
LOW = 0,
};
class GPIO{
public:
void toggle();
//TODO replace stupid offset hack from APB
void setHigh();
void setLow();
private:
friend class GPIOManager;
explicit GPIO(GPIO_Key key);
GPIO();
GPIO_Key GPIO_KEY;
};
#endif //SHMINGO_HAL_SHAL_GPIO_H