#include <util/atomic.h>
#include "eRTK.h"
Go to the source code of this file.
#define ROLLOVER |
( |
|
x, |
|
|
|
max |
|
) |
| x = ++x >= max ? 0 : x |
#define UART0_BAUD 19200lu |
#define UART1_BAUD 9600lu |
#define UART2_BAUD 9600lu |
#define UART3_BAUD 9600lu |
Enumerator |
---|
UART0 |
|
UART1 |
|
UART2 |
|
UART3 |
|
Definition at line 68 of file uart.h.
Definition at line 51 of file uart.c.
59 UCSR0C = ( 1<<UCSZ01 )^( 1<<UCSZ00 )^( 1<<USBS0 )^( 0<<UPM01 )^( 0<<UPM00 );
60 UCSR0B = ( 1<<RXEN0 )^( 1<<TXEN0 )^( 1<<RXCIE0 );
70 UCSR1C = ( 1<<UCSZ11 )^( 1<<UCSZ10 )^( 1<<USBS1 )^( 0<<UPM11 )^( 0<<UPM10 );
71 UCSR1B = ( 1<<RXEN1 )^( 1<<TXEN1 )^( 1<<RXCIE1 );
81 UCSR2C = ( 1<<UCSZ21 )^( 1<<UCSZ20 )^( 1<<USBS2 )^( 0<<UPM21 )^( 0<<UPM20 );
82 UCSR2B = ( 1<<RXEN2 )^( 1<<TXEN2 )^( 1<<RXCIE2 );
92 UCSR3C = ( 1<<UCSZ31 )^( 1<<UCSZ30 )^( 1<<USBS3 )^( 0<<UPM31 )^( 0<<UPM30 );
93 UCSR3B = ( 1<<RXEN3 )^( 1<<TXEN3 )^( 1<<RXCIE3 );
void eRTK_get_sema(uint8_t semaid)
void deadbeef(tsys reason)
uint8_t read |
( |
tUART |
port, |
|
|
void * |
puffer, |
|
|
uint8_t |
nbytes, |
|
|
uint8_t |
timeout |
|
) |
| |
Definition at line 249 of file uart.c.
250 register uint8_t anz=0;
258 UCSR0B|=( 1<<RXCIE0 );
259 while( anz<nbytes ) {
260 if( rx_in0!=rx_out0 ) {
261 *( uint8_t * )puffer++=rx_buf0[rx_out0];
267 ATOMIC_BLOCK( ATOMIC_RESTORESTATE ) {
287 UCSR1B|=( 1<<RXCIE1 );
288 while( anz<nbytes ) {
289 if( rx_in1!=rx_out1 ) {
290 *( uint8_t * )puffer++=rx_buf1[rx_out1];
296 ATOMIC_BLOCK( ATOMIC_RESTORESTATE ) {
316 UCSR2B|=( 1<<RXCIE2 );
317 while( anz<nbytes ) {
318 if( rx_in2!=rx_out2 ) {
319 *( uint8_t * )puffer++=rx_buf2[rx_out2];
325 ATOMIC_BLOCK( ATOMIC_RESTORESTATE ) {
345 UCSR3B|=( 1<<RXCIE3 );
346 while( anz<nbytes ) {
347 if( rx_in3!=rx_out3 ) {
348 *( uint8_t * )puffer++=rx_buf3[rx_out3];
354 ATOMIC_BLOCK( ATOMIC_RESTORESTATE ) {
uint8_t eRTK_GetTid(void)
void eRTK_wefet(uint8_t timeout)
void deadbeef(tsys reason)
void write |
( |
tUART |
port, |
|
|
void * |
puffer, |
|
|
uint8_t |
nbytes |
|
) |
| |
Definition at line 373 of file uart.c.
379 register uint8_t i=tx_in0;
381 if( i!=tx_out0 )
break;
382 ATOMIC_BLOCK( ATOMIC_RESTORESTATE ) {
383 UCSR0B|=( 1<<UDRIE0 );
389 tx_buff0[tx_in0] = *( uint8_t * )puffer++;
391 UCSR0B|=( 1<<UDRIE0 );
400 register uint8_t i=tx_in1;
402 if( i!=tx_out1 )
break;
403 ATOMIC_BLOCK( ATOMIC_RESTORESTATE ) {
404 UCSR1B|=( 1<<UDRIE1 );
410 tx_buff1[tx_in1] = *( uint8_t * )puffer++;
412 UCSR1B|=( 1<<UDRIE1 );
421 register uint8_t i=tx_in2;
423 if( i!=tx_out2 )
break;
424 ATOMIC_BLOCK( ATOMIC_RESTORESTATE ) {
425 UCSR2B|=( 1<<UDRIE2 );
431 tx_buff2[tx_in2] = *( uint8_t * )puffer++;
433 UCSR2B|=( 1<<UDRIE2 );
442 register uint8_t i=tx_in3;
444 if( i!=tx_out3 )
break;
445 ATOMIC_BLOCK( ATOMIC_RESTORESTATE ) {
446 UCSR3B|=( 1<<UDRIE3 );
452 tx_buff3[tx_in3] = *( uint8_t * )puffer++;
454 UCSR3B|=( 1<<UDRIE3 );
uint8_t eRTK_GetTid(void)
void deadbeef(tsys reason)
void eRTK_SetSuspended(uint8_t tid)