rfLPC
A low level library for using NXP's LPC17xx SoC. Config is given for MBED prototyping board
uart.h
Go to the documentation of this file.
1 /* This file is part of rflpc. Copyright 2010-2011 Michael Hauspie
2  *
3  * rflpc is free software: you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation, either version 3 of the License, or
6  * (at your option) any later version.
7  *
8  * rflpc is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with rflpc. If not, see <http://www.gnu.org/licenses/>.
15  */
19 /*
20  Author: Michael Hauspie <michael.hauspie@univ-lille1.fr>
21  Created:
22  Time-stamp: <2015-03-31 16:52:13 (hauspie)>
23 */
24 #ifndef __RFLPC_UART_H__
25 #define __RFLPC_UART_H__
26 
27 #ifdef RFLPC_CONFIG_ENABLE_UART
28 
29 #include "../nxp/LPC17xx.h"
30 #include "../interrupt.h"
31 
45 typedef enum {
49 } rflpc_uart_t;
50 
51 
58 extern int rflpc_uart_init(rflpc_uart_t uart_num);
59 
60 
70 extern int rflpc_uart_init_ex(rflpc_uart_t uart_num, int dll, int dlm, int divadd, int mulval);
71 
72 
77 extern void rflpc_uart_putchar(rflpc_uart_t uart_num, char c);
78 
83 extern int rflpc_uart_byte_available(rflpc_uart_t uart_num);
84 
91 extern char rflpc_uart_getchar(rflpc_uart_t uart_num);
92 
98 extern void rflpc_uart_set_rx_callback(rflpc_uart_t uart_num, rflpc_irq_handler_t callback);
99 
102 #endif /* ENABLE_UART */
103 
104 #endif
Use UART2.
Definition: uart.h:47
int rflpc_uart_init_ex(rflpc_uart_t uart_num, int dll, int dlm, int divadd, int mulval)
Inits the UART e, using 8 bits data, no parity and 1 stop bit.
Use UART0.
Definition: uart.h:46
char rflpc_uart_getchar(rflpc_uart_t uart_num)
Gets a character from the uart.
void rflpc_uart_set_rx_callback(rflpc_uart_t uart_num, rflpc_irq_handler_t callback)
Sets the uart rx callback.
int rflpc_uart_byte_available(rflpc_uart_t uart_num)
Test the reception FIFO.
rflpc_uart_t
Constants that represents the UART port you want to use in uart driver functions. ...
Definition: uart.h:45
Use UART3.
Definition: uart.h:48
int rflpc_uart_init(rflpc_uart_t uart_num)
Inits the UART e, using 11520 baud, 8 bits data, no parity and 1 stop bit.
void rflpc_uart_putchar(rflpc_uart_t uart_num, char c)
Sends a byte to the uart.
void(* rflpc_irq_handler_t)(void)
Interrupt handler type.
Definition: interrupt.h:62