source: firmware/FSC/usb_src/usart.h@ 20099

Last change on this file since 20099 was 10236, checked in by neise, 14 years ago
File size: 2.0 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];
31extern U08 usart_received_chars;
32//-----------------------------------------------------------------------------
33
34void usart_init(void);
35void usart_write_char(U08 data);
36void usart_write_crlf(void);
37void usart_write_str(pU08 str);
38void usart_writeln_str(pU08 str);
39void usart_write_flash_str(fpU08 str);
40void usart_writeln_flash_str(fpU08 str);
41void usart_write_U08(U08 value,U08 digits);
42void usart_write_S08(S08 value,U08 digits);
43void usart_write_U08_hex(U08 value);
44void usart_write_U08_bin(U08 value);
45void usart_write_U16(U16 value,U08 digits);
46void usart_write_S16(S16 value,U08 digits);
47void usart_write_U16_hex(U16 value);
48void usart_write_U32(U32 value,U08 digits);
49void usart_write_S32(S32 value,U08 digits);
50void usart_write_U32_hex(U32 value);
51void usart_write_float(float value,U08 decimals,U08 digits);
52//-----------------------------------------------------------------------------
53
54#endif
Note: See TracBrowser for help on using the repository browser.