2025-08-10 23:18:29 +08:00

21 lines
463 B
C

#include "led.h"
void led_init(void) {
rcu_periph_clock_enable(LED_RCU);
gpio_mode_set(LED_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, LED_PIN);
gpio_output_options_set(LED_PORT, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, LED_PIN);
gpio_bit_reset(LED_PORT, LED_PIN);
}
void led_on(void) {
gpio_bit_set(LED_PORT, LED_PIN);
}
void led_off(void) {
gpio_bit_reset(LED_PORT, LED_PIN);
}
void led_toggle(void) {
gpio_bit_toggle(LED_PORT, LED_PIN);
}