firmware  v0.1.2
Chromation Spectrometer Dev-Kit
Spi_faked.c
Go to the documentation of this file.
1 
37 #include "Mock.h" // record call history in "mock"
38 #include "ReadWriteBits.h"
39 #include "Spi_faked.h"
40 #include "Spi.h"
41 /* =====[ Mock _SpiTransferIsDone() ]===== */
42 static RecordedCall * Record__SpiTransferIsDone(void)
43 { // Define **what is recorded** when fake is called.
44  char const *call_name = "_SpiTransferIsDone";
45  RecordedCall *record_of_this_call = RecordedCall_new(call_name);
46  return record_of_this_call;
47 }
49 {
53  RecordActualCall(mock, Record__SpiTransferIsDone());
56  SetBit(Spi_SPSR, Spi_InterruptFlag);
60  return true;
61 }
62 
63 /* =====[ Mock ClearSpiInterruptFlag() ]===== */
64 static RecordedCall * Record_ClearSpiInterruptFlag(void)
65 { // Define **what is recorded** when fake is called.
66  char const *call_name = "ClearSpiInterruptFlag";
67  RecordedCall *record_of_this_call = RecordedCall_new(call_name);
68  return record_of_this_call;
69 }
71 {
75  RecordActualCall(mock, Record_ClearSpiInterruptFlag());
76 }
77 
spi_ptr Spi_SPSR
SPI Status Register.
Spi.h declares SPI hardware types and variables common to the SPI Master and SPI Slave.
bool _SpiTransferIsDone_fake(void)
Definition: Spi_faked.c:48
void ClearSpiInterruptFlag_fake(void)
Definition: Spi_faked.c:70