Analog Devices Wi-Fi Software Reference Manual  Release 1.0.0
Macros | Functions
Non-RTOS Framework Layer

Non-RTOS Framework Functions. More...

Macros

#define ADI_WIFI_INIT_CORE_INIT_RSP_TIME_MS   (5000u)
 

Functions

ADI_WIFI_RESULT adi_wifi_Init (ADI_CALLBACK const pCallbackFunc, void *const pCBParam)
 Initialize Framework Layer. More...
 
ADI_WIFI_RESULT adi_wifi_DispatchEvents (const uint32_t nTimeoutMilliSeconds)
 Event dispatcher. More...
 
ADI_WIFI_RESULT adi_wifi_WaitForResponseWithTimeout (const uint32_t nTimeoutMilliSeconds, ADI_WIFI_AT_CMDCODE eCommandType)
 Wait for response with a timeout. More...
 
void adi_wifi_NoosCallback (void *pCBParam, uint32_t Event, void *pArg)
 Wi-Fi no operating system layer callback. More...
 
void adi_wifi_TimerCallback (void *pCBParam, uint32_t Event, void *pArg)
 Timer callback. More...
 
void adi_wifi_PingTimerCallback (void *pCBParam, uint32_t Event, void *pArg)
 Ping Request Timer callback. More...
 
uint8_t adi_wifi_IsEventPending (void)
 Check event pending. More...
 
void adi_wifi_ClearEventPending (void)
 Clear event pending. More...
 
uint32_t adi_wifi_IsHardwareErrorPending (void)
 Check hardware error pending. More...
 
void adi_wifi_ClearHardwareErrorPending (void)
 Clear hardware error pending. More...
 
uint8_t adi_wifi_IsTimerDone (uint8_t nIsPingTimer)
 Timer peek function. More...
 
ADI_WIFI_RESULT adi_wifi_StartTimer (const uint32_t nMilliSeconds, uint8_t nIsPingTimer)
 Timer start. More...
 
ADI_WIFI_RESULT adi_wifi_StopTimer (uint8_t nIsPingTimer)
 Timer stop. More...
 

Detailed Description

Non-RTOS Framework Functions.

The set of functions in this module provide an application with a a simple interface for waiting for events from the radio with a timeout. This module is for applications in a non-RTOS operating environment. This layer uses a General Purpose Timer to implement timeouts, the user can configure the timeout in this file.

Macro Definition Documentation

§ ADI_WIFI_INIT_CORE_INIT_RSP_TIME_MS

#define ADI_WIFI_INIT_CORE_INIT_RSP_TIME_MS   (5000u)

Timeout value for #WIFI_EVENT_DISPATCH in adi_wifi_Init, note that this is just an upper limit.

Function Documentation

§ adi_wifi_ClearEventPending()

void adi_wifi_ClearEventPending ( void  )

Clear event pending.

Clear the event flag, should be done immediately after the application has finished reading the full packet from the radio.

§ adi_wifi_ClearHardwareErrorPending()

void adi_wifi_ClearHardwareErrorPending ( void  )

Clear hardware error pending.

Clear the hardware error flag.

§ adi_wifi_DispatchEvents()

ADI_WIFI_RESULT adi_wifi_DispatchEvents ( const uint32_t  nTimeoutMilliSeconds)

Event dispatcher.

Dispatch any events received for a fixed amount of time to the application callback. This function will block the caller for the specified amount of time, and pass events to the callback.

Parameters
[in]nTimeoutMilliSeconds: The time to wait (ms) if no event occurs.
Returns
ADI_WIFI_RESULT
  • #ADI_WIFI_SUCCESS is returned upon success
  • #ADI_WIFI_FAILURE is returned upon failure

§ adi_wifi_Init()

ADI_WIFI_RESULT adi_wifi_Init ( ADI_CALLBACK const  pCallbackFunc,
void *const  pCBParam 
)

Initialize Framework Layer.

Initialize companion module and register callback.

Parameters
[in]pCallbackFunc: Application callback function for Wi-Fi events.
[in]pCBParam: Pointer to the application callback parameter.
Returns
ADI_WIFI_RESULT
  • #ADI_WIFI_SUCCESS is returned upon success
  • #ADI_WIFI_FAILURE is returned upon failure

§ adi_wifi_IsEventPending()

uint8_t adi_wifi_IsEventPending ( void  )

Check event pending.

Check if a the radio issued an event. If so, the application should call adi_wifi_GetEvent() to read it from the radio.

Returns
1u if an event is pending, 0u if it is not.

§ adi_wifi_IsHardwareErrorPending()

uint32_t adi_wifi_IsHardwareErrorPending ( void  )

Check hardware error pending.

Check if a the radio issued n hardware error.

Returns
0u if an hardware error is not pending, otherwise the specific error is returned. This is a #ADI_UART_HW_ERRORS.

§ adi_wifi_IsTimerDone()

uint8_t adi_wifi_IsTimerDone ( uint8_t  nIsPingTimer)

Timer peek function.

Check if timeout occurred.

Parameters
[in]nIsPingTimer: Parameter to differentiate which timer event to check.
Returns
1u if timeout occurred, 0u if it did not.

§ adi_wifi_NoosCallback()

void adi_wifi_NoosCallback ( void *  pCBParam,
uint32_t  Event,
void *  pArg 
)

Wi-Fi no operating system layer callback.

Callback function passed to radio module to be called when a ESP8266 event occurs.

Parameters
[in]pCBParam: Callback parameter. (unused)
[in]Event: Callback event. (unused)
[in]pArg: Callback argument. (only used in the case of a hardware error)

§ adi_wifi_PingTimerCallback()

void adi_wifi_PingTimerCallback ( void *  pCBParam,
uint32_t  Event,
void *  pArg 
)

Ping Request Timer callback.

Function that gets executed when a Ping request to MQTT broker timeout event occurs.

Parameters
[in]pCBParam: Callback parameter. (unused)
[in]Event: Callback event. (unused)
[in]pArg: Callback argument. (unused)

§ adi_wifi_StartTimer()

ADI_WIFI_RESULT adi_wifi_StartTimer ( const uint32_t  nMilliSeconds,
uint8_t  nIsPingTimer 
)

Timer start.

Configure and start #ADI_WIFI_NOOS_GP_TIMER with a specific timeout value.

Parameters
[in]nMilliSeconds: The number of milliseconds before timeout.
[in]nIsPingTimer: Parameter to differentiate which timer to configure.
Returns
ADI_WIFI_RESULT
  • #ADI_WIFI_SUCCESS is returned upon success
  • #ADI_WIFI_FAILURE is returned upon failure

§ adi_wifi_StopTimer()

ADI_WIFI_RESULT adi_wifi_StopTimer ( uint8_t  nIsPingTimer)

Timer stop.

Disable the timer.

Parameters
[in]nIsPingTimer: Parameter to differentiate which timer to stop.
Returns
ADI_WIFI_RESULT
  • #ADI_WIFI_SUCCESS is returned upon success
  • #ADI_WIFI_FAILURE is returned upon failure

§ adi_wifi_TimerCallback()

void adi_wifi_TimerCallback ( void *  pCBParam,
uint32_t  Event,
void *  pArg 
)

Timer callback.

Function that gets executed when a timeout event occurs.

Parameters
[in]pCBParam: Callback parameter. (unused)
[in]Event: Callback event. (unused)
[in]pArg: Callback argument. (unused)

§ adi_wifi_WaitForResponseWithTimeout()

ADI_WIFI_RESULT adi_wifi_WaitForResponseWithTimeout ( const uint32_t  nTimeoutMilliSeconds,
ADI_WIFI_AT_CMDCODE  eCommandType 
)

Wait for response with a timeout.

This function will block until eCommandType occurs. If there is a duration of nTimeoutMilliSeconds between calling this function and the desired event, the function will timeout and return failure.

Parameters
[in]nTimeoutMilliSeconds: The time to wait (ms) if no event occurs before erroring out.
[in]eCommandType: The event we are expecting to receive.
Returns
ADI_WIFI_RESULT
  • #ADI_WIFI_SUCCESS is returned upon success
  • #ADI_WIFI_FAILURE is returned upon failure