Padframe.
More...
The padframe driver provides support for controlling PADs.
Flags are used to configure pad : drive strength, pull activation.
Enumerator |
---|
PI_PAD_PULL_DISABLE |
Disable pull.
|
PI_PAD_PULL_ENABLE |
Enable pull.
|
PI_PAD_DS_LOW |
Low drive strength.
|
PI_PAD_DS_HIGH |
High drive strength.
|
This is used to identify the function for each pad.
Enumerator |
---|
PI_PAD_FUNC0 |
Alternate func0, default func.
|
PI_PAD_FUNC1 |
Alternate func1.
|
PI_PAD_FUNC2 |
Alternate func2, pads as GPIOs.
|
PI_PAD_FUNC3 |
Alternate func3.
|
Flags are used to configure pad : direction, active state.
Enumerator |
---|
PI_PAD_SLEEPCFG_INPUT |
Pad is an input.
|
PI_PAD_SLEEPCFG_OUTPUT |
Pad is an output.
|
PI_PAD_SLEEPCFG_ACTIVE_LOW |
Pad is active low.
|
PI_PAD_SLEEPCFG_ACTIVE_HIGH |
Pad is active high.
|
void pi_pad_init |
( |
uint32_t |
pad_values[] | ) |
|
This function can be used to configure the function of all the pads in the case that they support several functions.
- Parameters
-
pad_values | Pad values. This is an array of 32 bit values, with one bit per pad and one 32 bit value per group of 32 pads. |
This function configures the pull activation and drive strength of a given pin.
- Parameters
-
pad | Pad to configure. |
cfg | Pad configuration, set of flags. |
void pi_pad_set_function |
( |
pi_pad_e |
pad, |
|
|
pi_pad_func_e |
function |
|
) |
| |
This function can be used to configure the function of the specified pad in the case that it supports several functions.
- Parameters
-
pad | Pad number. See the chip specific configuration for more details. |
function | Pad function. See the chip specific configuration for more details. |
void pi_pad_sleepcfg_set |
( |
uint32_t |
sleepcfg[], |
|
|
uint8_t |
sleep_ena |
|
) |
| |
This function configures pads behaviour when microcontroller goes into sleep or deep sleep mode. The array sent to this function should be filled for available pads(cf pi_pad_e), with 2 bits per pad(active state and direction).
Ex : Pad 10 - PI_PAD_18_A43_CAM_PCLK
uint32_t array[3] = {0};
array[PI_PAD_18_A43_CAM_PCLK / 16] |= ((PI_PAD_SLEEPCFG_INPUT | PI_PAD_SLEEPCFG_ACTIVE_HIGH) << PI_PAD_18_A43_CAM_PCLK);
- Parameters
-
sleepcfg | Pads sleep configuration. |
sleep_ena | Enable/disable pad sleep mode. |