esc_dc.h 1.36 KB
Newer Older
Jeroen Vreeken's avatar
Jeroen Vreeken committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
	Copyright Jeroen Vreeken (pe1rxq@amsat.org), 2013
	Copyright Stichting C.A. Muller Radioastronomiestation, 2013

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.

 */

#ifndef _INCLUDE_EC_ESC_DC_H_
#define _INCLUDE_EC_ESC_DC_H_

#include <unistd.h>

Jeroen Vreeken's avatar
Jeroen Vreeken committed
25
#include <ec/ec.h>
Jeroen Vreeken's avatar
Jeroen Vreeken committed
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

/* This module is used by devices (like stoeber) that don't use the 
   esc_device structure yet.
   This is why we use the direct address on our interface. Once all
   devices migrate to use the new esc_device functions this can change.
 */

struct esc_dc_sync {
	uint32_t sync0_cycle;
	int32_t sync0_shift;
	int32_t sync1_shift;
	bool sync_out_active;
	bool sync0_active;
	bool sync1_active;
	
	bool latch0_pdi;
	bool latch1_pdi;
};

int esc_dc_init(struct ec_dgram_addr *addr, struct esc_dc_sync *sync);

#endif /* _INCLUDE_EC_ESC_DC_H_ */