forked from Traumflug/Teacup_Firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserial.h
30 lines (22 loc) · 739 Bytes
/
serial.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef _SERIAL_H
#define _SERIAL_H
#include <stdint.h>
#include <avr/io.h>
#include <avr/pgmspace.h>
// initialise serial subsystem
void serial_init(void);
// return number of characters in the receive buffer, and number of spaces in the send buffer
uint8_t serial_rxchars(void);
// uint8_t serial_txchars(void);
// read one character
uint8_t serial_popchar(void);
// send one character
void serial_writechar(uint8_t data);
// read/write many characters
// uint8_t serial_recvblock(uint8_t *block, int blocksize);
void serial_writeblock(void *data, int datalen);
void serial_writestr(uint8_t *data);
// write from flash
void serial_writeblock_P(PGM_P data, int datalen);
void serial_writestr_P(PGM_P data);
#endif /* _SERIAL_H */