Rev 596 | Rev 606 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 596 | Rev 597 | ||
---|---|---|---|
Line 5... | Line 5... | ||
5 | struct str_ToNaviCtrl ToNaviCtrl; |
5 | struct str_ToNaviCtrl ToNaviCtrl; |
6 | struct str_FromNaviCtrl FromNaviCtrl; |
6 | struct str_FromNaviCtrl FromNaviCtrl; |
7 | unsigned char SPI_BufferIndex; |
7 | unsigned char SPI_BufferIndex; |
8 | volatile unsigned char SPI_Buffer[sizeof(FromNaviCtrl)]; |
8 | volatile unsigned char SPI_Buffer[sizeof(FromNaviCtrl)]; |
9 | unsigned char *Ptr_buffer = (unsigned char *) &ToNaviCtrl; |
9 | unsigned char *Ptr_buffer = (unsigned char *) &ToNaviCtrl; |
10 | - | ||
- | 10 | #ifdef USE_SPI_COMMUNICATION |
|
11 | //------------------------------------------------------ |
11 | //------------------------------------------------------ |
12 | void SPI_MasterInit(void) |
12 | void SPI_MasterInit(void) |
13 | { |
13 | { |
14 | DDR_SPI |= (1<<DD_MOSI)|(1<<DD_SCK); // Set MOSI and SCK output, all others input |
14 | DDR_SPI |= (1<<DD_MOSI)|(1<<DD_SCK); // Set MOSI and SCK output, all others input |
15 | SLAVE_SELECT_DDR_PORT |= (1 << SPI_SLAVE_SELECT); |
15 | SLAVE_SELECT_DDR_PORT |= (1 << SPI_SLAVE_SELECT); |
Line 76... | Line 76... | ||
76 | ToNaviCtrl.StickRoll = (char) StickRoll; |
76 | ToNaviCtrl.StickRoll = (char) StickRoll; |
77 | ToNaviCtrl.StickGier = (char) StickGier; |
77 | ToNaviCtrl.StickGier = (char) StickGier; |
78 | sei(); |
78 | sei(); |
79 | } |
79 | } |
Line -... | Line 80... | ||
- | 80 |