summaryrefslogtreecommitdiff
path: root/drivers/ppmsum.h
blob: 98c29844fe3c5c62e8a1f4580483e0458c0a2ade (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
27
28
29
#ifndef PPMSUM_H
#define PPMSUM_H

#include <stdint.h>
#include <timer/timer.h>
#include <interrupt/interrupt.h>

class PPMSum {
	friend void interrupt<Interrupt::TIM2>();
	
	private:
		static PPMSum* self;
		
		uint8_t index;
		
		void irq();
	
	public:
		PPMSum() {
			self = this;
		}
		
		bool synced;
		uint16_t channels[16];
		
		void enable();
};

#endif