firmware  v0.1.2
Chromation Spectrometer Dev-Kit
SpiMaster-HardwareFake.h
Go to the documentation of this file.
1 
10 #ifndef _SPIMASTER_HARDWAREFAKE_H
11 #define _SPIMASTER_HARDWAREFAKE_H
12 
13 #include "SpiMaster.h"
14 // ---Fake hardware registers as PC memory for unit tests---
15 static uint8_t volatile fake_SpiM_ddr;
16 static uint8_t volatile fake_SpiM_pin;
17 static uint8_t volatile fake_SpiM_port;
18 static uint8_t volatile fake_SpiM_SPCR;
19 static uint8_t volatile fake_SpiM_SPSR;
20 // ---Registers---
21 spim_reg SpiM_ddr = &fake_SpiM_ddr;
22 spim_reg SpiM_pin = &fake_SpiM_pin;
23 spim_reg SpiM_port = &fake_SpiM_port;
24 spim_reg SpiM_SPCR = &fake_SpiM_SPCR;
25 spim_reg SpiM_SPSR = &fake_SpiM_SPSR;
26 
27 // ---Pins---
28 spim_bit SpiM_DataReady = 1;
29 spim_bit SpiM_Ss = 2;
30 spim_bit SpiM_Mosi = 3;
31 spim_bit SpiM_Miso = 4;
32 spim_bit SpiM_Sck = 5;
33 // ---Bits---
34 spim_bit SpiM_MasterSlaveSelect = 4;
35 spim_bit SpiM_ClockBit0 = 0;
36 spim_bit SpiM_ClockBit1 = 1;
37 spim_bit SpiM_DoubleClock = 0;
38 spim_bit SpiM_SpiEnable = 6;
39 
40 #endif // _SPIMASTER_HARDWAREFAKE_H