tone-generator/serial.hpp

22 lines
343 B
C++
Raw Permalink Normal View History

#pragma once
#include <SoftwareSerial.h>
namespace serial {
constexpr int RXD = A2;
constexpr int TXD = A1;
inline SoftwareSerial dev(RXD, TXD);
void init();
bool is_connected();
bool wait_until_available();
unsigned read(char* data, unsigned len);
void write(const char* data, unsigned len);
void put(char ch);
int get();
};