Contiki 2.5
Files | Functions

Files

file  rs232.h
 Header file for MSP430 RS232 driver.
 
file  rs232.c
 RS232 communication device driver for the MSP430.
 
file  rs232.h
 Header file for MSP430 RS232 driver.
 
file  rs232.c
 RS232 communication device driver for the MSP430.
 
file  rs232.h
 Header file for MSP430 RS232 driver.
 

Functions

void rs232_init (void)
 Initialize the RS232 module. More...
 
void rs232_set_input (int(*f)(unsigned char))
 Set an input handler for incoming RS232 data. More...
 
void rs232_set_speed (unsigned char speed)
 Configure the speed of the RS232 hardware. More...
 
void rs232_print (char *text)
 Print a text string on RS232. More...
 
void rs232_send (char c)
 Print a character on RS232. More...
 
void rs232_set_speed (enum rs232_speed speed)
 Configure the speed of the RS232 hardware. More...
 

Detailed Description

Function Documentation

void rs232_init ( void  )

Initialize the RS232 module.

Initalize the RS232 port.

This function is called from the boot up code to initalize the RS232 module.

Referenced by main().

void rs232_print ( char *  text)

Print a text string on RS232.

Parameters
strA 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.

Referenced by main().

void rs232_send ( char  c)

Print a character on RS232.

Parameters
cThe 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.
void rs232_set_input ( int(*)(unsigned char)  f)

Set an input handler for incoming RS232 data.

Parameters
fA 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 56 of file rs232.c.

Referenced by main(), and slip_arch_init().

void rs232_set_speed ( enum rs232_speed  speed)

Configure the speed of the RS232 hardware.

Parameters
speedThe speed
        This function configures the speed of the RS232
        hardware. The allowed parameters are RS232_9600,
        RS232_19200, RS232_38400, RS232_57600, and RS232_115200.

Definition at line 91 of file rs232.c.

References UART_MODE_RS232.

void rs232_set_speed ( unsigned char  speed)

Configure the speed of the RS232 hardware.

Parameters
speedThe speed
        This function configures the speed of the RS232
        hardware. The allowed parameters are RS232_19200,
        RS232_38400, RS232_57600, and RS232_115200.