PIC24 Support Libraries
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
esos_comm.h
Go to the documentation of this file.
1 /*
2  * "Copyright (c) 2008 Robert B. Reese, Bryan A. Jones, J. W. Bruce ("AUTHORS")"
3  * All rights reserved.
4  * (R. Reese, reese_AT_ece.msstate.edu, Mississippi State University)
5  * (B. A. Jones, bjones_AT_ece.msstate.edu, Mississippi State University)
6  * (J. W. Bruce, jwbruce_AT_ece.msstate.edu, Mississippi State University)
7  *
8  * Permission to use, copy, modify, and distribute this software and its
9  * documentation for any purpose, without fee, and without written agreement is
10  * hereby granted, provided that the above copyright notice, the following
11  * two paragraphs and the authors appear in all copies of this software.
12  *
13  * IN NO EVENT SHALL THE "AUTHORS" BE LIABLE TO ANY PARTY FOR
14  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
15  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE "AUTHORS"
16  * HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17  *
18  * THE "AUTHORS" SPECIFICALLY DISCLAIMS ANY WARRANTIES,
19  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20  * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
21  * ON AN "AS IS" BASIS, AND THE "AUTHORS" HAS NO OBLIGATION TO
22  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
23  *
24  * Please maintain this header in its entirety when copying/modifying
25  * these files.
26  *
27  *
28  */
29 
30 
31 /**
32  * \addtogroup ESOS_UART_Service
33  * @{
34  */
35 
36 
37 /** \file
38  * This file contains macros, prototypes, and definitions for
39  * HARDWARE INDEPENDENT communications on ESOS
40  */
41 
42 
43 #ifndef ESOS_COMM_H
44 #define ESOS_COMM_H
45 
46 /* I N C L U D E S **********************************************************/
47 #include "esos.h"
48 
49 /* P R O T O T Y P E S ******************************************************/
50 void __esos_InitCommSystem(void);
51 uint8_t __esos_u8_GetMSBHexCharFromUint8(uint8_t u8_x);
52 uint8_t __esos_u8_GetLSBHexCharFromUint8(uint8_t u8_x);
53 ESOS_CHILD_TASK( __esos_OutChar, uint8_t u8_c);
54 ESOS_CHILD_TASK( __esos_OutUint8AsHexString, uint8_t u8_x);
55 ESOS_CHILD_TASK( __esos_OutUint32AsHexString, uint32_t u32_x);
56 ESOS_CHILD_TASK( __esos_OutCharBuffer, uint8_t* pu8_out, uint8_t u8_len);
57 ESOS_CHILD_TASK( __esos_getBuffer, uint8_t* pau8_buff, uint8_t u8_size);
58 ESOS_CHILD_TASK( __esos_getString, char* pau8_buff);
59 ESOS_CHILD_TASK( __esos_OutString, char* psz_out );
60 void __esos_unsafe_PutUint8(uint8_t u8_c);
61 void __esos_unsafe_PutString(char* psz_in);
62 uint8_t __esos_unsafe_GetUint8(void);
63 
64 /* D E F I N E S ************************************************************/
65 #define ESOS_COMM_SYS_USB 0x80
66 #define ESOS_COMM_SYS_SERIAL 0x00
67 #define ESOS_COMM_SYS_SERIAL_REV (ESOS_COMM_SYS_SERIAL + 0x01)
68 // size of buffer to catch data incoming to PIC (based on USB terminology)
69 #define ESOS_SERIAL_OUT_EP_SIZE 64
70 // size of buffer to hold data leaving the PIC (based on USB terminology)
71 #define ESOS_SERIAL_IN_EP_SIZE 64
72 
73 /***
74  *** A few defines to help make data transfer easier
75  ***/
76 #define __ESOS_COMM_TXFIFO_PREP() \
77  u16_tmp = __st_TxBuffer.u16_Head; \
78  u16_tmp++; \
79  if (u16_tmp == ESOS_SERIAL_IN_EP_SIZE) u16_tmp = 0
80 
81 #define __ESOS_COMM_WRITE_TXFIFO( u8_out ) \
82  __st_TxBuffer.pau8_Data[u16_tmp] = (u8_out); \
83  __st_TxBuffer.u16_Head = u16_tmp
84 
85 
86 
87 /* M A C R O S ************************************************************/
88 
89 /*
90  * Evaluates to the number of bytes in the ESOS "in" communications buffer
91  *
92  * \param pstTask A pointer to the ESOS task control structure specific to this task.
93  *
94  * \hideinitializer
95  */
96 
97 /*
98 * Evaluates to the number of bytes in the ESOS "in" communications buffer
99 *
100 * \param pfnTaskFcn pointer to task function
101 * \retval NULLPTR if no more tasks can execute at this time (scheduler is full)
102 * \retval pstTask pointer to the scheduled task's structure
103 *
104 * \hideinitializer
105 */
106 
107 /**
108 * Evaluates to the number of bytes in the ESOS "in" communications buffer
109 * \retval N number of bytes current contained in the "in" buffer
110 * \hideinitializer
111 */
112 #define GET_ESOS_COMM_IN_DATA_LEN() ((__st_RxBuffer.u16_Head>=__st_RxBuffer.u16_Tail)?(__st_RxBuffer.u16_Head-__st_RxBuffer.u16_Tail):(__st_RxBuffer.u16_Length-__st_RxBuffer.u16_Tail+__st_RxBuffer.u16_Head))
113 
114 /**
115 * Evaluates to the booelan to determine if "in" communications buffer has
116 * <em>exactly</em> x bytes
117 *
118 * \param x number of bytes to check for
119 * \retval TRUE if "in" buffer has <em>exactly</em> x bytes
120 * \retval FALSE otherwise
121 *
122 * \hideinitializer
123 */
124 #define IS_ESOS_COMM_GOT_EXACTLY_DATA_BYTES(x) (GET_ESOS_COMM_IN_DATA_LEN() == x)
125 
126 /**
127 * Evaluates to the booelan to determine if "in" communications buffer has
128 * <em>at least</em> x bytes
129 *
130 * \param x number of bytes to check for
131 * \retval TRUE if "in" buffer has x bytes <em>or more</em>
132 * \retval FALSE otherwise
133 *
134 * \hideinitializer
135 */
136 #define IS_ESOS_COMM_GOT_AT_LEAST_DATA_BYTES(x) (GET_ESOS_COMM_IN_DATA_LEN() >= x)
137 
138 /**
139 * Flushes the "in" communications buffer. All unread data in the "in" communications
140 * buffer will be lost.
141 *
142 * \note Use this function only if you want to reset the "in" communications buffer back
143 * to its empty state.
144 *
145 * \hideinitializer
146 */
147 #define FLUSH_ESOS_COMM_IN_DATA() (__st_RxBuffer.u16_Head = __st_RxBuffer.u16_Tail)
148 
149 /**
150 * Evaluates to the booelan to determine if "in" communications buffer
151 * <em>any</em> readable bytes
152 *
153 * \retval TRUE if "in" buffer has <em>some</em> data to read
154 * \retval FALSE otherwise
155 *
156 * \hideinitializer
157 */
158 #define IS_ESOS_COMM_GOT_IN_DATA() (__st_RxBuffer.u16_Head != __st_RxBuffer.u16_Tail)
159 
160 // should use PEEK... It is unsafe since IRQs can occur at anytime....
161 /**
162 * Evaluates to a "peek" of the x-th data byte in the "in" communications buffer
163 *
164 * \note This macro does <em>NOT</em> move the "in" buffer pointers. The data is
165 * still by the communcations subsystem GET_xxx routines. This macro simply does
166 * a peek or look-ahead into the buffer.
167 *
168 * \note Use sparingly. This macro may be deprecated at some point.
169 *
170 * \note ESOS communication systems built upon interrupts (most of them) will make
171 * this macro unsafe since the macro could be interrupted.
172 *
173 * \param x byte in FIFO to "peek"
174 * \retval data peeked data byte
175 *
176 * \hideinitializer
177 */
178 #define PEEK_ESOS_COMM_IN_DATA(x) ( __st_RxBuffer.pau8_Data[((__st_RxBuffer.u16_Tail+1+x)% ESOS_SERIAL_OUT_EP_SIZE)] )
179 
180 /**
181 * Evaluates to a "peek" of the most recent data byte written to the "in" communications buffer
182 *
183 * \note This macro does <em>NOT</em> move the "in" buffer pointers. The data is
184 * still by the communcations subsystem GET_xxx routines. This macro simply does
185 * a peek or look-ahead into the buffer.
186 *
187 * \note Use sparingly. This macro may be deprecated at some point.
188 *
189 * \note ESOS communication systems built upon interrupts (most of them) will make
190 * this macro unsafe since the macro could be interrupted.
191 *
192 * \retval data peeked data byte
193 *
194 * \hideinitializer
195 */
196 #define PEEK_ESOS_COMM_IN_LATEST_DATA() ( __st_RxBuffer.pau8_Data[__st_RxBuffer.u16_Head] )
197 
198 /**
199 * Evaluates to boolean to that determines whether the "out" system can accept anymore
200 * data
201 *
202 * \retval TRUE if "out" communication system buffer has room for 1+ bytes
203 * \retval FALSE otherwise
204 *
205 * \hideinitializer
206 */
207 #define IS_ESOS_COMM_READY_OUT_DATA() (__st_TxBuffer.u16_Head != __st_TxBuffer.u16_Tail)
208 
209 // communications commands used by ESOS tasks
210 /**
211  * Cause the current task to wait (block) until the ESOS "in" stream is available for
212  * use.
213  * \sa ESOS_TASK_SIGNAL_AVAILABLE_IN_COMM()
214  * \hideinitializer
215  */
216 #define ESOS_TASK_WAIT_ON_AVAILABLE_IN_COMM() \
217  ESOS_TASK_WAIT_WHILE( __esos_IsSystemFlagSet( __ESOS_SYS_COMM_RX_IS_BUSY ) ); \
218  __esos_SetSystemFlag( __ESOS_SYS_COMM_RX_IS_BUSY )
219 
220 /**
221  * Causes the current task to wait (block) until the ESOS "out" stream is available for
222  * use. Code will resume once the stream is available for our use. This routine marks
223  * the "in" stream in use by the current task.
224  * \sa ESOS_TASK_SIGNAL_AVAILABLE_OUT_COMM()
225  * \hideinitializer
226  */
227 #define ESOS_TASK_WAIT_ON_AVAILABLE_OUT_COMM() \
228  ESOS_TASK_WAIT_WHILE( __esos_IsSystemFlagSet( __ESOS_SYS_COMM_TX_IS_BUSY ) ); \
229  __esos_SetSystemFlag( __ESOS_SYS_COMM_TX_IS_BUSY )
230 /**
231  * Signals to other requesting tasks that the ESOS "in" stream is being used by
232  * the current task. \ref ESOS_TASK_WAIT_ON_AVAILABLE_IN_COMM now signals for
233  * us when the "in" stream is available.
234  *
235  * \sa ESOS_TASK_SIGNAL_AVAILABLE_IN_COMM()
236  * \sa ESOS_TASK_WAIT_ON_AVAILABLE_IN_COMM()
237  * \deprecated Discontinue use of this function. It is subject to removal at any point.
238  * \hideinitializer
239  */
240 #define ESOS_TASK_SIGNAL_BUSY_IN_COMM() __esos_SetSystemFlag( __ESOS_SYS_COMM_RX_IS_BUSY )
241 
242 /**
243  * Signals to other requesting tasks that the ESOS "out" stream is being used by
244  * the current task. \ref ESOS_TASK_WAIT_ON_AVAILABLE_OUT_COMM now signals for
245  * us when the "out" stream is available.
246  *
247  * \sa ESOS_TASK_SIGNAL_AVAILABLE_OUT_COMM()
248  * \sa ESOS_TASK_WAIT_ON_AVAILABLE_OUT_COMM()
249  * \deprecated Discontinue use of this function. It is subject to removal at any point.
250  * \hideinitializer
251  */
252 #define ESOS_TASK_SIGNAL_BUSY_OUT_COMM() __esos_SetSystemFlag( __ESOS_SYS_COMM_TX_IS_BUSY )
253 
254 
255 /**
256  * Signals to other requesting tasks that the current task is making the ESOS "in" stream
257  * available again.
258  *
259  * \sa ESOS_TASK_WAIT_ON_AVAILABLE_IN_COMM()
260  * \hideinitializer
261  */
262 #define ESOS_TASK_SIGNAL_AVAILABLE_IN_COMM() __esos_ClearSystemFlag( __ESOS_SYS_COMM_RX_IS_BUSY )
263 
264 /**
265  * Signals to other requesting tasks that the current task is making the ESOS "out" stream
266  * available again.
267  * \sa ESOS_TASK_WAIT_ON_AVAILABLE_OUT_COMM()
268  * \hideinitializer
269  */
270 #define ESOS_TASK_SIGNAL_AVAILABLE_OUT_COMM() __esos_ClearSystemFlag( __ESOS_SYS_COMM_TX_IS_BUSY )
271 
272 /**
273  * Signals to other requesting tasks that the ESOS "in" stream is being released or
274  * made available again by the current task.
275  * \sa ESOS_TASK_SIGNAL_AVAILABLE_IN_COMM()
276  * \sa ESOS_TASK_WAIT_ON_AVAILABLE_IN_COMM()
277  * \deprecated Use \ref ESOS_TASK_SIGNAL_AVAILABLE_IN_COMM instead.
278  *
279  * \hideinitializer
280  */
281 #define ESOS_TASK_RELEASE_IN_COMM() ESOS_TASK_SIGNAL_AVAILABLE_IN_COMM()
282 
283 /**
284  * Signals to other requesting tasks that the ESOS "out" stream is being released or
285  * made available again by the current task.
286  * \sa ESOS_TASK_SIGNAL_AVAILABLE_OUT_COMM()
287  * \sa ESOS_TASK_WAIT_ON_AVAILABLE_OUT_COMM()
288  * \deprecated Use \ref ESOS_TASK_SIGNAL_AVAILABLE_OUT_COMM instead.
289  * \hideinitializer
290  */
291 #define ESOS_TASK_RELEASE_OUT_COMM() ESOS_TASK_SIGNAL_AVAILABLE_OUT_COMM()
292 
293 
294 // **************** spawn child tasks to do getting and putting to comm streams ***********************
295 /**
296 * Create, spawn and wait on a child task to get a byte (uint8) from the ESOS "in" communications buffer
297 * <em>Results are written into the variable which is passed in</em>
298 *
299 * \note This call will block the current task until the 8-bit data is read
300 *
301 * \note This macro does not evaluate to anything. Data is returned in the argument variable because
302 * of the way ESOS tasks, child tasks, and macros are used.
303 *
304 * \param u8_in variable <em>in which</em> data should be returned
305 * \sa ESOS_TASK_SPAWN_AND_WAIT
306 * \hideinitializer
307 */
308 #define ESOS_TASK_WAIT_ON_GET_UINT8( u8_in ) \
309  ESOS_TASK_SPAWN_AND_WAIT( (ESOS_TASK_HANDLE)&__stChildTaskRx, __esos_getBuffer, &(u8_in), 1 )
310 
311 /**
312 * Create, spawn and wait on a child task to get an array of bytes (uint8s) from the ESOS "in" communications buffer
313 * <em>Results are written into the array whose address is passed in</em>
314 *
315 * \note This call will block the current task until the data is read
316 *
317 * \note This macro does not evaluate to anything. Data is returned in the argument variable because
318 * of the way ESOS tasks, child tasks, and macros are used.
319 *
320 * \param pau8_in pointer to array <em>in which</em> bytes should be returned
321 * \param u8_size number of bytes to read from "in" stream
322 * \sa ESOS_TASK_SPAWN_AND_WAIT
323 * \hideinitializer
324 */
325 #define ESOS_TASK_WAIT_ON_GET_U8BUFFER( pau8_in, u8_size) \
326  ESOS_TASK_SPAWN_AND_WAIT( (ESOS_TASK_HANDLE) &__stChildTaskRx, __esos_getBuffer, (pau8_in), (u8_size) )
327 
328 /**
329 * Create, spawn and wait on a child task to get a double-byte value (uint16) from the ESOS "in" communications buffer
330 * <em>Results are written into the variable which is passed in</em>
331 *
332 * \note This call will block the current task until the 16-bit data is read
333 *
334 * \note This macro does not evaluate to anything. Data is returned in the argument variable because
335 * of the way ESOS tasks, child tasks, and macros are used.
336 *
337 * \param u16_in variable <em>in which</em> data should be returned
338 * \sa ESOS_TASK_SPAWN_AND_WAIT
339 * \hideinitializer
340 */
341 #define ESOS_TASK_WAIT_ON_GET_UINT16( u16_in ) \
342  ESOS_TASK_SPAWN_AND_WAIT( (ESOS_TASK_HANDLE)&__stChildTaskRx, __esos_getBuffer, (uint8*) &(u16_in), 2 )
343 
344 /**
345 * Create, spawn and wait on a child task to get a quad-byte value (uint32) from the ESOS "in" communications buffer
346 * <em>Results are written into the variable which is passed in</em>
347 *
348 * \note This call will block the current task until the 32-bit data is read
349 *
350 * \note This macro does not evaluate to anything. Data is returned in the argument variable because
351 * of the way ESOS tasks, child tasks, and macros are used.
352 *
353 * \param u32_in variable <em>in which</em> data should be returned
354 * \sa ESOS_TASK_SPAWN_AND_WAIT
355 * \hideinitializer
356 */
357 #define ESOS_TASK_WAIT_ON_GET_UINT32( u32_in ) \
358  ESOS_TASK_SPAWN_AND_WAIT( (ESOS_TASK_HANDLE)&__stChildTaskRx, __esos_getBuffer, (uint8*) &(u32_in), 4 )
359 
360 
361 
362 /**
363 * Create, spawn and wait on a child task to get a string from the ESOS "in" communications buffer.
364 * The incoming string must be zero-terminated (useful when reading from other streaming data devices), or
365 * terminated with a newline/return character (useful when reading from terminals/keyboards/etc.)
366 * <em>Results are written into the array whose address is passed in</em>
367 *
368 * \note This call assumes that the data array target is large enough to hold the incoming string,
369 * which is limited to a length equal to the buffer used internally for the ESOS communications "in" buffer
370 *
371 * \note This call will block the current task until the data is read
372 *
373 * \note This macro does not evaluate to anything. Data is returned in the argument variable because
374 * of the way ESOS tasks, child tasks, and macros are used.
375 *
376 * \param pau8_in pointer to array <em>in which</em> bytes should be returned
377 * \sa ESOS_TASK_SPAWN_AND_WAIT
378 * \hideinitializer
379 */
380 #define ESOS_TASK_WAIT_ON_GET_STRING( pau8_in ) \
381  ESOS_TASK_SPAWN_AND_WAIT( (ESOS_TASK_HANDLE)&__stChildTaskRx, __esos_getString, (pau8_in) )
382 
383 /**
384 * Create, spawn and wait on a child task to put a byte (uint8) to the ESOS "out" communications buffer
385 *
386 * \note This call will block the current task until the data is absorbed by the ESOS communications subsystem
387 * \param u8_out data to write to "out" stream
388 * \sa ESOS_TASK_SPAWN_AND_WAIT
389 * \hideinitializer
390 */
391 #define ESOS_TASK_WAIT_ON_SEND_UINT8( u8_out) \
392  ESOS_TASK_SPAWN_AND_WAIT( (ESOS_TASK_HANDLE) &__stChildTaskTx, __esos_OutChar, (u8_out) )
393 
394 /**
395 * Create, spawn and wait on a child task to put a byte (uint8) to the ESOS "out" communications buffer as a human-readable
396 * hexadecimal string. Results will look like "0x4C"
397 *
398 * \note This call will block the current task until the data is absorbed by the ESOS communications subsystem
399 * \param u8_out data to write to "out" stream
400 * \sa ESOS_TASK_SPAWN_AND_WAIT
401 * \hideinitializer
402 */
403 #define ESOS_TASK_WAIT_ON_SEND_UINT8_AS_HEX_STRING( u8_out) \
404  ESOS_TASK_SPAWN_AND_WAIT( (ESOS_TASK_HANDLE)&__stChildTaskTx, __esos_OutUint8AsHexString, (u8_out) )
405 
406 
407 /**
408 * Create, spawn and wait on a child task to put a byte (uint8) to the ESOS "out" communications buffer as a human-readable
409 * decimal string. Results will look like "253"
410 *
411 * \note This call will block the current task until the data is absorbed by the ESOS communications subsystem
412 * \param u8_out data to write to "out" stream
413 * \sa ESOS_TASK_SPAWN_AND_WAIT
414 * \hideinitializer
415 */
416 #define ESOS_TASK_WAIT_ON_SEND_UINT8_AS_DEC_STRING( u8_out) \
417  ESOS_TASK_SPAWN_AND_WAIT( (ESOS_TASK_HANDLE)&__stChildTaskTx, __esos_OutUint8AsDecString,(u8_out))
418 /**
419 * Create, spawn and wait on a child task to put a 32-bit value (uint32) to the ESOS "out" communications buffer as a human-readable
420 * hexadecimal string. Results will look like "0x0123BEEF"
421 *
422 * \note This call will block the current task until the data is absorbed by the ESOS communications subsystem
423 * \param u32_out data to write to "out" stream
424 * \sa ESOS_TASK_SPAWN_AND_WAIT
425 * \hideinitializer
426 */
427 #define ESOS_TASK_WAIT_ON_SEND_UINT32_AS_HEX_STRING( u32_out) \
428  ESOS_TASK_SPAWN_AND_WAIT( (ESOS_TASK_HANDLE)&__stChildTaskTx, __esos_OutUint32AsHexString, (u32_out) )
429 
430 /**
431 * Create, spawn and wait on a child task to put a zero-terminated string to the ESOS "out" communications buffer.
432 *
433 * \note This call will block the current task until the data is absorbed by the ESOS communications subsystem
434 * \param psz_out pointer to the zero-terminated string
435 * \sa ESOS_TASK_SPAWN_AND_WAIT
436 * \hideinitializer
437 */
438 #define ESOS_TASK_WAIT_ON_SEND_STRING( psz_out) \
439  ESOS_TASK_SPAWN_AND_WAIT( (ESOS_TASK_HANDLE)&__stChildTaskTx, __esos_OutString, (psz_out) )
440 
441 /**
442 * Create, spawn and wait on a child task to put an array of bytes (uint8s) to the ESOS "out" communications buffer
443 *
444 * \note This call will block the current task until the data is absorbed by the ESOS communications subsystem
445 * \param pau8_out pointer to beginning of array of bytes to send to "out" stream
446 * \param u8_size number of bytes to send
447 * \sa ESOS_TASK_SPAWN_AND_WAIT
448 * \hideinitializer
449 */
450 #define ESOS_TASK_WAIT_ON_SEND_U8BUFFER( pau8_out, u8_size) \
451  ESOS_TASK_SPAWN_AND_WAIT( (ESOS_TASK_HANDLE)&__stChildTaskTx, __esos_OutCharBuffer, (pau8_out), (u8_size) )
452 
453 
454 /* S T R U C T U R E S ******************************************************/
455 
456 /**
457 * structure to contain a set of descriptors about the buffers used
458 * ES_OS bulk communications transfer defined by this library
459 *
460 * Data transfer can be over USB or old-fashioned RS-232 serial UART
461 **/
462 typedef struct _ESOS_COMM_BUFF_DSC {
463  volatile uint8_t* pau8_Data;
464  uint16_t u16_Head;
465  uint16_t u16_Tail;
466  uint16_t u16_Length;
468 
469 /* E X T E R N S ************************************************************/
470 extern volatile uint8_t __esos_comm_tx_buff[ESOS_SERIAL_IN_EP_SIZE];
471 extern volatile uint8_t __esos_comm_rx_buff[ESOS_SERIAL_OUT_EP_SIZE];
472 extern volatile ESOS_COMM_BUFF_DSC __st_TxBuffer, __st_RxBuffer;
473 extern volatile struct stTask __stChildTaskTx, __stChildTaskRx;
474 
475 /* P U B L I C P R O T O T Y P E S *****************************************/
476 /**
477 * Returns the version number of the ESOS communication systems
478 * \retval verNum Version number. Exact value and meaning depends on hardware
479 * \hideinitializer
480 */
482 
483 /**
484 * Returns the size of the ESOS communication systems "out" buffers
485 * \retval uint8_t Number of bytes
486 * \hideinitializer
487 */
489 
490 /**
491 * Returns the size of the ESOS communication systems "in" buffers
492 * \retval uint8_t Number of bytes
493 * \hideinitializer
494 */
496 
497 void __esos_InitCommSystem(void);
498 
499 /* prototypes of the unsafe comm functions provided by ESOS */
500 void __esos_unsafe_PutUint8(uint8_t u8_c);
501 void __esos_unsafe_PutString(char* psz_in);
502 uint8_t __esos_unsafe_GetUint8(void);
503 
504 /* prototypes of external functions provided by hardware */
505 void __esos_hw_signal_start_tx(void);
506 void __esos_hw_signal_stop_tx(void);
507 void __esos_hw_InitCommSystem(void);
508 
509 /** @} */
510 
511 #endif // ESOS_COMM_H