Skip to content

Commit

Permalink
LPC5xx: Connect HW_VERS6 and HW_VERS7 to reset functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
mathias-arm committed Apr 22, 2021
1 parent 76271c1 commit 6c1d916
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions source/hic_hal/nxp/lpc55xx/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,18 @@ void gpio_init(void)

// Configure pins.
IOCON->PIO[PIN_PIO_PORT][LED_CONNECTED] = IOCON_FUNC0 | IOCON_DIGITAL_EN;
IOCON->PIO[PIN_PIO_PORT][PIN_HW_VERS_6] = IOCON_FUNC0 | IOCON_MODE_PULLUP | IOCON_DIGITAL_EN | IOCON_OPENDRAIN_EN;
IOCON->PIO[PIN_PIO_PORT][PIN_HW_VERS_7] = IOCON_FUNC0 | IOCON_MODE_PULLUP | IOCON_DIGITAL_EN | IOCON_OPENDRAIN_EN;

// Turn off LED.
GPIO->B[PIN_PIO_PORT][LED_CONNECTED] = 1;
// Set LED to output.
GPIO->DIRSET[PIN_PIO_PORT] = LED_CONNECTED_MASK;
// Turn on LED.
GPIO->B[PIN_PIO_PORT][LED_CONNECTED] = 1;

GPIO->DIRCLR[PIN_PIO_PORT] = PIN_HW_VERS_6_MASK;
GPIO->DIRCLR[PIN_PIO_PORT] = PIN_HW_VERS_7_MASK;
}

void gpio_set_board_power(bool powerEnabled)
Expand All @@ -84,10 +89,10 @@ void gpio_set_msc_led(gpio_led_state_t state)

uint8_t gpio_get_reset_btn_no_fwrd(void)
{
return 0;
return GPIO->B[PIN_PIO_PORT][PIN_HW_VERS_6] ? 0 : 1;
}

uint8_t gpio_get_reset_btn_fwrd(void)
{
return 0;
return GPIO->B[PIN_PIO_PORT][PIN_HW_VERS_7] ? 0 : 1;
}

0 comments on commit 6c1d916

Please sign in to comment.