2022-03-26 16:38:42 +01:00
|
|
|
#pragma once
|
2021-03-13 14:42:30 +01:00
|
|
|
|
2022-01-17 15:58:27 +01:00
|
|
|
#include <fsfw_hal/common/gpio/gpioDefinitions.h>
|
2021-03-13 14:42:30 +01:00
|
|
|
|
2022-03-26 16:38:42 +01:00
|
|
|
class GpioIF;
|
2021-03-13 14:42:30 +01:00
|
|
|
|
2022-03-26 16:38:42 +01:00
|
|
|
namespace gpioCallbacks {
|
2021-03-13 14:42:30 +01:00
|
|
|
|
2022-01-17 15:58:27 +01:00
|
|
|
/**
|
|
|
|
* @brief This function implements the decoding to multiply gpios by using the decoder
|
|
|
|
* chips SN74LVC138APWR on the TCS board and the interface board.
|
|
|
|
*/
|
|
|
|
void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, gpio::Levels value,
|
|
|
|
void* args);
|
2021-05-02 13:48:39 +02:00
|
|
|
|
2022-01-17 15:58:27 +01:00
|
|
|
/**
|
|
|
|
* @brief This function sets mux bits 1-3 to a state which will only enable the decoder
|
|
|
|
* on the TCS board which is named to IC1 in the schematic.
|
|
|
|
*/
|
2022-03-26 16:38:42 +01:00
|
|
|
void enableDecoderTcsIc1(GpioIF* gpioIF);
|
2021-05-02 13:48:39 +02:00
|
|
|
|
2022-01-17 15:58:27 +01:00
|
|
|
/**
|
|
|
|
* @brief This function sets mux bits 1-3 to a state which will only enable the decoder
|
|
|
|
* on the TCS board which is named to IC2 in the schematic.
|
|
|
|
*/
|
2022-03-26 16:38:42 +01:00
|
|
|
void enableDecoderTcsIc2(GpioIF* gpioIF);
|
2021-05-02 13:48:39 +02:00
|
|
|
|
2022-01-17 15:58:27 +01:00
|
|
|
/**
|
|
|
|
* @brief This function sets mux bits 1-3 to a state which will only enable the decoder
|
|
|
|
* on the inteface board board which is named to IC21 in the schematic.
|
|
|
|
*/
|
2022-03-26 16:38:42 +01:00
|
|
|
void enableDecoderInterfaceBoardIc1(GpioIF* gpioIF);
|
2021-05-02 13:48:39 +02:00
|
|
|
|
2022-01-17 15:58:27 +01:00
|
|
|
/**
|
|
|
|
* @brief This function sets mux bits 1-3 to a state which will only enable the decoder
|
|
|
|
* on the inteface board board which is named to IC22 in the schematic.
|
|
|
|
*/
|
2022-03-26 16:38:42 +01:00
|
|
|
void enableDecoderInterfaceBoardIc2(GpioIF* gpioIF);
|
2021-05-07 18:48:42 +02:00
|
|
|
|
2022-03-26 16:38:42 +01:00
|
|
|
void disableDecoderTcsIc1(GpioIF* gpioIF);
|
|
|
|
void disableDecoderTcsIc2(GpioIF* gpioIF);
|
|
|
|
void disableDecoderInterfaceBoardIc1(GpioIF* gpioIF);
|
|
|
|
void disableDecoderInterfaceBoardIc2(GpioIF* gpioIF);
|
2021-10-29 19:13:48 +02:00
|
|
|
|
2022-01-17 15:58:27 +01:00
|
|
|
/**
|
|
|
|
* @brief Enables the reaction wheel chip select decoder (IC3).
|
|
|
|
*/
|
2022-03-26 16:38:42 +01:00
|
|
|
void enableRwDecoder(GpioIF* gpioIF);
|
|
|
|
void disableRwDecoder(GpioIF* gpioIF);
|
2021-06-21 17:15:19 +02:00
|
|
|
|
2022-01-17 15:58:27 +01:00
|
|
|
/**
|
|
|
|
* @brief This function disables all decoder.
|
|
|
|
*/
|
2022-03-26 16:38:42 +01:00
|
|
|
void disableAllDecoder(GpioIF* gpioIF);
|
2021-05-02 13:48:39 +02:00
|
|
|
|
2022-01-17 15:58:27 +01:00
|
|
|
/** The following functions enable the appropriate channel of the currently enabled decoder */
|
2022-03-26 16:38:42 +01:00
|
|
|
void selectY0(GpioIF* gpioIF);
|
|
|
|
void selectY1(GpioIF* gpioIF);
|
|
|
|
void selectY2(GpioIF* gpioIF);
|
|
|
|
void selectY3(GpioIF* gpioIF);
|
|
|
|
void selectY4(GpioIF* gpioIF);
|
|
|
|
void selectY5(GpioIF* gpioIF);
|
|
|
|
void selectY6(GpioIF* gpioIF);
|
|
|
|
void selectY7(GpioIF* gpioIF);
|
2021-03-13 14:42:30 +01:00
|
|
|
|
2022-03-26 16:38:42 +01:00
|
|
|
} // namespace gpioCallbacks
|