#include "uart_drv.h"
#include "uart/uart_bdr.h"
#include "compiler.h"
Go to the source code of this file.
Defines | |
| #define | AUTOBAUD 0 |
| #define | BAUDRATE 999 |
| #define | UART_CONFIG MSK_UART_8BIT |
Functions | |
| r_uart_gtchar | uart_getchar (void) |
| This function allows to get a character from the UART. | |
| 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. | |
| bit | uart_test_hit (void) |
| This function allows to inform if a character was received. | |
Copyright (c) 2004 Atmel.
Please read file license.txt for copyright notice.
This file contains Uart lib header file.
Definition in file uart_lib.h.
| #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.
| r_uart_gtchar uart_getchar | ( | void | ) |
This function allows to get a character from the UART.
Definition at line 73 of file uart_lib.c.
References Lin_get_data, and Lin_rx_response_ready.
Referenced by build_cmd().
00074 { 00075 while(!Lin_rx_response_ready()); 00076 return Lin_get_data(); 00077 }
| bit uart_init | ( | void | ) |
This function configures the UART configuration and timming following the constant definition of BAUDRATE and enables the UART controller.
Definition at line 54 of file uart_lib.c.
References BAUDRATE, BITSAMPLING, Byte_transfer_enable, Lin_set_btr_brr, Lin_set_data, and TRUE.
Referenced by ushell_task_init().
00055 { 00056 Lin_set_btr_brr(BITSAMPLING,BAUDRATE); 00057 Byte_transfer_enable(); 00058 Lin_set_data(0xFF); 00059 return TRUE; 00060 }
| r_uart_ptchar uart_putchar | ( | p_uart_ptchar | uc_wr_byte | ) |
This function allows to send a character on the UART.
| uc_wr_byte | character to print on UART. |
Definition at line 63 of file uart_lib.c.
References Lin_set_data, and Lin_tx_response_ready.
Referenced by build_cmd(), print_hex16(), print_msg(), and ushell_task().
00064 { 00065 while (!Lin_tx_response_ready()); 00066 Lin_set_data(ch); 00067 return (ch); 00068 }
| bit uart_test_hit | ( | void | ) |
This function allows to inform if a character was received.
Definition at line 48 of file uart_lib.c.
References Lin_rx_response_ready.
Referenced by build_cmd().
00049 { 00050 return (Lin_rx_response_ready()); 00051 }
1.5.7.1