This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C123GH6PGE: How to reconfigure a pin at run time?

Part Number: TM4C123GH6PGE

Hi,

I have two sources for the timer4 CCP0 signal. So I like to switch between these two channels.

At the TI HAL the function

GPIOPinConfigure

exists. I don't see any

GPIOPinConfigureReset or similar function.

This lead me to the general question: How to reset the pin config?

As example I print my config

// WT4CCP0 PH6
fan2_tacho: fan2_tacho {
	port = <&gpio_H>;
	pin = <6>;
	map = <0x00071807>;
	dirmode = "HW";
	strength = "2MA";
	type = "STD";
};

// T4CCP0 PG0
fan6_tacho: fan6_tacho {
	port = <&gpio_G>;
	pin = <0>;
	map = <0x00060007>;
	dirmode = "HW";
	strength = "2MA";
	type = "STD";
};

its at devicetree config for my pin controller for the Zephyr RTOS

I would guess its enough to call the GPIOPadConfigSet function and set the pin dir mode from HW to IN

  • Hello Stefan,

    So basically by reset you want to remove the configuration made?

    In general the single API call that handles DirMode and Strength and Type is GPIOPinTypeTimer in your case (since this is for T4CCP0).

    We don't really have a 'reset' or a 'default' function in TivaWare so what you could do is make your own function like 'GPIOPinReset' and then simple do whatever you want for these two APIs

        //
        // Make the pin(s) be peripheral controlled.
        //
        GPIODirModeSet(ui32Port, ui8Pins, GPIO_DIR_MODE_IN);
    
        //
        // Set the pad(s) for standard push-pull operation.
        //
        GPIOPadConfigSet(ui32Port, ui8Pins, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);

    Best Regards,

    Ralph Jacobi