firmware  v0.1.2
Chromation Spectrometer Dev-Kit
Spi-Hardware.h
1 #ifndef _SPI_HARDWARE_H
2 #define _SPI_HARDWARE_H
3 
4 #include <stdint.h>
5 #include <avr/io.h> // includes iom328p.h for hardware i/o values
6 #include "Spi.h"
7 
8 // ---i/o Registers---
10 spi_reg Spi_PortDirection = &DDRB;
12 spi_reg Spi_PortInput = &PINB;
14 spi_reg Spi_PortOutput = &PORTB;
16 spi_reg Spi_PortPullup = &PORTB;
18 spi_reg Spi_SPCR = &SPCR;
20 spi_reg Spi_SPSR = &SPSR;
22 spi_reg Spi_SPDR = &SPDR;
23 
24 // ---i/o Pins---
25 spi_bit Spi_DataReady = PORTB1;
26 spi_bit Spi_Ss = PORTB2;
27 spi_bit Spi_Mosi = PORTB3;
28 spi_bit Spi_Miso = PORTB4;
29 spi_bit Spi_Sck = PORTB5;
30 
31 // ---i/o Bits---
32 spi_bit Spi_MasterSlaveSelect = MSTR; // bit 4 in SPCR (0x2C)
33 spi_bit Spi_ClockBit0 = SPR0; // bit 0 in SPCR (0x2C)
34 spi_bit Spi_ClockBit1 = SPR1; // bit 1 in SPCR (0x2C)
35 spi_bit Spi_DoubleClock = SPI2X; // bit 0 in SPSR (0x2D)
36 spi_bit Spi_Enable = SPE; // bit 6 in SPCR (0x2C)
37 spi_bit Spi_InterruptEnable = SPIE; // bit 7 in SPCR (0x2C)
38 spi_bit Spi_InterruptFlag = SPIF; // bit 7 in SPSR (0x2D)
39 
40 #endif // _SPI_HARDWARE_H
spi_ptr Spi_SPSR
SPI Status Register.
spi_ptr Spi_SPCR
SPI Control Register.
spi_ptr Spi_SPDR
SPI Data Register.
Spi.h declares SPI hardware types and variables common to the SPI Master and SPI Slave.
spi_reg Spi_PortOutput
Atmel PORT.
spi_reg Spi_PortPullup
Atmel PORT alias.
Definition: Spi-Hardware.h:16
spi_reg Spi_PortDirection
Atmel DDR.
spi_reg Spi_PortInput
Atmel PIN.