source: firmware/FSC/src/usart.h@ 10110

Last change on this file since 10110 was 10109, checked in by lutz, 14 years ago
niculin & dom debugged quite some stuff
File size: 1.9 KB
Line 
1#ifndef __USART_H
2#define __USART_H
3//-----------------------------------------------------------------------------
4
5#include "typedefs.h"
6#include "application.h"
7#include "num_conversion.h"
8//-----------------------------------------------------------------------------
9
10#define USART_CHAR_BS 8
11#define USART_CHAR_LF 10
12#define USART_CHAR_CR 13
13#define USART_CHAR_ESC 27
14#define USART_CHAR_SPC 32
15//-----------------------------------------------------------------------------
16
17#define USART_SET_BAUDRATE(br) (UBRRH = (U08)((((U32)F_CPU) /\
18 ((U32)br * 16) - 1) >> 8),\
19 UBRRL = (U08)(((U32)F_CPU) /\
20 ((U32)br * 16) - 1))
21//-----------------------------------------------------------------------------
22/*
23extern U08 usart_rx_buffer[];
24extern volatile BOOL usart_rx_ready;
25extern volatile BOOL ISR_toggle_out;
26extern U08 usart_received_chars;
27*/
28extern bool usart_tx_buffer_overflow;
29extern U08 usart_tx_buffer_index;
30extern U08 usart_tx_buffer[USART_TX_BUFFER_SIZE];
31//-----------------------------------------------------------------------------
32
33void usart_init(void);
34void usart_write_char(U08 data);
35void usart_write_crlf(void);
36void usart_write_str(pU08 str);
37void usart_writeln_str(pU08 str);
38void usart_write_flash_str(fpU08 str);
39void usart_writeln_flash_str(fpU08 str);
40void usart_write_U08(U08 value,U08 digits);
41void usart_write_S08(S08 value,U08 digits);
42void usart_write_U08_hex(U08 value);
43void usart_write_U08_bin(U08 value);
44void usart_write_U16(U16 value,U08 digits);
45void usart_write_S16(S16 value,U08 digits);
46void usart_write_U16_hex(U16 value);
47void usart_write_U32(U32 value,U08 digits);
48void usart_write_S32(S32 value,U08 digits);
49void usart_write_U32_hex(U32 value);
50void usart_write_float(float value,U08 decimals,U08 digits);
51//-----------------------------------------------------------------------------
52
53#endif
Note: See TracBrowser for help on using the repository browser.