13.8.1.1.2 Code
Copy-paste the following setup code to your user application:
Add to user application initialization (typically the start of main()):void
configure_port_pins(
void
)
{
struct
port_config config_port_pin;
port_get_config_defaults(&config_port_pin);
config_port_pin.direction = PORT_PIN_DIR_INPUT;
config_port_pin.input_pull = PORT_PIN_PULL_UP;
port_pin_set_config(BUTTON_0_PIN, &config_port_pin);
config_port_pin.direction = PORT_PIN_DIR_OUTPUT;
port_pin_set_config(LED_0_PIN, &config_port_pin);
}
configure_port_pins();