initial commit

This commit is contained in:
2022-09-21 14:43:44 +02:00
commit e8d73df01d
51 changed files with 23641 additions and 0 deletions

20
spi.h Normal file
View File

@@ -0,0 +1,20 @@
#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