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