Classes | Macros | Typedefs | Functions
m2m_hif.h File Reference

This module contains M2M host interface APIs implementation. More...

#include "common/include/nm_common.h"
Include dependency graph for m2m_hif.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

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. This function reads HIF level directly from a register written by 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...
 

Detailed Description

This module contains M2M host interface APIs implementation.

Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.

Definition in file m2m_hif.h.

Macro Definition Documentation

◆ M2M_HIF_HDR_OFFSET

#define M2M_HIF_HDR_OFFSET   (sizeof(tstrHifHdr) + 4)

Definition at line 56 of file m2m_hif.h.

◆ M2M_HIF_MAX_PACKET_SIZE

#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.

Definition at line 52 of file m2m_hif.h.

Typedef Documentation

◆ tpfHifCallBack

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.

Parameters
[in]u8OpCodeHIF Opcode type.
[in]u16DataSizeHIF data length.
[in]u32AddrHIF address.
[in]grpHIF group type.

Definition at line 86 of file m2m_hif.h.

Function Documentation

◆ hif_check_code()

sint8 hif_check_code ( uint8  u8Gid,
uint8  u8OpCode 
)

To check that a particular hif message is supported with the current driver/firmware pair.

Parameters
[in]u8GidGroup ID.
[in]u8OpcodeOperation ID.
Returns
The function shall return ZERO for support and a negative value otherwise.

Definition at line 394 of file m2m_hif.c.

◆ hif_check_compatibility()

sint8 hif_check_compatibility ( uint16  u16HifInfo)

To check the compatibility of an image with the current driver.

Parameters
[in]u16HifInfoHIF info of image to be checked.
Returns
The function shall return ZERO for compatible image and a negative value otherwise.

Definition at line 327 of file m2m_hif.c.

◆ hif_chip_sleep()

NMI_API sint8 hif_chip_sleep ( void  )

To make the chip sleep.

Returns
The function shall return ZERO for successful operation and a negative value otherwise.

Definition at line 226 of file m2m_hif.c.

◆ hif_chip_wake()

NMI_API sint8 hif_chip_wake ( void  )

To Wakeup the chip.

Returns
The function shall return ZERO for successful operation and a negative value otherwise.

Definition at line 167 of file m2m_hif.c.

◆ hif_deinit()

NMI_API sint8 hif_deinit ( void *  arg)

To Deinitialize HIF layer.

Parameters
[in]argPointer to the arguments.
Returns
The function shall return ZERO for successful operation and a negative value otherwise.

Definition at line 289 of file m2m_hif.c.

◆ hif_enable_access()

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.

Returns
The function shall return ZERO for full match operation and a negative value if operation is restricted.

Definition at line 343 of file m2m_hif.c.

◆ hif_get_sleep_mode()

NMI_API uint8 hif_get_sleep_mode ( void  )

Get the sleep mode of the HIF layer.

Returns
The function SHALL return the sleep mode of the HIF layer.

Definition at line 216 of file m2m_hif.c.

◆ hif_handle_isr()

NMI_API sint8 hif_handle_isr ( void  )

Handle interrupt received from NMC1500 firmware.

Returns
The function SHALL return 0 for success and a negative value otherwise.

Definition at line 716 of file m2m_hif.c.

◆ hif_init()

NMI_API sint8 hif_init ( void *  arg)

To initialize HIF layer.

Parameters
[in]argPointer to the arguments.
Returns
The function shall return ZERO for successful operation and a negative value otherwise.

Definition at line 266 of file m2m_hif.c.

◆ hif_receive()

NMI_API sint8 hif_receive ( uint32  u32Addr,
uint8 pu8Buf,
uint16  u16Sz,
uint8  isDone 
)

Definition at line 762 of file m2m_hif.c.

◆ hif_register_cb()

NMI_API sint8 hif_register_cb ( uint8  u8Grp,
tpfHifCallBack  fn 
)

Definition at line 839 of file m2m_hif.c.

◆ hif_send()

NMI_API sint8 hif_send ( uint8  u8Gid,
uint8  u8Opcode,
uint8 pu8CtrlBuf,
uint16  u16CtrlBufSize,
uint8 pu8DataBuf,
uint16  u16DataSize,
uint16  u16DataOffset 
)

Send packet using host interface.

Parameters
[in]u8GidGroup ID.
[in]u8OpcodeOperation ID.
[in]pu8CtrlBufPointer to the Control buffer.
[in]u16CtrlBufSizeControl buffer size.
[in]u16DataOffsetPacket Data offset.
[in]pu8DataBufPacket buffer Allocated by the caller.
[in]u16DataSizePacket buffer size (including the HIF header).
Returns
The function shall return ZERO for successful operation and a negative value otherwise.

Definition at line 439 of file m2m_hif.c.

◆ hif_set_sleep_mode()

NMI_API void hif_set_sleep_mode ( uint8  u8Pstype)

Set the sleep mode of the HIF layer.

Parameters
[in]u8PstypeSleep mode.
Returns
The function SHALL return 0 for success and a negative value otherwise.

Definition at line 201 of file m2m_hif.c.

◆ hif_yield()

NMI_API void hif_yield ( void  )

Yields control from interrupt event handler.

Definition at line 711 of file m2m_hif.c.



inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:17:59