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

Internal ADC functions. More...

Go to the source code of this file.

Detailed Description

Internal ADC functions.

Author
Modtronix Engineering
Compiler:
MPLAB XC16

Description

Functions for using the internal ADC

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.

// *********************************************************************
// ---------- ADC Filtered Configuration (from nz_analog.h) ------------
// *********************************************************************
//#define NZ_ADC_DISABLE //Don't manage ADC - ADC is enabled by default
//If following line is included in projdefs.h, 3.3V supply is used for reference. Default is 2.5V external precision reference.
#define ADC_3V3_VREF //Use internal 3.3V supply as reference
//Number of filter stages for each ADC channel. Must be 2, 4 or 8. For each ADC channel, this many
//words are needed. Total required memory is ADC_MAX_CHAN x ADC_FILTERS words.
#define ADC_FILTER_STAGES ( 4 ) //[-DEFAULT-]
//ADC Interrupt priority, a value from 0 to 7. 0 will disable interrupt, 7 is highest priority.
#define nzINT_PRIORITY_ADC1 ( 4 ) //[-DEFAULT-]
//Maximum number of possible ADC channels. Default value is taken from board include file, and reserves memory for
//all possible ADC channels. To reduce memory used, define this value to be equal to actual number of ADC channels
//used. For example, if only using Port 1 and 2 (old port names X1 and X2) are ADC channels, change ADC_MAX_CHAN_BRD to 2.
#define ADC_MAX_CHAN ADC_MAX_CHAN_BRD //[-DEFAULT-]
//The channel mask indicates what AN channels can be used for ADC inputs. Default value is taken from board include
//file, and is a mask for all possible ADC channels. Don't change unless you know what you are doing!
#define ADC_CHANNEL_MASK_LOW ADC_CHANNEL_MASK_LOW_BRD //[-DEFAULT-]
#define ADC_CHANNEL_MASK_HIGH ADC_CHANNEL_MASK_HIGH_BRD //[-DEFAULT-]
//To reduce size of the nz_analog module, following defines can be added to projdefs.h
#define ADC_NO_MV_FUNCTIONS //No millivolt functions included
#define ADC_NO_CONVERT_FUNCTIONS //No convert functions included
#define ADC_NO_CHAN_FUNCTIONS //Don't support any channel functions - use indexed functions

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

2011-06-03, David H. (DH):

  • Initial version