am64x/am243x: SDFM: remove pinmux files

-Add sdfm pins in syscfg

Fixes: PINDSW-7139

Signed-off-by: Achala Ram <a-ram@ti.com>
This commit is contained in:
Achala Ram 2023-12-21 22:59:25 +05:30
parent e751569925
commit 403d244a53
31 changed files with 273 additions and 566 deletions

View File

@ -9,7 +9,6 @@ const files = {
"epwm_drv_aux.c",
"epwm_mod.c",
"sdfm.c",
"cfg_pad.c",
"main.c",
],
};

View File

@ -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";

View File

@ -110,8 +110,6 @@
</file>
<file path="../../../sdfm.c" openOnCreation="false" excludeFromBuild="false" action="copy">
</file>
<file path="../../../cfg_pad.c" openOnCreation="false" excludeFromBuild="false" action="copy">
</file>
<file path="../main.c" openOnCreation="false" excludeFromBuild="false" action="copy">
</file>
<file path="linker.cmd" openOnCreation="false" excludeFromBuild="false" action="copy">

View File

@ -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 \

View File

@ -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,9 +65,8 @@ 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";
@ -63,7 +76,12 @@ gpio4.GPIO.gpioPin.$assign = "PRG0_PRU1_GPO1";
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,11 +112,35 @@ 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.
*/
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";
@ -106,6 +148,10 @@ 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";

View File

@ -110,8 +110,6 @@
</file>
<file path="../../../sdfm.c" openOnCreation="false" excludeFromBuild="false" action="copy">
</file>
<file path="../../../cfg_pad.c" openOnCreation="false" excludeFromBuild="false" action="copy">
</file>
<file path="../main.c" openOnCreation="false" excludeFromBuild="false" action="copy">
</file>
<file path="linker.cmd" openOnCreation="false" excludeFromBuild="false" action="copy">

View File

@ -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 \

View File

@ -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,14 +396,6 @@ 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 */
init_sdfm();

View File

@ -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 <drivers/pinmux.h>
#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);
}

View File

@ -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_ */

View File

@ -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]);
}

View File

@ -9,7 +9,6 @@ const files = {
"epwm_drv_aux.c",
"epwm_mod.c",
"sdfm.c",
"cfg_pad.c",
"main.c",
],
};

View File

@ -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";
@ -63,7 +69,11 @@ 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";
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.
*/
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";

View File

@ -110,8 +110,6 @@
</file>
<file path="../../../sdfm.c" openOnCreation="false" excludeFromBuild="false" action="copy">
</file>
<file path="../../../cfg_pad.c" openOnCreation="false" excludeFromBuild="false" action="copy">
</file>
<file path="../main.c" openOnCreation="false" excludeFromBuild="false" action="copy">
</file>
<file path="linker.cmd" openOnCreation="false" excludeFromBuild="false" action="copy">

View File

@ -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 \

View File

@ -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,9 +57,8 @@ 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";
@ -63,7 +68,11 @@ gpio4.GPIO.gpioPin.$assign = "PRG0_PRU1_GPO1";
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,11 +103,20 @@ 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.
*/
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";
@ -106,6 +124,10 @@ 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";

View File

@ -110,8 +110,6 @@
</file>
<file path="../../../sdfm.c" openOnCreation="false" excludeFromBuild="false" action="copy">
</file>
<file path="../../../cfg_pad.c" openOnCreation="false" excludeFromBuild="false" action="copy">
</file>
<file path="../main.c" openOnCreation="false" excludeFromBuild="false" action="copy">
</file>
<file path="linker.cmd" openOnCreation="false" excludeFromBuild="false" action="copy">

View File

@ -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 \

View File

@ -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,14 +333,6 @@ 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 */
init_sdfm();

View File

@ -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 <drivers/pinmux.h>
#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);
}

View File

@ -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_ */

View File

@ -9,7 +9,6 @@ const files = {
"epwm_drv_aux.c",
"epwm_mod.c",
"sdfm.c",
"cfg_pad.c",
"main.c",
"mclk_iep0_sync.c",
],

View File

@ -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";
@ -64,13 +70,24 @@ 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";
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.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.
*/
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";

View File

@ -110,8 +110,6 @@
</file>
<file path="../../../sdfm.c" openOnCreation="false" excludeFromBuild="false" action="copy">
</file>
<file path="../../../cfg_pad.c" openOnCreation="false" excludeFromBuild="false" action="copy">
</file>
<file path="../main.c" openOnCreation="false" excludeFromBuild="false" action="copy">
</file>
<file path="../../../mclk_iep0_sync.c" openOnCreation="false" excludeFromBuild="false" action="copy">

View File

@ -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 \

View File

@ -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,9 +59,8 @@ 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";
@ -64,13 +70,26 @@ gpio4.GPIO.gpioPin.$assign = "PRG0_PRU1_GPO1";
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.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,11 +120,19 @@ 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.
*/
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";
@ -113,6 +140,9 @@ 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";

View File

@ -110,8 +110,6 @@
</file>
<file path="../../../sdfm.c" openOnCreation="false" excludeFromBuild="false" action="copy">
</file>
<file path="../../../cfg_pad.c" openOnCreation="false" excludeFromBuild="false" action="copy">
</file>
<file path="../main.c" openOnCreation="false" excludeFromBuild="false" action="copy">
</file>
<file path="../../../mclk_iep0_sync.c" openOnCreation="false" excludeFromBuild="false" action="copy">

View File

@ -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 \

View File

@ -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,14 +336,6 @@ 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)

View File

@ -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 <drivers/pinmux.h>
#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);
}

View File

@ -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_ */