aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/scale.h
blob: 173814f997e0db53eb1d5ce729a3f6335a492b17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef SCALE_H_
#define SCALE_H_

#include <stdint.h>

#include "fixpt.h"


fixpt_t scale(int16_t raw, int16_t raw_lo, int16_t raw_hi,
	      fixpt_t phys_lo, fixpt_t phys_hi);

int16_t unscale(fixpt_t phys, fixpt_t phys_lo, fixpt_t phys_hi,
		int16_t raw_lo, int16_t raw_hi);

fixpt_t rescale(fixpt_t phys0, fixpt_t phys0_lo, fixpt_t phys0_hi,
		fixpt_t phys1_lo, fixpt_t phys1_hi);

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