Defines | Functions | Variables
usart.c File Reference
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>
#include "utils.h"
#include "usart.h"
Include dependency graph for usart.c:

Go to the source code of this file.

Defines

#define UART_RX_BUFFER_MASK   ( UART_RX_BUFFER_SIZE - 1 )
#define UART_RX_BUFFER_SIZE   64 /* 2,4,8,16,32,64,128 or 256 bytes */
 AVR includes.
#define UART_TX_BUFFER_MASK   ( UART_TX_BUFFER_SIZE - 1 )
#define UART_TX_BUFFER_SIZE   64

Functions

 ISR (USART0_RX_vect)
 ISR (USART0_UDRE_vect)
void uart_bufferFlush (const int8_t b)
unsigned char uart_DataInReceiveBuffer ()
unsigned char uart_getc (void)
char uart_gets (char *str)
void uart_init ()
void uart_loopback ()
void uart_putc (unsigned char data)
void uart_puts (const char *str)

Variables

static unsigned char UART_RxBuf [UART_RX_BUFFER_SIZE]
static volatile char UART_RxHead
static volatile char UART_RxTail
static unsigned char UART_TxBuf [UART_TX_BUFFER_SIZE]
static volatile char UART_TxHead
static volatile char UART_TxTail

Detailed Description

Code usart module setup and operation

Version:
1.0
Author:
Julio Sagardoy

Definition in file usart.c.


Define Documentation

Definition at line 29 of file usart.c.

#define UART_RX_BUFFER_SIZE   64 /* 2,4,8,16,32,64,128 or 256 bytes */

AVR includes.

Own includes

Definition at line 26 of file usart.c.

Definition at line 34 of file usart.c.

#define UART_TX_BUFFER_SIZE   64

Definition at line 27 of file usart.c.


Function Documentation

ISR ( USART0_RX_vect  )

Definition at line 151 of file usart.c.

ISR ( USART0_UDRE_vect  )

Definition at line 179 of file usart.c.

void uart_bufferFlush ( const int8_t  b)

Definition at line 129 of file usart.c.

unsigned char uart_DataInReceiveBuffer ( )

Tells if there is data in the rxcycle buffer

Definition at line 111 of file usart.c.

unsigned char uart_getc ( void  )

Extract a single character from rx cycle buffer

Definition at line 48 of file usart.c.

char uart_gets ( char *  str)

Points to an entire string from rx cycle buffer. The end is signaled by a Unix <LF>. Returns the number of characters of the string

Definition at line 81 of file usart.c.

void uart_init ( void  )

Initializes UART ports and cycle buffers

Definition at line 200 of file usart.c.

void uart_loopback ( )

Echoes back received characters, except for 'q', which ends mode

Definition at line 118 of file usart.c.

void uart_putc ( unsigned char  data)

Put a single character to the tx cycle buffer

Definition at line 63 of file usart.c.

void uart_puts ( const char *  str)

Put an entire string into the tx cycle buffer. Appends a Unix <LF>

Definition at line 101 of file usart.c.


Variable Documentation

unsigned char UART_RxBuf[UART_RX_BUFFER_SIZE] [static]

Definition at line 39 of file usart.c.

volatile char UART_RxHead [static]

Definition at line 40 of file usart.c.

volatile char UART_RxTail [static]

Definition at line 41 of file usart.c.

unsigned char UART_TxBuf[UART_TX_BUFFER_SIZE] [static]

Definition at line 42 of file usart.c.

volatile char UART_TxHead [static]

Definition at line 43 of file usart.c.

volatile char UART_TxTail [static]

Definition at line 44 of file usart.c.



cob_3d_mapping_demonstrator
Author(s): Georg Arbeiter
autogenerated on Wed Aug 26 2015 11:03:46