Loading...
Searching...
No Matches
manchester_encoder.h
1#pragma once
2#include <stdint.h>
3#include <stdbool.h>
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
9typedef struct {
10 bool prev_bit;
11 uint8_t step;
13
14typedef enum {
15 ManchesterEncoderResultShortLow = 0b00,
16 ManchesterEncoderResultLongLow = 0b01,
17 ManchesterEncoderResultLongHigh = 0b10,
18 ManchesterEncoderResultShortHigh = 0b11,
19} ManchesterEncoderResult;
20
21void manchester_encoder_reset(ManchesterEncoderState* state);
22
23bool manchester_encoder_advance(
25 const bool curr_bit,
26 ManchesterEncoderResult* result);
27
28ManchesterEncoderResult manchester_encoder_finish(ManchesterEncoderState* state);
29
30#ifdef __cplusplus
31}
32#endif
Definition manchester_encoder.h:9