2021-07-01 10:53:50 +02:00
|
|
|
#ifndef BSP_Q7S_SPI_Q7SSPICOMIF_H_
|
|
|
|
#define BSP_Q7S_SPI_Q7SSPICOMIF_H_
|
|
|
|
|
2021-08-03 15:58:01 +02:00
|
|
|
#include <fsfw_hal/linux/spi/SpiComIF.h>
|
2021-07-01 10:53:50 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief This additional communication interface is required because the SPI busses behind the
|
|
|
|
* devices "/dev/spi2.0" and "dev/spidev3.0" are multiplexed to one SPI interface.
|
|
|
|
* This was necessary because the processing system spi (/dev/spi2.0) does not support
|
|
|
|
* frequencies lower than 650 kHz. To reach lower frequencies also the CPU frequency must
|
|
|
|
* be reduced which leads to other effects compromising kernel drivers.
|
|
|
|
* The nano avionics reaction wheels require a spi frequency between 150 kHz and 300 kHz
|
|
|
|
* why an additional AXI SPI core has been implemented in the programmable logic. However,
|
|
|
|
* the spi frequency of the AXI SPI core is not configurable during runtime. Therefore,
|
|
|
|
* this communication interface multiplexes either the hard-wired SPI or the AXI SPI to
|
|
|
|
* the SPI interface. The multiplexing is performed via a GPIO connected to a VHDL
|
|
|
|
* module responsible for switching between the to SPI peripherals.
|
|
|
|
*/
|
2022-01-17 13:48:55 +01:00
|
|
|
class Q7sSpiComIF : public SpiComIF {
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief Constructor
|
|
|
|
*
|
|
|
|
* @param objectId
|
|
|
|
* @param gpioComIF
|
|
|
|
* @param gpioSwitchId The gpio ID of the GPIO connected to the SPI mux module in the PL.
|
|
|
|
*/
|
|
|
|
Q7sSpiComIF(object_id_t objectId, GpioIF* gpioComIF, gpioId_t gpioSwitchId);
|
|
|
|
virtual ~Q7sSpiComIF();
|
2021-07-01 10:53:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* BSP_Q7S_SPI_Q7SSPICOMIF_H_ */
|