AvrIO  1.4.5
Bibliothèque C modulaire pour ATMEL AVR
serial_sw.h
1 
19 #ifndef _AVRIO_SERIAL_SW_H_
20 # define _AVRIO_SERIAL_SW_H_
21 
42 #include <avrio/defs.h>
43 __BEGIN_C_DECLS
44 /* ========================================================================== */
45 
46 #include <stdio.h>
47 #include <avr/interrupt.h>
48 
49 /* Status register defines. */
50 #define SERIAL_SW_TX_BUFFER_FULL 4
51 #define SERIAL_SW_RX_BUFFER_FULL 5
52 #define SERIAL_SW_RX_BUFFER_OVERFLOW 6
53 #define SERIAL_SW_FRAME_ERROR 7
54 
55 /* internal public functions ================================================ */
56 
61 void vSerialSwPutChar (char c);
62 
66 bool xSerialSwReady (void);
67 
72 void vSerialSwPutString (const char *pcString);
73 
78 int iSerialSwGetChar (void);
79 
83 uint16_t usSerialSwHit (void);
84 
88 void vSerialSwEnable (void);
89 
93 void vSerialSwDisable (void);
94 
95 /* public variables ========================================================= */
117 extern FILE xSerialSwPort;
118 
119 #if defined(__DOXYGEN__)
120 /*
121  * __DOXYGEN__ defined
122  * Partie documentation ne devant pas être compilée.
123  * =============================================================================
124  */
128 inline void vSerialSwInit (void);
129 
133 inline uint8_t ucSerialSwGetFlags (void);
134 
140 #else
141 /*
142  * __DOXYGEN__ not defined
143  * Partie ne devant pas être documentée.
144  * =============================================================================
145  */
146 #include <avr/interrupt.h>
147 extern volatile uint8_t ucStatus; //< Byte holding status flags.
148 
149 // -----------------------------------------------------------------------------
150 INLINE void
151 vSerialSwInit (void) {
152 
153  vSerialSwEnable();
154 }
155 
156 // -----------------------------------------------------------------------------
157 INLINE uint8_t
158 ucSerialSwGetFlags (void) {
159 
160  return ucStatus;
161 }
162 #endif /* __DOXYGEN__ not defined */
163 
164 /* ========================================================================== */
165 __END_C_DECLS
166 #endif /* _AVRIO_SERIAL_SW_H_ */
void vSerialSwDisable(void)
Valide l&#39;uart.
uint8_t ucSerialSwGetFlags(void)
Renvoie les drapeaux de l&#39;uart.
void vSerialSwPutString(const char *pcString)
Envoie une chaîne caractères sur la liaison série.
int iSerialSwGetChar(void)
Reçoit un caractère sur la liaison série.
FILE xSerialSwPort
Descripteur de fichier de l&#39;uart permettant son utilisation avec les fonctions de la libc...
void vSerialSwInit(void)
Initialise l&#39;SERIAL.
bool xSerialSwReady(void)
void vSerialSwPutChar(char c)
Envoie un caractère sur la liaison série.
uint16_t usSerialSwHit(void)
Renvoie le nombre de caractères reçus.
void vSerialSwEnable(void)
Valide l&#39;uart.