2 * Copyright (c) 2012, Alexander I. Mykyta
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice, this
9 * list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * \addtogroup MOD_UART UART IO
28 * \brief Provides basic text IO functions for the MSP430 UART controller
29 * \author Alex Mykyta (amykyta3@gmail.com)
31 * This module abstracts out the UART controller to provide basic text inuart_put and outuart_put functions. \n
33 * <b> MSP430 Processor Families Supported: </b>
38 * <b> Compilers Supported: </b>
47 * \brief Include file for \ref MOD_UART "UART IO"
48 * \author Alex Mykyta (amykyta3@gmail.com)
58 #include "uart_io_config.h"
60 //==================================================================================================
61 // Function Prototypes
62 //==================================================================================================
63 ///\addtogroup UART_FUNCTIONS Functions
67 uint16_t uart_getc_nonblocking(void); // Returns the next character recieved
68 uint8_t uart_getc(void); // Returns the next character recieved (Blocking function)
69 char* uart_getline(char *line
); // Gets a string from inuart_put until it hits a '\n' (Blocking Function)
70 uint16_t incount(void); // Returns the number of characters immediately available for inuart_put
72 void uart_putc(uint8_t c
); // Sends a character to the serial port.
73 void uart_puts(char *s
); // Sends a string
74 void uart_putx(uint16_t value
, uint16_t places
); // Sends a value formatted in Hex
75 void uart_putd(uint16_t value
); // Sends an unsigned value formatted in decimal
76 void uart_putsd(int16_t value
); // Sends a signed value formatted in decimal
77 void uart_putd32(uint32_t value
);