AvrIO  1.4.5
Bibliothèque C modulaire pour ATMEL AVR
term.h
1 
18 #ifndef _AVRIO_TERM_H_
19 #define _AVRIO_TERM_H_
20 
21 #include <avrio/defs.h>
22 #include <avrio/menu.h>
23 #include <stdio.h>
24 
25 __BEGIN_C_DECLS
26 /* ========================================================================== */
38 /* constants ================================================================ */
42  typedef enum {
43 
44  TERM_FLAG_NORMAL = 0x00,
45  TERM_FLAG_INVERSE = 0x01,
46  TERM_FLAG_BLINK = 0x02
47 } eTermFlag;
48 
49 /* structures =============================================================== */
53 typedef struct xTermSize {
54  int iHSize;
55  int iVSize;
56 } xTermSize;
57 
63 typedef struct xTermPos {
64  int iLine;
65  int iColumn;
66 } xTermPos;
67 
71 typedef struct xTerm {
72  FILE *pxInputStream;
73  FILE *pxOuputStream;
78 } xTerm;
79 
80 /* types ==================================================================== */
81 /* internal public functions ================================================ */
94 int iTermGetDec (FILE * pxInputStream, int iDigits);
95 
108 int iTermGetHex (FILE * pxInputStream, int iDigits);
109 
124 int iTermGetStr (char * pcStr, int iSize, FILE * pxInputStream);
125 
129 void vTermPutHexByte (uint8_t ucByte, FILE * pxOutputStream);
130 
134 void vTermPutHexWord (uint16_t usWord, FILE * pxOutputStream);
135 
139 void vTermPutHexDword (uint32_t ulDword, FILE * pxOutputStream);
140 
144 void vTermPutHexBytes (const uint8_t * pucBytes, int xLength, FILE * pxOutputStream);
145 
149 void vTermPutDec(uint16_t usValue, FILE * pxOutputStream);
150 
151 
152 #if defined(__DOXYGEN__)
153 
156 inline void vTermSetMenu (xTerm * pxTerm, xMenu * pxMenu);
157 
161 inline xMenu *pxTermGetMenu (xTerm * pxTerm);
162 
167 #else
168 /*
169  * __DOXYGEN__ not defined
170  * Partie ne devant pas être documentée.
171  * =============================================================================
172  */
173 // ------------------------------------------------------------------------------
174 static inline void
175 vTermSetMenu (xTerm * pxTerm, xMenu * pxMenu) {
176 
177  pxTerm->pxMenu = pxMenu;
178 }
179 
180 // ------------------------------------------------------------------------------
181 static inline xMenu *
182 pxTermGetMenu (xTerm * pxTerm) {
183 
184  return pxTerm->pxMenu;
185 }
186 
187 #endif /* __DOXYGEN__ not defined */
188 /* ========================================================================== */
189 __END_C_DECLS
190 #endif /* _AVRIO_TERM_H_ */
int iTermGetStr(char *pcStr, int iSize, FILE *pxInputStream)
Lecture d&#39;une chaîne de caractères.
FILE * pxOuputStream
Definition: term.h:73
int iLine
Definition: term.h:64
void vTermSetMenu(xTerm *pxTerm, xMenu *pxMenu)
Modifie le menu d&#39;un terminal.
void vTermPutHexBytes(const uint8_t *pucBytes, int xLength, FILE *pxOutputStream)
Affiche une suite d&#39;octets sous forme de digits hexadécimaux.
int iColumn
Definition: term.h:65
void vTermPutDec(uint16_t usValue, FILE *pxOutputStream)
Affiche un mot de 16 bits sous forme de décimal.
void vTermPutHexWord(uint16_t usWord, FILE *pxOutputStream)
Affiche un mot de 16 bits sous forme de 4 digits hexadécimaux.
xTermPos xPos
Definition: term.h:76
struct xTerm xTerm
Terminal.
int iHSize
Definition: term.h:54
void vTermPutHexByte(uint8_t ucByte, FILE *pxOutputStream)
Affiche un octet sous forme de 2 digits hexadécimaux.
xMenu * pxTermGetMenu(xTerm *pxTerm)
Renvoie le menu d&#39;un terminal.
struct xTermSize xTermSize
Taille d&#39;un terminal.
FILE * pxInputStream
Definition: term.h:72
eTermFlag
Flags d&#39;un terminal.
Definition: term.h:42
int iVSize
Definition: term.h:55
xMenu * pxMenu
Definition: term.h:74
Un menu hiérarchisé
Definition: menu.h:108
struct xTermPos xTermPos
Position du curseur d&#39;un terminal.
Terminal.
Definition: term.h:71
xTermSize xSize
Definition: term.h:75
eTermFlag eFlag
Definition: term.h:77
int iTermGetDec(FILE *pxInputStream, int iDigits)
Lecture d&#39;un entier en décimal.
Taille d&#39;un terminal.
Definition: term.h:53
int iTermGetHex(FILE *pxInputStream, int iDigits)
Lecture d&#39;un entier en hexadécimal.
void vTermPutHexDword(uint32_t ulDword, FILE *pxOutputStream)
Affiche un mot de 32 bits sous forme de 8 digits hexadécimaux.
Position du curseur d&#39;un terminal.
Definition: term.h:63