Netcruzer Library API  V2.03
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
nz_netcruzer.h File Reference

Main Netcruzer System file. More...

#include "nz_tick.h"
#include "nz_helpers.h"
#include "nz_ioPortDefs.h"
#include "nz_ioPorts.h"
#include "nz_analog.h"
#include "nz_pwm.h"

Go to the source code of this file.

Data Structures

struct  BOARD_STATUS
 
struct  WDT_FLAGS_
 
struct  _GLOBAL_DEFS
 

Macros

#define HAS_NZ_ADC
 
#define HAS_NZ_PWM
 
#define HAS_SERPORT_I2C
 
#define DEBUG_CONF_DEFAULT   DEBUG_LEVEL_ERROR
 
#define NZ_MALLOC(size)   malloc(size)
 
#define USER_RAM_SIZE   256
 
#define MAIN_LOOP_TOP()
 
#define MAIN_LOOP_BOTTOM()   inMainLoop = FALSE;
 
#define BUFFER_DUMMY_SIZE   2
 
#define NZ_GLOBALS_SERPORT_DEBUG   nzGlobals.serDebug
 
#define NZ_GLOBALS_SERPORT_FIRST   nzGlobals.serUart1
 
#define NZ_GLOBALS_SERPORT_LAST   nzGlobals.serUser8
 
#define SERPORT_COUNT   (NZ_GLOBALS_SERPORT_LAST - NZ_GLOBALS_SERPORT_FIRST)
 
#define NZSYS_ENABLE_TICK
 
#define USER_RAM_WORD(adr)   (*((WORD*)(&nzGlobals.userRam[adr])))
 
#define USER_RAM_BYTE(adr)   (nzGlobals.userRam[adr])
 

Typedefs

typedef struct WDT_FLAGS_ WDT_FLAGS
 
typedef struct _GLOBAL_DEFS GLOBAL_DEFS
 

Functions

void mainLoop (void)
 
void nzSysInitDefault (void)
 
void nzSysTaskDefault (void)
 
void nzSysGlobalInit (void)
 

Variables

GLOBAL_DEFS nzGlobals
 

Detailed Description

Main Netcruzer System file.

Author
Modtronix Engineering
Compiler:
MPLAB XC16 compiler

Description

This module contains Netcruzer System code.

Configuration

The following defines are used to configure this module, and should be placed in projdefs.h. Note that all items marked [-DEFAULT-] are defaults, and do not have to be placed in projdefs.h if they contain desired configuration! For details, see Project Configuration.

// *********************************************************************
// ---------- Netcruzer System Configuration (nz_netcruzer.h) ----------
// *********************************************************************
//The following are NOT defined by default. Defining them will prevent the system from managing the named resources
//#define NZSYS_DONT_MANAGE_GLOBALS //Don't call nzSysGlobalInit() function
//#define NZSYS_DONT_MANAGE_MAINLOOP //Don't create the mainLoop() function
//#define NZSYS_DONT_MANAGE_SERPORT //Don't manage nz_serDataPorts init() and task() functions
//#define NZSYS_DONT_MANAGE_TICK //Don't include nz_tick h & c files AND don't manage it(init, task)
//#define NZSYS_DONT_MANAGE_WDT //Don't manage the Watch Dog Timer
//#define NZ_ADC_DISABLE //Don't manage ADC - is enabled by default
//#define NZ_PWM_DISABLE //Don't manage PWM - is enabled by default
//#define NZ_RTC_ENABLE //Enable RTC - is disabled by default
#define NZ_APP_CONFIG_XEE_ENABLED //Enable NZ_APP_CONFIG_XEE
//#define NZSYS_NO_SERI2C_H_FILES //Don't include nz_serI2C.h in nz_netcruzer.h
//#define NZSYS_CALL_INITIALIZE_BOARD //The initializeBoard() function will be called during Netcruzer initialization
//#define NZSYS_CALL_APPCONF_FUNCTIONS //The cfgInit() and appConfInit() function will be called during Netcruzer initialization
//System will NOT initialize and manuage Debugging. Is only done if a DEBUG_USE_XXX define is found (HAS_USBHID_DEBUGGING for example)
//#define NZSYS_DONT_MANAGE_DEBUG
//#define NZSYS_DISABLE_DEFAULT_DEBUG //Disable the "nz_debugDefault.c" file
//#define NZSYS_DISABLE_DEFAULT_SERUSB //Disable the "nz_serUSB.c" file
//Indicates that *.c files should not be included from nz_netcruzer.c. Including *.c files simplifies a MPLAB project, seeing
//that all *.c files included in nz_netcruzer.c do not have to be added to the MPLAB project.
//#define NZSYS_DONT_INCLUDE_C_FILES
//System will add and manage LCD2S and I2C 1 bus (400kbit/sec). We don't have to add any files to project.
//#define NZSYS_ENABLE_LCD2S_AND_I2C1
//Default size of RAM User Memory. Default is 256, set to 0 to disable all "User Memory" functions
#define USER_RAM_SIZE ( 256 )
//Must set "nzGlobals.wdtFlags.bits.mainApp" flag each 8 seconds to prevent WDT reset
#define NZSYS_WDT_CHECK_MAINAPP_FLAG ( 1 )

Software License Agreement

The software supplied herewith is owned by Modtronix Engineering, and is protected under applicable copyright laws. The software supplied herewith is intended and supplied to you, the Company customer, for use solely and exclusively on products manufactured by Modtronix Engineering. The code may be modified and can be used free of charge for commercial and non commercial applications. All rights are reserved. Any use in violation of the foregoing restrictions may subject the user to criminal sanctions under applicable laws, as well as to civil liability for the breach of the terms and conditions of this license.

THIS SOFTWARE IS PROVIDED IN AN 'AS IS' CONDITION. NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.

File History

2012-08-08, David H. (DH):

  • Initial version

Macro Definition Documentation

#define MAIN_LOOP_TOP ( )
Value:
static BOOL inMainLoop=0; \
nzSysTaskDefault(); \
if (inMainLoop == TRUE) return; \
inMainLoop = TRUE;
#define USER_RAM_BYTE (   adr)    (nzGlobals.userRam[adr])

User Ram BYTE. Use to get or set User Ram BYTE.

For example, to get the BYTE at User Ram 0x42: BYTE val; val = USER_RAM_BYTE(0x42);

For example, to set the BYTE at User Ram 0xC2 to 0x0A: USER_RAM_BYTE(0xC2) = 0x0A;

#define USER_RAM_WORD (   adr)    (*((WORD*)(&nzGlobals.userRam[adr])))

User Ram WORD. Use to get or set User Ram WORD.

For example, to get the WORD at User Ram 0x42: WORD val; val = USER_RAM_WORD(0x42);

For example, to set the WORD at User Ram 0xC2 to 0x0A50: USER_RAM_WORD(0xC2) = 0xA50;

Typedef Documentation

typedef struct _GLOBAL_DEFS GLOBAL_DEFS

Global defines, located at 0x1000 (4096) in RAM

Function Documentation

void nzSysGlobalInit ( void  )

Initialize global data