SAMV71 Xplained Ultra Software Package 1.4

pio.c File Reference

#include "chip.h"

Go to the source code of this file.

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

Detailed Description

Definition in file pio.c.


Function Documentation

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:
pin Pointer to a Pin instance describing one or more pins.

Definition at line 355 of file pio.c.

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:
list Pointer to a list of Pin instances.
size Size of the Pin list (calculated using PIO_LISTSIZE).
Returns:
1 if the pins have been configured properly; otherwise 0.

Definition at line 280 of file pio.c.

Here is the call graph for this function:

void PIO_DisableWriteProtect ( const Pin pin  ) 

Disable write protect.

Parameters:
pin Pointer to a Pin instance describing one or more pins.

Definition at line 440 of file pio.c.

void PIO_EnableWriteProtect ( const Pin pin  ) 

Enable write protect.

Parameters:
pin Pointer to a Pin instance describing one or more pins.

Definition at line 427 of file pio.c.

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:
pin Pointer 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.

Definition at line 371 of file pio.c.

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:
pin Pointer 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.

Definition at line 398 of file pio.c.

uint32_t PIO_GetWriteProtectViolationInfo ( const Pin pin  ) 

Get write protect violation information.

Parameters:
pin Pointer to a Pin instance describing one or more pins.

Definition at line 452 of file pio.c.

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:
pin Pointer to a Pin instance describing one or more pins.

Definition at line 342 of file pio.c.

void PIO_SetDebounceFilter ( const Pin pin,
uint32_t  cuttoff 
)

Configures Glitch or Denouncing filter for input.

Parameters:
pin Pointer to a Pin instance describing one or more pins.
cuttoff Cut off frequency for denounce filter.

Definition at line 413 of file pio.c.

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:
pin Pointer to a Pin instance describing one or more pins.
pinType PIO_PERIPH_A, PIO_PERIPH_B, ...

Definition at line 464 of file pio.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines