This module contains M2M host interface APIs implementation.
Copyright (c) 2017-2019 Microchip Technology Inc. and its subsidiaries.
#include "common/include/nm_common.h"
Data Structures | |
struct | tstrHifHdr |
Structure to hold HIF header. More... | |
Macros | |
#define | M2M_HIF_HDR_OFFSET (sizeof(tstrHifHdr) + 4) |
#define | M2M_HIF_MAX_PACKET_SIZE (1600 - 4) |
Typedefs | |
typedef void(* | tpfHifCallBack )(uint8 u8OpCode, uint16 u16DataSize, uint32 u32Addr) |
used to point to Wi-Fi call back function depend on Arduino project or other projects. More... | |
Functions | |
sint8 | hif_check_code (uint8 u8Gid, uint8 u8OpCode) |
To check that a particular hif message is supported with the current driver/firmware pair.More... | |
sint8 | hif_check_compatibility (uint16 u16HifInfo) |
To check the compatibility of an image with the current driver.More... | |
NMI_API sint8 | hif_chip_sleep (void) |
To make the chip sleep. More... | |
NMI_API sint8 | hif_chip_wake (void) |
To Wakeup the chip. More... | |
NMI_API sint8 | hif_deinit (void *arg) |
To Deinitialize HIF layer. More... | |
sint8 | hif_enable_access (void) |
To enable access to HIF layer, based on HIF level of Firmware.More... | |
NMI_API uint8 | hif_get_sleep_mode (void) |
Get the sleep mode of the HIF layer. More... | |
NMI_API sint8 | hif_handle_isr (void) |
Handle interrupt received from NMC1500 firmware.More... | |
NMI_API sint8 | hif_init (void *arg) |
To initialize HIF layer. More... | |
NMI_API sint8 | hif_receive (uint32 u32Addr, uint8 *pu8Buf, uint16 u16Sz, uint8 isDone) |
NMI_API sint8 | hif_register_cb (uint8 u8Grp, tpfHifCallBack fn) |
NMI_API sint8 | hif_send (uint8 u8Gid, uint8 u8Opcode, uint8 *pu8CtrlBuf, uint16 u16CtrlBufSize, uint8 *pu8DataBuf, uint16 u16DataSize, uint16 u16DataOffset) |
Send packet using host interface. More... | |
NMI_API void | hif_set_sleep_mode (uint8 u8Pstype) |
Set the sleep mode of the HIF layer. More... | |
NMI_API void | hif_yield (void) |
Yields control from interrupt event handler. More... | |
#define M2M_HIF_HDR_OFFSET (sizeof(tstrHifHdr) + 4) |
Referenced by hif_isr(), hif_send(), m2m_ip_cb(), m2m_wifi_prng_get_random_bytes(), m2m_wifi_send_ethernet_pkt(), and sendto().
#define M2M_HIF_MAX_PACKET_SIZE (1600 - 4) |
< Include depends on UNO Board is used or not Maximum size of the buffer could be transferred between Host and Firmware.
Referenced by hif_send(), m2m_wifi_prng_get_random_bytes(), and sendto().
used to point to Wi-Fi call back function depend on Arduino project or other projects.
[in] | u8OpCode | HIF Opcode type. |
[in] | u16DataSize | HIF data length. |
[in] | u32Addr | HIF address. |
[in] | grp | HIF group type. |
To check that a particular hif message is supported with the current driver/firmware pair.
[in] | u8Gid | Group ID. |
[in] | u8Opcode | Operation ID. |
[in] | u8Gid | Group ID. |
[in] | u8Opcode | Operation ID. |
References gau16HifBlacklist, gu8HifBlOffset, HIF_BLACKLIST_SZ, HIFCODE_OTA_RB, HIFCODE_OTA_SW, M2M_ERR, M2M_ERR_SEND, and M2M_SUCCESS.
Referenced by hif_send().
To check the compatibility of an image with the current driver.
[in] | u16HifInfo | HIF info of image to be checked. |
References M2M_ERR_FW_VER_MISMATCH, M2M_GET_HIF_BLOCK, M2M_GET_HIF_MAJOR, M2M_HIF_BLOCK_VALUE, M2M_HIF_MAJOR_VALUE, and M2M_SUCCESS.
Referenced by hif_enable_access(), and m2m_wifi_check_ota_rb().
To make the chip sleep.
To make the chip sleep.
To Wakeup the chip.
To Wakeup the chip.
To Deinitialize HIF layer.
To De-initialize HIF layer.
To Deinitialize HIF layer.
[in] | arg | Pointer to the arguments. |
[in] | arg | Pointer to the arguments. |
sint8 hif_enable_access | ( | void | ) |
To enable access to HIF layer, based on HIF level of Firmware.
This function reads HIF level directly from a register written by Firmware.
References gu8HifBlOffset, HIF_BLACKLIST_SZ, hif_check_compatibility(), M2M_ERR, M2M_GET_HIF_MINOR, M2M_SUCCESS, nm_get_hif_info(), and NULL.
Referenced by m2m_wifi_init_start().
Get the sleep mode of the HIF layer.
Handle interrupt received from NMC1500 firmware.
Handle interrupt received from NMC1500 firmware.
To initialize HIF layer.
To initialize HIF layer.
[in] | arg | Pointer to the arguments. |
[in] | arg | Pointer to the arguments. |
NMI_API sint8 hif_register_cb | ( | uint8 | u8Grp, |
tpfHifCallBack | fn | ||
) |
NMI_API sint8 hif_send | ( | uint8 | u8Gid, |
uint8 | u8Opcode, | ||
uint8 * | pu8CtrlBuf, | ||
uint16 | u16CtrlBufSize, | ||
uint8 * | pu8DataBuf, | ||
uint16 | u16DataSize, | ||
uint16 | u16DataOffset | ||
) |
Send packet using host interface.
[in] | u8Gid | Group ID. |
[in] | u8Opcode | Operation ID. |
[in] | pu8CtrlBuf | Pointer to the Control buffer. |
[in] | u16CtrlBufSize | Control buffer size. |
[in] | u16DataOffset | Packet Data offset. |
[in] | pu8DataBuf | Packet buffer Allocated by the caller. |
[in] | u16DataSize | Packet buffer size (including the HIF header). |
[in] | u8Gid | Group ID. |
[in] | u8Opcode | Operation ID. |
[in] | pu8CtrlBuf | Pointer to the Control buffer. |
[in] | u16CtrlBufSize | Control buffer size. |
[in] | u16DataOffset | Packet Data offset. |
[in] | pu8DataBuf | Packet buffer Allocated by the caller. |
[in] | u16DataSize | Packet buffer size (including the HIF header). |
Set the sleep mode of the HIF layer.
[in] | u8Pstype | Sleep mode. |
NMI_API void hif_yield | ( | void | ) |
Yields control from interrupt event handler.
Yields control from interrupt event handler.