Go to the source code of this file.
Defines | |
| #define | DD_SPI_SS PB0 |
| #define | DD_SPI_SCK PB1 |
| #define | DD_SPI_MOSI PB2 |
| #define | DD_SPI_MISO PB3 |
| #define | DDR_SPI DDRB |
| #define | SPI_PORT PORTB |
| #define | PROPER_SPICON1 (0<<SPIE)|(1<<SPE)|(0<<DORD)|(1<<MSTR)|(0<<CPOL)|(0<<CPHA)|(0<<SPR1)|(1<<SPR0) |
Functions | |
| void | SPI_MasterInit (void) |
| SPI_MasterInit This function is used to Initialize the Chip's SPI as the Master. | |
| void | SPI_CS_high (int ChipSelect) |
| SPI_SlaveInit This function is used to Initialize the Chip's SPI as a Slave. | |
| void | SPI_CS_low (int ChipSelect) |
| SPI_CS_low This function is used to set a specific Chipselect to LOW. | |
| char | SPI_MasterTransmit (int ChipSelect, char cData) |
| SPI_MasterTransmit This function is used to Transmit Data via SPI (This is only working as Master, receiving is implemented as pseudo-reading) . | |
It is used to specify SPI pins
| #define DD_SPI_MISO PB3 |
Referenced by SPI_MasterInit().
| #define DD_SPI_MOSI PB2 |
Referenced by SPI_MasterInit().
| #define DD_SPI_SCK PB1 |
Referenced by SPI_MasterInit().
| #define DD_SPI_SS PB0 |
Referenced by SPI_MasterInit().
| #define DDR_SPI DDRB |
Referenced by SPI_MasterInit().
| #define PROPER_SPICON1 (0<<SPIE)|(1<<SPE)|(0<<DORD)|(1<<MSTR)|(0<<CPOL)|(0<<CPHA)|(0<<SPR1)|(1<<SPR0) |
Referenced by SPI_MasterInit().
| #define SPI_PORT PORTB |
Referenced by SPI_CS_high(), SPI_CS_low(), SPI_MasterInit(), and SPI_MasterTransmit().
| void SPI_CS_high | ( | int | ChipSelect | ) |
SPI_SlaveInit This function is used to Initialize the Chip's SPI as a Slave.
| void |
| ChipSelect | The ChipSelect PIN we want to drive to High |
References SPI_PORT.
Referenced by init().
| void SPI_CS_low | ( | int | ChipSelect | ) |
SPI_CS_low This function is used to set a specific Chipselect to LOW.
| ChipSelect | The ChipSelect PIN we want to drive to Low |
References SPI_PORT.
| void SPI_MasterInit | ( | void | ) |
SPI_MasterInit This function is used to Initialize the Chip's SPI as the Master.
| void |
References DD_SPI_MISO, DD_SPI_MOSI, DD_SPI_SCK, DD_SPI_SS, DDR_SPI, PROPER_SPICON1, and SPI_PORT.
Referenced by main().
| char SPI_MasterTransmit | ( | int | ChipSelect, | |
| char | cData | |||
| ) |
SPI_MasterTransmit This function is used to Transmit Data via SPI (This is only working as Master, receiving is implemented as pseudo-reading)
.
| ChipSelect | The ChipSelect PIN we need to drive to LOW to select the other Slave-Chip We drive it to HIGH again after the communication is finished. | |
| cData | The Byte we want to send via SPI |
References my_delay(), and SPI_PORT.
Referenced by get_temperature(), init_lcd(), lcd_clear(), lcd_send_bitmask(), lcd_send_char(), and lcd_set_start().
1.5.8