Exemplo n.º 1
0
static Status tml_Reset(void) {
	GPIO_ClearPinsOutput(NXPNCI_VEN_GPIO, 1U << NXPNCI_VEN_PIN);
	Sleep(10);
	GPIO_SetPinsOutput(NXPNCI_VEN_GPIO, 1U << NXPNCI_VEN_PIN);
	Sleep(10);
	return SUCCESS;
}
Exemplo n.º 2
0
void vTimerCallback(TimerHandle_t xTimer) {
  if (xSemaphoreTake(semLED, 0 /*portMAX_DELAY*/)==pdPASS) { /* block on semaphore */
    led++;
    if (led==3) { /* wrap */
      led = 0;
    }
    /* clear all LEDs */
    GPIO_SetPinsOutput(GPIOA, 1<<1u);
    GPIO_SetPinsOutput(GPIOA, 1<<2u);
    GPIO_SetPinsOutput(GPIOD, 1<<5u);
  }
  if (led==0) { /* red */
    GPIO_TogglePinsOutput(GPIOA, 1<<1u); /* toggle RED LED */
  } else if (led==1) { /* green */
    GPIO_TogglePinsOutput(GPIOA, 1<<2u); /* toggle GREEN LED */
  } else if (led==2) { /* blue */
    GPIO_TogglePinsOutput(GPIOD, 1<<5u); /* toggle BLUE LED */
  }
}
Exemplo n.º 3
0
int main(void) {
    BOARD_InitPins();
    BOARD_BootClockRUN();
    BOARD_InitDebugConsole();

    GPIO_PinInit(BOARD_LED_RED_GPIO, BOARD_LED_RED_GPIO_PIN, \
        &(gpio_pin_config_t){kGPIO_DigitalOutput, 0u});
    GPIO_PinInit(BOARD_LED_GREEN_GPIO, BOARD_LED_GREEN_GPIO_PIN, \
        &(gpio_pin_config_t){kGPIO_DigitalOutput, 0u});
    GPIO_PinInit(BOARD_LED_BLUE_GPIO, BOARD_LED_BLUE_GPIO_PIN, \
        &(gpio_pin_config_t){kGPIO_DigitalOutput, 0u});

    GPIO_SetPinsOutput(BOARD_LED_RED_GPIO, 1u << BOARD_LED_RED_GPIO_PIN);
    GPIO_SetPinsOutput(BOARD_LED_GREEN_GPIO, 1u << BOARD_LED_GREEN_GPIO_PIN);
    GPIO_SetPinsOutput(BOARD_LED_BLUE_GPIO, 1u << BOARD_LED_BLUE_GPIO_PIN);

    for(;;) {
        GPIO_TogglePinsOutput(BOARD_LED_BLUE_GPIO, 1u << BOARD_LED_BLUE_GPIO_PIN);
        delay();
    }
}