diff uart_addon.h @ 9:7da9a3f23592

Import ds18x20 code
author Matt Johnston <matt@ucc.asn.au>
date Fri, 18 May 2012 23:57:08 +0800
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uart_addon.h	Fri May 18 23:57:08 2012 +0800
@@ -0,0 +1,121 @@
+#ifndef UART_ADDON_H
+#define UART_ADDON_H
+/************************************************************************
+Title:     UART addon-library 
+Author:    Martin Thomas <[email protected]>   
+           http://www.siwawi.arubi.uni-kl.de/avr_projects
+Software:  AVR-GCC 3.3/3.4, Peter Fleury's UART-Library
+************************************************************************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** 
+ *  @defgroup UART library-addon
+ *  @code #include <uart_addon.h> @endcode
+ * 
+ *  @brief Additional functions for send numbers as decimal and hex to UART
+ *
+ *  @note needs Peter Fleury's UART-Library http://jump.to/fleury
+ *  @author  Martin Thomas [email protected]   
+ */
+ 
+/*@{*/
+
+/**
+ * @brief    Put long integer to ringbuffer for transmitting via UART.
+ *
+ * The integer is converted to a string which is buffered by the uart 
+ * library in a circular buffer and one character at a time is transmitted 
+ * to the UART using interrupts.
+ *
+ * @param    value to transfer
+ * @return   none
+ * @see      uart_puts_p
+ */
+extern void uart_put_longint( long int i );
+
+
+/**
+ * @brief    Put unsigned long integer to ringbuffer for transmitting via UART.
+ *
+ * The integer is converted to a string which is buffered by the uart 
+ * library in a circular buffer and one character at a time is transmitted 
+ * to the UART using interrupts.
+ *
+ * @param    value to transfer
+ * @return   none
+ * @see      uart_puts_p
+ */
+extern void uart_put_ulongint( unsigned long int i );
+
+
+/**
+ * @brief    Put integer to ringbuffer for transmitting via UART.
+ *
+ * The integer is converted to a string which is buffered by the uart 
+ * library in a circular buffer and one character at a time is transmitted 
+ * to the UART using interrupts.
+ *
+ * @param    value to transfer
+ * @return   none
+ * @see      uart_puts_p
+ */
+extern void uart_put_int( int i );
+
+
+/**
+ * @brief    Put nibble as hex to ringbuffer for transmit via UART.
+ *
+ * The lower nibble of the parameter is convertet to correspondig
+ * hex-char and put in a circular buffer and one character at a time 
+ * is transmitted to the UART using interrupts.
+ *
+ * @param    value to transfer (byte, only lower nibble converted)
+ * @return   none
+ * @see      uart_putc
+ */
+extern void uart_puthex_nibble( const unsigned char b );
+
+/**
+ * @brief    Put byte as hex to ringbuffer for transmit via UART.
+ *
+ * The upper and lower nibble of the parameter are convertet to 
+ * correspondig hex-chars and put in a circular buffer and one 
+ * character at a time is transmitted to the UART using interrupts.
+ *
+ * @param    value to transfer
+ * @return   none
+ * @see      uart_puthex_nibble
+ */
+extern void uart_puthex_byte( const unsigned char b );
+
+/**
+ * @brief    Put unsigned long as ASCII to ringbuffer for transmit via UART.
+ *
+ * @param    value to transfer
+ * @return   none
+ * @see      none
+ */
+extern void uart_puthex_long( unsigned long l );
+
+/**
+ * @brief    Put byte as bin to ringbuffer for transmit via UART.
+ *
+ * @param    value to transfer
+ * @return   none
+ * @see      uart_putc
+ */
+extern void uart_putbin_byte( const unsigned char b );
+
+
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* UART_ADDON_H */
+