/************************************************************************/ /* */ /* File: avr/uart.c */ /* Description: serial line device. */ /* Version: 1.0 */ /* Author: Otto Mattik */ /* */ /* (C)Copyright Otto Mattik 2014-2021. */ /* */ /* This file is a part of 'armen' (a tiny operating system). */ /* 'armen' is distributed under the CeCILL-V2.1 licence. For more */ /* details about this licence, please visit the website cecill.info */ /* */ /************************************************************************/ #ifndef AVR_UART_C #error "do not use this code directly, it must be included via uart.c" #endif #if defined(__AVR_ATtiny84__)\ || defined(__AVR_ATtiny85__) #include "avr/usi.c" #else #include "avr/usart.c" #endif void _uart_init( void ) { uint8_t i; for( i = 0; i < ARMEN_UARTS; i++ ) { devices[i].open = _uart_open; devices[i].close = _uart_close; devices[i].read = _uart_read; devices[i].write = _uart_write; #ifdef UART_IOCTL devices[i].ioctl = _uart_ioctl; #endif } }