STM32G0 MCAL 0.0.1
Tiny MCAL for educational purpose.
Loading...
Searching...
No Matches
Port_Arch.h
Go to the documentation of this file.
1
11#ifndef PORT_ARCH_H__
12#define PORT_ARCH_H__
13
14#include "Port_Types.h"
15
22#define PORT_A 0u
23#define PORT_B 1u
24#define PORT_C 2u
25#define PORT_D 3u
26#define PORT_E 4u
27#define PORT_F 5u
30
35#define GET_LOW_NIBBLE( x ) ( (x)&0xFu )
36#define GET_HIGH_NIBBLE( x ) ( ( x ) >> 4u )
37#define GET_HIGH_BYTE( x ) ( ( x ) >> 8u )
40
49#define PORT_MODE_INPUT 0x00u
50#define PORT_MODE_OUTPUT 0x10u
51#define PORT_MODE_ANALOG 0x30u
52#define PORT_MODE_ALT_AF0 0x20u
53#define PORT_MODE_ALT_AF1 0x21u
54#define PORT_MODE_ALT_AF2 0x22u
55#define PORT_MODE_ALT_AF3 0x23u
56#define PORT_MODE_ALT_AF4 0x24u
57#define PORT_MODE_ALT_AF5 0x25u
58#define PORT_MODE_ALT_AF6 0x26u
59#define PORT_MODE_ALT_AF7 0x27u
62
69#define PORT_NOPULL 0x00u
70#define PORT_PULLUP 0x01u
71#define PORT_PULLDOWN 0x02u
74
81#define PORT_PUSH_PULL 0x00u
82#define PORT_OPEN_COLECTOR 0x01u
85
92#define PORT_VERY_LOW_SPEED 0x00u
93#define PORT_LOW_SPEED 0x01u
94#define PORT_HIGH_SPEED 0x02u
95#define PORT_VERY_HIGH_SPEED 0x03u
98
105#define PORT_PIN_IN 0x00u
106#define PORT_PIN_OUT 0x01u
109
110void Port_Arch_Init( const Port_PinConfigType *PortConfigPtr );
111void Port_Arch_SetPinDirection( const Port_PinConfigType *PortConfigPtr, Port_PinDirectionType Direction );
112void Port_Arch_SetPinMode( const Port_PinConfigType *PortConfigPtr, uint8 PinMode, uint8 AltMode );
113void Port_Arch_RefreshPortDirection( const Port_PinConfigType *PortConfigPtr );
114
115#endif /* PORT_ARCH_H__ */
unsigned char uint8
Definition Platform_Types.h:94
void Port_Arch_RefreshPortDirection(const Port_PinConfigType *PortConfigPtr)
Refresh port direction.
Definition Port_Arch.c:133
void Port_Arch_SetPinDirection(const Port_PinConfigType *PortConfigPtr, Port_PinDirectionType Direction)
Set the direction of a GPIO during runtime.
Definition Port_Arch.c:86
void Port_Arch_SetPinMode(const Port_PinConfigType *PortConfigPtr, uint8 PinMode, uint8 AltMode)
Set the mode of a GPIO during runtime.
Definition Port_Arch.c:104
void Port_Arch_Init(const Port_PinConfigType *PortConfigPtr)
Initialize the GPIO pins to the configuration store on ConfigPTR.
Definition Port_Arch.c:51
PORT Driver Types
struct _Port_PinConfigType Port_PinConfigType
Definition of the external data structure containing the initialization data
uint8 Port_PinDirectionType
Data type for the symbolic direction of a pin. range: PORT_PIN_IN and PORT_PIN_OUT.
Definition Port_Types.h:70