Microchip® Advanced Software Framework

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

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


This function should be called only after a successful call to nm_bsp_init.

Functions

sint8 nm_bsp_deinit (void)
 De-iInitialize BSP. 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

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.

References CONF_WINC_PIN_CHIP_ENABLE, CONF_WINC_PIN_RESET, CONF_WINC_SPI_INT_PIN, port_config::direction, port_config::input_pull, M2M_SUCCESS, port_get_config_defaults(), PORT_PIN_DIR_INPUT, PORT_PIN_PULL_NONE, port_pin_set_config(), and port_pin_set_output_level().

Referenced by nm_bus_deinit().