-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathchannels.h
More file actions
30 lines (24 loc) · 700 Bytes
/
channels.h
File metadata and controls
30 lines (24 loc) · 700 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef CHANNELS_H
#define CHANNELS_H
#include "Arduino.h"
class channels_t
{
int8_t frameState;
char curChannel;
char frameHexData[8];
public:
uint8_t binary_writes;
void (*process_frame)(char channel, uint32_t value, channels_t& obj);
void (*serial_write)(uint8_t b);
channels_t();
void init(void (*process_frame_function)(char channel, uint32_t value, channels_t& obj),
void (*serial_write_function)(uint8_t b)
);
void StateMachine(byte b);
void sendFloat(char c, float v);
void send(char c, int32_t v);
void sendHexNibble(byte b);
void sendHexByte(byte b);
void sendByte(byte b);
};
#endif // CHANNELS_H