USART and serial I/O functions.
More...
#include <avr/io.h>
#include <avr/pgmspace.h>
#include <avr/interrupt.h>
#include <ctype.h>
#include <string.h>
#include "main.h"
#include "serial.h"
Go to the source code of this file.
Functions |
void | usart_init (void) |
| Init USART.
|
int | pc_putc (char data) |
| Send one byte to PC.
|
void | pc_puts (char *s) |
| Send RAM string to PC.
|
void | pc_puts_P (const char *s) |
| Send flash string to PC.
|
char | pc_getc (void) |
| Get one byte from PC.
|
void | putnum_ud (uint16_t n) |
| Send unsigned int number in ASCII to PC.
|
void | print_div (void) |
| Print divider on terminal.
|
uint16_t | pc_read16 (void) |
| Get unisgned int from PC.
|
Detailed Description
USART and serial I/O functions.
Definition in file serial.c.
Function Documentation
Get one byte from PC.
- Returns:
- Received byte
Definition at line 74 of file serial.c.
Send one byte to PC.
- Parameters:
-
Definition at line 38 of file serial.c.
Send RAM string to PC.
- Parameters:
-
Definition at line 52 of file serial.c.
void pc_puts_P |
( |
const char * |
s | ) |
|
Send flash string to PC.
- Parameters:
-
Definition at line 63 of file serial.c.
uint16_t pc_read16 |
( |
void |
| ) |
|
Get unisgned int from PC.
- Returns:
- Received number
Definition at line 120 of file serial.c.
Print divider on terminal.
Definition at line 110 of file serial.c.
void putnum_ud |
( |
uint16_t |
n | ) |
|
Send unsigned int number in ASCII to PC.
- Parameters:
-
Definition at line 87 of file serial.c.
Init USART.
Initialize USART for communication with PC.
Definition at line 21 of file serial.c.