summaryrefslogtreecommitdiffstats
path: root/firmware/filter.h
blob: 243e4aae2cc8bc64f53cf44bd8072ef8e4ef79a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef FILTER_H_
#define FILTER_H_

#include "util.h"


struct lp_filter_u16 {
	uint24_t filter_buf;
};


static inline void lp_filter_u16_reset(struct lp_filter_u16 *lp)
{
	lp->filter_buf = 0u;
}

uint16_t lp_filter_u16_run(struct lp_filter_u16 *lp, uint16_t in,
			   uint8_t filter_shift);

#endif /* FILTER_H_ */
bues.ch cgit interface