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

Functions for an Incremental Rotary Encoder. More...

#include "HardwareProfile.h"
#include "nz_encIncRot.h"
#include "nz_helpers.h"
#include "nz_helpersCx.h"
#include "nz_debug.h"

Macros

#define THIS_IS_NZ_ENC_INC_ROT_C
 
#define DEBUG_CONF_INCROTENC   DEBUG_CONF_DEFAULT
 
#define MY_DEBUG_LEVEL   DEBUG_CONF_INCROTENC
 
#define ENC_INC_ROT_RESOLUTION   16
 
#define ENC_INC_ROT_DEBOUNCE   8
 

Functions

BYTE rotinc_init (ENCROT_INFO *pObj, BYTE portIdChA, BYTE portIdChB)
 
void rotinc_task (ENCROT_INFO *pObj)
 

Detailed Description

Functions for an Incremental Rotary Encoder.

Author
Modtronix Engineering
Compiler:
MPLAB XC16 compiler

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

2014-01-02, David H. (DH):

  • Initial version

Function Documentation

BYTE rotinc_init ( ENCROT_INFO pObj,
BYTE  portIdChA,
BYTE  portIdChB 
)

Initialization.

Parameters
pObjPointer to ENCROT_INFO structure
portIdChAThe "Port ID" connected to channel A of the encoder. Is a number from 0 to 41, also known as the "Netcruzer Port Name".
portIdChBThe "Port ID" connected to channel B of the encoder. Is a number from 0 to 41, also known as the "Netcruzer Port Name".
Returns
The status of the Initialization, 0=Success, else error code
Examples:
rotary_encoder/main.c.
void rotinc_task ( ENCROT_INFO pObj)

DS2482 Task, is called when Channel A causes an interrupt

Examples:
rotary_encoder/main.c.