PIC24 Support Libraries
|
Implementation of the uC data transfer protocol. More...
Go to the source code of this file.
Functions | |
void | initDataXfer () |
int | formatVar (uint u_varIndex, char *psz_buf, size_t s_len) |
Send functions | |
void | outCharXfer (char c) |
void | specifyVar (uint u_varIndex, volatile void *pv_data, uint u_size, BOOL b_isWriteable, char *psz_format, char *psz_name, char *psz_desc) |
void | sendVar (uint u_varIndex) |
Implementation of the uC data transfer protocol.
Definition in file dataXfer.c.
int formatVar | ( | uint | u_varIndex, |
char * | psz_buf, | ||
size_t | s_len | ||
) |
Return a string with the data stored in the given variable formatted using the format string contained in the variable. PC only.
u_varIndex | The index of the variable to send; must be from 0 to NUM_XFER_VARS. |
psz_buf | Buffer to contain the formatted string. |
s_len | Length of the buffer. |
Definition at line 132 of file dataXfer.c.
void initDataXfer | ( | ) |
Initialize the data transfer system. This must be called before calling any of the data transfer functions in the library.
Definition at line 17 of file dataXfer.c.
void outCharXfer | ( | char | c | ) |
Send one character to the uC, escaping if necessary.
c | Character to send. |
Definition at line 27 of file dataXfer.c.
void sendVar | ( | uint | u_varIndex | ) |
Send an already-specified variable;
u_varIndex | The index of the variable to send; must be from 0 to NUM_XFER_VARS. |
Definition at line 88 of file dataXfer.c.
void specifyVar | ( | uint | u_varIndex, |
volatile void * | pv_data, | ||
uint | u_size, | ||
BOOL | b_isWriteable, | ||
char * | psz_format, | ||
char * | psz_name, | ||
char * | psz_desc | ||
) |
Specify a variable to be sent or received. uC only.
u_varIndex | A value from 0-NUM_XFER_VARS, unique for each var |
pv_data | A pointer to the data to be sent |
u_size | Size of the data in bytes; must be from 1 to 256. |
b_isWriteable | True if the PC is allowed to change this variable; false otherwise. This does NOT restrict the microcontroller to read-only access to this variable. |
psz_format | printf format string to use in displaying the Variable. |
psz_name | Name of this variable, typically the same as used in the code |
psz_desc | Description of this variable. |
Definition at line 36 of file dataXfer.c.