2925 |
poskozby |
1 |
/* |
|
|
2 |
* uart.h |
|
|
3 |
* |
|
|
4 |
* Created: 29.11.2011 19:24:39 |
|
|
5 |
* Author: Zbynek |
|
|
6 |
poskocil@email.cz |
|
|
7 |
*/ |
|
|
8 |
|
|
|
9 |
|
|
|
10 |
#ifndef UART_H_ |
|
|
11 |
#define UART_H_ |
|
|
12 |
/************************************************************************/ |
|
|
13 |
/* Definice konstant */ |
|
|
14 |
/************************************************************************/ |
|
|
15 |
#define UART0_BAUD_RATE 9600 |
|
|
16 |
#define VELIKOST_PRIJIMACIHO_BUFFERU 244 // MAX 255 velikost bufferu pro uchovani prichozich zprav z USARTn v bytech |
|
|
17 |
|
|
|
18 |
/************************************************************************/ |
|
|
19 |
/* Definice struktur */ |
|
|
20 |
/************************************************************************/ |
|
|
21 |
typedef struct |
|
|
22 |
{ |
|
|
23 |
char obsah[VELIKOST_PRIJIMACIHO_BUFFERU]; |
|
|
24 |
unsigned char zaplneno_bytu; |
|
|
25 |
|
|
|
26 |
} RX_buffer; |
|
|
27 |
|
|
|
28 |
RX_buffer RX0_buffer; |
|
|
29 |
RX_buffer NMEA_retezec; |
|
|
30 |
|
|
|
31 |
/************************************************************************/ |
|
|
32 |
/* Deklarace funkci */ |
|
|
33 |
/************************************************************************/ |
|
|
34 |
void USART0_posli_znak( unsigned char data); |
|
|
35 |
unsigned char USART0_prijmi_znak( void ); |
|
|
36 |
void USART0_posli_retezec (const unsigned char *retezec); |
|
|
37 |
void USART_Init(void); |
|
|
38 |
void USART0_smaz_buffer (void); |
|
|
39 |
void dekoduj_zpravu_GPS (void); |
|
|
40 |
|
|
|
41 |
#endif /* UART_H_ */ |