This file contains basic pio driver functions.
Definition in file pio.h.
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Defines | |
| #define | PIO_INVALID_ARGUMENT -1 |
| #define | PIO_SUCCESS 0 |
Typedefs | |
| typedef char | avr32_piomap_t [][2] |
Functions | |
| void | pio_enable_module (avr32_piomap_t piomap, int size) |
| int | pio_setup_pin (int pin, int function) |
| volatile avr32_pio_t * | pioGetHandle (int port) |
|
|
Definition at line 75 of file pio.h. Referenced by pio_setup_pin(). |
|
|
Definition at line 76 of file pio.h. Referenced by pio_setup_pin(). |
|
|
A type definitions of pins and module connectivity. First column is the pin number, the second is pio connectivity |
|
||||||||||||
|
This function will enable a module pin for a given set of pins and respective modules
Definition at line 102 of file pio.c. References pio_setup_pin(). Referenced by main(). 00103 { 00104 int i; 00105 00106 for(i=0; i<size; i++){ 00107 pio_setup_pin(**piomap, *(*piomap+1) ); 00108 piomap++; 00109 } 00110 }
Here is the call graph for this function: ![]() |
|
||||||||||||
|
This function will put a single pin under a module's control
Definition at line 79 of file pio.c. References PIO_INVALID_ARGUMENT, PIO_SUCCESS, and pioGetHandle(). Referenced by pio_enable_module(). 00080 { 00081 volatile avr32_pio_t *pio = pioGetHandle(pin/32); 00082 00083 00084 /* Disable pio control */ 00085 pio->pdr |= (1<<(pin%32)); 00086 pio->pudr |= (1<<(pin%32)); 00087 00088 /* Enable the correct function */ 00089 switch(function){ 00090 case 0: 00091 pio->asr |= (1<<(pin%32)); 00092 break; 00093 case 1: 00094 pio->bsr |= (1<<(pin%32)); 00095 break; 00096 default: 00097 return PIO_INVALID_ARGUMENT; 00098 } 00099 return PIO_SUCCESS; 00100 }
Here is the call graph for this function: ![]() |
|
|
This function will return the baseaddress for a port
Definition at line 60 of file pio.c. Referenced by pio_setup_pin(). 00061 { 00062 switch (port) { 00063 case 0: 00064 return &AVR32_PIOA; 00065 case 1: 00066 return &AVR32_PIOB; 00067 case 2: 00068 return &AVR32_PIOC; 00069 case 3: 00070 return &AVR32_PIOD; 00071 case 4: 00072 return &AVR32_PIOE; 00073 default : 00074 break; 00075 } 00076 return (avr32_pio_t *) -1; 00077 }
|
1.4.6