NetBurner 3.1
m2m_hif.h File Reference

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

Go to the source code of this file.

Classes

struct  tstrHifHdr
 Structure to hold HIF header. More...
 
struct  tstrHifinitParam
 Structure to hold HIF Init Param. More...
 

Macros

#define M2M_HIF_MAX_PACKET_SIZE   (1600 - 4)
 

Typedefs

typedef void(* tpfHifCallBack) (uint8 u8OpCode, uint16 u16DataSize, uint8 *pu8Buff)
 used to point to Wi-Fi call back function depend on Arduino project or other projects. More...
 

Functions

NMI_API sint8 hif_deinit (void *arg)
 To Deinitialize HIF layer. More...
 
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 sint8 hif_chip_sleep (void)
 To make the chip sleep. More...
 
NMI_API sint8 hif_chip_sleep_sc (void)
 To clear the chip count only but keep the chip awake. More...
 
NMI_API sint8 hif_chip_wake (void)
 To Wakeup the chip. More...
 
NMI_API void hif_set_sleep_mode (uint8 u8Pstype)
 Set the sleep mode of the HIF layer. 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_set_receive_buffer (void *pvBuffer, uint16 u16BufferLen)
 Handle interrupt received from NMC1500 firmware. More...
 

Detailed Description

This module contains M2M host interface APIs implementation.

Copyright (c) 2014 Atmel Corporation. All rights reserved.

Macro Definition Documentation

◆ M2M_HIF_MAX_PACKET_SIZE

#define M2M_HIF_MAX_PACKET_SIZE   (1600 - 4)

Maximum size of the buffer could be transferred between Host and Firmware.

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]pu8BuffHIF Data Buffer.
[in]grpHIF group type.

Function Documentation

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

◆ hif_chip_sleep_sc()

NMI_API sint8 hif_chip_sleep_sc ( void  )

To clear the chip count only but keep the chip awake.

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

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

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

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

◆ hif_handle_isr()

hif_handle_isr ( void  )

Handle interrupt received from NMC1500 firmware.

Returns

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

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

◆ hif_set_receive_buffer()

hif_set_receive_buffer ( void *  pvBuffer,
uint16  u16BufferLen 
)

Handle interrupt received from NMC1500 firmware.

Parameters
[in]pvBufferPointer to the buffer.
[in]u16BufferLenSize of the buffer.
Returns

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

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