Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions

    Lists the available BSP (<strong>B</strong>oard <strong>S</strong>upport <strong>P</strong>ackage) APIs.

Modules

 nm_bsp_init
 
Initialization for BSP (<strong>B</strong>oard <strong>S</strong>upport <strong>P</strong>ackage)
such as Reset and Chip Enable Pins for WINC, delays, register ISR, enable/disable IRQ for WINC, etc.

 
 nm_bsp_deinit
 
De-initialization of the BSP (<strong>B</strong>oard <strong>S</strong>upport <strong>P</strong>ackage).

 
 nm_bsp_reset
 
Resets the WINC SoC by setting CHIP_EN and RESET_N signals low, then after an appropriate delay,
this function will put CHIP_EN high then RESET_N high, for more details on the timing between signals
please check the WINC data-sheet.

 
 nm_bsp_sleep
 
Sleep in units of milliseconds.

 
 nm_bsp_register_isr
 
Register ISR (Interrupt Service Routine) in the initialization of the HIF (Host Interface) Layer.

 
 nm_bsp_interrupt_ctrl
 
Synchronous enable/disable of WINC to host interrupts.

 

Functions

sint8 nm_bsp_deinit (void)
 De-iInitialize BSP. More...
 
sint8 nm_bsp_init (void)
 Initialize BSP. More...
 
void nm_bsp_interrupt_ctrl (uint8 u8Enable)
 Enable/Disable interrupts from the WINC. More...
 
void nm_bsp_register_isr (tpfNmBspIsr pfIsr)
 Register the host interface interrupt service routine. More...
 
void nm_bsp_reset (void)
 Reset the WINC SoC by setting CHIP_EN and RESET_N signals low, CHIP_EN high then RESET_N high. More...
 
void nm_bsp_sleep (uint32 u32TimeMsec)
 Used to put the host to sleep for the specified duration (in milliseconds). Forcing the host to sleep for extended period may lead to host not being able to respond to WINC board events. It is important to be considerate while choosing the sleep period. More...
 

sint8 nm_bsp_deinit ( void  )

De-iInitialize BSP.

This function is used to de-initialize the BSP and turn off the WINC board.

Returns
0 in case of success and -1 in case of failure
0 in case of success and -1 in case of failure
Version
1.0

The nm_bsp_deinit is the last function that should be called after the application has finished and before the WINC is switched off. A call to this function will turn off the WINC board by setting CHIP_EN and RESET_N signals low. Every function call of nm_bsp_init should be matched with a call to nm_bsp_deinit. Failure to do so may result in the WINC consuming higher power than expected, since it won't be properly de-initialized.

Precondition
The BSP should be initialized through nm_bsp_init first.
Note
Implementation of this function is host dependent.
Warning
Omitting this function may lead to unknown behavior in case of soft reset.
See Also
nm_bsp_init
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
sint8 nm_bsp_init ( void  )

Initialize BSP.

This function is used to initialize the Board Support Package (BSP) in order to prepare the WINC before any WINC API calls.

Returns
0 in case of success and -1 in case of failure
Version
1.0

The nm_bsp_init function is the first function that should be called at the beginning of every application to initialize the BSP and the WINC board. Otherwise, the rest of the BSP function calls will return with failure. This function should also be called after the WINC has been switched off with a successful call to nm_bsp_deinit in order to reinitialize the BSP before the Application can use any of the WINC APIs again. After the function initializes the WINC, a hard reset must be applied to start the WINC board by calling nm_bsp_reset.

Note
Implementation of this function is host dependent.
Warning
Omitting this function will lead to unavailability of host-chip communication.
See Also
nm_bsp_deinit, nm_bsp_reset
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
void nm_bsp_interrupt_ctrl ( uint8  u8Enable)

Enable/Disable interrupts from the WINC.

This function can be used to enable/disable the WINC to host interrupts, depending on how the driver is implemented. It is an internal driver function and shouldn't be called by the application.

Parameters
[in]u8Enable
  • '0' disable interrupts.
  • '1' enable interrupts.
Precondition
The interrupt must be registered using nm_bsp_register_isr first.
Note
Implementation of this function is host dependent and called by HIF layer.
See Also
tpfNmBspIsr, nm_bsp_register_isr
Returns
None
void nm_bsp_register_isr ( tpfNmBspIsr  pfIsr)

Register the host interface interrupt service routine.

The WINC board uses the SPI interface to communicate with the host. This function registers the SPI interrupt to notify the host whenever there is an outstanding message from the WINC board. This function should be called during the initialization of the host interface. It is an internal driver function and shouldn't be called by the Application.

Parameters
[in]pfIsrPointer to ISR handler in the HIF layer.
Note
Implementation of this function is host dependent and called by HIF layer.
Warning
Make sure that ISR for IRQ pin for WINC is disabled by default in your implementation.
See Also
tpfNmBspIsr
Returns
None
void nm_bsp_reset ( void  )

Reset the WINC SoC by setting CHIP_EN and RESET_N signals low, CHIP_EN high then RESET_N high.

Reset WINC1500 SoC by setting CHIP_EN and RESET_N signals low, CHIP_EN high then RESET_N high.

Performs a hardware reset to the WINC board.

The nm_bsp_reset is used to perform a hard reset on the WINC board by setting CHIP_EN and RESET_N signals low, then after an appropriate delay this function puts CHIP_EN high then RESET_N high, for more details on the timing between signals please check the WINC data-sheet. After a successful call, the WINC board firmware will kick off to load and start the WINC firmware. This function should be called to reset the WINC firmware after the BSP is initialized and before the start of any communication with WINC board. Calling this function at any other time will result in losing the state and connections saved in the WINC board and starting again from the initial state. The host driver will need to be de-initialized before calling nm_bsp_reset and initialized again, which can be achieved by use of m2m_wifi_init and m2m_wifi_deinit.

Precondition
Initialize the BSP first by calling nm_bsp_init.
Note
Implementation of this function is host dependent and called by HIF layer.
Warning
Calling this function will drop any connection and lose the internal state saved on the WINC firmware.
See Also
nm_bsp_init, m2m_wifi_init, m2m_wifi_deinit
Returns
None
void nm_bsp_sleep ( uint32  u32TimeMsec)

Used to put the host to sleep for the specified duration (in milliseconds). Forcing the host to sleep for extended period may lead to host not being able to respond to WINC board events. It is important to be considerate while choosing the sleep period.

Parameters
[in]u32TimeMsecTime unit in milliseconds.
Precondition
Initialize nm_bsp_init first.
Note
Implementation of this function is host dependent.
Warning
Maximum value must nor exceed 4294967295 milliseconds which is equal to 4294967.295 seconds.
See Also
nm_bsp_init
Returns
None