aboutsummaryrefslogtreecommitdiff
path: root/center_fw/8seg_protocol.h
blob: 2da42c414f365b9515d4cf48af9aaf5b304436ea (plain)
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
#ifndef __8SEG_PROTOCOL_H__
#define __8SEG_PROTOCOL_H__

enum packet_type {
    PKT_TYPE_RESERVED = 0,
    PKT_TYPE_SET_OUTPUTS_BINARY = 1,
    PKT_TYPE_SET_GLOBAL_BRIGHTNESS = 2,
    PKT_TYPE_SET_OUTPUTS = 3,
    PKT_TYPE_GET_STATUS = 4,
    PKT_TYPE_MAX
};

struct status_tx {
    int16_t temp_tenths_C;
    uint32_t uptime_s;
    uint32_t decoding_error_cnt, protocol_error_cnt;
    int16_t vcc_mv, vin_mv, vskew_mv;
    uint16_t jitter_meas_avg_ns;
};

extern void set_outputs(uint8_t val[8]);
extern void set_outputs_binary(int mask, int global_brightness);

void protocol_init(void);

#endif /* __8SEG_PROTOCOL_H__ */