RTEMS 6.1-rc2
Loading...
Searching...
No Matches
Functions
pio.c File Reference
#include "chip.h"

Functions

uint8_t PIO_Configure (const Pin *list, uint32_t size)
 Configures a list of Pin instances, each of which can either hold a single pin or a group of pins, depending on the mask value; all pins are configured by this function. The size of the array must also be provided and is easily computed using PIO_LISTSIZE whenever its length is not known in advance.
 
void PIO_Set (const Pin *pin)
 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.
 
void PIO_Clear (const Pin *pin)
 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.
 
unsigned char PIO_Get (const Pin *pin)
 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.
 
unsigned char PIO_GetOutputDataStatus (const Pin *pin)
 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.
 
void PIO_SetDebounceFilter (const Pin *pin, uint32_t cuttoff)
 Configures Glitch or Denouncing filter for input.
 
void PIO_EnableWriteProtect (const Pin *pin)
 Enable write protect.
 
void PIO_DisableWriteProtect (const Pin *pin)
 Disable write protect.
 
uint32_t PIO_GetWriteProtectViolationInfo (const Pin *pin)
 Get write protect violation information.
 
void PIO_SetPinType (Pin *pin, uint8_t pinType)
 Set pin type the pin is controlled by the corresponding peripheral (A, B, C, D,E)
 
void PIO_SetDriveStrength (const Pin *pin, uint8_t strength)
 Set the drive strength of the pin.
 

Function Documentation

◆ PIO_Clear()

void PIO_Clear ( const Pin pin)

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.

◆ PIO_Configure()

uint8_t PIO_Configure ( const Pin list,
uint32_t  size 
)

Configures a list of Pin instances, each of which can either hold a single pin or a group of pins, depending on the mask value; all pins are configured by this function. The size of the array must also be provided and is easily computed using PIO_LISTSIZE whenever its length is not known in advance.

Parameters
listPointer to a list of Pin instances.
sizeSize of the Pin list (calculated using PIO_LISTSIZE).
Returns
1 if the pins have been configured properly; otherwise 0.

◆ PIO_DisableWriteProtect()

void PIO_DisableWriteProtect ( const Pin pin)

Disable write protect.

Parameters
pinPointer to a Pin instance describing one or more pins.

◆ PIO_EnableWriteProtect()

void PIO_EnableWriteProtect ( const Pin pin)

Enable write protect.

Parameters
pinPointer to a Pin instance describing one or more pins.

◆ PIO_Get()

unsigned char PIO_Get ( const Pin pin)

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.

◆ PIO_GetOutputDataStatus()

unsigned char PIO_GetOutputDataStatus ( const Pin pin)

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
pinPointer 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.

◆ PIO_GetWriteProtectViolationInfo()

uint32_t PIO_GetWriteProtectViolationInfo ( const Pin pin)

Get write protect violation information.

Parameters
pinPointer to a Pin instance describing one or more pins.

◆ PIO_Set()

void PIO_Set ( const Pin pin)

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.

◆ PIO_SetDebounceFilter()

void PIO_SetDebounceFilter ( const Pin pin,
uint32_t  cuttoff 
)

Configures Glitch or Denouncing filter for input.

Parameters
pinPointer to a Pin instance describing one or more pins.
cuttoffCut off frequency for denounce filter.

◆ PIO_SetDriveStrength()

void PIO_SetDriveStrength ( const Pin pin,
uint8_t  strength 
)

Set the drive strength of the pin.

Parameters
pinPointer to a Pin instance describing one or more pins.
strength0 for low drive strength or 1 for high drive strength.

◆ PIO_SetPinType()

void PIO_SetPinType ( Pin pin,
uint8_t  pinType 
)

Set pin type the pin is controlled by the corresponding peripheral (A, B, C, D,E)

Parameters
pinPointer to a Pin instance describing one or more pins.
pinTypePIO_PERIPH_A, PIO_PERIPH_B, ...