5.13.0.0R1
Software Development Kit
Platform Interface

Bus Functions

Functions that enable WICED to start and stop the hardware communications bus for a paritcular platform.

wwd_result_t host_platform_bus_init (void)
 
wwd_result_t host_platform_bus_deinit (void)
 
void wwd_thread_notify_irq (void)
 
wwd_result_t host_platform_bus_enable_interrupt (void)
 
wwd_result_t host_platform_bus_disable_interrupt (void)
 
void host_platform_bus_buffer_freed (wwd_buffer_dir_t direction)
 

General Platform Functions

Functions that enable WICED to use the hardware platform.

void host_platform_reset_wifi (wiced_bool_t reset_asserted)
 
void host_platform_power_wifi (wiced_bool_t power_enabled)
 
wwd_result_t host_platform_init (void)
 
wwd_result_t host_platform_deinit (void)
 
void host_platform_clocks_needed (void)
 
void host_platform_clocks_not_needed (void)
 
wwd_result_t host_platform_get_mac_address (wiced_mac_t *mac)
 
wwd_result_t host_platform_get_ethernet_mac_address (wiced_mac_t *mac)
 
uint32_t host_platform_get_cycle_count (void)
 
wiced_bool_t host_platform_is_in_interrupt_context (void)
 
wwd_result_t host_platform_init_wlan_powersave_clock (void)
 
wwd_result_t host_platform_deinit_wlan_powersave_clock (void)
 

SDIO Bus Functions

Functions that enable WICED to use an SDIO bus on a particular hardware platform.

wwd_result_t host_platform_sdio_transfer (wwd_bus_transfer_direction_t direction, sdio_command_t command, sdio_transfer_mode_t mode, sdio_block_size_t block_size, uint32_t argument, uint32_t *data, uint16_t data_size, sdio_response_needed_t response_expected, uint32_t *response)
 
wwd_result_t host_platform_sdio_enumerate (void)
 
wwd_result_t host_platform_enable_high_speed_sdio (void)
 
void sdio_irq (void)
 
wwd_result_t host_platform_unmask_sdio_interrupt (void)
 
wwd_result_t host_enable_oob_interrupt (void)
 
uint8_t host_platform_get_oob_interrupt_pin (void)
 

Detailed Description

Enables WICED to use the hardware platform.

Function Documentation

wwd_result_t host_enable_oob_interrupt ( void  )

SDIO Out-of-band interrupt handler

This function should enable the detection of an external interrupt from the GPIO0 pin of the WLAN chip.

void host_platform_bus_buffer_freed ( wwd_buffer_dir_t  direction)

Informs the platform bus implementation that a buffer has been freed

This function is called by WICED during buffer release to allow the platform to reuse the released buffer - especially where a DMA chain needs to be refilled.

wwd_result_t host_platform_bus_deinit ( void  )

De-Initializes the WICED Bus

Implemented in the WICED Platform interface which is specific to the platform in use. This function does the reverse of host_platform_bus_init

Returns
WWD_SUCCESS or Error code
wwd_result_t host_platform_bus_disable_interrupt ( void  )

Disables the bus interrupt

This function is called by WICED during de-init, to stop the system supplying any more interrupts in preparation for shutdown

wwd_result_t host_platform_bus_enable_interrupt ( void  )

Enables the bus interrupt

This function is called by WICED during init, once the system is ready to receive interrupts

wwd_result_t host_platform_bus_init ( void  )

Initializes the WICED Bus

Implemented in the WICED Platform interface which is specific to the platform in use. This function should set the bus GPIO pins to the correct modes, set up the interrupts for the WICED bus, enable power and clocks to the bus, and set up the bus peripheral.

Returns
WWD_SUCCESS or Error code
void host_platform_clocks_needed ( void  )

Disable power saving modes that would stop clocks

void host_platform_clocks_not_needed ( void  )

Enable power saving modes that would stop clocks

wwd_result_t host_platform_deinit ( void  )

De-Initialises platform for WICED

Does the opposite to the host_platform_init function, leaving the Broadcom Wi-Fi in a powered down, reset state.

Returns
WWD_SUCCESS or Error code
wwd_result_t host_platform_enable_high_speed_sdio ( void  )

Switch SDIO bus to high speed mode

When SDIO starts, it must be in a low speed mode This function switches it to high speed mode (up to 50MHz)

uint32_t host_platform_get_cycle_count ( void  )

Returns the current CPU cycle count.

This function is used to accurately calculate sub-systick timing.

wwd_result_t host_platform_get_ethernet_mac_address ( wiced_mac_t mac)

Returns Ethernet MAC address

Parameters
mac: A wiced_mac_t pointer to the Ethernet MAC address
wwd_result_t host_platform_get_mac_address ( wiced_mac_t mac)

The host MCU can provide a MAC address to the Wi-Fi driver (rather than the driver using the MAC in NVRAM or OTP). To use this functionality, add a global define (MAC_ADDRESS_SET_BY_HOST) in the application makefile. Further information is available in the generated_mac_address.txt file that is created during the application build process.

Parameters
mac: A wiced_mac_t pointer to the Wi-Fi MAC address
uint8_t host_platform_get_oob_interrupt_pin ( void  )

Get OOB interrupt pin (WLAN GPIO0 or GPIO1)

wwd_result_t host_platform_init ( void  )

Initialises platform for WICED

Sets up parts of the hardware platform which are not directly part of the bus. These may include: Reset Pin and Regulator-On Pin.

Returns
WWD_SUCCESS or Error code
wiced_bool_t host_platform_is_in_interrupt_context ( void  )

Returns TRUE if the CPU is currently running in interrupt context

void host_platform_power_wifi ( wiced_bool_t  power_enabled)

Switches the Power signal to the Broadcom Wi-Fi

WICED uses this function to switch the power signal to the Broadcom Wi-Fi chip. It should toggle the appropriate GPIO pins.

Parameters
power_enabled: WICED_TRUE = power up WICED_FALSE = power down
void host_platform_reset_wifi ( wiced_bool_t  reset_asserted)

Switches the Reset signal to the Broadcom Wi-Fi

WICED uses this function to switch the reset signal to the Broadcom Wi-Fi chip. It should toggle the appropriate GPIO pins.

Parameters
reset_assertedWICED_TRUE = reset asserted WICED_FALSE = reset de-asserted
wwd_result_t host_platform_sdio_enumerate ( void  )

Performs SDIO enumeration

This needs to be called if the WLAN chip is reset

wwd_result_t host_platform_sdio_transfer ( wwd_bus_transfer_direction_t  direction,
sdio_command_t  command,
sdio_transfer_mode_t  mode,
sdio_block_size_t  block_size,
uint32_t  argument,
uint32_t *  data,
uint16_t  data_size,
sdio_response_needed_t  response_expected,
uint32_t *  response 
)

Transfers SDIO data

Implemented in the WICED Platform interface, which is specific to the platform in use. WICED uses this function as a generic way to transfer data across an SDIO bus. Please refer to the SDIO specification.

Parameters
direction: Direction of transfer - Write = to Wi-Fi device, Read = from Wi-Fi device
command: The SDIO command number
mode: Indicates whether transfer will be byte mode or block mode
block_size: The block size to use (if using block mode transfer)
argument: The argument of the particular SDIO command
data: A pointer to the data buffer used to transmit or receive
data_size: The length of the data buffer
response_expected: Indicates if a response is expected - RESPONSE_NEEDED = Yes NO_RESPONSE = No
response: A pointer to a variable which will receive the SDIO response. Can be null if the caller does not care about the response value.
Returns
WWD_SUCCESS if successful, otherwise an error code
wwd_result_t host_platform_unmask_sdio_interrupt ( void  )

Unmasks the bus interrupt

This function is called by WICED to unmask the bus interrupt on host platforms that must mask off the bus interrupt to allow processing of the existing interrupt.

void sdio_irq ( void  )

SDIO interrupt handler

This function is implemented by Wiced and must be called from the interrupt vector

void wwd_thread_notify_irq ( void  )

Informs WWD of an interrupt

This function should be called from the SDIO/SPI interrupt function and usually indicates newly received data is available. It wakes the WWD Thread, forcing it to check the send/receive