firmware  v0.1.2
Chromation Spectrometer Dev-Kit
SpiMaster-Hardware.h
Go to the documentation of this file.
1 
10 #ifndef _SPIMASTER_HARDWARE_H
11 #define _SPIMASTER_HARDWARE_H
12 #include <stdint.h>
13 #include <avr/io.h> // includes iom328p.h for hardware i/o values
14 #include "SpiMaster.h"
15 // ---Registers---
16 spi_reg Spi_ddr = &DDRB;
17 spi_reg Spi_pin = &PINB;
18 spi_reg Spi_port = &PORTB;
19 spi_reg Spi_SPCR = &SPCR;
20 spi_reg Spi_SPSR = &SPSR;
21 spi_reg Spi_SPDR = &SPDR;
22 // ---Pins---
23 spi_bit Spi_DataReady = PORTB1;
24 spi_bit Spi_Ss = PORTB2;
25 spi_bit Spi_Mosi = PORTB3;
26 spi_bit Spi_Miso = PORTB4;
27 spi_bit Spi_Sck = PORTB5;
28 // ---Bits---
29 spi_bit Spi_MasterSlaveSelect = MSTR; // bit 4 in SPCR (0x2C)
30 spi_bit Spi_ClockBit0 = SPR0; // bit 0 in SPCR (0x2C)
31 spi_bit Spi_ClockBit1 = SPR1; // bit 1 in SPCR (0x2C)
32 spi_bit Spi_DoubleClock = SPI2X; // bit 0 in SPSR (0x2D)
33 spi_bit Spi_SpiEnable = SPE; // bit 6 in SPCR (0x2C)
34 
35 #endif // _SPIMASTER_HARDWARE_H
36 
spi_reg Spi_SPDR
SPI Data Register.
spi_reg Spi_SPCR
SPI Control Register.
spi_reg Spi_SPSR
SPI Status Register.