完成LED、RS485、IIC初始化部分代码。

This commit is contained in:
2024-12-03 20:04:03 +08:00
parent 2d7e6fb6e4
commit 828721759d
8 changed files with 227 additions and 4 deletions

View File

@@ -35,6 +35,7 @@ OF SUCH DAMAGE.
#include "gd32e23x_it.h"
#include "main.h"
#include "systick.h"
#include "LDC1612.h"
/*!
\brief this function handles NMI exception
@@ -116,4 +117,27 @@ void TIMER13_IRQHandler(void)
}
led_status = !led_status;
}
}
/**
* @brief This function handles TIMER5 interrupt request.
* @param[in] none
* @param[out] none
* @retval None
*/
void TIMER16_IRQHandler(void) {
if (timer_interrupt_flag_get(LED_TIMER, TIMER_INT_FLAG_UP) == SET)
{
timer_interrupt_flag_clear(LED_TIMER, TIMER_INT_FLAG_UP);
static uint8_t led_status = 0;
if (led_status)
{
gpio_bit_write(LED_PORT, LED_PIN, RESET);
timer_autoreload_value_config(LED_TIMER, 19200);
} else {
gpio_bit_write(LED_PORT, LED_PIN, SET);
timer_autoreload_value_config(LED_TIMER, 800);
}
led_status = !led_status;
}
}