Khangai Robot Play - Naive  01
THe naive play of the Khangai Robot
arduino.h
Go to the documentation of this file.
1 /*
2  * arduino.h
3  *
4  * Created : 1/5/2018
5  * Author : n-is
6  * email : 073bex422.nischal@pcampus.edu.np
7  */
8 
9 #ifndef _ARDUINO_H_
10 #define _ARDUINO_H_
11 
12 #include "sensor.h"
13 #include "queue_custom.h"
14 
15 
17 {
18 public:
19  Arduino_Device(uint8_t id, uint8_t num_bytes);
20  Arduino_Device(Arduino_Device &&) = default;
21  Arduino_Device(const Arduino_Device &) = default;
23  Arduino_Device &operator=(const Arduino_Device &) = default;
25 
26  static int init();
27  float read();
28  bool available();
29  void denit();
30 
31  int read(uint8_t *buf, uint16_t len);
32 
33  uint8_t get_ID() const { return id_; }
34  int write(uint8_t *buf, uint16_t len);
35 
36  void store(float val) { rx_data_.insert(val); }
37 private:
39  static bool initiated;
40  uint8_t id_;
41 };
42 
43 
44 void add_Device(Arduino_Device *adev);
45 
46 void Arduino_Handle_RxCplt(void);
47 void Arduino_Handle_TxCplt(void);
48 
49 #endif // !_ARDUINO_H_
float read()
Definition: arduino.cpp:62
bool available()
Definition: arduino.cpp:70
Arduino_Device & operator=(Arduino_Device &&)=default
void insert(T elem)
Definition: queue_custom.h:25
Arduino_Device(uint8_t id, uint8_t num_bytes)
Definition: arduino.cpp:38
~Arduino_Device()
Definition: arduino.h:24
Definition: arduino.h:16
void add_Device(Arduino_Device *adev)
uint8_t id_
Definition: arduino.h:40
void store(float val)
Definition: arduino.h:36
Queue< float, 2 > rx_data_
Definition: arduino.h:38
void Arduino_Handle_TxCplt(void)
Definition: arduino.cpp:122
static bool initiated
Definition: arduino.h:39
void Arduino_Handle_RxCplt(void)
Definition: arduino.cpp:144
static int init()
Definition: arduino.cpp:49
void denit()
Definition: arduino.cpp:75
int write(uint8_t *buf, uint16_t len)
Definition: arduino.cpp:91
uint8_t get_ID() const
Definition: arduino.h:33