49 lines
1.2 KiB
C
49 lines
1.2 KiB
C
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <assert.h>
|
|
#include <math.h>
|
|
#include <stdint.h>
|
|
|
|
#include "gd32e23x.h"
|
|
#include "systick.h"
|
|
|
|
#include "chirp_smartsonic.h"
|
|
#include "soniclib.h"
|
|
#include "chirp_bsp.h"
|
|
|
|
#include "board_init.h"
|
|
#include "chirp_board_config.h"
|
|
|
|
#include "app_config.h"
|
|
|
|
|
|
void sensor_led_on(void) {
|
|
gpio_bit_reset(CHIRP_PIN_LED_PORT, CHIRP_PIN_LED_PIN); // PB1 = Lo LED = On
|
|
}
|
|
|
|
void sensor_led_off(void) {
|
|
gpio_bit_set(CHIRP_PIN_LED_PORT, CHIRP_PIN_LED_PIN); // PB1 = Hi LED = Off
|
|
}
|
|
|
|
void sensor_led_toggle(void)
|
|
{
|
|
gpio_bit_toggle(CHIRP_PIN_LED_PORT, CHIRP_PIN_LED_PIN);
|
|
}
|
|
|
|
/*!
|
|
\brief Indicate Board Alive
|
|
\param[in] none
|
|
\param[out] none
|
|
\retval none
|
|
\note LED Heart Beat
|
|
*/
|
|
void indicate_alive(void){
|
|
gpio_bit_reset(CHIRP_PIN_LED_PORT, CHIRP_PIN_LED_PIN); // PB1 = Lo LED = On
|
|
delay_ms(100);
|
|
gpio_bit_set(CHIRP_PIN_LED_PORT, CHIRP_PIN_LED_PIN); // PB1 = Hi LED = Off
|
|
delay_ms(100);
|
|
gpio_bit_reset(CHIRP_PIN_LED_PORT, CHIRP_PIN_LED_PIN); // PB1 = Lo LED = On
|
|
delay_ms(100);
|
|
gpio_bit_set(CHIRP_PIN_LED_PORT, CHIRP_PIN_LED_PIN); // PB1 = Hi LED = Off
|
|
delay_ms(300);
|
|
} |