Robobo
pio.c File Reference
#include "chip.h"

Functions

void PIO_DisableInterrupt (Pio *pPio, const uint32_t dwMask)
 Configures Pio pin internal pull-up. More...
 
void PIO_PullUp (Pio *pPio, const uint32_t dwMask, const uint32_t dwPullUpEnable)
 Configures Pio pin internal pull-up. More...
 
void PIO_SetDebounceFilter (Pio *pPio, const uint32_t dwMask, const uint32_t dwCuttOff)
 Configures Glitch or Debouncing filter for input. More...
 
void PIO_Set (Pio *pPio, const uint32_t dwMask)
 Sets a high output level on all the PIOs defined in the given Pin instance. This has no immediate effects on PIOs that are not output, but the PIO controller will memorize the value they are changed to outputs. More...
 
uint32_t PIO_Get (Pio *pPio, const EPioType dwType, const uint32_t dwMask)
 Returns 1 if one or more PIO of the given Pin instance currently have a high level; otherwise returns 0. This method returns the actual value that is being read on the pin. To return the supposed output value of a pin, use PIO_GetOutputDataStatus() instead. More...
 
void PIO_Clear (Pio *pPio, const uint32_t dwMask)
 Sets a low output level on all the PIOs defined in the given Pin instance. This has no immediate effects on PIOs that are not output, but the PIO controller will memorize the value they are changed to outputs. More...
 
void PIO_SetPeripheral (Pio *pPio, EPioType dwType, uint32_t dwMask)
 Configures one pin of a PIO controller as being controlled by specific peripheral. More...
 
void PIO_SetInput (Pio *pPio, uint32_t dwMask, uint32_t dwAttribute)
 Configures one or more pin(s) or a PIO controller as inputs. Optionally, the corresponding internal pull-up(s) and glitch filter(s) can be enabled. More...
 
void PIO_SetOutput (Pio *pPio, uint32_t dwMask, uint32_t dwDefaultValue, uint32_t dwMultiDriveEnable, uint32_t dwPullUpEnable)
 Configures one or more pin(s) of a PIO controller as outputs, with the given default value. Optionally, the multi-drive feature can be enabled on the pin(s). More...
 
uint32_t PIO_Configure (Pio *pPio, const EPioType dwType, const uint32_t dwMask, const uint32_t dwAttribute)
 
uint32_t PIO_GetOutputDataStatus (const Pio *pPio, const uint32_t dwMask)
 Returns 1 if one or more PIO of the given Pin are configured to output a high level (even if they are not output). To get the actual value of the pin, use PIO_Get() instead. More...
 

Function Documentation

void PIO_Clear ( Pio pPio,
const uint32_t  dwMask 
)

Sets a low output level on all the PIOs defined in the given Pin instance. This has no immediate effects on PIOs that are not output, but the PIO controller will memorize the value they are changed to outputs.

Parameters
pinPointer to a Pin instance describing one or more pins.
uint32_t PIO_Configure ( Pio pPio,
const EPioType  dwType,
const uint32_t  dwMask,
const uint32_t  dwAttribute 
)
Returns
1 if the pins have been configured properly; otherwise 0.
void PIO_DisableInterrupt ( Pio pPio,
const uint32_t  dwMask 
)

Configures Pio pin internal pull-up.

Parameters
pPioPointer to a PIO controller.
dwMaskBitmask of one or more pin(s) to configure.
dwPullUpEnableIndicates if the pin(s) internal pull-up shall be configured.
uint32_t PIO_Get ( Pio pPio,
const EPioType  dwType,
const uint32_t  dwMask 
)

Returns 1 if one or more PIO of the given Pin instance currently have a high level; otherwise returns 0. This method returns the actual value that is being read on the pin. To return the supposed output value of a pin, use PIO_GetOutputDataStatus() instead.

Parameters
pinPointer to a Pin instance describing one or more pins.
Returns
1 if the Pin instance contains at least one PIO that currently has a high level; otherwise 0.
uint32_t PIO_GetOutputDataStatus ( const Pio pPio,
const uint32_t  dwMask 
)

Returns 1 if one or more PIO of the given Pin are configured to output a high level (even if they are not output). To get the actual value of the pin, use PIO_Get() instead.

Parameters
pPioPointer to a Pin instance describing one or more pins.
Returns
1 if the Pin instance contains at least one PIO that is configured to output a high level; otherwise 0.
void PIO_PullUp ( Pio pPio,
const uint32_t  dwMask,
const uint32_t  dwPullUpEnable 
)

Configures Pio pin internal pull-up.

Parameters
pPioPointer to a PIO controller.
dwMaskBitmask of one or more pin(s) to configure.
dwPullUpEnableIndicates if the pin(s) internal pull-up shall be configured.
void PIO_Set ( Pio pPio,
const uint32_t  dwMask 
)

Sets a high output level on all the PIOs defined in the given Pin instance. This has no immediate effects on PIOs that are not output, but the PIO controller will memorize the value they are changed to outputs.

Parameters
pinPointer to a Pin instance describing one or more pins.
void PIO_SetDebounceFilter ( Pio pPio,
const uint32_t  dwMask,
const uint32_t  dwCuttOff 
)

Configures Glitch or Debouncing filter for input.

Parameters
pinPointer to a Pin instance describing one or more pins.
cuttoffCutt off frequency for debounce filter.
void PIO_SetInput ( Pio pPio,
uint32_t  dwMask,
uint32_t  dwAttribute 
)

Configures one or more pin(s) or a PIO controller as inputs. Optionally, the corresponding internal pull-up(s) and glitch filter(s) can be enabled.

Parameters
pPioPointer to a PIO controller.
dwMaskBitmask indicating which pin(s) to configure as input(s).
dwAttribute.
void PIO_SetOutput ( Pio pPio,
uint32_t  dwMask,
uint32_t  dwDefaultValue,
uint32_t  dwMultiDriveEnable,
uint32_t  dwPullUpEnable 
)

Configures one or more pin(s) of a PIO controller as outputs, with the given default value. Optionally, the multi-drive feature can be enabled on the pin(s).

Parameters
pPioPointer to a PIO controller.
dwMaskBitmask indicating which pin(s) to configure.
defaultValueDefault level on the pin(s).
enableMultiDriveIndicates if the pin(s) shall be configured as open-drain.
enablePullUpIndicates if the pin shall have its pull-up activated.
void PIO_SetPeripheral ( Pio pPio,
EPioType  dwType,
uint32_t  dwMask 
)

Configures one pin of a PIO controller as being controlled by specific peripheral.

Parameters
pPioPointer to a PIO controller.
dwTypePIO type.
dwMaskBitmask of one or more pin(s) to configure.