/*!
 * @file        main.c
 *
 * @brief       Main program body
 *
 * @version     V1.0.2
 *
 * @date        2023-03-31
 *
 * @attention
 *
 *  Copyright (C) 2023 Geehy Semiconductor
 *
 *  You may not use this file except in compliance with the
 *  GEEHY COPYRIGHT NOTICE (GEEHY SOFTWARE PACKAGE LICENSE).
 *
 *  The program is only for reference, which is distributed in the hope
 *  that it will be useful and instructional for customers to develop
 *  their software. Unless required by applicable law or agreed to in
 *  writing, the program is distributed on an "AS IS" BASIS, WITHOUT
 *  ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the GEEHY SOFTWARE PACKAGE LICENSE for the governing permissions
 *  and limitations under the License.
 */

/* Includes */
#include "main.h"

/** @addtogroup Examples
  @{
*/

/** @addtogroup GPIO_Toggle
  @{
*/

/** @defgroup GPIO_Toggle_Macros Macros
  @{
*/

/*!
 * @brief       Main program
 *
 * @param       None
 *
 * @retval      None
 */
int main(void)
{
    GPIO_Config_T gpioConfig;

    /* LED2 GPIO configuration */
    gpioConfig.mode = GPIO_MODE_OUT_OD;
    gpioConfig.pin = GPIO_PIN_5;
    gpioConfig.speed = GPIO_SPEED_10MHz;
    GPIO_Config(GPIOB, &gpioConfig);

    /* LED3 GPIO configuration */
    gpioConfig.pin = GPIO_PIN_4;
    GPIO_Config(GPIOB, &gpioConfig);

    /* Turn LED2 on */
    GPIO_ClearBit(GPIOB, GPIO_PIN_5);
    /* Turn LED3 off */
    GPIO_SetBit(GPIOB, GPIO_PIN_4);

    APM_DelayInit(APM_DELAY_MS);

    while(1)
    {
        /* Toggle LED2 */
        GPIO_Toggle(GPIOB, GPIO_PIN_5);
        /* Toggle LED3 */
        GPIO_Toggle(GPIOB, GPIO_PIN_4);
        APM_Delay(500);
    }
}

/**@} end of group GPIO_Toggle_Functions */
/**@} end of group GPIO_Toggle */
/**@} end of group Examples */
