This repository has been archived on 2023-01-14. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
05_wickler/spi.h
2022-01-12 16:44:12 +01:00

21 lines
609 B
C

#ifndef _SPI_H_
#define _SPI_H_
#include <avr/io.h>
#define SPI_PORT PORTB /* target-specific port containing the SPI lines */
#define SPI_DDR DDRB /* target-specific DDR for the SPI port lines */
#define CS_DDR DDRJ /* target-specific DDR for chip-select */
#define CS_PORT PORTJ /* target-specific port used as chip-select */
#define CS_BIT 3 /* target-specific port line used as chip-select */
uint8_t spi_read();
void spi_write(uint8_t d);
void spi_select(void);
void spi_deselect(void);
unsigned char spi_xchg(unsigned char val);
void spi_init(void);
#endif