Datasheet

Flyport Wi-Fi and Ethernet Programmer's guide framework 2.3 (rev 1.0) www.openpicus.com
The pin configuration depends on your specific application, so the “Hardware Architecture” should
be decided first: which pins will be used as peripherals, and which pins will be “simple I/Os”
Remappable Pins Functions
To REMAP a pin you can simply use the IOInit function. The difference between the digital I/Os and
PeripheralPinSelect assignment is done with different values of the second parameter:
IOInit ( p2, EXT_INT3 ); will associate the pin 2 of Flyport to the External Interrupt 3 functions.
IOInit ( p18, SPI_OUT); will associate the pin 18 of Flyport to the SPI2 data out functionality.
Note: Remapping is useful but you need to pay attention. If a pin is assigned to a peripheral, the
IOGet and IOPut will not work properly. Secondly, after the assignment, a new function will be
associated to a pin, and it must be used the related peripheral functions to set up the peripheral
module.
For example UART2 and UART3 are not enabled by default to give more memory to the user
application. If you need to use 3 UARTs in your application, you must enable these 3 UARTs using the
Wizard inside the IDE. See the UART section for more information.
QUESTION: Can I use the remapping feature at runtime?
Yes, the openPicus Framework supports pin remapping at runtime.
We suggest to plan a definitive pin mapping and don't change during the development. Remember
that an error with remapping may cause hardware fault.
Example: remap the UART2 on pin 2 and 4
#include "taskFlyport.h"
void FlyportTask()
{
// First of all: REMAP THE PINS
IOInit(p2,UART2RX); // Remap p2 pin as UART2RX
IOInit(p4,UART2TX); // Remap p4 pin as UART2TX
//After Remapping enable the module...(see UART chapter...)
while (1)
{
// MAIN LOOP
}
}
16