Subversion Repositories FlightCtrl

Rev

Rev 596 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
304 ingob 1
// ######################## SPI - FlightCtrl ###################
2
#ifndef _SPI_H
3
#define _SPI_H
4
 
5
#define SPI_PROTOCOL_COMP   1
6
 
7
//-----------------------------------------
8
#define DDR_SPI DDRB
9
#define DD_SS   PB4
10
#define DD_SCK  PB7
11
#define DD_MOSI PB5
12
#define DD_MISO PB6 
13
 
14
 
15
#define SLAVE_SELECT_DDR_PORT   DDRC
16
#define SLAVE_SELECT_PORT       PORTC
17
#define SPI_SLAVE_SELECT        PC5
18
 
19
struct str_ToNaviCtrl
20
{
21
 unsigned char Comp;
22
 int IntegralNick;
23
 int IntegralRoll;
24
 char StickNick,StickRoll,StickGier;
25
};
26
 
27
struct str_FromNaviCtrl
28
{
29
 unsigned char Comp;
30
 int GPS_Nick;
31
 int GPS_Roll;
32
 int CompassValue;
33
};
34
 
35
extern struct str_ToNaviCtrl   ToNaviCtrl;
36
extern struct str_FromNaviCtrl   FromNaviCtrl;
37
 
38
 
39
extern void SPI_MasterInit(void);
40
extern void SPI_StartTransmitPacket(void);
41
extern void UpdateSPI_Buffer(void);
42
extern void SPI_TransmitByte(void);
43
 
44
 
45
 
46
#endif