示例#1
0
/* Configure GPIO pins to be used as LED and push button */
static void configure_gpios()
{
	/* Get the corresponding pin numbers using the board specific calls */
	/* also configures the gpio accordingly for LED */
	led_1 = board_led_1();
	led_2 = board_led_2();
	button_1 = board_button_1();
	button_2 = board_button_2();

    push_button_set_cb((input_gpio_cfg_t){button_1, GPIO_ACTIVE_LOW}, pushbutton_cb, 0, 0, 0);
    push_button_set_cb((input_gpio_cfg_t){button_2, GPIO_ACTIVE_LOW}, pushbutton_cb, 0, 0, 0);
}
示例#2
0
// TO override the pin start mode in mc200_startup.c, so that LED are off at startup
void SetPinStartMode(void)
{
    GPIO_PinModeConfig(board_led_1().gpio, PINMODE_PULLUP);
    GPIO_PinModeConfig(board_led_2().gpio, PINMODE_PULLUP);
}