Morse Micro IoT SDK  2.9.7

Detailed Description

API for communicating with the WLAN transceiver over an SPI interface.

Note
These functions should only be implemented if using a SPI interface. They are not required when using the WLAN HAL API for SDIO interface.
Warning
These functions shall not be called directly by the end application they are for use by Morselib.

Functions

void mmhal_wlan_spi_cs_assert (void)
 Assert the WLAN SPI chip select pin.
 
void mmhal_wlan_spi_cs_deassert (void)
 Deassert the WLAN SPI chip select pin.
 
uint8_t mmhal_wlan_spi_rw (uint8_t data)
 Simultaneously read and write on the SPI bus. More...
 
void mmhal_wlan_spi_read_buf (uint8_t *buf, unsigned len)
 Receive multiple octets of data from SPI bus. More...
 
void mmhal_wlan_spi_write_buf (const uint8_t *buf, unsigned len)
 Transmit multiple octets of data to SPI bus. More...
 
void mmhal_wlan_hard_reset (void)
 Hard reset the chip by asserting and then releasing the reset pin. More...
 
bool mmhal_wlan_ext_xtal_init_is_required (void)
 Invoked by the driver to check whether the external crystal initialization sequence is required. More...
 
void mmhal_wlan_send_training_seq (void)
 Issue the training sequence. More...
 
void mmhal_wlan_register_spi_irq_handler (mmhal_irq_handler_t handler)
 Register a handler for SPI interrupts. More...
 
void mmhal_wlan_set_spi_irq_enabled (bool enabled)
 Sets whether the SPI interrupt is enabled. More...
 
bool mmhal_wlan_spi_irq_is_asserted (void)
 Tests whether the SPI interrupt pin is currently asserted. More...
 
void mmhal_wlan_clear_spi_irq (void)
 Clear the SPI IRQ. More...
 

Function Documentation

◆ mmhal_wlan_clear_spi_irq()

void mmhal_wlan_clear_spi_irq ( void  )

Clear the SPI IRQ.

Deprecated:
Do not invoke this function because it is deprecated and will be removed from the mmhal API in a future release. This function need not be implemented as a weak stub is used in morselib.

◆ mmhal_wlan_ext_xtal_init_is_required()

bool mmhal_wlan_ext_xtal_init_is_required ( void  )

Invoked by the driver to check whether the external crystal initialization sequence is required.

Implementation of this function is optional if the external crystal initialization sequence is not required. If this function is not implemented then the external crystal initialization sequence will be disabled. Refer to the data sheet for your module to check if this initialization is required.

Returns
true if the external crystal initialization sequence is required else false.

◆ mmhal_wlan_hard_reset()

void mmhal_wlan_hard_reset ( void  )

Hard reset the chip by asserting and then releasing the reset pin.

Warning
This function must return with the chip in a fully booted state. i.e only return once the reset_n line has been high for at least the boot time specified in the data sheet. Failure to do so may lead to undefined behavior.

◆ mmhal_wlan_register_spi_irq_handler()

void mmhal_wlan_register_spi_irq_handler ( mmhal_irq_handler_t  handler)

Register a handler for SPI interrupts.

Parameters
handlerThe handler to register.

◆ mmhal_wlan_send_training_seq()

void mmhal_wlan_send_training_seq ( void  )

Issue the training sequence.

During this at least 74 clock cycles must be supplied to the chip to allow it to prepare for the first command. This is only invoked when using SPI mode in which case the CS shall be held high (mmhal_wlan_spi_cs_deassert()) during the 74 clock cycles.

See section 6.4.1.1 of the SD spec "Physical Layer Simplified Specification Version 9.10" for more detail.

◆ mmhal_wlan_set_spi_irq_enabled()

void mmhal_wlan_set_spi_irq_enabled ( bool  enabled)

Sets whether the SPI interrupt is enabled.

Warning
The interrupt handler function must be configured using mmhal_wlan_register_spi_irq_handler() before enabling the interrupt.
Parameters
enabledtrue to enable or false to disable.

◆ mmhal_wlan_spi_irq_is_asserted()

bool mmhal_wlan_spi_irq_is_asserted ( void  )

Tests whether the SPI interrupt pin is currently asserted.

Note
This is whether it is logically asserted and does not necessarily represent the level of the GPIO pin.
Returns
true if asserted, else false.

◆ mmhal_wlan_spi_read_buf()

void mmhal_wlan_spi_read_buf ( uint8_t *  buf,
unsigned  len 
)

Receive multiple octets of data from SPI bus.

Parameters
bufThe buffer to receive into.
lenThe number of octets to receive.

◆ mmhal_wlan_spi_rw()

uint8_t mmhal_wlan_spi_rw ( uint8_t  data)

Simultaneously read and write on the SPI bus.

Parameters
dataData to be written.
Returns
the value that was read.

◆ mmhal_wlan_spi_write_buf()

void mmhal_wlan_spi_write_buf ( const uint8_t *  buf,
unsigned  len 
)

Transmit multiple octets of data to SPI bus.

Parameters
bufThe buffer to transmit from.
lenThe number of octets to transmit.
Note
Blocks until transfer complete.