Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
serial.h
Go to the documentation of this file.
1
5#ifndef HAL_SERIAL_H
6#define HAL_SERIAL_H
7
8#include <cstddef>
9#include <cstdint>
10
11namespace lampda {
12namespace hal {
14namespace serial {
15
19extern void init();
20
22extern bool is_activated();
23
25extern bool is_available();
26
28extern char read();
29
36extern size_t write(const char* const buffer, size_t bufferSize);
37
39uint16_t mtu_size();
40
41} // namespace serial
42} // namespace hal
43} // namespace lampda
44
45#endif
bool is_activated()
Return true if the serial port is active.
Definition: serial.cpp:14
bool is_available()
Return true if a char is available to read.
Definition: serial.cpp:15
uint16_t mtu_size()
Return the usable MTU size.
Definition: serial.cpp:19
void init()
call once at program start
Definition: serial.cpp:13
char read()
Read a character (blocking)
Definition: serial.cpp:16
size_t write(const char *const buffer, size_t bufferSize)
Write a char buffer to the serial port.
Definition: serial.cpp:17
Program scope.
Definition: control_fixed_modes.hpp:12