![]() |
S32 SDK
|
This module covers the functionality of the PORT peripheral.
PORT HAL provides the API for reading and writing register bit-fields belonging to the PORT module.
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... | |
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... | |
Digital filter clock source selection Implements : port_digital_filter_clock_source_t_Class.
Enumerator | |
---|---|
PORT_BUS_CLOCK |
Digital filters are clocked by the bus clock. |
PORT_LPO_CLOCK |
Digital filters are clocked by the 1 kHz LPO clock. |
Definition at line 113 of file port_hal.h.
Configures the drive strength. Implements : port_drive_strength_t_Class.
Enumerator | |
---|---|
PORT_LOW_DRIVE_STRENGTH |
low drive strength is configured. |
PORT_HIGH_DRIVE_STRENGTH |
high drive strength is configured. |
Definition at line 87 of file port_hal.h.
Configures the interrupt generation condition. Implements : port_interrupt_config_t_Class.
Definition at line 123 of file port_hal.h.
enum port_mux_t |
Pin mux selection Implements : port_mux_t_Class.
Definition at line 97 of file port_hal.h.
enum port_pull_config_t |
Internal resistor pull feature selection Implements : port_pull_config_t_Class.
Definition at line 64 of file port_hal.h.
|
inlinestatic |
Clears the individual pin-interrupt status flag.
[in] | base | port base pointer |
[in] | pin | port pin number Implements : PORT_HAL_ClearPinIntFlagCmd_Activity |
Definition at line 517 of file port_hal.h.
|
inlinestatic |
Clears the entire port interrupt status flag.
[in] | base | port base pointer Implements : PORT_HAL_ClearPortIntFlagCmd_Activity |
Definition at line 547 of file port_hal.h.
|
inlinestatic |
Reads the individual pin-interrupt status flag.
If a pin is configured to generate the DMA request, the corresponding flag is cleared automatically at the completion of the requested DMA transfer. Otherwise, the flag remains set until a logic one is written to that flag. If configured for a level sensitive interrupt that remains asserted, the flag is set again immediately.
[in] | base | port base pointer |
[in] | pin | port pin number |
Definition at line 502 of file port_hal.h.
|
inlinestatic |
Gets the current port pin interrupt/DMA request configuration.
[in] | base | port base pointer |
[in] | pin | port pin number |
Definition at line 478 of file port_hal.h.
|
inlinestatic |
Reads the entire port interrupt status flag.
[in] | base | port base pointer |
Definition at line 535 of file port_hal.h.
|
inlinestatic |
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.
[in] | base | port base pointer |
[in] | clockSource | chose which clock source to use for current port
|
Definition at line 379 of file port_hal.h.
|
inlinestatic |
Enables or disables the digital filter in one single port. Each bit of the 32-bit register represents one pin.
[in] | base | port base pointer |
[in] | pin | port pin number |
[in] | isDigitalFilterEnabled | digital filter enable/disable
|
Definition at line 355 of file port_hal.h.
|
inlinestatic |
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.
[in] | base | port base pointer |
[in] | width | configure digital filter width (should be less than 5 bits). Implements : PORT_HAL_SetDigitalFilterWidth_Activity |
Definition at line 396 of file port_hal.h.
|
inlinestatic |
Configures the drive strength if the pin is used as a digital output.
[in] | base | port base pointer |
[in] | pin | port pin number |
[in] | driveSelect | drive strength selection
|
Definition at line 284 of file port_hal.h.
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.
[in] | base | port base pointer |
[in] | highPinSelect | update corresponding pin control register or not. For a specific bit:
|
[in] | config | value is written to a high half port control register bits[15:0]. |
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.
[in] | base | port base pointer |
[in] | lowPinSelect | update corresponding pin control register or not. For a specific bit:
|
[in] | config | value is written to a low half port control register bits[15:0]. |
|
inlinestatic |
Configures the pin muxing.
[in] | base | port base pointer |
[in] | pin | port pin number |
[in] | mux | pin muxing slot selection
|
Definition at line 309 of file port_hal.h.
|
inlinestatic |
Configures the passive filter if the pin is used as a digital input.
If enabled, a low pass filter (10 MHz to 30 MHz bandwidth) is enabled on the digital input path. Disable the Passive Input Filter when supporting high speed interfaces (> 2 MHz) on the pin.
[in] | base | port base pointer |
[in] | pin | port pin number |
[in] | isPassiveFilterEnabled | passive filter configuration
|
Definition at line 239 of file port_hal.h.
|
inlinestatic |
Locks or unlocks the pin control register bits[15:0].
[in] | base | port base pointer |
[in] | pin | port pin number |
[in] | isPinLockEnabled | lock pin control register or not
|
Definition at line 331 of file port_hal.h.
|
inlinestatic |
Configures the port pin interrupt/DMA request.
[in] | base | port base pointer. |
[in] | pin | port pin number |
[in] | intConfig | interrupt configuration
|
Definition at line 450 of file port_hal.h.
|
inlinestatic |
Configures the internal resistor.
Pull configuration is valid in all digital pin muxing modes.
[in] | base | port base pointer. |
[in] | pin | port pin number |
[in] | pullConfig | internal resistor pull feature selection
|
Definition at line 164 of file port_hal.h.