JM9 XRCU Board 0.1.3a
Libraries API Reference
Loading...
Searching...
No Matches
Uts_uart.h
Go to the documentation of this file.
1
8
9#ifndef UTS_UART_H
10#define UTS_UART_H
11
12#include <Arduino.h>
13#include <HardwareSerial.h>
14
15#include <UartPorts.h>
16
17#include <Uts_togglable.h>
18
26class Uts_uart : public Uts_togglable {
27 private:
33 bool begin_private ();
34
38 void end_private ();
39
45 HardwareSerial *const hserial;
46
47 // // the previous time a trigger is sent (unit is microseconds)
48 // volatile unsigned long prev_trig_micros;
49 // // the previous time an echo is received (unit is microseconds)
50 // volatile unsigned long prev_echo_micros;
51
55 friend void JM9_uts_uart_callback ();
56
62 bool send_trig ();
63
69 bool available ();
70
76 bool update ();
77
78 public:
84 Uts_uart (const uint8_t port);
85
91 Uts_uart (HardwareSerial &init_serial);
92
101 bool begin ();
102
109 void end ();
110};
111
112#endif // #ifndef UTS_UART_H
Definition HardwareSerial.h:99
Uts_togglable()
Constructor for a togglable ultrasonic sensor driver.
Definition Uts_togglable.cpp:8
void end()
Deactivates this ultrasonic sensor.
Definition Uts_uart.cpp:131
bool begin()
Activates this ultrasonic sensor.
Definition Uts_uart.cpp:115
friend void JM9_uts_uart_callback()
Friend for low-frequency regular callback.
Definition Uts_uart.cpp:191
Uts_uart(const uint8_t port)
Creates a new Uts_uart object.
Definition Uts_uart.cpp:45