NetBurner 3.1
nm_bsp.h
Go to the documentation of this file.
1 
48 #ifndef _NM_BSP_H_
49 #define _NM_BSP_H_
50 
51 #define NMI_API
52 
56 #ifdef __MCF964548__
57 #define CONST code
58 #else
59 #define CONST const
60 #endif
61 
71 typedef void (*tpfNmBspIsr)(void);
72 
73 
74 
75 #ifndef NULL
76 #define NULL ((void*)0)
77 #endif
78 
83 #define BSP_MIN(x,y) ((x)>(y)?(y):(x))
84 
89 
100 typedef unsigned char uint8;
101 
107 typedef unsigned short uint16;
108 
114 typedef unsigned long uint32;
115 
116 
122 typedef signed char sint8;
129 typedef signed short sint16;
137 typedef signed long sint32;
139 
140 #ifndef CORTUS_APP
141 
142 
143 #ifdef __cplusplus
144 extern "C"{
145 #endif
146 
166 sint8 nm_bsp_init(void);
184 sint8 nm_bsp_deinit(void);
204 void resetWILC(int resetPinNum = -1, int wakePinNum =-1, int chipEnablePinNum = -1, int connectorNum = -1);
225 void nSecDelay(unsigned char nSec);
244 void setWILCIsr(tpfNmBspIsr pfIsr);
263 void nm_bsp_interrupt_ctrl(uint8 u8Enable);
280 void* nm_bsp_malloc(uint32 u32Size);
297 void nm_bsp_free(void* pvMemBuffer);
300 #ifdef __cplusplus
301 }
302 #endif
303 
304 #endif
305 
306 #ifdef WIN32
307 #include "nm_bsp_win32.h"
308 #define __M2M_DMA_BUF_ATT__
309 #endif
310 
311 #ifdef __K20D50M__
312 #include "nm_bsp_k20d50m.h"
313 #define __M2M_DMA_BUF_ATT__
314 #endif
315 
316 #ifdef __MSP430FR5739__
317 #include "bsp_msp430fr5739.h"
318 #define __M2M_DMA_BUF_ATT__
319 #endif
320 
321 #ifdef _FREESCALE_MCF51CN128_
322 #include "bsp/include/nm_bsp_mcf51cn128.h"
323 #define __M2M_DMA_BUF_ATT__
324 #endif
325 
326 #ifdef __MCF964548__
327 #include "bsp/include/nm_bsp_mc96f4548.h"
328 #define __M2M_DMA_BUF_ATT__
329 #endif
330 
331 #ifdef __APP_APS3_CORTUS__
332 #include "nm_bsp_aps3_cortus.h"
333 #define __M2M_DMA_BUF_ATT__
334 #endif
335 
336 #ifdef __KERNEL__
337 #include "bsp\include\nm_bsp_linux.h"
338 #define __M2M_DMA_BUF_ATT__
339 #endif
340 
341 #if (defined __SAMD21J18A__) || (defined __SAMD21G18A__)
342 #include "bsp/include/nm_bsp_samd21.h"
343 #define __M2M_DMA_BUF_ATT__
344 #endif
345 
346 #if (defined __SAM4S16C__) || (defined __SAM4SD32C__)
347 #include "bsp/include/nm_bsp_sam4s.h"
348 #define __M2M_DMA_BUF_ATT__ __attribute__((aligned(32)))
349 #endif
350 #if (defined __SAMV71Q21__) || (defined __SAMS70N21__) || (defined __SAMV71Q21B__)
351 #include "bsp/include/nm_bsp_samv71.h"
352 #define __M2M_DMA_BUF_ATT__ __attribute__((aligned(32)))
353 #endif
354 
355 #ifdef __SAMG53N19__
356 #include "bsp/include/nm_bsp_samg53.h"
357 #define __M2M_DMA_BUF_ATT__
358 #endif
359 
360 #ifdef __SAMG55J19__
361 #include "bsp/include/nm_bsp_samg55.h"
362 #define __M2M_DMA_BUF_ATT__
363 #endif
364 
365 #ifdef CORTUS_APP
366 #include "crt_iface.h"
367 #define __M2M_DMA_BUF_ATT__
368 #endif
369 
370 #ifdef NRF51
371 #include "nm_bsp_nrf51822.h"
372 #define __M2M_DMA_BUF_ATT__
373 #endif
374 
375 #ifdef _ARDUINO_UNO_
376 #include <bsp/include/nm_bsp_arduino_uno.h>
377 #define __M2M_DMA_BUF_ATT__
378 #endif
379 
380 /* Added by NetBurner */
381 #ifdef MCF5441X
382 #define __M2M_DMA_BUF_ATT__ __attribute__((aligned(32)))
383 #endif
384 
385 #ifdef MODM7AE70
386 #define __M2M_DMA_BUF_ATT__ __attribute__((aligned(32)))
387 #endif
388 /* End NetBurner additions */
389 
390 #ifndef __M2M_DMA_BUF_ATT__
391 #define __M2M_DMA_BUF_ATT__ __attribute__((aligned(32)))
392 #warning __M2M_DMA_BUF_ATT__ not defined
393 #endif
394 
395 
396 
397 #include <endian.h> // NetBurner endian library
398 
399 
400 #ifdef NB_BIG_ENDIAN
401 #define NM_BSP_B_L_32(x) \
402 ((((x) & 0x000000FF) << 24) + \
403 (((x) & 0x0000FF00) << 8) + \
404 (((x) & 0x00FF0000) >> 8) + \
405 (((x) & 0xFF000000) >> 24))
406 #define NM_BSP_B_L_16(x) \
407 ((((x) & 0x00FF) << 8) + \
408 (((x) & 0xFF00) >> 8))
409 #else
410 #define NM_BSP_B_L_32(x) (x)
411 #define NM_BSP_B_L_16(x) (x)
412 #endif
413 
414 
415 #endif /*_NM_BSP_H_*/
416 
417 
418 
void * nm_bsp_malloc(uint32 u32Size)
Allocate memory.
void(* tpfNmBspIsr)(void)
Pointer to function. Used as a data type of ISR function registered by nm_bsp_register_isr.
Definition: nm_bsp.h:71
void nm_bsp_interrupt_ctrl(uint8 u8Enable)
Enable/Disable interrupts.
sint8 nm_bsp_init(void)
Initialization for bsp (Board Support Package) such as Reset and Chip Enable Pins for WILC...
#define uint32
Range of values between 0 to 4294967295.
Definition: aes.cpp:38
signed long sint32
Range of values between -2147483648 to 2147483647.
Definition: nm_bsp.h:138
signed char sint8
Range of values between -128 to 127.
Definition: nm_bsp.h:123
signed short sint16
Range of values between -32768 to 32767.
Definition: nm_bsp.h:130
sint8 nm_bsp_deinit(void)
#define uint8
Range of values between 0 to 255.
Definition: aes.cpp:34
void nm_bsp_free(void *pvMemBuffer)
Free memory.
unsigned short uint16
Range of values between 0 to 65535.
Definition: ahdlc.cpp:46