added rad sensor enable, obj factory fixes
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit

This commit is contained in:
Robin Müller 2022-02-17 20:51:20 +01:00
parent 49decb8e9a
commit 64b4ab3249
2 changed files with 14 additions and 6 deletions

View File

@ -70,6 +70,7 @@ static constexpr char EN_RW_3[] = "enable_rw_3";
static constexpr char EN_RW_4[] = "enable_rw_4"; static constexpr char EN_RW_4[] = "enable_rw_4";
static constexpr char RAD_SENSOR_CHIP_SELECT[] = "rad_sensor_chip_select"; static constexpr char RAD_SENSOR_CHIP_SELECT[] = "rad_sensor_chip_select";
static constexpr char ENABLE_RADFET[] = "enable_radfet";
static constexpr char PAPB_BUSY_SIGNAL_VC0[] = "papb_busy_signal_vc0"; static constexpr char PAPB_BUSY_SIGNAL_VC0[] = "papb_busy_signal_vc0";
static constexpr char PAPB_EMPTY_SIGNAL_VC0[] = "papb_empty_signal_vc0"; static constexpr char PAPB_EMPTY_SIGNAL_VC0[] = "papb_empty_signal_vc0";
static constexpr char PAPB_BUSY_SIGNAL_VC1[] = "papb_busy_signal_vc1"; static constexpr char PAPB_BUSY_SIGNAL_VC1[] = "papb_busy_signal_vc1";

View File

@ -140,13 +140,11 @@ void ObjectFactory::produce(void* args) {
createHeaterComponents(); createHeaterComponents();
createSolarArrayDeploymentComponents(); createSolarArrayDeploymentComponents();
createPlPcduComponents(gpioComIF, spiComIF);
#if OBSW_ADD_SYRLINKS == 1 #if OBSW_ADD_SYRLINKS == 1
createSyrlinksComponents(); createSyrlinksComponents();
#endif /* OBSW_ADD_SYRLINKS == 1 */ #endif /* OBSW_ADD_SYRLINKS == 1 */
#if OBSW_ADD_RTD_DEVICES == 1
createRtdComponents(gpioComIF); createRtdComponents(gpioComIF);
#endif /* OBSW_ADD_RTD_DEVICES == 1 */
#if OBSW_ADD_MGT == 1 #if OBSW_ADD_MGT == 1
I2cCookie* imtqI2cCookie = I2cCookie* imtqI2cCookie =
@ -254,9 +252,7 @@ void ObjectFactory::createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, Ua
new CspComIF(objects::CSP_COM_IF); new CspComIF(objects::CSP_COM_IF);
*i2cComIF = new I2cComIF(objects::I2C_COM_IF); *i2cComIF = new I2cComIF(objects::I2C_COM_IF);
*uartComIF = new UartComIF(objects::UART_COM_IF); *uartComIF = new UartComIF(objects::UART_COM_IF);
#if OBSW_ADD_SPI_TEST_CODE == 0
*spiComIF = new SpiComIF(objects::SPI_COM_IF, *gpioComIF); *spiComIF = new SpiComIF(objects::SPI_COM_IF, *gpioComIF);
#endif /* Q7S_ADD_SPI_TEST_CODE == 0 */
#if BOARD_TE0720 == 0 #if BOARD_TE0720 == 0
/* Adding gpios for chip select decoding to the gpioComIf */ /* Adding gpios for chip select decoding to the gpioComIf */
@ -298,6 +294,9 @@ void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) {
GpiodRegularByLineName* gpio = new GpiodRegularByLineName( GpiodRegularByLineName* gpio = new GpiodRegularByLineName(
q7s::gpioNames::RAD_SENSOR_CHIP_SELECT, consumer.str(), gpio::DIR_OUT, gpio::HIGH); q7s::gpioNames::RAD_SENSOR_CHIP_SELECT, consumer.str(), gpio::DIR_OUT, gpio::HIGH);
gpioCookieRadSensor->addGpio(gpioIds::CS_RAD_SENSOR, gpio); gpioCookieRadSensor->addGpio(gpioIds::CS_RAD_SENSOR, gpio);
gpio = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_RADFET, consumer.str(), gpio::DIR_OUT,
gpio::LOW);
gpioCookieRadSensor->addGpio(gpioIds::ENABLE_RADFET, gpio);
gpioComIF->addGpios(gpioCookieRadSensor); gpioComIF->addGpios(gpioCookieRadSensor);
SpiCookie* spiCookieRadSensor = new SpiCookie( SpiCookie* spiCookieRadSensor = new SpiCookie(
@ -355,6 +354,7 @@ void ObjectFactory::createSunSensorComponents(LinuxLibgpioIF* gpioComIF, SpiComI
gpioComIF->addGpios(gpioCookieSus); gpioComIF->addGpios(gpioCookieSus);
#if OBSW_ADD_SUN_SENSORS == 1
SpiCookie* spiCookie = SpiCookie* spiCookie =
new SpiCookie(addresses::SUS_0, gpioIds::CS_SUS_0, q7s::SPI_DEFAULT_DEV, SUS::MAX_CMD_SIZE, new SpiCookie(addresses::SUS_0, gpioIds::CS_SUS_0, q7s::SPI_DEFAULT_DEV, SUS::MAX_CMD_SIZE,
spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
@ -464,6 +464,8 @@ void ObjectFactory::createSunSensorComponents(LinuxLibgpioIF* gpioComIF, SpiComI
susHandler10->setToGoToNormalMode(true); susHandler10->setToGoToNormalMode(true);
susHandler11->setToGoToNormalMode(true); susHandler11->setToGoToNormalMode(true);
#endif #endif
#endif /* OBSW_ADD_SUN_SENSORS == 1 */
} }
void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF) { void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF) {
@ -793,6 +795,7 @@ void ObjectFactory::createRtdComponents(LinuxLibgpioIF* gpioComIF) {
gpioComIF->addGpios(rtdGpioCookie); gpioComIF->addGpios(rtdGpioCookie);
#if OBSW_ADD_RTD_DEVICES == 1
SpiCookie* spiRtdIc0 = SpiCookie* spiRtdIc0 =
new SpiCookie(addresses::RTD_IC_3, gpioIds::RTD_IC_3, q7s::SPI_DEFAULT_DEV, new SpiCookie(addresses::RTD_IC_3, gpioIds::RTD_IC_3, q7s::SPI_DEFAULT_DEV,
Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED);
@ -900,6 +903,7 @@ void ObjectFactory::createRtdComponents(LinuxLibgpioIF* gpioComIF) {
static_cast<void>(rtdIc13); static_cast<void>(rtdIc13);
static_cast<void>(rtdIc14); static_cast<void>(rtdIc14);
static_cast<void>(rtdIc15); static_cast<void>(rtdIc15);
#endif
} }
void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) { void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) {
@ -941,6 +945,7 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) {
gpioComIF->addGpios(gpioCookieRw); gpioComIF->addGpios(gpioCookieRw);
#if OBSW_ADD_RW == 1
auto rw1SpiCookie = auto rw1SpiCookie =
new SpiCookie(addresses::RW1, gpioIds::CS_RW1, q7s::SPI_RW_DEV, RwDefinitions::MAX_REPLY_SIZE, new SpiCookie(addresses::RW1, gpioIds::CS_RW1, q7s::SPI_RW_DEV, RwDefinitions::MAX_REPLY_SIZE,
spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr); spi::RW_MODE, spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr);
@ -982,6 +987,8 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) {
rwHandler4->setStartUpImmediately(); rwHandler4->setStartUpImmediately();
#endif #endif
rw4SpiCookie->setCallbackArgs(rwHandler4); rw4SpiCookie->setCallbackArgs(rwHandler4);
#endif /* OBSW_ADD_RW == 1 */
} }
void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) { void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
@ -1103,7 +1110,7 @@ void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF*
gpio::Levels::LOW); gpio::Levels::LOW);
plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_VBAT0, gpio); plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_VBAT0, gpio);
consumer = "PLPCDU_ENB_VBAT_1"; consumer = "PLPCDU_ENB_VBAT_1";
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_VBAT0, consumer, gpio::DIR_OUT, gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_VBAT1, consumer, gpio::DIR_OUT,
gpio::Levels::LOW); gpio::Levels::LOW);
plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_VBAT1, gpio); plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_VBAT1, gpio);
consumer = "PLPCDU_ENB_DRO"; consumer = "PLPCDU_ENB_DRO";