NetBurner 3.1
m2m_hif.h
Go to the documentation of this file.
1 
49 #ifndef _M2M_HIF_
50 #define _M2M_HIF_
51 
52 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
53 INCLUDES
54 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
55 
58 
59 #if !(defined CONF_WILC_USE_1000_REV_B || defined CONF_WILC_USE_3000_REV_A)
60 #error "Please define either CONF_WILC_USE_1000_REV_B or CONF_WILC_USE_3000_REV_A before compiling the host driver"
61 #endif
62 
63 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
64 MACROS
65 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
66 
67 #define M2M_HIF_MAX_PACKET_SIZE (1600 - 4)
68 
71 #define M2M_HIF_HDR_OFFSET (sizeof(tstrHifHdr) + 4)
72 
77 typedef struct
78 {
79  unsigned char u8Gid;
80  unsigned char u8Opcode;
81  unsigned short u16Length;
82 }tstrHifHdr;
83 
88 typedef struct
89 {
90  uint8 * pu8RcvBuff;
93 
94 typedef struct
95 {
96  unsigned char u8Gid;
97  unsigned char u8Opcode;
98  unsigned short u16Length;
99  unsigned char __PAD32__[4];
100 }tstrHifHdrOffset;
101 
102 #ifdef __cplusplus
103  extern "C" {
104 #endif
105 
118 typedef void (*tpfHifCallBack)(uint8 u8OpCode, uint16 u16DataSize, uint8* pu8Buff);
128 NMI_API sint8 hif_init(tstrHifinitParam * pstrInitParam);
138 NMI_API sint8 hif_deinit(void * arg);
160 NMI_API sint8 hif_send(uint8 u8Gid,uint8 u8Opcode,uint8 *pu8CtrlBuf,uint16 u16CtrlBufSize,
161  uint8 *pu8DataBuf,uint16 u16DataSize, uint16 u16DataOffset);
162 
185 sint8 hif_send_optimized(uint8 u8Gid, uint8 u8Opcode, uint8* buffer, uint16 u16DataSize);
186 
187 /*
188 * @fn hif_receive
189 * @brief Host interface interrupt serviece routine
190 * @param [in] u32Addr
191 * Receive start address
192 * @param [out] pu8Buf
193 * Pointer to receive buffer. Allocated by the caller
194 * @param [in] u16Sz
195 * Receive buffer size
196 * @param [in] isDone
197 * If you don't need any more packets send True otherwise send false
198 * @return
199  The function shall return ZERO for successful operation and a negative value otherwise.
200 */
201 
202 NMI_API sint8 hif_receive(uint32 u32Addr, uint8 *pu8Buf, uint16 u16Sz, uint8 isDone);
216 NMI_API sint8 hif_register_cb(uint8 u8Grp,tpfHifCallBack fn);
256 NMI_API void hif_set_sleep_mode(uint8 u8Pstype);
268 NMI_API uint8 hif_get_sleep_mode(void);
269 
270 #ifdef CORTUS_APP
271 
285 NMI_API sint8 hif_Resp_handler(uint8 *pu8Buffer, uint16 u16BufferSize);
286 #endif
287 
296 
308 NMI_API sint8 hif_set_receive_buffer(void* pvBuffer,uint16 u16BufferLen);
309 
310 #ifdef __cplusplus
311 }
312 #endif
313 #endif
314 
WiFi Settings.
NMI_API sint8 hif_deinit(void *arg)
To Deinitialize HIF layer.
This module contains common APIs declarations.
uint32 u32RcvBuffSize
Definition: m2m_hif.h:91
NMI_API sint8 hif_chip_sleep_sc(void)
To clear the chip count only but keep the chip awake.
NMI_API sint8 hif_chip_sleep(void)
To make the chip sleep.
void(* tpfHifCallBack)(uint8 u8OpCode, uint16 u16DataSize, uint8 *pu8Buff)
used to point to Wi-Fi call back function depend on Arduino project or other projects.
Definition: m2m_hif.h:118
NMI_API sint8 hif_handle_isr(void)
Handle interrupt received from NMC1500 firmware.
unsigned char u8Opcode
Definition: m2m_hif.h:80
NMI_API uint8 hif_get_sleep_mode(void)
Get the sleep mode of the HIF layer.
uint8 * pu8RcvBuff
Definition: m2m_hif.h:90
unsigned short u16Length
Definition: m2m_hif.h:81
#define NMI_API
Definition: nm_bsp.h:51
signed char sint8
Range of values between -128 to 127.
Definition: nm_bsp.h:123
NMI_API void hif_set_sleep_mode(uint8 u8Pstype)
Set the sleep mode of the HIF layer.
NMI_API sint8 hif_chip_wake(void)
To Wakeup the chip.
NMI_API sint8 hif_set_receive_buffer(void *pvBuffer, uint16 u16BufferLen)
Handle interrupt received from NMC1500 firmware.
Structure to hold HIF Init Param.
Definition: m2m_hif.h:88
NMI_API sint8 hif_send(uint8 u8Gid, uint8 u8Opcode, uint8 *pu8CtrlBuf, uint16 u16CtrlBufSize, uint8 *pu8DataBuf, uint16 u16DataSize, uint16 u16DataOffset)
Send packet using host interface.
unsigned char u8Gid
Definition: m2m_hif.h:79
Structure to hold HIF header.
Definition: m2m_hif.h:77
unsigned short uint16
Range of values between 0 to 65535.
Definition: ahdlc.cpp:46