PMSIS API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Padframe

Padframe. More...

Enumerations

enum  pi_pad_func_e
 Pad functions. More...
 
enum  pi_pad_flags_e
 Pad configuration flags. More...
 
enum  pi_pad_sleepcfg_flags_e
 Pad sleep configuration flags. More...
 

Functions

void pi_pad_set_function (pi_pad_e pad, pi_pad_func_e function)
 Set the function of one pad. More...
 
void pi_pad_init (uint32_t pad_values[])
 Set the function of all pads. More...
 
void pi_pad_set_configuration (pi_pad_e pad, pi_pad_flags_e cfg)
 Set the configuration for a pin. More...
 
void pi_pad_sleepcfg_set (uint32_t sleepcfg[], uint8_t sleep_ena)
 Set the sleep configuration for a set of pins. More...
 

Description

The padframe driver provides support for controlling PADs.

Enumeration Type Documentation

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.

Function Documentation

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_valuesPad values. This is an array of 32 bit values, with one bit per pad and one 32 bit value per group of 32 pads.
void pi_pad_set_configuration ( pi_pad_e  pad,
pi_pad_flags_e  cfg 
)

This function configures the pull activation and drive strength of a given pin.

Parameters
padPad to configure.
cfgPad 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
padPad number. See the chip specific configuration for more details.
functionPad 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
sleepcfgPads sleep configuration.
sleep_enaEnable/disable pad sleep mode.