uart.c File Reference

Serial interface functions. More...

#include <msp430x44x.h>
#include <msp430/basic_clock.h>
#include <msp430/system_clock.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include "uart.h"

Include dependency graph for uart.c:

Go to the source code of this file.

Functions

void UART_init (void)
 Initialize UART (RS232) port: 9600 baud, 8n1.
void UART_putChar (char c)
 Send ony byte via UART.
char UART_getCharIsReady ()
 Check UART's input buffer.
char UART_getChar ()
 Receive one byte via UART.
void UART_write (const char *buf, int length)
 Write string buffer to UART.
void UART_printf (const char *fmt,...)
 Printf function which uses UART interface to send.


Detailed Description

Serial interface functions.

Author:
Peter Ivanov

Definition in file uart.c.


Function Documentation

char UART_getChar (  ) 

Receive one byte via UART.

This function waits for the input (blocking).

Returns:
Received character.

Definition at line 72 of file uart.c.

char UART_getCharIsReady (  ) 

Check UART's input buffer.

Returns:
TRUE: if input buffer contains received data.

Definition at line 62 of file uart.c.

void UART_init ( void   ) 

Initialize UART (RS232) port: 9600 baud, 8n1.

Definition at line 29 of file uart.c.

void UART_printf ( const char *  fmt,
  ... 
)

Printf function which uses UART interface to send.

Example:

UART_printf ("Number: %02i\r\n", number);

Parameters:
fmt Printf format string. Example: "Value: %02i\r\n"

Definition at line 102 of file uart.c.

void UART_putChar ( char  c  ) 

Send ony byte via UART.

Parameters:
c Character to send.

Definition at line 51 of file uart.c.

void UART_write ( const char *  buf,
int  length 
)

Write string buffer to UART.

Parameters:
buf String buffer to send.
length Length of string buffer.

Definition at line 84 of file uart.c.


Generated on Thu Dec 27 14:21:53 2007 for Sample MSP430-449STK2 project by  doxygen 1.5.1