Porting oWL Pico API to a new platform

The oWL Pico API is available in the wlp_api/ folder of the source package available here DownloadSources Currently, the source package also includes a reference design software which gives an example of how the oWL Pico API can be used. This reference design software can be compiled to run on a linux host or on an Atmel XPLAIN host.

To run oWL Pico API on another platform, a small porting effort might be required. This section will guide you through the necessary steps to do such a porting.

Verify the hardware connections

  • Check that there is 3.3V on pin 10 and Ground at pin 9
  • Check that pin 2 isn’t pulled high by the host, it will power down the SPB800
  • Check that UART RX (PIN 4) on the SPB800 goes to TX on the host MCU and that UART TX (PIN 3) on the SPB800 goes to RX on the host.
  • If RTS/CTS are used, check their connectivity.
  • Check that nothing blocks the RF signals from the antenna

Build a minimal example using

An simple example of how to write a simple pico client can be found under the Linux-application "pico_simple" in the pico_framework.
Porting this example to another platform is rather straightforward:

1. Initialize the platforms UART port and corresponding gpios (Baudrate 115200, 8 Databits, no parity, 1 stopbit).

2. Implement the function: board_exchange(void *ctx, const void *tx, void *rx, int len).
This function should check the rx and tx in-parameters for either write or read and act accordingly.
When rx parameter is non-NULL, the function must block until len bytes has been read from the UART.
The function must return the number of bytes read/written.

3. Implement the function: int board_poll(void *ctx).
This function is responsible of signaling the api of incoming UART data.
E.g. if the host has a UART read buffer, the board_poll() can return the number of bytes in the buffer.
If there is no UART buffer available, board_poll() needs to at least return a non-zero value when UART data
is incoming (e.g. UART RX interrupt).

4. Implement the function: void board_delay(int ms).
This function should implement a millisec-delay. board_delay() should be called before calling wlp_init() to make sure
that the wifi-module is done booting.

Topic revision: r1 - 2015-08-27 - 07:38:44 - AndersGrahn
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback