Subversion Repositories FlightCtrl

Rev

Rev 596 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

// ######################## SPI - FlightCtrl ###################
#ifndef _SPI_H
#define _SPI_H

#define SPI_PROTOCOL_COMP   1

//-----------------------------------------
#define DDR_SPI DDRB
#define DD_SS   PB4
#define DD_SCK  PB7
#define DD_MOSI PB5
#define DD_MISO PB6


#define SLAVE_SELECT_DDR_PORT   DDRC
#define SLAVE_SELECT_PORT       PORTC
#define SPI_SLAVE_SELECT        PC5

struct str_ToNaviCtrl
{
 unsigned char Comp;
 int IntegralNick;
 int IntegralRoll;
 char StickNick,StickRoll,StickGier;
};

struct str_FromNaviCtrl
{
 unsigned char Comp;
 int GPS_Nick;
 int GPS_Roll;
 int CompassValue;
};

extern struct str_ToNaviCtrl   ToNaviCtrl;
extern struct str_FromNaviCtrl   FromNaviCtrl;


extern void SPI_MasterInit(void);
extern void SPI_StartTransmitPacket(void);
extern void UpdateSPI_Buffer(void);
extern void SPI_TransmitByte(void);



#endif