⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 udcount.h

📁 CanOpen的源代码
💻 H
字号:

#ifndef __UDCOUNTH__   /* Schutz gegen mehrfaches #include */
#define __UDCOUNTH__

/***********************************************************************
 *      udcount.h
 *      Projekt :
 *      Funktion: Headerdatei f乺 das Softwaremodul "udcount.c".
 *
 *      Autor   : Hoppe
 *      Sprache : Keil-C51V4
 *
 *      ----------------------------------------------------------------
 *      Copyright (C) 1999 by J. Hoppe, PEAK Service GmbH, Darmstadt
 *      */
#include "compiler.h"

typedef struct _TUDCChannel 
{
	byte idx;
	byte bit_byte;
	byte flags;			// 7:enable 6:mode 5:intel/mot 4: 0=Absolutwert,1=Delta 3-0:bitlen
						// mode=0	obere/untere Grenze=Anschlag
       					// mode=1	endlos im Kreis, 黚erlauf von max->min und umgekehrt

	byte dir_last;		// 7-4 lastin 3-0 dir: 0=stillstand ,1=vorwaerts, 2 = rueckwaerts
	word counter ; 	// zaehlerstand
    word oldcount ; 	// Zum Zeitpunkt der letzten Abfrage (fuer Delta berechnung)
    word minlimit;		// 
    word maxlimit;  	// 
 }  TUDCChannel ;
 // 4 * 12 bytes =48 Bytes

/*** Konstantendefinitionen ***/
#define UDC_CHANNELS 4       // soviele Counter sind moeglich


/*** Typendefinitionen ***/

/*** Deklaration von Objekten f乺 andere Module ***/
#ifndef __UDCOUNTC__
/* ... */
#endif /* __UDCOUNTC__ */


/*** Prototypen f黵 Methoden ***/
void    UDC_Init(void) ;
void    UDC_1000Hz(void) ;
word   UDC_GetCount(uchar channel) ;
int     UDC_GetDelta(uchar channel) ;
char    UDC_GetDirection(uchar channel) ;
void    UDC_Reset(uchar channel) ;
//void    UDC_DefChannel(uchar channel, uchar din) ;
//void UDC_DefChannel(uchar channel, uword minlimit, uword maxlimit, uword initval);	// neu GB 10.12.2001


#endif /* __UDCOUNTH__ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -