Skip to content

Commit

Permalink
Refs #1856. Refactored GPIO pin configuration.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@1101 5dc33758-31d5-4daf-9ae8-b24bf3d40d73
  • Loading branch information
feaser committed Oct 25, 2023
1 parent 4bf1c8a commit 8321fc6
Show file tree
Hide file tree
Showing 7 changed files with 572 additions and 539 deletions.
36 changes: 19 additions & 17 deletions Target/Demo/TRICORE_TC3_TC375_Lite_Kit_ADS/Boot/App/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@
static void Init(void);


/****************************************************************************************
* External data declarations
****************************************************************************************/
#if (BOOT_COM_RS232_ENABLE > 0)
extern IfxAsclin_Rx_In * rs232RxPin;
extern IfxAsclin_Tx_Out * rs232TxPin;
#endif
#if (BOOT_COM_CAN_ENABLE > 0)
extern IfxCan_Rxd_In * canRxPin;
extern IfxCan_Txd_Out * canTxPin;
#endif


/************************************************************************************//**
** \brief Initializes the bootloader application. Should be called once during
** software program initialization.
Expand Down Expand Up @@ -82,30 +95,19 @@ static void Init(void)
/* Configure the pushbutton GPIO pin P00.7. */
IfxPort_setPinMode(&MODULE_P00, 7U, IfxPort_Mode_inputPullUp);
#if (BOOT_COM_RS232_ENABLE > 0)
/* Enable the ASCLIN0 module. */
IfxAsclin_enableModule(&MODULE_ASCLIN0);
/* Disable the clock before configuring the GPIO pins. */
IfxAsclin_setClockSource(&MODULE_ASCLIN0, IfxAsclin_ClockSource_noClock);
/* Configure the ASCLIN0 GPIO pins P14.1 Rx and P14.0 Tx. */
IfxAsclin_initRxPin(&IfxAsclin0_RXA_P14_1_IN, IfxPort_InputMode_pullUp,
IfxPort_PadDriver_cmosAutomotiveSpeed1);
IfxAsclin_initTxPin(&IfxAsclin0_TX_P14_0_OUT, IfxPort_OutputMode_pushPull,
IfxPort_PadDriver_cmosAutomotiveSpeed1);
/* Configure ASCLIN0 GPIO pins P14.0 Tx and P14.1 Rx (node 0). */
rs232RxPin = &IfxAsclin0_RXA_P14_1_IN;
rs232TxPin = &IfxAsclin0_TX_P14_0_OUT;
#endif
#if (BOOT_COM_CAN_ENABLE > 0)
/* Configure the STBY GPIO pin P20.6 as a digital output. */
IfxPort_setPinModeOutput(&MODULE_P20, 6U, IfxPort_OutputMode_pushPull,
IfxPort_OutputIdx_general);
/* Switch the CAN transceiver to normal mode by setting the STBY GPIO pin logic low. */
IfxPort_setPinLow(&MODULE_P20, 6U);
/* Enable the MODULE_CAN0 module. */
IfxCan_enableModule(&MODULE_CAN0);
/* Configure MCMCAN0 GPIO pins P20.8 Tx and P20.7 Rx (node 0). */
IfxCan_Node_initTxPin(&IfxCan_TXD00_P20_8_OUT, IfxPort_OutputMode_pushPull,
IfxPort_PadDriver_cmosAutomotiveSpeed1);
IfxCan_Node_initRxPin(&MODULE_CAN0.N[IfxCan_NodeId_0], &IfxCan_RXD00B_P20_7_IN,
IfxPort_InputMode_pullUp,
IfxPort_PadDriver_cmosAutomotiveSpeed1);
/* Configure MultiCAN GPIO pins P20.8 Tx and P20.7 Rx (node 0). */
canRxPin = &IfxCan_RXD00B_P20_7_IN;
canTxPin = &IfxCan_TXD00_P20_8_OUT;
#endif
} /*** end of Init ***/

Expand Down
697 changes: 351 additions & 346 deletions Target/Demo/TRICORE_TC3_TC375_Lite_Kit_ADS/Boot/Debug/openblt_tc375.srec

Large diffs are not rendered by default.

21 changes: 0 additions & 21 deletions Target/Demo/TRICORE_TC3_TC375_Lite_Kit_ADS/Prog/App/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@
const unsigned long bltChecksumSignature = 0x55AA11EE;


/****************************************************************************************
* Function prototypes
****************************************************************************************/
static void Init(void);


/************************************************************************************//**
** \brief Initializes the user program application. Should be called once during
** software program initialization.
Expand All @@ -56,8 +50,6 @@ static void Init(void);
****************************************************************************************/
void AppInit(void)
{
/* Initialize the microcontroller. */
Init();
/* Initialize the timer driver. */
TimerInit();
/* Initialize the led driver. */
Expand All @@ -82,17 +74,4 @@ void AppTask(void)
} /*** end of AppTask ***/


/************************************************************************************//**
** \brief Initializes the microcontroller.
** \return none.
**
****************************************************************************************/
static void Init(void)
{
/* Configure the LED GPIO pin P00.5. */
IfxPort_setPinModeOutput(&MODULE_P00, 5U, IfxPort_OutputMode_pushPull,
IfxPort_OutputIdx_general);
} /*** end of Init ***/


/*********************************** end of app.c **************************************/
3 changes: 3 additions & 0 deletions Target/Demo/TRICORE_TC3_TC375_Lite_Kit_ADS/Prog/App/led.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
****************************************************************************************/
void LedInit(void)
{
/* configure the LED GPIO pin P00.5. */
IfxPort_setPinModeOutput(&MODULE_P00, 5U, IfxPort_OutputMode_pushPull,
IfxPort_OutputIdx_general);
/* make sure the LED is turned off by default. Note that it is low active */
IfxPort_setPinHigh(&MODULE_P00, 5U);
} /*** end of LedInit ***/
Expand Down
Loading

0 comments on commit 8321fc6

Please sign in to comment.