Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize some pins to VDDIOH on MAX78002EVKIT, MSDK-927 #406

Merged
merged 3 commits into from
Feb 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Libraries/Boards/MAX78002/EvKit_V1/Source/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ const mxc_gpio_cfg_t led_pin[] = {
};
const unsigned int num_leds = (sizeof(led_pin) / sizeof(mxc_gpio_cfg_t));

// The following pins are pulled up to 3V3 via external resistors on the AI87 EVKIT,
// and therefore must be initialized to VDDIOH to prevent current injection into VDDIO/VDDA
// in standby, backup, and powerdown modes.
const uint32_t _port0_vddioh_mask = MXC_GPIO_PIN_0;
const uint32_t _port1_vddioh_mask = (MXC_GPIO_PIN_10 | MXC_GPIO_PIN_11 | MXC_GPIO_PIN_12 |
MXC_GPIO_PIN_13 | MXC_GPIO_PIN_14 | MXC_GPIO_PIN_16);
const uint32_t _port2_vddioh_mask = MXC_GPIO_PIN_2;

// TFT Data/Command pin
const mxc_gpio_cfg_t tft_dc_pin = { TFT_DC_PORT, TFT_DC_PIN, MXC_GPIO_FUNC_OUT, MXC_GPIO_PAD_NONE,
MXC_GPIO_VSSEL_VDDIOH };
Expand Down Expand Up @@ -292,6 +300,12 @@ int Board_Init(void)
MXC_SYS_ClockEnable(MXC_SYS_PERIPH_CLOCK_GPIO1);
MXC_SYS_ClockEnable(MXC_SYS_PERIPH_CLOCK_GPIO2);

// Set VSSEL to VDDIOH for any pins that are pulled
// up to 3V3 on the EVKIT.
MXC_GPIO_SetVSSEL(MXC_GPIO0, MXC_GPIO_VSSEL_VDDIOH, _port0_vddioh_mask);
MXC_GPIO_SetVSSEL(MXC_GPIO1, MXC_GPIO_VSSEL_VDDIOH, _port1_vddioh_mask);
MXC_GPIO_SetVSSEL(MXC_GPIO2, MXC_GPIO_VSSEL_VDDIOH, _port2_vddioh_mask);

if ((err = Console_Init()) < E_NO_ERROR) {
return err;
}
Expand Down