From f0885fcb2ebbee0f9c168efc9a20a1a7f67f1104 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Sat, 25 Sep 2021 11:09:29 +0200 Subject: [PATCH] removed unused gpio definitions in busConf.h --- bsp_q7s/boardconfig/busConf.h | 79 -------------------------------- linux/boardtest/SpiTestClass.cpp | 46 ++++++++----------- linux/boardtest/SpiTestClass.h | 9 ---- 3 files changed, 20 insertions(+), 114 deletions(-) diff --git a/bsp_q7s/boardconfig/busConf.h b/bsp_q7s/boardconfig/busConf.h index c78125ea..1149a54e 100644 --- a/bsp_q7s/boardconfig/busConf.h +++ b/bsp_q7s/boardconfig/busConf.h @@ -16,85 +16,6 @@ static constexpr char UART_STAR_TRACKER_DEV[] = "/dev/ttyUL8"; static constexpr char UART_GNSS_0_DEV[] = "/dev/ttyUL0"; static constexpr char UART_GNSS_1_DEV[] = "/dev/ttyUL2"; -/**************************************************************/ -/** OBC1E */ -/**************************************************************/ -static constexpr char GPIO_MULTIPURPOSE_1V8_OBC1D[] = "/amba_pl/gpio@42020000"; -static const char* const GPIO_GYRO_ADIS_LABEL = GPIO_MULTIPURPOSE_1V8_OBC1D; -static constexpr uint32_t GPIO_GYRO_0_ADIS_CS = 0; // Package Pin: W20 -static constexpr uint32_t GPIO_GYRO_2_ADIS_CS = 2; // AA22 - -/**************************************************************/ -/** OBC1F B0 */ -/**************************************************************/ -static constexpr char GPIO_FLEX_OBC1F_B0[] = "/amba_pl/gpio@42030000"; -static constexpr uint32_t GPIO_FLEX_OBC1F_B0_WIDTH = 20; -static const char* const GPIO_ACS_BOARD_DEFAULT_LABEL = GPIO_FLEX_OBC1F_B0; -static const char* const GPIO_RW_DEFAULT_LABEL = GPIO_FLEX_OBC1F_B0; -static const char* const GPIO_RAD_SENSOR_LABEL = GPIO_FLEX_OBC1F_B0; - - -static constexpr uint32_t GPIO_RW_0_CS = 7; // B20 -static constexpr uint32_t GPIO_RW_1_CS = 3; // G22 -static constexpr uint32_t GPIO_RW_2_CS = 11; // E18 -static constexpr uint32_t GPIO_RW_3_CS = 6; // B19 - -static constexpr uint32_t GPIO_GYRO_1_L3G_CS = 18; // N22 -static constexpr uint32_t GPIO_GYRO_3_L3G_CS = 1; // M21 -static constexpr uint32_t GPIO_MGM_0_LIS3_CS = 5; // C18 -static constexpr uint32_t GPIO_MGM_1_RM3100_CS = 16; // A16 -static constexpr uint32_t GPIO_MGM_3_RM3100_CS = 10; // C17 - -// Active low enable pin (needs to be driven low for regular operations) -static constexpr uint32_t GPIO_GYRO_0_ENABLE = 2; // H22 - -// Active low reset pin (needs to be driven high for regular operations) -static constexpr uint32_t GPIO_RESET_GNSS_0 = 9; // C22 -static constexpr uint32_t GPIO_RESET_GNSS_1 = 12; // B21 - -static constexpr uint32_t GPIO_RAD_SENSOR_CS = 19; // R18 - -/**************************************************************/ -/** OBC1F B1 */ -/**************************************************************/ -static constexpr char GPIO_FLEX_OBC1F_B1[] = "/amba_pl/gpio@42030000"; -// Need to use chip name here for now because the label name is the name for -// gpiochip 5 and gpiochip6 -static constexpr char GPIO_FLEX_OBC1F_B1_CHIP[] = "gpiochip6"; -static const char* const GPIO_MGM2_LIS3_LABEL = GPIO_FLEX_OBC1F_B1_CHIP; -static constexpr uint32_t GPIO_MGM_2_LIS3_CS = 0; // D18 - -/**************************************************************/ -/** OBC1C */ -/**************************************************************/ -static constexpr char GPIO_3V3_OBC1C[] = "/amba_pl/gpio@42040000"; -static const char* const GPIO_HEATER_LABEL = GPIO_3V3_OBC1C; -static const char* const GPIO_SOLAR_ARR_DEPL_LABEL = GPIO_3V3_OBC1C; -static constexpr uint32_t GPIO_HEATER_0_PIN = 6; -static constexpr uint32_t GPIO_HEATER_1_PIN = 12; -static constexpr uint32_t GPIO_HEATER_2_PIN = 7; -static constexpr uint32_t GPIO_HEATER_3_PIN = 5; -static constexpr uint32_t GPIO_HEATER_4_PIN = 3; -static constexpr uint32_t GPIO_HEATER_5_PIN = 0; -static constexpr uint32_t GPIO_HEATER_6_PIN = 1; -static constexpr uint32_t GPIO_HEATER_7_PIN = 11; -static constexpr uint32_t GPIO_GYRO_2_ENABLE = 18; // F22 - -static constexpr uint32_t GPIO_SOL_DEPL_SA_0_PIN = 4; -static constexpr uint32_t GPIO_SOL_DEPL_SA_1_PIN = 2; - -static constexpr char GPIO_RW_SPI_MUX_LABEL[] = "zynq_gpio"; -// Uses EMIO interface to PL, starts at 54 -static constexpr uint32_t GPIO_RW_SPI_MUX_CS = 54; - -static constexpr uint32_t SPI_MUX_BIT_1 = 13; -static constexpr uint32_t SPI_MUX_BIT_2 = 14; -static constexpr uint32_t SPI_MUX_BIT_3 = 15; -static constexpr uint32_t SPI_MUX_BIT_4 = 16; -static constexpr uint32_t SPI_MUX_BIT_5 = 17; -static constexpr uint32_t SPI_MUX_BIT_6 = 9; -static constexpr uint32_t EN_RW_CS = 17; - namespace gpioNames { static constexpr char GYRO_0_ADIS_CS[] = "gyro_0_adis_chip_select"; static constexpr char GYRO_1_L3G_CS[] = "gyro_1_l3g_chip_select"; diff --git a/linux/boardtest/SpiTestClass.cpp b/linux/boardtest/SpiTestClass.cpp index 8a340ecb..5168ba95 100644 --- a/linux/boardtest/SpiTestClass.cpp +++ b/linux/boardtest/SpiTestClass.cpp @@ -206,12 +206,6 @@ void SpiTestClass::performL3gTest(uint8_t l3gId) { /* Configure all SPI chip selects and pull them high */ acsInit(); - l3gId = gyro1L3gd20ChipSelect; - - /* Adapt accordingly */ - if(l3gId != gyro1L3gd20ChipSelect and l3gId != gyro3L3gd20ChipSelect) { - sif::warning << "SpiTestClass::performLis3MdlTest: Invalid MGM ID!" << std::endl; - } gpioId_t currentGpioId = 0; uint8_t chipSelectPin = l3gId; uint8_t whoAmIReg = 0b0000'1111; @@ -330,39 +324,39 @@ void SpiTestClass::acsInit() { gpio::Direction::OUT, 1); gpioCookie->addGpio(gpioIds::MGM_3_RM3100_CS, gpio); #elif defined(XIPHOS_Q7S) - GpiodRegularByLabel* gpio = nullptr; - gpio = new GpiodRegularByLabel(q7s::GPIO_ACS_BOARD_DEFAULT_LABEL, mgm0Lis3mdlChipSelect, - "MGM_0_LIS3", gpio::Direction::OUT, gpio::HIGH); + GpiodRegularByLineName* gpio = nullptr; + gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_0_CS, "MGM_0_LIS3", gpio::Direction::OUT, + gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_0_LIS3_CS, gpio); - gpio = new GpiodRegularByLabel(q7s::GPIO_ACS_BOARD_DEFAULT_LABEL, mgm1Rm3100ChipSelect, - "MGM_1_RM3100", gpio::Direction::OUT, gpio::HIGH); + gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_1_CS, "MGM_1_RM3100", gpio::Direction::OUT, + gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_1_RM3100_CS, gpio); - gpio = new GpiodRegularByLabel(q7s::GPIO_MGM2_LIS3_LABEL, mgm2Lis3mdlChipSelect, - "MGM_2_LIS3", gpio::Direction::OUT, gpio::HIGH); + gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_2_CS, "MGM_2_LIS3", gpio::Direction::OUT, + gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_2_LIS3_CS, gpio); - gpio = new GpiodRegularByLabel(q7s::GPIO_ACS_BOARD_DEFAULT_LABEL, mgm3Rm3100ChipSelect, - "MGM_3_RM3100", gpio::Direction::OUT, gpio::HIGH); + gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_1_CS, "MGM_3_RM3100", gpio::Direction::OUT, + gpio::HIGH); gpioCookie->addGpio(gpioIds::MGM_3_RM3100_CS, gpio); - gpio = new GpiodRegularByLabel(q7s::GPIO_GYRO_ADIS_LABEL, gyro0AdisChipSelect, - "GYRO_0_ADIS", gpio::Direction::OUT, gpio::HIGH); + gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ADIS_CS, "GYRO_0_ADIS", + gpio::Direction::OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::GYRO_0_ADIS_CS, gpio); - gpio = new GpiodRegularByLabel(q7s::GPIO_ACS_BOARD_DEFAULT_LABEL, gyro1L3gd20ChipSelect, - "GYRO_1_L3G", gpio::Direction::OUT, gpio::HIGH); + gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_1_L3G_CS, "GYRO_1_L3G", gpio::Direction::OUT, + gpio::HIGH); gpioCookie->addGpio(gpioIds::GYRO_1_L3G_CS, gpio); - gpio = new GpiodRegularByLabel(q7s::GPIO_GYRO_ADIS_LABEL, gyro2AdisChipSelect, "GYRO_2_ADIS", + gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_2_ADIS_CS, "GYRO_2_ADIS", gpio::Direction::OUT, gpio::HIGH); gpioCookie->addGpio(gpioIds::GYRO_2_ADIS_CS, gpio); - gpio = new GpiodRegularByLabel(q7s::GPIO_ACS_BOARD_DEFAULT_LABEL, gyro3L3gd20ChipSelect, - "GYRO_3_L3G", gpio::Direction::OUT, gpio::HIGH); + gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_3_L3G_CS, "GYRO_3_L3G", gpio::Direction::OUT, + gpio::HIGH); gpioCookie->addGpio(gpioIds::GYRO_3_L3G_CS, gpio); // Enable pins must be pulled low for regular operations - gpio = new GpiodRegularByLabel(q7s::GPIO_FLEX_OBC1F_B0, q7s::GPIO_GYRO_0_ENABLE, - "GYRO_0_ENABLE", gpio::OUT, gpio::LOW); + gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ENABLE, "GYRO_0_ENABLE", gpio::OUT, + gpio::LOW); gpioCookie->addGpio(gpioIds::GYRO_0_ENABLE, gpio); - gpio = new GpiodRegularByLabel(q7s::GPIO_3V3_OBC1C, q7s::GPIO_GYRO_2_ENABLE, - "GYRO_2_ENABLE", gpio::OUT, gpio::LOW); + gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ENABLE, "GYRO_2_ENABLE", gpio::OUT, + gpio::LOW); gpioCookie->addGpio(gpioIds::GYRO_2_ENABLE, gpio); #endif if (gpioIF != nullptr) { diff --git a/linux/boardtest/SpiTestClass.h b/linux/boardtest/SpiTestClass.h index 45a7cdd8..ffd56dd1 100644 --- a/linux/boardtest/SpiTestClass.h +++ b/linux/boardtest/SpiTestClass.h @@ -54,15 +54,6 @@ private: uint8_t gyro1L3gd20ChipSelect = gpio::GYRO_1_BCM_PIN; uint8_t gyro2AdisChipSelect = gpio::GYRO_2_BCM_PIN; uint8_t gyro3L3gd20ChipSelect = gpio::GYRO_3_BCM_PIN; -#elif defined(XIPHOS_Q7S) - uint8_t mgm0Lis3mdlChipSelect = q7s::GPIO_MGM_0_LIS3_CS; - uint8_t mgm1Rm3100ChipSelect = q7s::GPIO_MGM_1_RM3100_CS; - uint8_t gyro0AdisChipSelect = q7s::GPIO_GYRO_0_ADIS_CS; - uint8_t gyro2AdisChipSelect = q7s::GPIO_GYRO_2_ADIS_CS; - uint8_t gyro1L3gd20ChipSelect = q7s::GPIO_GYRO_1_L3G_CS; - uint8_t gyro3L3gd20ChipSelect = q7s::GPIO_GYRO_3_L3G_CS; - uint8_t mgm2Lis3mdlChipSelect = q7s::GPIO_MGM_2_LIS3_CS; - uint8_t mgm3Rm3100ChipSelect = q7s::GPIO_MGM_3_RM3100_CS; #else uint8_t mgm0Lis3mdlChipSelect = 0; uint8_t mgm1Rm3100ChipSelect = 0;