firmware  v0.1.2
Chromation Spectrometer Dev-Kit
SpiSlave_faked.c
Go to the documentation of this file.
1 
37 #include "SpiSlave_faked.h"
38 #include "Mock.h" // record call history in "mock"
39 #include "ReadWriteBits.h"
40 #include "SpiSlave.h"
41 
42 /* =====[ Mock SpiSlaveTxByte() ]===== */
43 static RecordedCall * Record_SpiSlaveTxByte(uint8_t arg1)
44 { // Define **what is recorded** when fake is called.
45  char const *call_name = "SpiSlaveTxByte";
46  RecordedCall *record_of_this_call = RecordedCall_new(call_name);
47  RecordedArg *record_of_arg1 = RecordedArg_new(SetupRecord_uint8_t);
48  *((uint8_t *)record_of_arg1->pArg) = arg1;
49  // Store the arg records in the call record.
50  RecordArg(record_of_this_call, record_of_arg1);
51  return record_of_this_call;
52 }
53 void SpiSlaveTxByte_fake(uint8_t input_byte)
54 {
59  RecordActualCall(mock, Record_SpiSlaveTxByte(input_byte));
60 }
61 
62 /* =====[ Mock EnableSpiInterrupt() ]===== */
63 static RecordedCall * Record_EnableSpiInterrupt(void)
64 { // Define **what is recorded** when fake is called.
65  char const *call_name = "EnableSpiInterrupt";
66  RecordedCall *record_of_this_call = RecordedCall_new(call_name);
67  return record_of_this_call;
68 }
70 {
74  RecordActualCall(mock, Record_EnableSpiInterrupt());
75 }
76 
77 /* =====[ Mock _SignalDataReady() ]===== */
78 static RecordedCall * Record__SignalDataReady(void)
79 { // Define **what is recorded** when fake is called.
80  char const *call_name = "_SignalDataReady";
81  RecordedCall *record_of_this_call = RecordedCall_new(call_name);
82  return record_of_this_call;
83 }
85 {
89  RecordActualCall(mock, Record__SignalDataReady());
90 }
91 
92 /* =====[ Mock DisableSpiInterrupt() ]===== */
93 static RecordedCall * Record_DisableSpiInterrupt(void)
94 { // Define **what is recorded** when fake is called.
95  char const *call_name = "DisableSpiInterrupt";
96  RecordedCall *record_of_this_call = RecordedCall_new(call_name);
97  return record_of_this_call;
98 }
100 {
104  RecordActualCall(mock, Record_DisableSpiInterrupt());
105 }
106 
void _SignalDataReady_fake(void)
void SpiSlaveTxByte_fake(uint8_t input_byte)
void EnableSpiInterrupt_fake(void)
void DisableSpiInterrupt_fake(void)