diff --git a/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/.project/project_am243x.js b/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/.project/project_am243x.js index 75a42d7..09e096b 100644 --- a/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/.project/project_am243x.js +++ b/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/.project/project_am243x.js @@ -9,7 +9,6 @@ const files = { "epwm_drv_aux.c", "epwm_mod.c", "sdfm.c", - "cfg_pad.c", "main.c", ], }; diff --git a/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-evm/r5fss0-0_freertos/example.syscfg b/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-evm/r5fss0-0_freertos/example.syscfg index 9596e0a..26f7043 100644 --- a/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-evm/r5fss0-0_freertos/example.syscfg +++ b/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-evm/r5fss0-0_freertos/example.syscfg @@ -8,6 +8,8 @@ /** * Import the modules used in this configuration. */ +const sdfm = scripting.addModule("/current_sense/sdfm", {}, false); +const sdfm1 = sdfm.addInstance(); const epwm = scripting.addModule("/drivers/epwm/epwm", {}, false); const epwm1 = epwm.addInstance(); const gpio = scripting.addModule("/drivers/gpio/gpio", {}, false); @@ -25,10 +27,23 @@ const mpu_armv73 = mpu_armv7.addInstance(); const mpu_armv74 = mpu_armv7.addInstance(); const mpu_armv75 = mpu_armv7.addInstance(); const mpu_armv76 = mpu_armv7.addInstance(); +const pwm = scripting.addModule("/pru_icssg/pwm", {}, false); +const pwm1 = pwm.addInstance(); +const pwm2 = pwm.addInstance(); +const pwm3 = pwm.addInstance(); /** * Write custom configuration values to the imported modules. */ +sdfm1.$name = "CONFIG_SDFM0"; +sdfm1.Channel_3 = true; +sdfm1.Channel_4 = true; +sdfm1.Channel_5 = true; +sdfm1.Channel_6 = true; +sdfm1.Channel_7 = true; +sdfm1.Channel_8 = true; +sdfm1.PRU_ICSSG0_PRU.$assign = "PRU_ICSSG0_PRU0"; + epwm1.$name = "CONFIG_EPWM0"; epwm1.EPWM.$assign = "EHRPWM0"; epwm1.EPWM.A.$assign = "GPMC0_AD3"; @@ -63,6 +78,7 @@ gpio4.MCU_GPIO.gpioPin.$assign = "MCU_SPI1_D1"; pruicss1.$name = "CONFIG_PRU_ICSS0"; pruicss1.coreClk = 300000000; pruicss1.iepClk = 300000000; +sdfm1.pru = pruicss1; pruicss1.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO0"; debug_log.enableUartLog = true; @@ -98,12 +114,37 @@ mpu_armv76.$name = "CONFIG_MPU_REGION5"; mpu_armv76.baseAddr = 0x80000000; mpu_armv76.size = 31; +pwm1.$name = "CONFIG_PRU_ICSS_PWM0"; +pwm1.PRU_ICSSG0_PWM.$assign = "PRU_ICSSG0_PWM0"; +pwm1.PRU_ICSSG0_PWM.TZ_OUT.$used = true; + +pwm2.$name = "CONFIG_PRU_ICSS_PWM1"; +pwm2.PRU_ICSSG0_PWM.$assign = "PRU_ICSSG0_PWM1"; +pwm2.PRU_ICSSG0_PWM.TZ_OUT.$used = true; + +pwm3.$name = "CONFIG_PRU_ICSS_PWM2"; +pwm3.PRU_ICSSG0_PWM.$assign = "PRU_ICSSG0_PWM2"; +pwm3.PRU_ICSSG0_PWM.TZ_OUT.$used = true; + /** * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future * version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to * re-solve from scratch. */ +sdfm1.PRU_ICSSG0_PRU.GPI16.$suggestSolution = "PRG0_PRU0_GPO16"; +sdfm1.PRU_ICSSG0_PRU.GPI1.$suggestSolution = "PRG0_PRU0_GPO1"; +sdfm1.PRU_ICSSG0_PRU.GPI3.$suggestSolution = "PRG0_PRU0_GPO3"; +sdfm1.PRU_ICSSG0_PRU.GPI5.$suggestSolution = "PRG0_PRU0_GPO5"; +sdfm1.PRU_ICSSG0_PRU.GPI7.$suggestSolution = "PRG0_PRU0_GPO7"; +sdfm1.PRU_ICSSG0_PRU.GPI18.$suggestSolution = "PRG0_PRU0_GPO18"; +sdfm1.PRU_ICSSG0_PRU.GPI11.$suggestSolution = "PRG0_PRU0_GPO11"; +sdfm1.PRU_ICSSG0_PRU.GPI13.$suggestSolution = "PRG0_PRU0_GPO13"; +sdfm1.PRU_ICSSG0_PRU.GPI15.$suggestSolution = "PRG0_PRU0_GPO15"; +sdfm1.PRU_ICSSG0_PRU.GPI17.$suggestSolution = "PRG0_PRU0_GPO17"; gpio3.MCU_GPIO.$suggestSolution = "MCU_GPIO0"; gpio4.MCU_GPIO.$suggestSolution = "MCU_GPIO0"; debug_log.uartLog.UART.RXD.$suggestSolution = "UART0_RXD"; debug_log.uartLog.UART.TXD.$suggestSolution = "UART0_TXD"; +pwm1.PRU_ICSSG0_PWM.TZ_OUT.$suggestSolution = "PRG0_PRU0_GPO19"; +pwm2.PRU_ICSSG0_PWM.TZ_OUT.$suggestSolution = "PRG0_PRU1_GPO19"; +pwm3.PRU_ICSSG0_PWM.TZ_OUT.$suggestSolution = "PRG0_PRU1_GPO8"; diff --git a/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-evm/r5fss0-0_freertos/ti-arm-clang/example.projectspec b/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-evm/r5fss0-0_freertos/ti-arm-clang/example.projectspec index cfdc493..3251841 100644 --- a/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-evm/r5fss0-0_freertos/ti-arm-clang/example.projectspec +++ b/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-evm/r5fss0-0_freertos/ti-arm-clang/example.projectspec @@ -110,8 +110,6 @@ - - diff --git a/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-evm/r5fss0-0_freertos/ti-arm-clang/makefile b/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-evm/r5fss0-0_freertos/ti-arm-clang/makefile index 1ddc7f1..aef6442 100644 --- a/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-evm/r5fss0-0_freertos/ti-arm-clang/makefile +++ b/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-evm/r5fss0-0_freertos/ti-arm-clang/makefile @@ -43,7 +43,6 @@ FILES_common := \ epwm_drv_aux.c \ epwm_mod.c \ sdfm.c \ - cfg_pad.c \ main.c \ ti_drivers_config.c \ ti_drivers_open_close.c \ diff --git a/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-lp/r5fss0-0_freertos/example.syscfg b/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-lp/r5fss0-0_freertos/example.syscfg index 20a22f7..4df72dc 100644 --- a/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-lp/r5fss0-0_freertos/example.syscfg +++ b/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-lp/r5fss0-0_freertos/example.syscfg @@ -8,6 +8,8 @@ /** * Import the modules used in this configuration. */ +const sdfm = scripting.addModule("/current_sense/sdfm", {}, false); +const sdfm1 = sdfm.addInstance(); const epwm = scripting.addModule("/drivers/epwm/epwm", {}, false); const epwm1 = epwm.addInstance(); const epwm2 = epwm.addInstance(); @@ -25,10 +27,22 @@ const mpu_armv72 = mpu_armv7.addInstance(); const mpu_armv73 = mpu_armv7.addInstance(); const mpu_armv74 = mpu_armv7.addInstance(); const mpu_armv75 = mpu_armv7.addInstance(); +const pwm = scripting.addModule("/pru_icssg/pwm", {}, false); +const pwm1 = pwm.addInstance(); +const pwm2 = pwm.addInstance(); +const pwm3 = pwm.addInstance(); /** * Write custom configuration values to the imported modules. */ +sdfm1.$name = "CONFIG_SDFM0"; +sdfm1.Channel_3 = true; +sdfm1.Channel_4 = true; +sdfm1.Channel_8 = true; +sdfm1.Channel_7 = true; +sdfm1.PRU_ICSSG0_PRU.GPI11.$used = true; +sdfm1.PRU_ICSSG0_PRU.GPI13.$used = true; + epwm1.$name = "CONFIG_EPWM0"; epwm1.EPWM.$assign = "EHRPWM0"; epwm1.EPWM.SYNCI.$used = false; @@ -51,19 +65,23 @@ gpio2.GPIO.gpioPin.$assign = "PRG1_PRU0_GPO18"; gpio3.pinDir = "OUTPUT"; gpio3.$name = "GPIO_ZC_TH_CH1"; -gpio3.GPIO.$assign = "GPIO0"; gpio3.GPIO.gpioPin.rx = false; -gpio3.GPIO.gpioPin.$assign = "PRG1_PRU0_GPO17"; +gpio3.GPIO.gpioPin.$assign = "PRG0_PRU1_GPO2"; gpio4.pinDir = "OUTPUT"; gpio4.$name = "GPIO_ZC_TH_CH2"; gpio4.GPIO.gpioPin.rx = false; gpio4.GPIO.gpioPin.$assign = "PRG0_PRU1_GPO1"; -pruicss1.$name = "CONFIG_PRU_ICSS0"; -pruicss1.coreClk = 300000000; -pruicss1.iepClk = 300000000; -pruicss1.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO0"; +pruicss1.$name = "CONFIG_PRU_ICSS0"; +pruicss1.coreClk = 300000000; +pruicss1.iepClk = 300000000; +sdfm1.pru = pruicss1; +pruicss1.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO0"; +pruicss1.AdditionalICSSSettings[0].PruEcapIO.create(1); +pruicss1.AdditionalICSSSettings[0].PruEcapIO[0].$name = "CONFIG_PRU_ICSS_ECAP_IO0"; +pruicss1.AdditionalICSSSettings[0].PruEcapIO[0].PRU_ICSSG0_ECAP.$assign = "PRU_ICSSG0_ECAP0"; +pruicss1.AdditionalICSSSettings[0].PruEcapIO[0].PRU_ICSSG0_ECAP.IN_APWM_OUT.$used = true; debug_log.enableUartLog = true; debug_log.uartLog.$name = "CONFIG_UART_CONSOLE"; @@ -94,18 +112,46 @@ mpu_armv75.baseAddr = 0x60000000; mpu_armv75.size = 28; mpu_armv75.accessPermissions = "Supervisor RD, User RD"; +pwm1.$name = "CONFIG_PRU_ICSS_PWM0"; +pwm1.PRU_ICSSG0_PWM.$assign = "PRU_ICSSG0_PWM0"; +pwm1.PRU_ICSSG0_PWM.TZ_OUT.$assign = "PRG0_PRU0_GPO19"; +pwm1.PRU_ICSSG0_PWM.TZ_OUT.$used = true; + +pwm2.$name = "CONFIG_PRU_ICSS_PWM1"; +pwm2.PRU_ICSSG0_PWM.$assign = "PRU_ICSSG0_PWM1"; +pwm2.PRU_ICSSG0_PWM.TZ_OUT.$used = true; + +pwm3.$name = "CONFIG_PRU_ICSS_PWM2"; +pwm3.PRU_ICSSG0_PWM.$assign = "PRU_ICSSG0_PWM2"; +pwm3.PRU_ICSSG0_PWM.TZ_OUT.$used = true; + /** * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future * version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to * re-solve from scratch. */ -epwm1.EPWM.A.$suggestSolution = "GPMC0_AD3"; -epwm1.EPWM.B.$suggestSolution = "GPMC0_AD4"; -epwm1.EPWM.SYNCO.$suggestSolution = "GPMC0_AD1"; -epwm2.EPWM.$suggestSolution = "EHRPWM1"; -epwm2.EPWM.A.$suggestSolution = "GPMC0_AD5"; -epwm2.EPWM.B.$suggestSolution = "GPMC0_AD6"; -gpio1.MCU_GPIO.$suggestSolution = "MCU_GPIO0"; -gpio4.GPIO.$suggestSolution = "GPIO1"; -debug_log.uartLog.UART.RXD.$suggestSolution = "UART0_RXD"; -debug_log.uartLog.UART.TXD.$suggestSolution = "UART0_TXD"; +sdfm1.PRU_ICSSG0_PRU.$suggestSolution = "PRU_ICSSG0_PRU0"; +sdfm1.PRU_ICSSG0_PRU.GPI16.$suggestSolution = "PRG0_PRU0_GPO16"; +sdfm1.PRU_ICSSG0_PRU.GPI1.$suggestSolution = "PRG0_PRU0_GPO1"; +sdfm1.PRU_ICSSG0_PRU.GPI3.$suggestSolution = "PRG0_PRU0_GPO3"; +sdfm1.PRU_ICSSG0_PRU.GPI5.$suggestSolution = "PRG0_PRU0_GPO5"; +sdfm1.PRU_ICSSG0_PRU.GPI11.$suggestSolution = "PRG0_PRU0_GPO11"; +sdfm1.PRU_ICSSG0_PRU.GPI13.$suggestSolution = "PRG0_PRU0_GPO13"; +sdfm1.PRU_ICSSG0_PRU.GPI7.$suggestSolution = "PRG0_PRU0_GPO7"; +sdfm1.PRU_ICSSG0_PRU.GPI18.$suggestSolution = "PRG0_PRU0_GPO18"; +sdfm1.PRU_ICSSG0_PRU.GPI17.$suggestSolution = "PRG0_PRU0_GPO17"; +sdfm1.PRU_ICSSG0_PRU.GPI15.$suggestSolution = "PRG0_PRU0_GPO15"; +epwm1.EPWM.A.$suggestSolution = "GPMC0_AD3"; +epwm1.EPWM.B.$suggestSolution = "GPMC0_AD4"; +epwm1.EPWM.SYNCO.$suggestSolution = "GPMC0_AD1"; +epwm2.EPWM.$suggestSolution = "EHRPWM1"; +epwm2.EPWM.A.$suggestSolution = "GPMC0_AD5"; +epwm2.EPWM.B.$suggestSolution = "GPMC0_AD6"; +gpio1.MCU_GPIO.$suggestSolution = "MCU_GPIO0"; +gpio3.GPIO.$suggestSolution = "GPIO1"; +gpio4.GPIO.$suggestSolution = "GPIO1"; +pruicss1.AdditionalICSSSettings[0].PruEcapIO[0].PRU_ICSSG0_ECAP.IN_APWM_OUT.$suggestSolution = "PRG0_PRU1_GPO15"; +debug_log.uartLog.UART.RXD.$suggestSolution = "UART0_RXD"; +debug_log.uartLog.UART.TXD.$suggestSolution = "UART0_TXD"; +pwm2.PRU_ICSSG0_PWM.TZ_OUT.$suggestSolution = "PRG0_PRU1_GPO19"; +pwm3.PRU_ICSSG0_PWM.TZ_OUT.$suggestSolution = "PRG0_PRU1_GPO8"; diff --git a/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec b/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec index 10f91d8..8417a3a 100644 --- a/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec +++ b/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec @@ -110,8 +110,6 @@ - - diff --git a/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-lp/r5fss0-0_freertos/ti-arm-clang/makefile b/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-lp/r5fss0-0_freertos/ti-arm-clang/makefile index a5eb2f3..dd547b3 100644 --- a/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-lp/r5fss0-0_freertos/ti-arm-clang/makefile +++ b/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/am243x-lp/r5fss0-0_freertos/ti-arm-clang/makefile @@ -43,7 +43,6 @@ FILES_common := \ epwm_drv_aux.c \ epwm_mod.c \ sdfm.c \ - cfg_pad.c \ main.c \ ti_drivers_config.c \ ti_drivers_open_close.c \ diff --git a/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/app_sdfm.c b/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/app_sdfm.c index 4068773..502a5ea 100644 --- a/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/app_sdfm.c +++ b/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/app_sdfm.c @@ -40,7 +40,6 @@ #include "ti_board_open_close.h" #include "epwm_dc.h" -#include "cfg_pad.h" #include "sdfm.h" /*EPWM1 configuration for sigma delta clock generation: */ @@ -397,16 +396,8 @@ void sdfm_main(void *args) */ init_pwm(); DebugP_log("EPWM Configured!\r\n"); - /* - * Configure SDFM - */ - - /* Configure SOC pads for SDFM. - Normally handled via Pinmux_init(), - but currently no way to pads for ICSSG from Sysconfig. */ - cfgPad(); - - /* Configure SDFM */ + + /* Configure SDFM */ init_sdfm(); DebugP_log("SDFM Configured!\r\n"); diff --git a/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/cfg_pad.c b/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/cfg_pad.c deleted file mode 100644 index 5ed2f68..0000000 --- a/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/cfg_pad.c +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (C) 2023 Texas Instruments Incorporated - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - * Neither the name of Texas Instruments Incorporated nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include "cfg_pad.h" - -static Pinmux_PerCfg_t gPinMuxMainDomainCfgsdfm[] = { - - /* PRG0_ECAP0_IN_APWM_OUT, - PRG0_PRU1_GPO15, PRG0_ECAP0_IN_APWM_OUT, U5, J2.C11 */ - { - PIN_PRG0_PRU1_GPO15, - ( PIN_MODE(10) | PIN_PULL_DISABLE ) - }, - /* SD8_CLK, - PRG0_PRU0_GPI16, SD8_CLK, U4, J2E:P9 */ - { - PIN_PRG0_PRU0_GPO16, - ( PIN_MODE(1) | PIN_INPUT_ENABLE | PIN_PULL_DISABLE ) - }, - /* SD0_D, - PRG0_PRU0_GPI1, SD0_D, R4, J2E:P8 */ - { - PIN_PRG0_PRU0_GPO1, - ( PIN_MODE(1) | PIN_INPUT_ENABLE | PIN_PULL_DISABLE ) - }, - /* SD1_D, - PRG0_PRU0_GPI3, SD1_D, V2, J2A:P9 */ - { - PIN_PRG0_PRU0_GPO3, - ( PIN_MODE(1) | PIN_INPUT_ENABLE | PIN_PULL_DISABLE ) - }, - /* SD2_D, - PRG0_PRU0_GPI5, SD2_D, R3, J2C:P6 */ - { - PIN_PRG0_PRU0_GPO5, - ( PIN_MODE(1) | PIN_INPUT_ENABLE | PIN_PULL_DISABLE ) - }, - /* SD3_D, - PRG0_PRU0_GPI7, SD3_D, T1, J2B:P7 */ - { - PIN_PRG0_PRU0_GPO7, - ( PIN_MODE(1) | PIN_INPUT_ENABLE | PIN_PULL_DISABLE ) - }, - /* SD4_D, - PRG0_PRU0_GPI18, SD4_D, V1, J2B:P9 */ - { - PIN_PRG0_PRU0_GPO18, - ( PIN_MODE(1) | PIN_INPUT_ENABLE | PIN_PULL_DISABLE ) - }, - /* SD5_D, - PRG0_PRU0_GPI11, SD5_D, Y3, J2B:P14 */ - { - PIN_PRG0_PRU0_GPO11, - ( PIN_MODE(1) | PIN_INPUT_ENABLE | PIN_PULL_DISABLE ) - }, - /* SD6_D, - PRG0_PRU0_GPI13, SD6_D, R6, J2C:P5 */ - { - PIN_PRG0_PRU0_GPO13, - ( PIN_MODE(1) | PIN_INPUT_ENABLE | PIN_PULL_DISABLE ) - }, - /* SD7_D, - PRG0_PRU0_GPI15, SD7_D, T5, J2D:P12 */ - { - PIN_PRG0_PRU0_GPO15, - ( PIN_MODE(1) | PIN_INPUT_ENABLE | PIN_PULL_DISABLE ) - }, - /* SD8_D, - PRG0_PRU0_GPI17, SD8_D, U1, J2B:P8 */ - { - PIN_PRG0_PRU0_GPO17, - ( PIN_MODE(1) | PIN_INPUT_ENABLE | PIN_PULL_DISABLE ) - }, - - /* PWM0_TZ_OUT, - PRG0_PWM0_TZ_OUT, TZ_OUT, R3, J2C:P6 */ - { - PIN_PRG0_PRU0_GPO19, - ( PIN_MODE(3) | PIN_PULL_DISABLE ) - }, - /* PWM1_TZ_OUT, - PRG0_PWM1_TZ_OUT, TZ_OUT, R3, J2C:P6 J8.76 */ - { - PIN_PRG0_PRU1_GPO19, - ( PIN_MODE(3) | PIN_PULL_DISABLE ) - }, - /* PWM2_TZ_OUT, - PRG0_PWM2_TZ_OUT, TZ_OUT, R3, J2C:P6 J6.57 */ - { - PIN_PRG0_PRU1_GPO8, - ( PIN_MODE(3) | PIN_PULL_DISABLE ) - }, - - - {PINMUX_END, PINMUX_END} -}; - -/* Configure SOC pads */ -void cfgPad(void) -{ - Pinmux_config(gPinMuxMainDomainCfgsdfm, PINMUX_DOMAIN_ID_MAIN); -} diff --git a/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/cfg_pad.h b/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/cfg_pad.h deleted file mode 100644 index 31acbcc..0000000 --- a/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/cfg_pad.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2023 Texas Instruments Incorporated - http://www.ti.com/ - * - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Texas Instruments Incorporated nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _CFG_PAD_H_ -#define _CFG_PAD_H_ - -/* Configure SOC pads. - Normally handled via Pinmux_init(), - but currently no way to pads for ICSSG from Sysconfig. */ -void cfgPad(void); - -#endif /* _CFG_PAD_H_ */ diff --git a/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/sdfm.c b/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/sdfm.c index cdd2956..9a2ccdc 100644 --- a/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/sdfm.c +++ b/examples/current_sense/icss_sdfm_nine_channel_load_share_mode/sdfm.c @@ -255,8 +255,8 @@ int32_t initSdfmFw(uint8_t pruId, SdfmPrms *pSdfmPrms, sdfm_handle *pHSdfm, PRUI if( pSdfmPrms->loadShare ) { if(pSdfmPrms->pruInsId == PRUICSS_PRU0) - { - SDFM_enableLoadShareMode(hSdfm, pSdfmPrms->icssgSliceId); + { + SDFM_enableLoadShareMode(hSdfm, pSdfmPrms->icssgSliceId); } switch (pSdfmPrms->pruInsId) @@ -346,7 +346,7 @@ int32_t initSdfmFw(uint8_t pruId, SdfmPrms *pSdfmPrms, sdfm_handle *pHSdfm, PRUI } /*enabling Zero cross only for first channel of axis*/ - if(pSdfmPrms->en_zc && SDFM_CH == 0) + if(pSdfmPrms->en_zc && SDFM_CH == 2) { SDFM_enableZeroCrossDetection(hSdfm, SDFM_CH, pSdfmPrms->zcThr[SDFM_CH]); } diff --git a/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/.project/project_am243x.js b/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/.project/project_am243x.js index 7407249..22bf3ca 100644 --- a/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/.project/project_am243x.js +++ b/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/.project/project_am243x.js @@ -9,7 +9,6 @@ const files = { "epwm_drv_aux.c", "epwm_mod.c", "sdfm.c", - "cfg_pad.c", "main.c", ], }; diff --git a/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-evm/r5fss0-0_freertos/example.syscfg b/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-evm/r5fss0-0_freertos/example.syscfg index 9596e0a..3e05d5a 100644 --- a/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-evm/r5fss0-0_freertos/example.syscfg +++ b/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-evm/r5fss0-0_freertos/example.syscfg @@ -8,6 +8,8 @@ /** * Import the modules used in this configuration. */ +const sdfm = scripting.addModule("/current_sense/sdfm", {}, false); +const sdfm1 = sdfm.addInstance(); const epwm = scripting.addModule("/drivers/epwm/epwm", {}, false); const epwm1 = epwm.addInstance(); const gpio = scripting.addModule("/drivers/gpio/gpio", {}, false); @@ -25,10 +27,14 @@ const mpu_armv73 = mpu_armv7.addInstance(); const mpu_armv74 = mpu_armv7.addInstance(); const mpu_armv75 = mpu_armv7.addInstance(); const mpu_armv76 = mpu_armv7.addInstance(); +const pwm = scripting.addModule("/pru_icssg/pwm", {}, false); +const pwm1 = pwm.addInstance(); /** * Write custom configuration values to the imported modules. */ +sdfm1.$name = "CONFIG_SDFM0"; + epwm1.$name = "CONFIG_EPWM0"; epwm1.EPWM.$assign = "EHRPWM0"; epwm1.EPWM.A.$assign = "GPMC0_AD3"; @@ -60,10 +66,14 @@ gpio4.useMcuDomainPeripherals = true; gpio4.$name = "GPIO_ZC_TH_CH2"; gpio4.MCU_GPIO.gpioPin.$assign = "MCU_SPI1_D1"; -pruicss1.$name = "CONFIG_PRU_ICSS0"; -pruicss1.coreClk = 300000000; -pruicss1.iepClk = 300000000; -pruicss1.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO0"; +pruicss1.$name = "CONFIG_PRU_ICSS0"; +pruicss1.coreClk = 300000000; +pruicss1.iepClk = 300000000; +sdfm1.pru = pruicss1; +pruicss1.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO0"; +pruicss1.AdditionalICSSSettings[0].PruEcapIO.create(1); +pruicss1.AdditionalICSSSettings[0].PruEcapIO[0].$name = "CONFIG_PRU_ICSS_ECAP_IO0"; +pruicss1.AdditionalICSSSettings[0].PruEcapIO[0].PRU_ICSSG0_ECAP.IN_APWM_OUT.$used = true; debug_log.enableUartLog = true; debug_log.uartLog.$name = "CONFIG_UART_CONSOLE"; @@ -98,12 +108,24 @@ mpu_armv76.$name = "CONFIG_MPU_REGION5"; mpu_armv76.baseAddr = 0x80000000; mpu_armv76.size = 31; +pwm1.$name = "CONFIG_PRU_ICSS_PWM0"; +pwm1.PRU_ICSSG0_PWM.TZ_OUT.$used = true; + /** * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future * version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to * re-solve from scratch. */ -gpio3.MCU_GPIO.$suggestSolution = "MCU_GPIO0"; -gpio4.MCU_GPIO.$suggestSolution = "MCU_GPIO0"; -debug_log.uartLog.UART.RXD.$suggestSolution = "UART0_RXD"; -debug_log.uartLog.UART.TXD.$suggestSolution = "UART0_TXD"; +sdfm1.PRU_ICSSG0_PRU.$suggestSolution = "PRU_ICSSG0_PRU0"; +sdfm1.PRU_ICSSG0_PRU.GPI16.$suggestSolution = "PRG0_PRU0_GPO16"; +sdfm1.PRU_ICSSG0_PRU.GPI1.$suggestSolution = "PRG0_PRU0_GPO1"; +sdfm1.PRU_ICSSG0_PRU.GPI3.$suggestSolution = "PRG0_PRU0_GPO3"; +sdfm1.PRU_ICSSG0_PRU.GPI5.$suggestSolution = "PRG0_PRU0_GPO5"; +gpio3.MCU_GPIO.$suggestSolution = "MCU_GPIO0"; +gpio4.MCU_GPIO.$suggestSolution = "MCU_GPIO0"; +pruicss1.AdditionalICSSSettings[0].PruEcapIO[0].PRU_ICSSG0_ECAP.$suggestSolution = "PRU_ICSSG0_ECAP0"; +pruicss1.AdditionalICSSSettings[0].PruEcapIO[0].PRU_ICSSG0_ECAP.IN_APWM_OUT.$suggestSolution = "PRG0_PRU1_GPO15"; +debug_log.uartLog.UART.RXD.$suggestSolution = "UART0_RXD"; +debug_log.uartLog.UART.TXD.$suggestSolution = "UART0_TXD"; +pwm1.PRU_ICSSG0_PWM.$suggestSolution = "PRU_ICSSG0_PWM0"; +pwm1.PRU_ICSSG0_PWM.TZ_OUT.$suggestSolution = "PRG0_PRU0_GPO19"; diff --git a/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-evm/r5fss0-0_freertos/ti-arm-clang/example.projectspec b/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-evm/r5fss0-0_freertos/ti-arm-clang/example.projectspec index e3da0a2..f9af6d7 100644 --- a/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-evm/r5fss0-0_freertos/ti-arm-clang/example.projectspec +++ b/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-evm/r5fss0-0_freertos/ti-arm-clang/example.projectspec @@ -110,8 +110,6 @@ - - diff --git a/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-evm/r5fss0-0_freertos/ti-arm-clang/makefile b/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-evm/r5fss0-0_freertos/ti-arm-clang/makefile index ae13861..6c73814 100644 --- a/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-evm/r5fss0-0_freertos/ti-arm-clang/makefile +++ b/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-evm/r5fss0-0_freertos/ti-arm-clang/makefile @@ -43,7 +43,6 @@ FILES_common := \ epwm_drv_aux.c \ epwm_mod.c \ sdfm.c \ - cfg_pad.c \ main.c \ ti_drivers_config.c \ ti_drivers_open_close.c \ diff --git a/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-lp/r5fss0-0_freertos/example.syscfg b/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-lp/r5fss0-0_freertos/example.syscfg index 20a22f7..dc22fa5 100644 --- a/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-lp/r5fss0-0_freertos/example.syscfg +++ b/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-lp/r5fss0-0_freertos/example.syscfg @@ -8,6 +8,8 @@ /** * Import the modules used in this configuration. */ +const sdfm = scripting.addModule("/current_sense/sdfm", {}, false); +const sdfm1 = sdfm.addInstance(); const epwm = scripting.addModule("/drivers/epwm/epwm", {}, false); const epwm1 = epwm.addInstance(); const epwm2 = epwm.addInstance(); @@ -25,10 +27,14 @@ const mpu_armv72 = mpu_armv7.addInstance(); const mpu_armv73 = mpu_armv7.addInstance(); const mpu_armv74 = mpu_armv7.addInstance(); const mpu_armv75 = mpu_armv7.addInstance(); +const pwm = scripting.addModule("/pru_icssg/pwm", {}, false); +const pwm1 = pwm.addInstance(); /** * Write custom configuration values to the imported modules. */ +sdfm1.$name = "CONFIG_SDFM0"; + epwm1.$name = "CONFIG_EPWM0"; epwm1.EPWM.$assign = "EHRPWM0"; epwm1.EPWM.SYNCI.$used = false; @@ -51,19 +57,22 @@ gpio2.GPIO.gpioPin.$assign = "PRG1_PRU0_GPO18"; gpio3.pinDir = "OUTPUT"; gpio3.$name = "GPIO_ZC_TH_CH1"; -gpio3.GPIO.$assign = "GPIO0"; gpio3.GPIO.gpioPin.rx = false; -gpio3.GPIO.gpioPin.$assign = "PRG1_PRU0_GPO17"; +gpio3.GPIO.gpioPin.$assign = "PRG0_PRU1_GPO2"; gpio4.pinDir = "OUTPUT"; gpio4.$name = "GPIO_ZC_TH_CH2"; gpio4.GPIO.gpioPin.rx = false; gpio4.GPIO.gpioPin.$assign = "PRG0_PRU1_GPO1"; -pruicss1.$name = "CONFIG_PRU_ICSS0"; -pruicss1.coreClk = 300000000; -pruicss1.iepClk = 300000000; -pruicss1.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO0"; +pruicss1.$name = "CONFIG_PRU_ICSS0"; +pruicss1.coreClk = 300000000; +pruicss1.iepClk = 300000000; +sdfm1.pru = pruicss1; +pruicss1.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO0"; +pruicss1.AdditionalICSSSettings[0].PruEcapIO.create(1); +pruicss1.AdditionalICSSSettings[0].PruEcapIO[0].$name = "CONFIG_PRU_ICSS_ECAP_IO0"; +pruicss1.AdditionalICSSSettings[0].PruEcapIO[0].PRU_ICSSG0_ECAP.IN_APWM_OUT.$used = true; debug_log.enableUartLog = true; debug_log.uartLog.$name = "CONFIG_UART_CONSOLE"; @@ -94,18 +103,31 @@ mpu_armv75.baseAddr = 0x60000000; mpu_armv75.size = 28; mpu_armv75.accessPermissions = "Supervisor RD, User RD"; +pwm1.$name = "CONFIG_PRU_ICSS_PWM0"; +pwm1.PRU_ICSSG0_PWM.$assign = "PRU_ICSSG0_PWM0"; +pwm1.PRU_ICSSG0_PWM.TZ_OUT.$used = true; + /** * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future * version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to * re-solve from scratch. */ -epwm1.EPWM.A.$suggestSolution = "GPMC0_AD3"; -epwm1.EPWM.B.$suggestSolution = "GPMC0_AD4"; -epwm1.EPWM.SYNCO.$suggestSolution = "GPMC0_AD1"; -epwm2.EPWM.$suggestSolution = "EHRPWM1"; -epwm2.EPWM.A.$suggestSolution = "GPMC0_AD5"; -epwm2.EPWM.B.$suggestSolution = "GPMC0_AD6"; -gpio1.MCU_GPIO.$suggestSolution = "MCU_GPIO0"; -gpio4.GPIO.$suggestSolution = "GPIO1"; -debug_log.uartLog.UART.RXD.$suggestSolution = "UART0_RXD"; -debug_log.uartLog.UART.TXD.$suggestSolution = "UART0_TXD"; +sdfm1.PRU_ICSSG0_PRU.$suggestSolution = "PRU_ICSSG0_PRU0"; +sdfm1.PRU_ICSSG0_PRU.GPI16.$suggestSolution = "PRG0_PRU0_GPO16"; +sdfm1.PRU_ICSSG0_PRU.GPI1.$suggestSolution = "PRG0_PRU0_GPO1"; +sdfm1.PRU_ICSSG0_PRU.GPI3.$suggestSolution = "PRG0_PRU0_GPO3"; +sdfm1.PRU_ICSSG0_PRU.GPI5.$suggestSolution = "PRG0_PRU0_GPO5"; +epwm1.EPWM.A.$suggestSolution = "GPMC0_AD3"; +epwm1.EPWM.B.$suggestSolution = "GPMC0_AD4"; +epwm1.EPWM.SYNCO.$suggestSolution = "GPMC0_AD1"; +epwm2.EPWM.$suggestSolution = "EHRPWM1"; +epwm2.EPWM.A.$suggestSolution = "GPMC0_AD5"; +epwm2.EPWM.B.$suggestSolution = "GPMC0_AD6"; +gpio1.MCU_GPIO.$suggestSolution = "MCU_GPIO0"; +gpio3.GPIO.$suggestSolution = "GPIO1"; +gpio4.GPIO.$suggestSolution = "GPIO1"; +pruicss1.AdditionalICSSSettings[0].PruEcapIO[0].PRU_ICSSG0_ECAP.$suggestSolution = "PRU_ICSSG0_ECAP0"; +pruicss1.AdditionalICSSSettings[0].PruEcapIO[0].PRU_ICSSG0_ECAP.IN_APWM_OUT.$suggestSolution = "PRG0_PRU1_GPO15"; +debug_log.uartLog.UART.RXD.$suggestSolution = "UART0_RXD"; +debug_log.uartLog.UART.TXD.$suggestSolution = "UART0_TXD"; +pwm1.PRU_ICSSG0_PWM.TZ_OUT.$suggestSolution = "PRG0_PRU0_GPO19"; diff --git a/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec b/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec index c62c545..1dae0dd 100644 --- a/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec +++ b/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec @@ -110,8 +110,6 @@ - - diff --git a/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-lp/r5fss0-0_freertos/ti-arm-clang/makefile b/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-lp/r5fss0-0_freertos/ti-arm-clang/makefile index cec8d40..f1a3b42 100644 --- a/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-lp/r5fss0-0_freertos/ti-arm-clang/makefile +++ b/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/am243x-lp/r5fss0-0_freertos/ti-arm-clang/makefile @@ -43,7 +43,6 @@ FILES_common := \ epwm_drv_aux.c \ epwm_mod.c \ sdfm.c \ - cfg_pad.c \ main.c \ ti_drivers_config.c \ ti_drivers_open_close.c \ diff --git a/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/app_sdfm.c b/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/app_sdfm.c index 5403f76..de81527 100644 --- a/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/app_sdfm.c +++ b/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/app_sdfm.c @@ -40,7 +40,6 @@ #include "ti_board_open_close.h" #include "epwm_dc.h" -#include "cfg_pad.h" #include "sdfm.h" /*EPWM1 configuration for sigma delta clock generation: */ @@ -334,16 +333,8 @@ void sdfm_main(void *args) */ init_pwm(); DebugP_log("EPWM Configured!\r\n"); - /* - * Configure SDFM - */ - - /* Configure SOC pads for SDFM. - Normally handled via Pinmux_init(), - but currently no way to pads for ICSSG from Sysconfig. */ - cfgPad(); - - /* Configure SDFM */ + + /* Configure SDFM */ init_sdfm(); DebugP_log("SDFM Configured!\r\n"); diff --git a/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/cfg_pad.c b/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/cfg_pad.c deleted file mode 100644 index 88a0389..0000000 --- a/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/cfg_pad.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2023 Texas Instruments Incorporated - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - * Neither the name of Texas Instruments Incorporated nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include "cfg_pad.h" - -static Pinmux_PerCfg_t gPinMuxMainDomainCfgsdfm[] = { - - /* PRG0_ECAP0_IN_APWM_OUT, - PRG0_PRU1_GPO15, PRG0_ECAP0_IN_APWM_OUT, U5, J2.C11 */ - { - PIN_PRG0_PRU1_GPO15, - ( PIN_MODE(10) | PIN_PULL_DISABLE ) - }, - /* SD8_CLK, - PRG0_PRU0_GPI16, SD8_CLK, U4, J2E:P9 */ - { - PIN_PRG0_PRU0_GPO16, - ( PIN_MODE(1) | PIN_INPUT_ENABLE | PIN_PULL_DISABLE ) - }, - /* SD0_D, - PRG0_PRU0_GPI1, SD0_D, R4, J2E:P8 */ - { - PIN_PRG0_PRU0_GPO1, - ( PIN_MODE(1) | PIN_INPUT_ENABLE | PIN_PULL_DISABLE ) - }, - /* SD1_D, - PRG0_PRU0_GPI3, SD1_D, V2, J2A:P9 */ - { - PIN_PRG0_PRU0_GPO3, - ( PIN_MODE(1) | PIN_INPUT_ENABLE | PIN_PULL_DISABLE ) - }, - /* SD2_D, - PRG0_PRU0_GPI5, SD2_D, R3, J2C:P6 */ - { - PIN_PRG0_PRU0_GPO5, - ( PIN_MODE(1) | PIN_INPUT_ENABLE | PIN_PULL_DISABLE ) - }, - - /* PWM0_TZ_OUT, - PRG0_PWM0_TZ_OUT, TZ_OUT, R3, J2C:P6 */ - { - PIN_PRG0_PRU0_GPO19, - ( PIN_MODE(3) | PIN_PULL_DISABLE ) - }, - - {PINMUX_END, PINMUX_END} -}; - -/* Configure SOC pads */ -void cfgPad(void) -{ - Pinmux_config(gPinMuxMainDomainCfgsdfm, PINMUX_DOMAIN_ID_MAIN); -} diff --git a/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/cfg_pad.h b/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/cfg_pad.h deleted file mode 100644 index 31acbcc..0000000 --- a/examples/current_sense/icss_sdfm_three_channel_single_pru_mode/cfg_pad.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2023 Texas Instruments Incorporated - http://www.ti.com/ - * - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Texas Instruments Incorporated nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _CFG_PAD_H_ -#define _CFG_PAD_H_ - -/* Configure SOC pads. - Normally handled via Pinmux_init(), - but currently no way to pads for ICSSG from Sysconfig. */ -void cfgPad(void); - -#endif /* _CFG_PAD_H_ */ diff --git a/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/.project/project_am243x.js b/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/.project/project_am243x.js index eefc1f3..7d3ddc9 100644 --- a/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/.project/project_am243x.js +++ b/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/.project/project_am243x.js @@ -9,7 +9,6 @@ const files = { "epwm_drv_aux.c", "epwm_mod.c", "sdfm.c", - "cfg_pad.c", "main.c", "mclk_iep0_sync.c", ], diff --git a/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-evm/r5fss0-0_freertos/example.syscfg b/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-evm/r5fss0-0_freertos/example.syscfg index d49fdcd..1a220ea 100644 --- a/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-evm/r5fss0-0_freertos/example.syscfg +++ b/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-evm/r5fss0-0_freertos/example.syscfg @@ -8,6 +8,8 @@ /** * Import the modules used in this configuration. */ +const sdfm = scripting.addModule("/current_sense/sdfm", {}, false); +const sdfm1 = sdfm.addInstance(); const epwm = scripting.addModule("/drivers/epwm/epwm", {}, false); const epwm1 = epwm.addInstance(); const gpio = scripting.addModule("/drivers/gpio/gpio", {}, false); @@ -26,10 +28,14 @@ const mpu_armv73 = mpu_armv7.addInstance(); const mpu_armv74 = mpu_armv7.addInstance(); const mpu_armv75 = mpu_armv7.addInstance(); const mpu_armv76 = mpu_armv7.addInstance(); +const pwm = scripting.addModule("/pru_icssg/pwm", {}, false); +const pwm1 = pwm.addInstance(); /** * Write custom configuration values to the imported modules. */ +sdfm1.$name = "CONFIG_SDFM0"; + epwm1.$name = "CONFIG_EPWM0"; epwm1.EPWM.$assign = "EHRPWM0"; epwm1.EPWM.A.$assign = "GPMC0_AD3"; @@ -61,16 +67,27 @@ gpio4.useMcuDomainPeripherals = true; gpio4.$name = "GPIO_ZC_TH_CH2"; gpio4.MCU_GPIO.gpioPin.$assign = "MCU_SPI1_D1"; -pruicss1.$name = "CONFIG_PRU_ICSS0"; -pruicss1.coreClk = 300000000; -pruicss1.iepClk = 300000000; -pruicss1.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO0"; +pruicss1.$name = "CONFIG_PRU_ICSS0"; +pruicss1.coreClk = 300000000; +pruicss1.iepClk = 300000000; +sdfm1.pru = pruicss1; +pruicss1.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO0"; +pruicss1.AdditionalICSSSettings[0].PruEcapIO.create(1); +pruicss1.AdditionalICSSSettings[0].PruEcapIO[0].$name = "CONFIG_PRU_ICSS_ECAP_IO0"; +pruicss1.AdditionalICSSSettings[0].PruEcapIO[0].PRU_ICSSG0_ECAP.$assign = "PRU_ICSSG0_ECAP0"; +pruicss1.AdditionalICSSSettings[0].PruEcapIO[0].PRU_ICSSG0_ECAP.IN_APWM_OUT.$used = true; -pruicss2.$name = "CONFIG_PRU_ICSS1"; -pruicss2.instance = "ICSSG1"; -pruicss2.coreClk = 300000000; -pruicss2.iepClk = 300000000; -pruicss2.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO1"; +pruicss2.$name = "CONFIG_PRU_ICSS1"; +pruicss2.instance = "ICSSG1"; +pruicss2.coreClk = 300000000; +pruicss2.iepClk = 300000000; +pruicss2.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO1"; +pruicss2.AdditionalICSSSettings[0].PruIepIO.create(1); +pruicss2.AdditionalICSSSettings[0].PruIepIO[0].$name = "CONFIG_PRU_ICSS_IEP_IO0"; +pruicss2.AdditionalICSSSettings[0].PruIepIO[0].instance = "ICSSG1"; +pruicss2.AdditionalICSSSettings[0].PruIepIO[0].PRU_ICSSG1_IEP.$assign = "PRU_ICSSG1_IEP0"; +pruicss2.AdditionalICSSSettings[0].PruIepIO[0].PRU_ICSSG1_IEP.EDC_SYNC_OUT0.$used = true; +pruicss2.AdditionalICSSSettings[0].PruIepIO[0].PRU_ICSSG1_IEP.EDC_SYNC_OUT1.$used = true; debug_log.enableUartLog = true; debug_log.uartLog.$name = "CONFIG_UART_CONSOLE"; @@ -105,12 +122,25 @@ mpu_armv76.$name = "CONFIG_MPU_REGION5"; mpu_armv76.baseAddr = 0x80000000; mpu_armv76.size = 31; +pwm1.$name = "CONFIG_PRU_ICSS_PWM0"; +pwm1.PRU_ICSSG0_PWM.$assign = "PRU_ICSSG0_PWM0"; +pwm1.PRU_ICSSG0_PWM.TZ_OUT.$assign = "PRG0_PRU0_GPO19"; +pwm1.PRU_ICSSG0_PWM.TZ_OUT.$used = true; + /** * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future * version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to * re-solve from scratch. */ -gpio3.MCU_GPIO.$suggestSolution = "MCU_GPIO0"; -gpio4.MCU_GPIO.$suggestSolution = "MCU_GPIO0"; -debug_log.uartLog.UART.RXD.$suggestSolution = "UART0_RXD"; -debug_log.uartLog.UART.TXD.$suggestSolution = "UART0_TXD"; +sdfm1.PRU_ICSSG0_PRU.$suggestSolution = "PRU_ICSSG0_PRU1"; +sdfm1.PRU_ICSSG0_PRU.GPI16.$suggestSolution = "PRG0_PRU1_GPO16"; +sdfm1.PRU_ICSSG0_PRU.GPI1.$suggestSolution = "PRG0_PRU1_GPO1"; +sdfm1.PRU_ICSSG0_PRU.GPI3.$suggestSolution = "PRG0_PRU1_GPO3"; +sdfm1.PRU_ICSSG0_PRU.GPI5.$suggestSolution = "PRG0_PRU1_GPO5"; +gpio3.MCU_GPIO.$suggestSolution = "MCU_GPIO0"; +gpio4.MCU_GPIO.$suggestSolution = "MCU_GPIO0"; +pruicss1.AdditionalICSSSettings[0].PruEcapIO[0].PRU_ICSSG0_ECAP.IN_APWM_OUT.$suggestSolution = "PRG0_PRU1_GPO15"; +pruicss2.AdditionalICSSSettings[0].PruIepIO[0].PRU_ICSSG1_IEP.EDC_SYNC_OUT0.$suggestSolution = "PRG1_PRU0_GPO19"; +pruicss2.AdditionalICSSSettings[0].PruIepIO[0].PRU_ICSSG1_IEP.EDC_SYNC_OUT1.$suggestSolution = "PRG1_PRU0_GPO17"; +debug_log.uartLog.UART.RXD.$suggestSolution = "UART0_RXD"; +debug_log.uartLog.UART.TXD.$suggestSolution = "UART0_TXD"; diff --git a/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-evm/r5fss0-0_freertos/ti-arm-clang/example.projectspec b/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-evm/r5fss0-0_freertos/ti-arm-clang/example.projectspec index 877e6aa..7366586 100644 --- a/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-evm/r5fss0-0_freertos/ti-arm-clang/example.projectspec +++ b/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-evm/r5fss0-0_freertos/ti-arm-clang/example.projectspec @@ -110,8 +110,6 @@ - - diff --git a/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-evm/r5fss0-0_freertos/ti-arm-clang/makefile b/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-evm/r5fss0-0_freertos/ti-arm-clang/makefile index 295671f..626527a 100644 --- a/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-evm/r5fss0-0_freertos/ti-arm-clang/makefile +++ b/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-evm/r5fss0-0_freertos/ti-arm-clang/makefile @@ -43,7 +43,6 @@ FILES_common := \ epwm_drv_aux.c \ epwm_mod.c \ sdfm.c \ - cfg_pad.c \ main.c \ mclk_iep0_sync.c \ ti_drivers_config.c \ diff --git a/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-lp/r5fss0-0_freertos/example.syscfg b/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-lp/r5fss0-0_freertos/example.syscfg index a8c4c1d..67d09b7 100644 --- a/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-lp/r5fss0-0_freertos/example.syscfg +++ b/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-lp/r5fss0-0_freertos/example.syscfg @@ -8,6 +8,8 @@ /** * Import the modules used in this configuration. */ +const sdfm = scripting.addModule("/current_sense/sdfm", {}, false); +const sdfm1 = sdfm.addInstance(); const epwm = scripting.addModule("/drivers/epwm/epwm", {}, false); const epwm1 = epwm.addInstance(); const epwm2 = epwm.addInstance(); @@ -26,10 +28,15 @@ const mpu_armv72 = mpu_armv7.addInstance(); const mpu_armv73 = mpu_armv7.addInstance(); const mpu_armv74 = mpu_armv7.addInstance(); const mpu_armv75 = mpu_armv7.addInstance(); +const pwm = scripting.addModule("/pru_icssg/pwm", {}, false); +const pwm1 = pwm.addInstance(); /** * Write custom configuration values to the imported modules. */ +sdfm1.$name = "CONFIG_SDFM0"; +sdfm1.PRU_ICSSG0_PRU.$assign = "PRU_ICSSG0_PRU0"; + epwm1.$name = "CONFIG_EPWM0"; epwm1.EPWM.$assign = "EHRPWM0"; epwm1.EPWM.SYNCI.$used = false; @@ -52,25 +59,37 @@ gpio2.GPIO.gpioPin.$assign = "PRG1_PRU0_GPO18"; gpio3.pinDir = "OUTPUT"; gpio3.$name = "GPIO_ZC_TH_CH1"; -gpio3.GPIO.$assign = "GPIO0"; gpio3.GPIO.gpioPin.rx = false; -gpio3.GPIO.gpioPin.$assign = "PRG1_PRU0_GPO17"; +gpio3.GPIO.gpioPin.$assign = "PRG0_PRU1_GPO2"; gpio4.pinDir = "OUTPUT"; gpio4.$name = "GPIO_ZC_TH_CH2"; gpio4.GPIO.gpioPin.rx = false; gpio4.GPIO.gpioPin.$assign = "PRG0_PRU1_GPO1"; -pruicss1.$name = "CONFIG_PRU_ICSS0"; -pruicss1.coreClk = 300000000; -pruicss1.iepClk = 300000000; -pruicss1.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO0"; +pruicss1.$name = "CONFIG_PRU_ICSS0"; +pruicss1.coreClk = 300000000; +pruicss1.iepClk = 300000000; +sdfm1.pru = pruicss1; +pruicss1.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO0"; +pruicss1.AdditionalICSSSettings[0].PruEcapIO.create(1); +pruicss1.AdditionalICSSSettings[0].PruEcapIO[0].$name = "CONFIG_PRU_ICSS_ECAP_IO0"; +pruicss1.AdditionalICSSSettings[0].PruEcapIO[0].PRU_ICSSG0_ECAP.$assign = "PRU_ICSSG0_ECAP0"; +pruicss1.AdditionalICSSSettings[0].PruEcapIO[0].PRU_ICSSG0_ECAP.IN_APWM_OUT.$used = true; -pruicss2.$name = "CONFIG_PRU_ICSS1"; -pruicss2.instance = "ICSSG1"; -pruicss2.coreClk = 300000000; -pruicss2.iepClk = 300000000; -pruicss2.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO1"; +pruicss2.$name = "CONFIG_PRU_ICSS1"; +pruicss2.instance = "ICSSG1"; +pruicss2.coreClk = 300000000; +pruicss2.iepClk = 300000000; +pruicss2.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO1"; +pruicss2.AdditionalICSSSettings[0].PruIepIO.create(1); +pruicss2.AdditionalICSSSettings[0].PruIepIO[0].$name = "CONFIG_PRU_ICSS_IEP_IO0"; +pruicss2.AdditionalICSSSettings[0].PruIepIO[0].instance = "ICSSG1"; +pruicss2.AdditionalICSSSettings[0].PruIepIO[0].PRU_ICSSG1_IEP.$assign = "PRU_ICSSG1_IEP0"; +pruicss2.AdditionalICSSSettings[0].PruIepIO[0].PRU_ICSSG1_IEP.EDC_SYNC_OUT0.$assign = "PRG1_PRU0_GPO19"; +pruicss2.AdditionalICSSSettings[0].PruIepIO[0].PRU_ICSSG1_IEP.EDC_SYNC_OUT0.$used = true; +pruicss2.AdditionalICSSSettings[0].PruIepIO[0].PRU_ICSSG1_IEP.EDC_SYNC_OUT1.$assign = "PRG1_PRU0_GPO17"; +pruicss2.AdditionalICSSSettings[0].PruIepIO[0].PRU_ICSSG1_IEP.EDC_SYNC_OUT1.$used = true; debug_log.enableUartLog = true; debug_log.uartLog.$name = "CONFIG_UART_CONSOLE"; @@ -101,18 +120,29 @@ mpu_armv75.baseAddr = 0x60000000; mpu_armv75.size = 28; mpu_armv75.accessPermissions = "Supervisor RD, User RD"; +pwm1.$name = "CONFIG_PRU_ICSS_PWM0"; +pwm1.PRU_ICSSG0_PWM.$assign = "PRU_ICSSG0_PWM0"; +pwm1.PRU_ICSSG0_PWM.TZ_OUT.$used = true; + /** * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future * version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to * re-solve from scratch. */ -epwm1.EPWM.A.$suggestSolution = "GPMC0_AD3"; -epwm1.EPWM.B.$suggestSolution = "GPMC0_AD4"; -epwm1.EPWM.SYNCO.$suggestSolution = "GPMC0_AD1"; -epwm2.EPWM.$suggestSolution = "EHRPWM1"; -epwm2.EPWM.A.$suggestSolution = "GPMC0_AD5"; -epwm2.EPWM.B.$suggestSolution = "GPMC0_AD6"; -gpio1.MCU_GPIO.$suggestSolution = "MCU_GPIO0"; -gpio4.GPIO.$suggestSolution = "GPIO1"; -debug_log.uartLog.UART.RXD.$suggestSolution = "UART0_RXD"; -debug_log.uartLog.UART.TXD.$suggestSolution = "UART0_TXD"; +sdfm1.PRU_ICSSG0_PRU.GPI16.$suggestSolution = "PRG0_PRU0_GPO16"; +sdfm1.PRU_ICSSG0_PRU.GPI1.$suggestSolution = "PRG0_PRU0_GPO1"; +sdfm1.PRU_ICSSG0_PRU.GPI3.$suggestSolution = "PRG0_PRU0_GPO3"; +sdfm1.PRU_ICSSG0_PRU.GPI5.$suggestSolution = "PRG0_PRU0_GPO5"; +epwm1.EPWM.A.$suggestSolution = "GPMC0_AD3"; +epwm1.EPWM.B.$suggestSolution = "GPMC0_AD4"; +epwm1.EPWM.SYNCO.$suggestSolution = "GPMC0_AD1"; +epwm2.EPWM.$suggestSolution = "EHRPWM1"; +epwm2.EPWM.A.$suggestSolution = "GPMC0_AD5"; +epwm2.EPWM.B.$suggestSolution = "GPMC0_AD6"; +gpio1.MCU_GPIO.$suggestSolution = "MCU_GPIO0"; +gpio3.GPIO.$suggestSolution = "GPIO1"; +gpio4.GPIO.$suggestSolution = "GPIO1"; +pruicss1.AdditionalICSSSettings[0].PruEcapIO[0].PRU_ICSSG0_ECAP.IN_APWM_OUT.$suggestSolution = "PRG0_PRU1_GPO15"; +debug_log.uartLog.UART.RXD.$suggestSolution = "UART0_RXD"; +debug_log.uartLog.UART.TXD.$suggestSolution = "UART0_TXD"; +pwm1.PRU_ICSSG0_PWM.TZ_OUT.$suggestSolution = "PRG0_PRU0_GPO19"; diff --git a/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec b/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec index aa37ae1..96ea882 100644 --- a/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec +++ b/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-lp/r5fss0-0_freertos/ti-arm-clang/example.projectspec @@ -110,8 +110,6 @@ - - diff --git a/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-lp/r5fss0-0_freertos/ti-arm-clang/makefile b/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-lp/r5fss0-0_freertos/ti-arm-clang/makefile index 987b32a..79d3669 100644 --- a/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-lp/r5fss0-0_freertos/ti-arm-clang/makefile +++ b/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/am243x-lp/r5fss0-0_freertos/ti-arm-clang/makefile @@ -43,7 +43,6 @@ FILES_common := \ epwm_drv_aux.c \ epwm_mod.c \ sdfm.c \ - cfg_pad.c \ main.c \ mclk_iep0_sync.c \ ti_drivers_config.c \ diff --git a/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/app_sdfm.c b/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/app_sdfm.c index 2be6faa..8a5f977 100644 --- a/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/app_sdfm.c +++ b/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/app_sdfm.c @@ -40,7 +40,6 @@ #include "ti_board_open_close.h" #include "epwm_dc.h" -#include "cfg_pad.h" #include "sdfm.h" #include "mclk_iep0_sync.h" @@ -337,15 +336,7 @@ void sdfm_main(void *args) */ init_pwm(); DebugP_log("EPWM Configured!\r\n"); - /* - * Configure SDFM - */ - - /* Configure SOC pads for SDFM. - Normally handled via Pinmux_init(), - but currently no way to pads for ICSSG from Sysconfig. */ - cfgPad(); - + /*Configure IEP for SD clock when phase delay calculaton is enabled*/ if(gTestSdfmPrms.phase_delay) { diff --git a/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/cfg_pad.c b/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/cfg_pad.c deleted file mode 100644 index dd43c6b..0000000 --- a/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/cfg_pad.c +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (C) 2023 Texas Instruments Incorporated - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - * Neither the name of Texas Instruments Incorporated nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include "cfg_pad.h" - -static Pinmux_PerCfg_t gPinMuxMainDomainCfgsdfm[] = { - - /* PRG0_ECAP0_IN_APWM_OUT, - PRG0_PRU1_GPO15, PRG0_ECAP0_IN_APWM_OUT, U5, J2.C11 */ - { - PIN_PRG0_PRU1_GPO15, - ( PIN_MODE(10) | PIN_PULL_DISABLE ) - }, - /* SD8_CLK, - PRG0_PRU0_GPI16, SD8_CLK, U4, J2E:P9 */ - { - PIN_PRG0_PRU0_GPO16, - ( PIN_MODE(1) | PIN_INPUT_ENABLE | PIN_PULL_DISABLE ) - }, - /* SD0_D, - PRG0_PRU0_GPI1, SD0_D, R4, J2E:P8 */ - { - PIN_PRG0_PRU0_GPO1, - ( PIN_MODE(1) | PIN_INPUT_ENABLE | PIN_PULL_DISABLE ) - }, - /* SD1_D, - PRG0_PRU0_GPI3, SD1_D, V2, J2A:P9 */ - { - PIN_PRG0_PRU0_GPO3, - ( PIN_MODE(1) | PIN_INPUT_ENABLE | PIN_PULL_DISABLE ) - }, - /* SD2_D, - PRG0_PRU0_GPI5, SD2_D, R3, J2C:P6 */ - { - PIN_PRG0_PRU0_GPO5, - ( PIN_MODE(1) | PIN_INPUT_ENABLE | PIN_PULL_DISABLE ) - }, - /* ICSSG1_IEP0_SYNC_OUT0, - PRG1_IEP0_EDC_SYNC_OUT0, SYNC_OUT0, R3, J7.63 */ - { - PIN_PRG1_PRU0_GPO19, - ( PIN_MODE(2) | PIN_PULL_DISABLE ) - }, - /* ICSSG1_IEP0_SYNC_OUT1, - PRG1_IEP0_EDC_SYNC_OUT0, SYNC_OUT1, R3, J7.65 */ - { - PIN_PRG1_PRU0_GPO17, - ( PIN_MODE(2) | PIN_PULL_DISABLE ) - }, - - /* PWM0_TZ_OUT, - PRG0_PWM0_TZ_OUT, TZ_OUT, R3, J2C:P6 */ - { - PIN_PRG0_PRU0_GPO19, - ( PIN_MODE(3) | PIN_PULL_DISABLE ) - }, - - {PINMUX_END, PINMUX_END} -}; - -/* Configure SOC pads */ -void cfgPad(void) -{ - Pinmux_config(gPinMuxMainDomainCfgsdfm, PINMUX_DOMAIN_ID_MAIN); -} diff --git a/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/cfg_pad.h b/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/cfg_pad.h deleted file mode 100644 index 31acbcc..0000000 --- a/examples/current_sense/icss_sdfm_three_channel_with_phase_compensation/cfg_pad.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2023 Texas Instruments Incorporated - http://www.ti.com/ - * - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the - * distribution. - * - * * Neither the name of Texas Instruments Incorporated nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _CFG_PAD_H_ -#define _CFG_PAD_H_ - -/* Configure SOC pads. - Normally handled via Pinmux_init(), - but currently no way to pads for ICSSG from Sysconfig. */ -void cfgPad(void); - -#endif /* _CFG_PAD_H_ */