USART Code für einen ATxmega-basierten Computer.
Mehr ...
#include <avr/io.h>
#include <avr/interrupt.h>
#include <stdio.h>
#include <stdint.h>
#include <util/delay.h>
#include "usartx.h"
gehe zum Quellcode dieser Datei
|
#define | OWNER |
|
#define | QUEUE_SIZE 64 /* MUST BE A POWER OF 2!! */ |
|
|
static void | _rxcisr (int usartnum) |
|
| ISR (USARTC0_RXC_vect) |
|
| ISR (USARTC1_RXC_vect) |
|
| ISR (USARTD0_RXC_vect) |
|
| ISR (USARTD1_RXC_vect) |
|
| ISR (USARTE0_RXC_vect) |
|
| ISR (USARTF0_RXC_vect) |
|
void | USART_Connect (int usartnum, int streamsel) |
|
static int | USART_getchar (FILE *stream) __attribute__((noinline)) |
|
void | USART_Init (uint8_t usartnum, uint8_t bauda, uint8_t baudb) |
|
static int | USART_putchar (char c, FILE *stream) __attribute__((noinline)) |
|
|
static volatile unsigned char | inptr [NUM_USARTS] = { 0, 0, 0, 0, 0, 0 } |
|
static volatile unsigned char | outptr [NUM_USARTS] = { 0, 0, 0, 0, 0, 0 } |
|
static volatile unsigned char | queue [NUM_USARTS][QUEUE_SIZE] |
|
static USART_t * | usart [NUM_USARTS] = { &USARTC0, &USARTC1, &USARTD0, &USARTD1, &USARTE0, &USARTF0 } |
|
FILE | usart_out = FDEV_SETUP_STREAM(USART_putchar, NULL, _FDEV_SETUP_WRITE) |
|
FILE | usartin = FDEV_SETUP_STREAM(NULL, USART_getchar, _FDEV_SETUP_READ) |
|
FILE | usartout = FDEV_SETUP_STREAM(USART_putchar, NULL, _FDEV_SETUP_WRITE) |
|
static int | usartsel_err = eUSARTC0 |
|
static int | usartsel_in = eUSARTC0 |
|
static int | usartsel_out = eUSARTC0 |
|
USART Code für einen ATxmega-basierten Computer.
- Autor
- Karl Lunt
-
Anpassungen Hanna Burggraf
- Datum
- 03.04.2011 / 03.02.2016
$Revision: 463 $
$Date: 2016-04-02 12:14:42 +0200 (Sat, 02 Apr 2016) $
These routines provide support for stream I/O and can be hooked into stdin, stdout, and stderr.
This module provides support for all seven USARTs on the ATxmega256a3 and related devices. For details on using these routines, consult the associated usartx.h header file. http://www.seanet.com/~karllunt/atxmegasource.html
Definiert in Datei usartx.c.