My Project
 All Classes Functions Variables Pages
RMT.h
1 /*
2  * RMT.h
3  *
4  * Created on: Mar 1, 2017
5  * Author: kolban
6  */
7 
8 #ifndef COMPONENTS_CPP_UTILS_RMT_H_
9 #define COMPONENTS_CPP_UTILS_RMT_H_
10 #include <driver/rmt.h>
11 #include <vector>
12 
16 class RMT {
17 public:
18  RMT(gpio_num_t pin, rmt_channel_t channel = RMT_CHANNEL_0);
19  virtual ~RMT();
20  void add(bool level, uint32_t duration);
21  void clear();
22  void rxStart();
23  void rxStop();
24  void txStart();
25  void txStop();
26  void write();
27 
28 private:
29  rmt_channel_t channel;
30  std::vector<rmt_item32_t> items;
31  int bitCount = 0;
32 
33 };
34 
35 #endif /* COMPONENTS_CPP_UTILS_RMT_H_ */
Drive the RMT peripheral.
Definition: RMT.h:16
void rxStop()
Stop receiving.
Definition: RMT.cpp:60
virtual ~RMT()
Class destructor.
Definition: RMT.cpp:44
void write()
Write the items out through the RMT.
Definition: RMT.cpp:88
void add(bool level, uint32_t duration)
Add a level/duration to the transaction to be written.
Definition: RMT.cpp:101
void clear()
Clear any previously written level/duration pairs that have not been sent.
Definition: RMT.cpp:118
void rxStart()
Start receiving.
Definition: RMT.cpp:52
void txStop()
Stop transmitting.
Definition: RMT.cpp:76
void txStart()
Start transmitting.
Definition: RMT.cpp:68
RMT(gpio_num_t pin, rmt_channel_t channel=RMT_CHANNEL_0)
Create a class instance.
Definition: RMT.cpp:19