summaryrefslogtreecommitdiff
path: root/digital/beacon/src/twi_specific.h
blob: 76c6b42a92f68af31f89ea393f94f0f8a2b40729 (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
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
61
62
63
64
65
66
67
68
69
/* twi_specific.h */
/* twi specific funtion. {{{
 *
 * Copyright (C) 2012 Florent Duchon
 *
 * APBTeam:
 *        Web: http://apbteam.org/
 *      Email: team AT apbteam DOT org
 *
 * 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 2 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, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 * }}} */

#ifndef _TWI_SPECIFIC_H
#define _TWI_SPECIFIC_H

#define TWI_TASK_PERIOD 	4L


typedef enum
{
	TWI_RX_CRC_FIELD,
	TWI_RX_SEQ_FIELD,
	TWI_RX_JACK_FIELD,
	TWI_RX_NB_ADV_FIELD,
	TWI_RX_X_MSB_FIELD,
	TWI_RX_X_LSB_FIELD,
	TWI_RX_Y_MSB_FIELD,
	TWI_RX_Y_LSB_FIELD
} TTWI_RX_field;

typedef enum
{
	TWI_TX_CRC_FIELD,
	TWI_TX_RFU1_FIELD,
	TWI_TX_RFU2_FIELD,
	TWI_TX_SEQ_FIELD,
	TWI_TX_X1_MSB_FIELD,
	TWI_TX_X1_LSB_FIELD,
	TWI_TX_Y1_MSB_FIELD,
	TWI_TX_Y1_LSB_FIELD,
	TWI_TX_TRUST1_FIELD,
	TWI_TX_X2_MSB_FIELD,
	TWI_TX_X2_LSB_FIELD,
	TWI_TX_Y2_MSB_FIELD,
	TWI_TX_Y2_LSB_FIELD,
	TWI_TX_TRUST2_FIELD,
	TWI_TX_FIELD_NB
} TTWI_TX_field;

/* This function manages the TWI RX/RX transferts */
void twi_task(void);

/* Initialisze specific TWI */
void twi_init_specific(void);

#endif