Netcruzer Library API  V2.03
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
nz_encIncRot.h
Go to the documentation of this file.
1 
67 #ifndef NZ_ENC_INC_ROT_H
68 #define NZ_ENC_INC_ROT_H
69 
71 
72 
74 //Circular Buffer size
75 #if !defined(ENC_INC_ROT_BUFSIZE)
76 #define ENC_INC_ROT_BUFSIZE 128
77 #endif
78 
79 
80 
81 //typedef struct ENCROT_INFO_
82 typedef struct __attribute__((__packed__)) ENCROT_INFO_
83 //typedef struct __attribute__((aligned(2), packed)) ENCROT_INFO_
84 {
85  WORD bitadrChA; //Channel A
86  WORD bitadrChB; //Channel B
87  DWORD oldUticks; //Old Utick value
88  #if (ENC_INC_ROT_BUFSIZE<256)
89  BYTE put;
90  #else
91  WORD put;
92  #endif
93  WORD buf[ENC_INC_ROT_BUFSIZE]; //Signed 16-bit value
94  union {
95  struct
96  {
97  unsigned int oldValA : 1;
98  } flags;
99  BYTE flagVal;
100  };
101 } ENCROT_INFO;
102 
103 
105 
117 BYTE rotinc_init(ENCROT_INFO* pObj, BYTE portIdChA, BYTE portIdChB);
118 
119 
125 void rotinc_task(ENCROT_INFO* pObj);
126 
127 #endif //#ifndef NZ_ENC_INC_ROT_H