Header file for COOJA RS232 driver.
More...
Go to the source code of this file.
|
void | rs232_init (void) |
| Initialize the RS232 module.
|
|
void | rs232_set_input (int(*f)(unsigned char)) |
| Set an input handler for incoming RS232 data.
|
|
void | rs232_set_speed (unsigned char speed) |
| Configure the speed of the RS232 hardware.
|
|
void | rs232_print (char *text) |
| Print a text string on RS232.
|
|
void | rs232_send (char c) |
| Print a character on RS232.
|
|
Header file for COOJA RS232 driver.
- Author
- Adam Dunkels adam@.nosp@m.sics.nosp@m..se
Definition in file rs232.h.
◆ rs232_init()
Initialize the RS232 module.
This function is called from the boot up code to
initalize the RS232 module.
Definition at line 49 of file rs232.c.
◆ rs232_print()
void rs232_print |
( |
char * | text | ) |
|
Print a text string on RS232.
- Parameters
-
text | A pointer to the string that is to be printed This function prints a string to RS232. The string must
be terminated by a null byte. The RS232 module must be
correctly initalized and configured for this function
to work.
|
Definition at line 64 of file rs232.c.
◆ rs232_send()
void rs232_send |
( |
char | c | ) |
|
Print a character on RS232.
- Parameters
-
c | The character to be printed This function prints a character to RS232. The RS232
module must be correctly initalized and configured for
this function to work.
|
Definition at line 59 of file rs232.c.
◆ rs232_set_input()
void rs232_set_input |
( |
int(*)(unsigned char) | f | ) |
|
Set an input handler for incoming RS232 data.
- Parameters
-
f | A pointer to a byte input handler This function sets the input handler for incoming RS232
data. The input handler function is called for every
incoming data byte. The function is called from the
RS232 interrupt handler, so care must be taken when
implementing the input handler to avoid race
conditions.
The return value of the input handler affects the sleep
mode of the CPU: if the input handler returns non-zero
(true), the CPU is awakened to let other processing
take place. If the input handler returns zero, the CPU
is kept sleeping.
|
Definition at line 54 of file rs232.c.
◆ rs232_set_speed()
void rs232_set_speed |
( |
unsigned char | speed | ) |
|
Configure the speed of the RS232 hardware.
- Parameters
-
speed | The speed This function configures the speed of the RS232
hardware. The allowed parameters are RS232_19200,
RS232_38400, RS232_57600, and RS232_115200.
|
Definition at line 51 of file rs232.c.