]> git.tdb.fi Git - model-railway-devices.git/blob - arducontrol/output.h
Rewrite ringbuffer implementation to be interrupt-safe
[model-railway-devices.git] / arducontrol / output.h
1 #ifndef PACKET_H_
2 #define PACKET_H_
3
4 #include <stdint.h>
5
6 typedef struct
7 {
8         uint8_t bit_duration:5;
9         uint8_t ready:1;
10         uint8_t sending:1;
11         volatile uint8_t done:1;
12         uint8_t length;
13         uint8_t data[32];
14         uint8_t repeat_count;
15         uint8_t repeat_delay;
16         uint8_t final_delay;
17 } OutputPacket;
18
19 extern OutputPacket packet;
20
21 void output_init(void);
22 void clear_packet(void);
23 void output_set_power(uint8_t);
24 uint8_t output_command(const uint8_t *, uint8_t);
25
26 #endif