API for communicating with the WLAN transceiver.
There are different interfaces supported for communicating with the transceiver:
- Warning
- These functions shall not be called directly by the end application they are for use by Morselib.
◆ MMHAL_WLAN_FW_BCF_MIN_READ_LENGTH
| #define MMHAL_WLAN_FW_BCF_MIN_READ_LENGTH (4) |
◆ mmhal_irq_handler_t
| typedef void(* mmhal_irq_handler_t) (void) |
Function prototype for interrupt handler callbacks.
Definition at line 42 of file mmhal_wlan.h.
◆ mmhal_read_mac_addr()
| void mmhal_read_mac_addr |
( |
uint8_t * |
mac_addr | ) |
|
Get MAC address override.
This function allows the HAL to override the MAC address to be used by the device. The MAC address override should be written to mac_addr. If no override is required then mac_addr should be left untouched.
- Parameters
-
| [out] | mac_addr | Location where the MAC address will be stored. This will be initialized to zero the first time this function is invoked, and to the previously configured MAC address on subsequent invocations. |
◆ mmhal_wlan_busy_is_asserted()
| bool mmhal_wlan_busy_is_asserted |
( |
void |
| ) |
|
Tests whether the busy 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_deinit()
| void mmhal_wlan_deinit |
( |
void |
| ) |
|
Deinitialize the WLAN HAL.
Things to do here may include:
- Disable SPI peripheral
- Disable GPIOs
- Disable power to the Morse Micro transceiver
◆ mmhal_wlan_init()
| void mmhal_wlan_init |
( |
void |
| ) |
|
Initialize the WLAN HAL.
Things to do here may include:
- Enable SPI peripheral
- Configure GPIOs
- Enable power to the Morse Micro transceiver
- Note
- If enabling power for the Morse Micro transceiver in this function you may need to add a blocking delay to allow the power rail to stabilize. This is hardware specific so is not accounted for in the calling function.
◆ mmhal_wlan_read_bcf_file()
| void mmhal_wlan_read_bcf_file |
( |
uint32_t |
offset, |
|
|
uint32_t |
requested_len, |
|
|
struct mmhal_robuf * |
robuf |
|
) |
| |
Retrieves the content of the Morse Micro Board Configuration File and places it into the given buffer.
- Parameters
-
| offset | Offset from which to start reading the bcf |
| requested_len | Length of data we would like to read. The length of the data returned by this function may be less than requested_len, but must be at least MMHAL_WLAN_FW_BCF_MIN_READ_LENGTH. |
| robuf | Read-only buffer data structure to be filled out by this function. |
- Note
- On error, this function should set
robuf->buf to NULL.
-
The caller must zero
robuf before invoking the function.
-
The BCF must be in mbin format.
- Warning
- The caller is responsible for checking
robuf->free_cb and calling when the buffer is no longer required. Ignored if robuf->free_cb is NULL.
◆ mmhal_wlan_read_fw_file()
| void mmhal_wlan_read_fw_file |
( |
uint32_t |
offset, |
|
|
uint32_t |
requested_len, |
|
|
struct mmhal_robuf * |
robuf |
|
) |
| |
Retrieves the content of the Morse Micro Chip Firmware and places it into the given buffer.
- Parameters
-
| offset | Offset from which to start reading the bcf |
| requested_len | Length of data we would like to read. The length of the data returned by this function may be less than requested_len, but must be at least MMHAL_WLAN_FW_BCF_MIN_READ_LENGTH. |
| robuf | Read-only buffer data structure to be filled out by this function. |
- Note
- On error, this function should set
robuf->buf to NULL.
-
The caller must zero
robuf before invoking the function.
-
The firmware must be in mbin format.
- Warning
- The caller is responsible for checking
robuf->free_cb and calling when the buffer is no longer required. Ignored if robuf->free_cb is NULL.
◆ mmhal_wlan_register_busy_irq_handler()
Register a handler for busy interrupts.
- Parameters
-
| handler | The handler to register. |
◆ mmhal_wlan_set_busy_irq_enabled()
| void mmhal_wlan_set_busy_irq_enabled |
( |
bool |
enabled | ) |
|
Sets whether the busy interrupt is enabled.
- Warning
- The interrupt handler function must be configured using mmhal_wlan_register_busy_irq_handler() before enabling the interrupt.
- Parameters
-
| enabled | true to enable or false to disable. |