S32 SDK
port_hal.h File Reference
#include "device_registers.h"
#include <stdbool.h>

Go to the source code of this file.

Enumerations

enum  port_pull_config_t { PORT_INTERNAL_PULL_NOT_ENABLED = 0U, PORT_INTERNAL_PULL_DOWN_ENABLED = 1U, PORT_INTERNAL_PULL_UP_ENABLED = 2U }
 Internal resistor pull feature selection Implements : port_pull_config_t_Class. More...
 
enum  port_drive_strength_t { PORT_LOW_DRIVE_STRENGTH = 0U, PORT_HIGH_DRIVE_STRENGTH = 1U }
 Configures the drive strength. Implements : port_drive_strength_t_Class. More...
 
enum  port_mux_t {
  PORT_PIN_DISABLED = 0U, PORT_MUX_AS_GPIO = 1U, PORT_MUX_ALT2 = 2U, PORT_MUX_ALT3 = 3U,
  PORT_MUX_ALT4 = 4U, PORT_MUX_ALT5 = 5U, PORT_MUX_ALT6 = 6U, PORT_MUX_ALT7 = 7U
}
 Pin mux selection Implements : port_mux_t_Class. More...
 
enum  port_digital_filter_clock_source_t { PORT_BUS_CLOCK = 0U, PORT_LPO_CLOCK = 1U }
 Digital filter clock source selection Implements : port_digital_filter_clock_source_t_Class. More...
 
enum  port_interrupt_config_t {
  PORT_DMA_INT_DISABLED = 0x0U, PORT_DMA_RISING_EDGE = 0x1U, PORT_DMA_FALLING_EDGE = 0x2U, PORT_DMA_EITHER_EDGE = 0x3U,
  PORT_INT_LOGIC_ZERO = 0x8U, PORT_INT_RISING_EDGE = 0x9U, PORT_INT_FALLING_EDGE = 0xAU, PORT_INT_EITHER_EDGE = 0xBU,
  PORT_INT_LOGIC_ONE = 0xCU
}
 Configures the interrupt generation condition. Implements : port_interrupt_config_t_Class. More...
 

Functions

Configuration
static void PORT_HAL_SetPullSel (PORT_Type *const base, const uint32_t pin, const port_pull_config_t pullConfig)
 Configures the internal resistor. More...
 
static void PORT_HAL_SetPassiveFilterMode (PORT_Type *const base, const uint32_t pin, const bool isPassiveFilterEnabled)
 Configures the passive filter if the pin is used as a digital input. More...
 
static void PORT_HAL_SetDriveStrengthMode (PORT_Type *const base, const uint32_t pin, const port_drive_strength_t driveSelect)
 Configures the drive strength if the pin is used as a digital output. More...
 
static void PORT_HAL_SetMuxModeSel (PORT_Type *const base, const uint32_t pin, const port_mux_t mux)
 Configures the pin muxing. More...
 
static void PORT_HAL_SetPinCtrlLockMode (PORT_Type *const base, const uint32_t pin, const bool isPinLockEnabled)
 Locks or unlocks the pin control register bits[15:0]. More...
 
static void PORT_HAL_SetDigitalFilterMode (PORT_Type *const base, const uint32_t pin, const bool isDigitalFilterEnabled)
 Enables or disables the digital filter in one single port. Each bit of the 32-bit register represents one pin. More...
 
static void PORT_HAL_SetDigitalFilterClock (PORT_Type *const base, const port_digital_filter_clock_source_t clockSource)
 Configures the clock source for the digital input filters. Changing the filter clock source should only be done after disabling all enabled filters. Every pin in one port uses the same clock source. More...
 
static void PORT_HAL_SetDigitalFilterWidth (PORT_Type *const base, const uint8_t width)
 Configures the maximum size of the glitches (in clock cycles) that the digital filter absorbs for enabled digital filters. Glitches that are longer than this register setting (in clock cycles) pass through the digital filter, while glitches that are equal to or less than this register setting (in clock cycles) are filtered. Changing the filter length should only be done after disabling all enabled filters. More...
 
void PORT_HAL_SetLowGlobalPinCtrlCmd (PORT_Type *const base, const uint16_t lowPinSelect, const uint16_t config)
 Configures the low half of the pin control register for the same settings. This function operates pin 0 -15 of one specific port. More...
 
void PORT_HAL_SetHighGlobalPinCtrlCmd (PORT_Type *const base, const uint16_t highPinSelect, const uint16_t config)
 Configures the high half of pin control register for the same settings. This function operates pin 16 -31 of one specific port. More...
 
Interrupt
static void PORT_HAL_SetPinIntSel (PORT_Type *const base, const uint32_t pin, const port_interrupt_config_t intConfig)
 Configures the port pin interrupt/DMA request. More...
 
static port_interrupt_config_t PORT_HAL_GetPinIntSel (const PORT_Type *const base, const uint32_t pin)
 Gets the current port pin interrupt/DMA request configuration. More...
 
static bool PORT_HAL_GetPinIntMode (const PORT_Type *const base, const uint32_t pin)
 Reads the individual pin-interrupt status flag. More...
 
static void PORT_HAL_ClearPinIntFlagCmd (PORT_Type *const base, const uint32_t pin)
 Clears the individual pin-interrupt status flag. More...
 
static uint32_t PORT_HAL_GetPortIntFlag (const PORT_Type *const base)
 Reads the entire port interrupt status flag. More...
 
static void PORT_HAL_ClearPortIntFlagCmd (PORT_Type *const base)
 Clears the entire port interrupt status flag. More...