AnsweredAssumed Answered

K82: full gpio pin configuration

Question asked by Eugene Hiihtaja on Apr 26, 2019
Latest reply on Apr 26, 2019 by Sebastian Delrio

Hello !

 

I would like to configure gpio pin as normal gigital output with default state 0.

 

Config tool generate :

 

gpio_pin_config_t SWITCH_EN_config = {
.pinDirection = kGPIO_DigitalOutput,
.outputLogic = 0U
};
/* Initialize GPIO functionality on pin .../
GPIO_PinInit(BOARD_SWITCH_EN_GPIO, BOARD_SWITCH_EN_PIN, &SWITCH_EN_config);

 

PORT_SetPinMux(BOARD_SWITCH_EN_PORT, BOARD_SWITCH_EN_PIN, kPORT_MuxAsGpio);


But default exact pin config is missing and in theory it should looks like this :


const port_pin_config_t pin_config = {
/* No pull setup for this pin */
.pullSelect = kPORT_PullDisable,
/* Fast slew rate is configured */
.slewRate = kPORT_FastSlewRate,
/* Passive filter is disabled */
.passiveFilterEnable = kPORT_PassiveFilterDisable,
/* Open drain is enabled */
.openDrainEnable = kPORT_OpenDrainDisable,
/* Low drive strength is configured */
.driveStrength = kPORT_LowDriveStrength,
/* Pin is configured as GPIO */
.mux = kPORT_MuxAsGpio,
/* Pin Control Register fields [15:0] are not locked */
.lockRegister = kPORT_UnlockRegister};
PORT_SetPinConfig(PORTC, BOARD_SWITCH_EN_PIN, &pin_config);

 

All of those constants have value 0.

 

Can I assume that PORT_SetPinConfig() call is no need if values have default state e.g 0 ?

 

Regards,

Eugene

 

Outcomes