![]() |
Morse Micro IoT SDK
2.9.7
|
Useful macros and inline utilities function for use by SDIO and SPI HALs.
Macros | |
| #define | MMHAL_SDIO_ADDRESS_OFFSET (9) |
| CMD52/53 Register Address (17 bit) offset. More... | |
| #define | MMHAL_SDIO_ADDRESS_MAX ((1ul << 18) - 1) |
| CMD52/53 Register Address maximum value. More... | |
| #define | MMHAL_SDIO_COUNT_OFFSET (0) |
| CMD53 Byte/block count offset (9 bit). More... | |
| #define | MMHAL_SDIO_COUNT_MAX ((1ul << 10) - 1) |
| CMD53 Byte/block count maximum value. More... | |
| #define | MMHAL_SDIO_CMD52_DATA_OFFSET (0) |
| CMD52 Data (8 bit) offset. More... | |
Enumerations | |
| enum | mmhal_sdio_rw { MMHAL_SDIO_READ = 0 , MMHAL_SDIO_WRITE = (1ul << 31) } |
| SDIO CMD52/CMD53 R/W flag. More... | |
| enum | mmhal_sdio_function { MMHAL_SDIO_FUNCTION_0 = 0 , MMHAL_SDIO_FUNCTION_1 = (1ul << 28) , MMHAL_SDIO_FUNCTION_2 = (2ul << 28) } |
| SDIO CMD52/CMD53 function number. More... | |
| enum | mmhal_sdio_mode { MMHAL_SDIO_MODE_BYTE = 0 , MMHAL_SDIO_MODE_BLOCK = (1ul << 27) } |
| SDIO CMD53 block mode. More... | |
| enum | mmhal_sdio_opcode { MMHAL_SDIO_OPCODE_FIXED_ADDR = 0 , MMHAL_SDIO_OPCODE_INC_ADDR = (1ul << 26) } |
| SDIO CMD53 OP code. More... | |
Functions | |
| static uint32_t | mmhal_make_cmd52_arg (enum mmhal_sdio_rw rw, enum mmhal_sdio_function fn, uint32_t address, uint8_t write_data) |
| Construct an SDIO CMD52 argument based on the given arguments. More... | |
| static uint32_t | mmhal_make_cmd53_arg (enum mmhal_sdio_rw rw, enum mmhal_sdio_function fn, enum mmhal_sdio_mode mode, uint32_t address, uint16_t count) |
| Construct an SDIO CMD53 argument based on the given arguments. More... | |
| #define MMHAL_SDIO_ADDRESS_MAX ((1ul << 18) - 1) |
CMD52/53 Register Address maximum value.
Definition at line 638 of file mmhal_wlan.h.
| #define MMHAL_SDIO_ADDRESS_OFFSET (9) |
CMD52/53 Register Address (17 bit) offset.
Definition at line 636 of file mmhal_wlan.h.
| #define MMHAL_SDIO_CMD52_DATA_OFFSET (0) |
CMD52 Data (8 bit) offset.
Definition at line 646 of file mmhal_wlan.h.
| #define MMHAL_SDIO_COUNT_MAX ((1ul << 10) - 1) |
CMD53 Byte/block count maximum value.
Definition at line 643 of file mmhal_wlan.h.
| #define MMHAL_SDIO_COUNT_OFFSET (0) |
CMD53 Byte/block count offset (9 bit).
Definition at line 641 of file mmhal_wlan.h.
| enum mmhal_sdio_function |
SDIO CMD52/CMD53 function number.
| Enumerator | |
|---|---|
| MMHAL_SDIO_FUNCTION_1 | Function 0. |
| MMHAL_SDIO_FUNCTION_2 | Function 1. |
Definition at line 612 of file mmhal_wlan.h.
| enum mmhal_sdio_mode |
SDIO CMD53 block mode.
| Enumerator | |
|---|---|
| MMHAL_SDIO_MODE_BLOCK | Byte mode. |
Definition at line 620 of file mmhal_wlan.h.
| enum mmhal_sdio_opcode |
SDIO CMD53 OP code.
| Enumerator | |
|---|---|
| MMHAL_SDIO_OPCODE_FIXED_ADDR | Operate on a single, fixed address. |
| MMHAL_SDIO_OPCODE_INC_ADDR | Increment address by 1 after each byte. |
Definition at line 627 of file mmhal_wlan.h.
| enum mmhal_sdio_rw |
SDIO CMD52/CMD53 R/W flag.
| Enumerator | |
|---|---|
| MMHAL_SDIO_READ | Read operation. |
| MMHAL_SDIO_WRITE | Write operation. |
Definition at line 605 of file mmhal_wlan.h.
|
inlinestatic |
Construct an SDIO CMD52 argument based on the given arguments.
| rw | Flag indication direction (read or write). |
| fn | The applicable function. |
| address | The address to read/write. Must be <= MMHAL_SDIO_ADDRESS_MAX. |
| write_data | The data to write if this is a write operation. Should be set to zero for a read operation. |
Definition at line 659 of file mmhal_wlan.h.
|
inlinestatic |
Construct an SDIO CMD53 argument based on the given arguments.
| rw | Flag indication direction (read or write). |
| fn | The applicable function. |
| mode | Selects between byte and block mode. |
| address | The address to read/write. Must be <= MMHAL_SDIO_ADDRESS_MAX. |
| count | The count of bytes/blocks (depending on mode) to transfer. Must be <= MMHAL_SDIO_COUNT_MAX. |
Definition at line 684 of file mmhal_wlan.h.