Lists the available BSP (<strong>B</strong>oard <strong>S</strong>upport <strong>P</strong>ackage) APIs.
Functions | |
sint8 | nm_bsp_deinit (void) |
De-iInitialize BSP. More... | |
sint8 | nm_bsp_init (void) |
This function is used to initialize the Board Support Package (BSP) in order to prepare the WINC before any WINC API calls. 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) |
Performs a hardware reset to the WINC board. 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.
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.
References CONF_WINC_PIN_CHIP_ENABLE, CONF_WINC_PIN_RESET, M2M_SUCCESS, and pio_set_pin_low().
Referenced by nm_bus_deinit().
sint8 nm_bsp_init | ( | void | ) |
This function is used to initialize the Board Support Package (BSP) in order to prepare the WINC before any WINC API calls.
Initialize BSP.
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.
References gpfIsr, init_chip_pins(), nm_bsp_reset(), and NULL.
Referenced by main().
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.
[in] | u8Enable |
|
References CONF_WINC_SPI_INT_MASK, CONF_WINC_SPI_INT_PIO, pio_disable_interrupt(), pio_enable_interrupt(), and pio_get_interrupt_status().
Referenced by hif_handle_isr(), hif_set_rx_done(), and isr().
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.
[in] | pfIsr | Pointer to ISR handler in the HIF layer. |
References chip_isr(), CONF_WINC_SPI_INT_MASK, CONF_WINC_SPI_INT_PIN, CONF_WINC_SPI_INT_PIO, CONF_WINC_SPI_INT_PIO_ID, CONF_WINC_SPI_INT_PRIORITY, gpfIsr, pio_configure_pin(), pio_enable_interrupt(), pio_handler_set_pin(), pio_handler_set_priority(), PIO_IT_LOW_LEVEL, pio_pull_up(), PIO_PULLUP, PIO_TYPE_PIO_INPUT, and sysclk_enable_peripheral_clock().
Referenced by hif_init().
void nm_bsp_reset | ( | void | ) |
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.
References CONF_WINC_PIN_CHIP_ENABLE, CONF_WINC_PIN_RESET, nm_bsp_sleep(), and pio_set_pin_high().
Referenced by nm_bsp_init(), and nm_bus_init().
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.
[in] | u32TimeMsec | Time unit in milliseconds. |
References delay_ms.
Referenced by chip_reset(), chip_wake(), cpu_start(), enable_rf_blocks(), hif_send(), load_efuse_to_regs(), nm_bsp_reset(), nm_drv_init_hold(), nm_spi_read_block(), nm_spi_read_reg_with_ret(), nm_spi_write_block(), nm_spi_write_reg(), wait_for_bootrom(), wait_for_firmware_start(), and write_to_efuse().