pio.h
Default mainpageat91libperipheralspiopio.h
Description Overview  
Description
Purpose
This file provides a basic API for PIO configuration and usage of user-controlled pins. Please refer to the board.h file for a list of available pin definitions.

Usage
  1. Define a constant pin description array such as the following one, using the existing definitions provided by the board.h file if possible:
    const Pin pPins[] = {PIN_USART0_TXD, PIN_USART0_RXD};
    
    Alternatively, it is possible to add new pins by provided the full Pin structure:
    // Pin instance to configure PA10 & PA11 as inputs with the internal
    // pull-up enabled.
    const Pin pPins = {
         (1 << 10) | (1 << 11),
         AT91C_BASE_PIOA,
         AT91C_ID_PIOA,
         PIO_INPUT,
         PIO_PULLUP
    };
    
  2. Configure a pin array by calling PIO_Configure() with a pointer to the array and its size (which is computed using the PIO_LISTSIZE macro).
  3. Change and get the value of a user-controlled pin using the PIO_Set, PIO_Clear and PIO_Get methods.
  4. Get the level being currently output by a user-controlled pin configured as an output using PIO_GetOutputDataStatus().