added spi mux functionality to the rwSpiCallback

This commit is contained in:
2021-07-01 10:53:50 +02:00
parent caebb4a4f4
commit 8dbe77d4a5
6 changed files with 117 additions and 40 deletions

View File

@ -3,6 +3,10 @@
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
#include <fsfw_hal/linux/spi/SpiComIF.h>
#include <fsfw_hal/common/gpio/GpioCookie.h>
namespace rwSpiCallback {
/**
* @brief This is the callback function to send commands to the nano avionics reaction wheels and
@ -14,8 +18,17 @@
* Arbeitsdaten/08_Used%20Components/Nanoavionics_Reactionwheels&fileid=181622
* Each command entails exactly one reply which will also be read in and decoded by this
* function.
* Because the reaction wheels require a spi clock frequency of maximum 300 kHZ and minimum
* 150 kHz which is not supported by the processing system SPI peripheral an AXI SPI core
* has been implemented in the programmable logic. This AXI SPI core works with a fixed
* frequency of 250 kHz.
* To allow the parallel usage of the same physical SPI bus, a VHDL module has been
* implemented which is able to disconnect the hard-wired SPI peripheral of the PS and
* route the AXI SPI to the SPI lines.
* To switch between the to SPI peripherals, an EMIO is used which will also be controlled
* by this function.
*/
ReturnValue_t rwSpiCallback(SpiComIF* comIf, SpiCookie *cookie, const uint8_t *sendData,
ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie *cookie, const uint8_t *sendData,
size_t sendLen, void* args);
/**
@ -27,4 +40,5 @@ ReturnValue_t rwSpiCallback(SpiComIF* comIf, SpiCookie *cookie, const uint8_t *s
*/
void closeSpi(gpioId_t gpioId, GpioIF* gpioIF, MutexIF* mutex);
}
#endif /* BSP_Q7S_RW_SPI_CALLBACK_H_ */