esc_esi.h 2.07 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
/*
	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_ESI_H_
#define _INCLUDE_EC_ESC_ESI_H_

Jeroen Vreeken's avatar
Jeroen Vreeken committed
23
#include <ec/esc_device.h>
Jeroen Vreeken's avatar
Jeroen Vreeken committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60

ssize_t esc_esi_eeprom_read(struct ec_dgram_addr *ec_addr, 
    void *buffer, size_t offset, size_t size);

uint16_t esc_esi_read16(struct ec_dgram_addr *ec_addr, size_t offset);
uint32_t esc_esi_read32(struct ec_dgram_addr *ec_addr, size_t offset);

uint32_t esc_esi_vendorid_get(struct ec_dgram_addr *ec_addr);
uint32_t esc_esi_productcode_get(struct ec_dgram_addr *ec_addr);
uint32_t esc_esi_revisionno_get(struct ec_dgram_addr *ec_addr);
uint32_t esc_esi_serialno_get(struct ec_dgram_addr *ec_addr);

size_t esc_esi_standard_rx_mailbox_offset_get(struct ec_dgram_addr *ec_addr);
size_t esc_esi_standard_tx_mailbox_offset_get(struct ec_dgram_addr *ec_addr);
size_t esc_esi_standard_rx_mailbox_size_get(struct ec_dgram_addr *ec_addr);
size_t esc_esi_standard_tx_mailbox_size_get(struct ec_dgram_addr *ec_addr);


struct esc_esi_category {
	size_t		length;
	uint16_t	type;
	unsigned char	*data;
	
	struct esc_esi_category *next;
};

struct esc_esi_category *esc_esi_categories_create(struct ec_dgram_addr *ec_addr);
void esc_esi_categories_destroy(struct esc_esi_category *cat);



ssize_t esc_esi_category_strings_get(struct esc_esi_category *categories,
    int nr, char *str, size_t len);

int esc_esi_device_fill(struct esc_device *dev);

#endif /* _INCLUDE_EC_ESC_ESI_H_ */