This module contains M2M host interface APIs implementation. More...
#include "common/include/nm_common.h"
#include "driver/source/nmbus.h"
#include "driver/source/nmdrv.h"
#include "bsp/include/nm_bsp.h"
#include "m2m_hif.h"
#include "driver/include/m2m_types.h"
#include "driver/source/nmasic.h"
#include "driver/include/m2m_periph.h"
Go to the source code of this file.
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... | |
sint8 | hif_chip_sleep (void) |
To make the chip sleep. More... | |
sint8 | hif_chip_wake (void) |
To Wakeup the chip. More... | |
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. This function reads HIF level directly from a register written by Firmware. More... | |
uint8 | hif_get_sleep_mode (void) |
Get the sleep mode of the HIF layer. More... | |
sint8 | hif_handle_isr (void) |
Handle interrupt received from NMC1500 firmware. More... | |
sint8 | hif_init (void *arg) |
To initialize HIF layer. More... | |
static sint8 | hif_isr (void) |
Host interface interrupt service routine. More... | |
sint8 | hif_receive (uint32 u32Addr, uint8 *pu8Buf, uint16 u16Sz, uint8 isDone) |
sint8 | hif_register_cb (uint8 u8Grp, tpfHifCallBack fn) |
sint8 | hif_send (uint8 u8Gid, uint8 u8Opcode, uint8 *pu8CtrlBuf, uint16 u16CtrlBufSize, uint8 *pu8DataBuf, uint16 u16DataSize, uint16 u16DataOffset) |
Send packet using host interface. More... | |
static sint8 | hif_set_rx_done (void) |
void | hif_set_sleep_mode (uint8 u8Pstype) |
Set the sleep mode of the HIF layer. More... | |
void | hif_yield (void) |
Yields control from interrupt event handler. More... | |
static void | isr (void) |
static void | m2m_hif_cb (uint8 u8OpCode, uint16 u16DataSize, uint32 u32Addr) |
WiFi call back function. More... | |
Variables | |
static uint16 | gau16HifBlacklist [] = {NEW_HIF_LIST} |
static volatile uint8 | gu8ChipMode = 0 |
static volatile uint8 | gu8ChipSleep = 0 |
static uint8 | gu8HifBlOffset = 0 |
static volatile uint8 | gu8HifSizeDone = 0 |
static volatile uint8 | gu8Interrupt = 0 |
static volatile uint8 | gu8Yield = 0 |
tpfHifCallBack | pfHifCb = NULL |
tpfHifCallBack | pfIpCb = NULL |
tpfHifCallBack | pfOtaCb = NULL |
tpfHifCallBack | pfSigmaCb = NULL |
tpfHifCallBack | pfSSLCb = NULL |
tpfHifCallBack | pfWifiCb = NULL |
This module contains M2M host interface APIs implementation.
Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.
Definition in file m2m_hif.c.
#define HIF_BLACKLIST_SZ (sizeof(gau16HifBlacklist)/sizeof(gau16HifBlacklist[0])) |
#define HIFCODE_OTA_RB ((M2M_REQ_GROUP_OTA << 8) | M2M_OTA_REQ_ROLLBACK) |
#define HIFCODE_OTA_SW ((M2M_REQ_GROUP_OTA << 8) | M2M_OTA_REQ_SWITCH_FIRMWARE) |
#define HIFCODE_SSL_WRITECERT ((M2M_REQ_GROUP_SSL << 8) | M2M_SSL_REQ_WRITE_OWN_CERTS) |
#define HIFCODE_WIFI_PASSIVESCAN ((M2M_REQ_GROUP_WIFI << 8) | M2M_WIFI_REQ_PASSIVE_SCAN) |
#define NEW_HIF_LIST HIF_OTA_RB_ONLY, HIFCODE_SSL_WRITECERT, HIFCODE_WIFI_PASSIVESCAN |
sint8 hif_enable_access | ( | void | ) |
hif_handle_isr | ( | void | ) |
|
static |
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). |
hif_yield | ( | void | ) |
|
static |
tpfHifCallBack pfHifCb = NULL |
tpfHifCallBack pfIpCb = NULL |
tpfHifCallBack pfOtaCb = NULL |
tpfHifCallBack pfSigmaCb = NULL |
tpfHifCallBack pfSSLCb = NULL |
tpfHifCallBack pfWifiCb = NULL |