/* * Copyright (C) 2014-2017 Infineon Technologies AG. All rights reserved. * * Infineon Technologies AG (Infineon) is supplying this software for use with * Infineon's microcontrollers. * This file can be freely distributed within development tools that are * supporting such microcontrollers. * * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. * INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, * OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. * */ /** * @file * @date 02 Feb, 2017 * @version 1.0.0 * * @brief XMC4200 Application kit GPIO toggle example * * GPIO toggle example flashes the leds of the board with a periodic rate. * LED1 is connected to P2.1 * * History
* * Version 1.0.0 Initial
* */ #include #define TICKS_PER_SECOND 1000 #define TICKS_WAIT 500 #define LED1 P2_1 void SysTick_Handler(void) { static uint32_t ticks = 0; ticks++; if (ticks == TICKS_WAIT) { XMC_GPIO_ToggleOutput(LED1); ticks = 0; } } int main(void) { XMC_GPIO_CONFIG_t config; config.mode = XMC_GPIO_MODE_OUTPUT_PUSH_PULL; config.output_level = XMC_GPIO_OUTPUT_LEVEL_HIGH; config.output_strength = XMC_GPIO_OUTPUT_STRENGTH_MEDIUM; XMC_GPIO_Init(LED1, &config); /* System timer configuration */ SysTick_Config(SystemCoreClock / TICKS_PER_SECOND); while(1) { /* Infinite loop */ } }