ESOS_UART_Service


Data Structures

struct  ESOS_COMM_BUFF_DSC

Files

file  esos_comm.h
file  esos_pic24_rs232.c

Defines

#define GET_ESOS_COMM_IN_DATA_LEN()
#define IS_ESOS_COMM_GOT_EXACTLY_DATA_BYTES(x)
#define IS_ESOS_COMM_GOT_AT_LEAST_DATA_BYTES(x)
#define FLUSH_ESOS_COMM_IN_DATA()
#define IS_ESOS_COMM_GOT_IN_DATA()
#define PEEK_ESOS_COMM_IN_DATA(x)
#define PEEK_ESOS_COMM_IN_LATEST_DATA()
#define IS_ESOS_COMM_READY_OUT_DATA()
#define ESOS_TASK_WAIT_ON_AVAILABLE_IN_COMM()
#define ESOS_TASK_WAIT_ON_AVAILABLE_OUT_COMM()
#define ESOS_TASK_SIGNAL_BUSY_IN_COMM()
#define ESOS_TASK_SIGNAL_BUSY_OUT_COMM()
#define ESOS_TASK_SIGNAL_AVAILABLE_IN_COMM()
#define ESOS_TASK_SIGNAL_AVAILABLE_OUT_COMM()
#define ESOS_TASK_RELEASE_IN_COMM()
#define ESOS_TASK_RELEASE_OUT_COMM()
#define ESOS_TASK_WAIT_ON_GET_UINT8(u8_in)
#define ESOS_TASK_WAIT_ON_GET_U8BUFFER(pau8_in, u8_size)
#define ESOS_TASK_WAIT_ON_GET_STRING(pau8_in)
#define ESOS_TASK_WAIT_ON_SEND_UINT8(u8_out)
#define ESOS_TASK_WAIT_ON_SEND_UINT8_AS_HEX_STRING(u8_out)
#define ESOS_TASK_WAIT_ON_SEND_UINT32_AS_HEX_STRING(u32_out)
#define ESOS_TASK_WAIT_ON_SEND_STRING(psz_out)
#define ESOS_TASK_WAIT_ON_SEND_U8BUFFER(pau8_out, u8_size)

Functions

uint8 esos_GetCommSystemVersion (void)
uint8 esos_GetCommSystemMaxOutDataLen (void)
uint8 esos_GetCommSystemMaxInDataLen (void)
void configUART1 (uint32 u32_baudRate)

Define Documentation

 
#define ESOS_TASK_RELEASE_IN_COMM (  ) 

Signals to other requesting tasks that the ESOS "in" stream is being released or made available again by the current task.

See also:
ESOS_TASK_SIGNAL_AVAILABLE_IN_COMM()

ESOS_TASK_WAIT_ON_AVAILABLE_IN_COMM()

Deprecated:
Use ESOS_TASK_SIGNAL_AVAILABLE_IN_COMM instead.

Definition at line 281 of file esos_comm.h.

 
#define ESOS_TASK_RELEASE_OUT_COMM (  ) 

Signals to other requesting tasks that the ESOS "out" stream is being released or made available again by the current task.

See also:
ESOS_TASK_SIGNAL_AVAILABLE_OUT_COMM()

ESOS_TASK_WAIT_ON_AVAILABLE_OUT_COMM()

Deprecated:
Use ESOS_TASK_SIGNAL_AVAILABLE_OUT_COMM instead.

Definition at line 291 of file esos_comm.h.

 
#define ESOS_TASK_SIGNAL_AVAILABLE_IN_COMM (  ) 

Signals to other requesting tasks that the current task is making the ESOS "in" stream available again.

See also:
ESOS_TASK_WAIT_ON_AVAILABLE_IN_COMM()

Definition at line 262 of file esos_comm.h.

 
#define ESOS_TASK_SIGNAL_AVAILABLE_OUT_COMM (  ) 

Signals to other requesting tasks that the current task is making the ESOS "out" stream available again.

See also:
ESOS_TASK_WAIT_ON_AVAILABLE_OUT_COMM()

Definition at line 270 of file esos_comm.h.

 
#define ESOS_TASK_SIGNAL_BUSY_IN_COMM (  ) 

Signals to other requesting tasks that the ESOS "in" stream is being used by the current task. ESOS_TASK_WAIT_ON_AVAILABLE_IN_COMM now signals for us when the "in" stream is available.

See also:
ESOS_TASK_SIGNAL_AVAILABLE_IN_COMM()

ESOS_TASK_WAIT_ON_AVAILABLE_IN_COMM()

Deprecated:
Discontinue use of this function. It is subject to removal at any point.

Definition at line 240 of file esos_comm.h.

 
#define ESOS_TASK_SIGNAL_BUSY_OUT_COMM (  ) 

Signals to other requesting tasks that the ESOS "out" stream is being used by the current task. ESOS_TASK_WAIT_ON_AVAILABLE_OUT_COMM now signals for us when the "out" stream is available.

See also:
ESOS_TASK_SIGNAL_AVAILABLE_OUT_COMM()

ESOS_TASK_WAIT_ON_AVAILABLE_OUT_COMM()

Deprecated:
Discontinue use of this function. It is subject to removal at any point.

Definition at line 252 of file esos_comm.h.

 
#define ESOS_TASK_WAIT_ON_AVAILABLE_IN_COMM (  ) 

Cause the current task to wait (block) until the ESOS "in" stream is available for use.

See also:
ESOS_TASK_SIGNAL_AVAILABLE_IN_COMM()

Definition at line 216 of file esos_comm.h.

 
#define ESOS_TASK_WAIT_ON_AVAILABLE_OUT_COMM (  ) 

Causes the current task to wait (block) until the ESOS "out" stream is available for use. Code will resume once the stream is available for our use. This routine marks the "in" stream in use by the current task.

See also:
ESOS_TASK_SIGNAL_AVAILABLE_OUT_COMM()

Definition at line 227 of file esos_comm.h.

#define ESOS_TASK_WAIT_ON_GET_STRING ( pau8_in   ) 

Create, spawn and wait on a child task to get a string from the ESOS "in" communications buffer. The incoming string must be zero-terminated (useful when reading from other streaming data devices), or terminated with a newline/return character (useful when reading from terminals/keyboards/etc.) Results are written into the array whose address is passed in

Note:
This call assumes that the data array target is large enough to hold the incoming string, which is limited to a length equal to the buffer used internally for the ESOS communications "in" buffer

This call will block the current task until the data is read

This macro does not evaluate to anything. Data is returned in the argument variable because of the way ESOS tasks, child tasks, and macros are used.

Parameters:
pau8_in pointer to array in which bytes should be returned
See also:
ESOS_TASK_SPAWN_AND_WAIT

Definition at line 346 of file esos_comm.h.

#define ESOS_TASK_WAIT_ON_GET_U8BUFFER ( pau8_in,
u8_size   ) 

Create, spawn and wait on a child task to get an array of bytes (uint8s) from the ESOS "in" communications buffer Results are written into the array whose address is passed in

Note:
This call will block the current task until the data is read

This macro does not evaluate to anything. Data is returned in the argument variable because of the way ESOS tasks, child tasks, and macros are used.

Parameters:
pau8_in pointer to array in which bytes should be returned
u8_size number of bytes to read from "in" stream
See also:
ESOS_TASK_SPAWN_AND_WAIT

Definition at line 325 of file esos_comm.h.

#define ESOS_TASK_WAIT_ON_GET_UINT8 ( u8_in   ) 

Create, spawn and wait on a child task to get a byte (uint8) from the ESOS "in" communications buffer Results are written into the variable which is passed in

Note:
This call will block the current task until the 8-bit data is read

This macro does not evaluate to anything. Data is returned in the argument variable because of the way ESOS tasks, child tasks, and macros are used.

Parameters:
u8_in variable in which data should be returned
See also:
ESOS_TASK_SPAWN_AND_WAIT

Definition at line 308 of file esos_comm.h.

#define ESOS_TASK_WAIT_ON_SEND_STRING ( psz_out   ) 

Create, spawn and wait on a child task to put a zero-terminated string to the ESOS "out" communications buffer.

Note:
This call will block the current task until the data is absorbed by the ESOS communications subsystem
Parameters:
psz_out pointer to the zero-terminated string
See also:
ESOS_TASK_SPAWN_AND_WAIT

Definition at line 392 of file esos_comm.h.

#define ESOS_TASK_WAIT_ON_SEND_U8BUFFER ( pau8_out,
u8_size   ) 

Create, spawn and wait on a child task to put an array of bytes (uint8s) to the ESOS "out" communications buffer

Note:
This call will block the current task until the data is absorbed by the ESOS communications subsystem
Parameters:
pau8_out pointer to beginning of array of bytes to send to "out" stream
u8_size number of bytes to send
See also:
ESOS_TASK_SPAWN_AND_WAIT

Definition at line 404 of file esos_comm.h.

#define ESOS_TASK_WAIT_ON_SEND_UINT32_AS_HEX_STRING ( u32_out   ) 

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 hexadecimal string. Results will look like "0x0123BEEF"

Note:
This call will block the current task until the data is absorbed by the ESOS communications subsystem
Parameters:
u32_out data to write to "out" stream
See also:
ESOS_TASK_SPAWN_AND_WAIT

Definition at line 381 of file esos_comm.h.

#define ESOS_TASK_WAIT_ON_SEND_UINT8 ( u8_out   ) 

Create, spawn and wait on a child task to put a byte (uint8) to the ESOS "out" communications buffer

Note:
This call will block the current task until the data is absorbed by the ESOS communications subsystem
Parameters:
u8_out data to write to "out" stream
See also:
ESOS_TASK_SPAWN_AND_WAIT

Definition at line 357 of file esos_comm.h.

#define ESOS_TASK_WAIT_ON_SEND_UINT8_AS_HEX_STRING ( u8_out   ) 

Create, spawn and wait on a child task to put a byte (uint8) to the ESOS "out" communications buffer as a human-readable hexadecimal string. Results will look like "0x4C"

Note:
This call will block the current task until the data is absorbed by the ESOS communications subsystem
Parameters:
u8_out data to write to "out" stream
See also:
ESOS_TASK_SPAWN_AND_WAIT

Definition at line 369 of file esos_comm.h.

 
#define FLUSH_ESOS_COMM_IN_DATA (  ) 

Flushes the "in" communications buffer. All unread data in the "in" communications buffer will be lost.

Note:
Use this function only if you want to reset the "in" communications buffer back to its empty state.

Definition at line 147 of file esos_comm.h.

 
#define GET_ESOS_COMM_IN_DATA_LEN (  ) 

Evaluates to the number of bytes in the ESOS "in" communications buffer

Return values:
N number of bytes current contained in the "in" buffer

Definition at line 112 of file esos_comm.h.

#define IS_ESOS_COMM_GOT_AT_LEAST_DATA_BYTES (  ) 

Evaluates to the booelan to determine if "in" communications buffer has at least x bytes

Parameters:
x number of bytes to check for
Return values:
TRUE if "in" buffer has x bytes or more
FALSE otherwise

Definition at line 136 of file esos_comm.h.

#define IS_ESOS_COMM_GOT_EXACTLY_DATA_BYTES (  ) 

Evaluates to the booelan to determine if "in" communications buffer has exactly x bytes

Parameters:
x number of bytes to check for
Return values:
TRUE if "in" buffer has exactly x bytes
FALSE otherwise

Definition at line 124 of file esos_comm.h.

 
#define IS_ESOS_COMM_GOT_IN_DATA (  ) 

Evaluates to the booelan to determine if "in" communications buffer any readable bytes

Return values:
TRUE if "in" buffer has some data to read
FALSE otherwise

Definition at line 158 of file esos_comm.h.

 
#define IS_ESOS_COMM_READY_OUT_DATA (  ) 

Evaluates to boolean to that determines whether the "out" system can accept anymore data

Return values:
TRUE if "out" communication system buffer has room for 1+ bytes
FALSE otherwise

Definition at line 207 of file esos_comm.h.

#define PEEK_ESOS_COMM_IN_DATA (  ) 

Evaluates to a "peek" of the x-th data byte in the "in" communications buffer

Note:
This macro does NOT move the "in" buffer pointers. The data is still by the communcations subsystem GET_xxx routines. This macro simply does a peek or look-ahead into the buffer.

Use sparingly. This macro may be deprecated at some point.

ESOS communication systems built upon interrupts (most of them) will make this macro unsafe since the macro could be interrupted.

Parameters:
x byte in FIFO to "peek"
Return values:
data peeked data byte

Definition at line 178 of file esos_comm.h.

 
#define PEEK_ESOS_COMM_IN_LATEST_DATA (  ) 

Evaluates to a "peek" of the most recent data byte written to the "in" communications buffer

Note:
This macro does NOT move the "in" buffer pointers. The data is still by the communcations subsystem GET_xxx routines. This macro simply does a peek or look-ahead into the buffer.

Use sparingly. This macro may be deprecated at some point.

ESOS communication systems built upon interrupts (most of them) will make this macro unsafe since the macro could be interrupted.

Return values:
data peeked data byte

Definition at line 196 of file esos_comm.h.


Function Documentation

void configUART1 ( uint32  u32_baudRate  ) 

Configure the UART. Settings chosen:

  • TX is on RP11
  • RX is on RP10
  • Format is 8 data bits, no parity, 1 stop bit
  • CTS, RTS, and BCLK not used

Parameters:
u32_baudRate The baud rate to use.

Definition at line 104 of file esos_pic24_rs232.c.

uint8 esos_GetCommSystemMaxInDataLen ( void   ) 

Returns the size of the ESOS communication systems "in" buffers

Return values:
uint8 Number of bytes

Definition at line 175 of file esos_pic24_rs232.c.

uint8 esos_GetCommSystemMaxOutDataLen ( void   ) 

Returns the size of the ESOS communication systems "out" buffers

Return values:
uint8 Number of bytes

Definition at line 203 of file esos_pic24_rs232.c.

uint8 esos_GetCommSystemVersion ( void   ) 

Returns the version number of the ESOS communication systems

Return values:
verNum Version number. Exact value and meaning depends on hardware


Generated on Sun Mar 15 11:14:22 2009 for PIC24 Support Libraries by  doxygen 1.5.8