Project 2
8×8 Dot-Matrix Display
|
Neff Site |
Header file for the SPI interface. More...
#include <avr/io.h>
Go to the source code of this file.
Macros | |
#define | SPI_PORT PORTF |
#define | SPI_MODULE SPIF |
#define | SPI_SS_bp PIN4_bp |
#define | SPI_MOSI_bp PIN5_bp |
#define | SPI_MISO_bp PIN6_bp |
#define | SPI_SCK_bp PIN7_bp |
#define | SPI_SS_bm PIN4_bm |
#define | SPI_MOSI_bm PIN5_bm |
#define | SPI_MISO_bm PIN6_bm |
#define | SPI_SCK_bm PIN7_bm |
#define | SPI_CLOCK_SPEED_gc SPI_PRESCALER_DIV4_gc |
Functions | |
void | spi_init (void) |
Initialize interface. More... | |
void | spi_select_slave (void) |
Activate the slave. More... | |
void | spi_deselect_slave (void) |
Dectivate the slave. More... | |
uint8_t | spi_transfer (uint8_t byte) |
Transfer one data byte. More... | |
Header file for the SPI interface.
This library provides high level access to the Serial Peripheral Interface bus interface.
#define SPI_CLOCK_SPEED_gc SPI_PRESCALER_DIV4_gc |
#define SPI_MISO_bm PIN6_bm |
#define SPI_MISO_bp PIN6_bp |
#define SPI_MODULE SPIF |
#define SPI_MOSI_bm PIN5_bm |
#define SPI_MOSI_bp PIN5_bp |
#define SPI_PORT PORTF |
#define SPI_SCK_bm PIN7_bm |
#define SPI_SCK_bp PIN7_bp |
#define SPI_SS_bm PIN4_bm |
#define SPI_SS_bp PIN4_bp |
void spi_deselect_slave | ( | void | ) |
Dectivate the slave.
Drives the chip select line high in order to deactivate the slave.
void spi_init | ( | void | ) |
Initialize interface.
Setup the interface pins and initialize the spi controller.
void spi_select_slave | ( | void | ) |
Activate the slave.
Drops the chip select line in order to activate the slave.
uint8_t spi_transfer | ( | uint8_t | byte | ) |
Transfer one data byte.
Transmits one data byte to the slave and receives one from the slave.
byte | The data byte sent to the slave. |
Contact | Generated by 1.8.13 |