STM32G0 MCAL 0.0.1
Tiny MCAL for educational purpose.
|
Port Specific Arquitecture Driver More...
#include "Std_Types.h"
#include "Port_Cfg.h"
#include "Port_Arch.h"
#include "Registers.h"
#include "Bfx.h"
Macros | |
#define | TWO_BITS 0x02u |
#define | FOUR_BITS 0x04u |
#define | PIN_08_VAL 0x08u |
#define | MUL_BY_TWO 1u |
#define | MUL_BY_FOUR 2u |
Functions | |
void | Port_Arch_Init (const Port_PinConfigType *PortConfigPtr) |
Initialize the GPIO pins to the configuration store on ConfigPTR. | |
void | Port_Arch_SetPinDirection (const Port_PinConfigType *PortConfigPtr, Port_PinDirectionType Direction) |
Set the direction of a GPIO during runtime. | |
void | Port_Arch_SetPinMode (const Port_PinConfigType *PortConfigPtr, uint8 PinMode, uint8 AltMode) |
Set the mode of a GPIO during runtime. | |
void | Port_Arch_RefreshPortDirection (const Port_PinConfigType *PortConfigPtr) |
Refresh port direction. | |
Variables | |
static Port_RegisterType * | PortPeripherals [] = { PORTA, PORTB, PORTC, PORTD, PORTE, PORTF } |
Global port register array. | |
Port Specific Arquitecture Driver
PORT driver implementation for the STM32G0xx family of microcontrollers. This file contains the hardware specific implementation of the PORT driver. The file is implemented as a means of abstraction from the hardware, this way we can avoid to include Arch headers in the actual driver header, making the low level interfaces available only for the inmediate upper layer.
void Port_Arch_Init | ( | const Port_PinConfigType * | PortConfigPtr | ) |
Initialize the GPIO pins to the configuration store on ConfigPTR.
This function changes the values of the registers depending on the ConfigPtr values.
PortConfigPtr | Pointer to ConfigPtr struct array. |
< Multiply by two on a shift operation
< operation on two bits
< Multiply by two on a shift operation
< operation on two bits
< Multiply by two on a shift operation
< operation on two bits
< get the four most significant nibble
< value of pin 8
< Multiply by four on a shift operation
< operation on four bits
< get the less significant bits
< value of pin 8
< Multiply by four on a shift operation
< operation on four bits
< get the less significant bits
void Port_Arch_RefreshPortDirection | ( | const Port_PinConfigType * | PortConfigPtr | ) |
Refresh port direction.
The function refreshes the registers values of the GPIOS moder during runtime to the initial values only if they are configured as non changeables.
PortConfigPtr | Pointer for the port configuration value. |
< Input mode value
< General purpose output mode value
< Multiply by two on a shift operation
< operation on two bits
< get the four most significant nibble
void Port_Arch_SetPinDirection | ( | const Port_PinConfigType * | PortConfigPtr, |
Port_PinDirectionType | Direction ) |
Set the direction of a GPIO during runtime.
The function changes the registers values of the GPIOS direction during runtime.
PortConfigPtr | Pointer for the port configuration value. |
Direction | Direction to be changed. |
< Multiply by two on a shift operation
< operation on two bits
void Port_Arch_SetPinMode | ( | const Port_PinConfigType * | PortConfigPtr, |
uint8 | PinMode, | ||
uint8 | AltMode ) |
Set the mode of a GPIO during runtime.
The function changes the registers values of the GPIOS mode during runtime.
PortConfigPtr | Pointer for the port configuration value. |
PinMode | Pin Mode to be changed. |
AltMode | Altern Mode to be changed. |
< Multiply by two on a shift operation
< operation on two bits
< value of pin 8
< Multiply by four on a shift operation
< operation on four bits
< value of pin 8
< Multiply by four on a shift operation
< operation on four bits