added boostc files
This commit is contained in:
parent
19025584c9
commit
42b5801a03
11 changed files with 647 additions and 14 deletions
33
boostc/usart.h
Normal file
33
boostc/usart.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/*******************************************************************/
|
||||
// Defines
|
||||
/*******************************************************************/
|
||||
//******* usart_init
|
||||
// (FOSC/(4 x Baud rate)) -1 BRGH=1 BRG16=1
|
||||
// (FOSC/(16 x Baud rate)) -1 (BRGH=1 BRG16=0) or (BRGH=0 BRG16=1) - High speed
|
||||
// (FOSC/(64 x Baud rate)) -1 BRGH=0 BRG16=0 - Low speed
|
||||
//******* usart_init_auto
|
||||
// BRG16=0 BRGH=0 => FOSC/512
|
||||
// BRG16=0 BRGH=1 => FOSC/128
|
||||
// BRG16=1 BRGH=0 => FOSC/128
|
||||
// BRG16=1 BRGH=1 => FOSC/32
|
||||
#define BAUD_RATE 0x0196 //0x0065 // 4800
|
||||
#define BAUD_BRGH 1
|
||||
#define BAUD_BRG16 1
|
||||
|
||||
#define TX_LED portb.4
|
||||
#define RX_LED portb.4
|
||||
|
||||
/*******************************************************************/
|
||||
// Functions
|
||||
/*******************************************************************/
|
||||
void usart_init(void);
|
||||
void usart_init_auto(void);
|
||||
void usart_putc(unsigned char data);
|
||||
unsigned char usart_getc(void);
|
||||
|
||||
void usart_gets(unsigned char *destination);
|
||||
void usart_puts(unsigned char *source);
|
||||
void usart_putsln(unsigned char *source);
|
||||
void usart_put_newline(void);
|
||||
void usart_waitfor(unsigned char c);
|
||||
void usart_put_baoud(void);
|
||||
Loading…
Add table
Add a link
Reference in a new issue