Main Page | File List | Globals | Related Pages

uart_lib.h File Reference

#include "uart_drv.h"
#include "lib_mcu/uart/uart_bdr.h"

Go to the source code of this file.

Defines

#define UART_CONFIG   MSK_UART_8BIT
#define BAUDRATE   999
#define AUTOBAUD   0

Functions

bit uart_init (void)
 This function configures the UART configuration and timming following the constant definition of BAUDRATE and enables the UART controller.

r_uart_ptchar uart_putchar (p_uart_ptchar uc_wr_byte)
 This function allows to send a character on the UART.

char uart_getchar (void)
 This function allows to get a character from the UART.


Define Documentation

#define AUTOBAUD   0
 

Definition at line 33 of file uart_lib.h.

#define BAUDRATE   999
 

Definition at line 30 of file uart_lib.h.

#define UART_CONFIG   MSK_UART_8BIT
 

Definition at line 25 of file uart_lib.h.


Function Documentation

char uart_getchar void   ) 
 

This function allows to get a character from the UART.

Returns:
character read.

bit uart_init void   ) 
 

This function configures the UART configuration and timming following the constant definition of BAUDRATE and enables the UART controller.

Precondition:
before calling this function some declaration must be define in config.h:
  • FOSC Frequency of crystal in kHz (mandatory)Standard crystals available
  • BAUDRATE Baudrate in bit per second used for UART configuration (mandatory)
  • UART_CONFIG : (by default 8 bits| 1 bit stop |without parity)

r_uart_ptchar uart_putchar p_uart_ptchar  uc_wr_byte  ) 
 

This function allows to send a character on the UART.

Parameters:
uc_wr_byte character to print on UART.
Returns:
character sent.
Note:
the type p_uart_ptchar and r_uart_ptchar can be define to macth with a printf need.


Generated on Thu Apr 1 15:51:00 2004 for UART Library by doxygen 1.3.6