Initial commit
This commit is contained in:
19
Source/Drivers/HAL_M/GPIO/Inc/HAL_GPIO.h
Normal file
19
Source/Drivers/HAL_M/GPIO/Inc/HAL_GPIO.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef HAL_GPIO
|
||||
#define HAL_GPIO
|
||||
|
||||
#include "stm32g431xx.h"
|
||||
|
||||
// I/O MODES
|
||||
#define INPUT_MODE ((uint32_t) 0x00) // input mode
|
||||
#define OUTPUT_MODE ((uint32_t) 0x01) // general purpose output mode
|
||||
#define ALT_FUNC_MODE ((uint32_t) 0x02) // alternative function mode
|
||||
#define ANALOG_MODE ((uint32_t) 0x03) // alanog mode (reset state)
|
||||
|
||||
// CLOCK ENABLING
|
||||
#define GPIO_CLOCK_EN_GPIOA (RCC->AHB2ENR |= (1 << 0))
|
||||
#define GPIO_CLOCK_EN_GPIOB (RCC->AHB2ENR |= (1 << 1))
|
||||
#define GPIO_CLOCK_EN_GPIOC (RCC->AHB2ENR |= (1 << 2))
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
3
Source/Drivers/HAL_M/GPIO/Src/HAL_GPIO.c
Normal file
3
Source/Drivers/HAL_M/GPIO/Src/HAL_GPIO.c
Normal file
@@ -0,0 +1,3 @@
|
||||
#include "GPIO/Inc/HAL_GPIO.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user