#ifndef STM32F1_GPIO_H_ #define STM32F1_GPIO_H_ /* ########################################################################################################################################################## */ /* # Includes #################################################################################################################################### Includes # */ /* ########################################################################################################################################################## */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpadded" #include #pragma GCC diagnostic pop #include /* ########################################################################################################################################################## */ /* # Define Definitions ################################################################################################################ Define Definitions # */ /* ########################################################################################################################################################## */ /* ########################################################################################################################################################## */ /* # Macro Definitions ################################################################################################################## Macro Definitions # */ /* ########################################################################################################################################################## */ /* ########################################################################################################################################################## */ /* # Type Definitions #################################################################################################################### Type Definitions # */ /* ########################################################################################################################################################## */ enum STM32F1_IMODE_ENUM { STM32F1_ANALOG = 0, STM32F1_FLOATING = 1, STM32F1_PULLUP_PULLDOWN = 2, }__attribute__((packed)) ; typedef enum STM32F1_IMODE_ENUM STM32F1_IMODE; enum STM32F1_OMODE_ENUM { STM32F1_PUSHPULL = 0, STM32F1_OPENDRAIN = 1 }__attribute__((packed)) ; typedef enum STM32F1_OMODE_ENUM STM32F1_OMODE; enum STM32F1_OSPEED_ENUM { STM32F1_10MHZ = 1, STM32F1_2MHZ = 2, STM32F1_50MHZ = 3 }__attribute__((packed)) ; typedef enum STM32F1_OSPEED_ENUM STM32F1_OSPEED; /* ########################################################################################################################################################## */ /* # Variable Declarations ########################################################################################################## Variable Declarations # */ /* ########################################################################################################################################################## */ /* ########################################################################################################################################################## */ /* # Static Inline Functions ###################################################################################################### Static Inline Functions # */ /* ########################################################################################################################################################## */ /* ########################################################################################################################################################## */ /* # Function Prototypes ############################################################################################################## Function Prototypes # */ /* ########################################################################################################################################################## */ EXITCODE STM32F1_GPIO_configInput(GPIO_TypeDef* port, const uint8 pin, const STM32F1_IMODE mode); EXITCODE STM32F1_GPIO_configOutput(GPIO_TypeDef* port, const uint8 pin, const STM32F1_OMODE mode, const STM32F1_OSPEED ospeed); EXITCODE STM32F1_GPIO_configAlternate(GPIO_TypeDef* port, const uint8 pin, const STM32F1_OMODE mode, const STM32F1_OSPEED ospeed); EXITCODE STM32F1_GPIO_setPin(GPIO_TypeDef* port, const uint8 pin); EXITCODE STM32F1_GPIO_unsetPin(GPIO_TypeDef* port, const uint8 pin); EXITCODE STM32F1_GPIO_putPin(GPIO_TypeDef* port, const uint8 pin, const BYTE value); EXITCODE STM32F1_GPIO_getPin(const GPIO_TypeDef* port, const uint8 pin, BYTE* value); BYTE STM32F1_GPIO_getPin_Direct(const GPIO_TypeDef* port, const uint8 pin); /* ########################################################################################################################################################## */ #endif /* STM32F1_GPIO_H_ */ /* EOF */