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

Last change on this file since 10094 was 10094, checked in by neise, 12 years ago
initial commit of FSC firmware - use for FSC testing only -
File size: 1.8 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//-----------------------------------------------------------------------------
28
29void usart_init(void);
30void usart_write_char(U08 data);
31void usart_write_crlf(void);
32void usart_write_str(pU08 str);
33void usart_writeln_str(pU08 str);
34void usart_write_flash_str(fpU08 str);
35void usart_writeln_flash_str(fpU08 str);
36void usart_write_U08(U08 value,U08 digits);
37void usart_write_S08(S08 value,U08 digits);
38void usart_write_U08_hex(U08 value);
39void usart_write_U08_bin(U08 value);
40void usart_write_U16(U16 value,U08 digits);
41void usart_write_S16(S16 value,U08 digits);
42void usart_write_U16_hex(U16 value);
43void usart_write_U32(U32 value,U08 digits);
44void usart_write_S32(S32 value,U08 digits);
45void usart_write_U32_hex(U32 value);
46void usart_write_float(float value,U08 decimals,U08 digits);
47//-----------------------------------------------------------------------------
48
49#endif
Note: See TracBrowser for help on using the repository browser.