#ifndef __BSP_BEEP__ #define __BSP_BEEP__ #include "board.h" #include "drv_gpio.h" #include "agile_led.h" #define TEST_BSP_BEEP extern agile_led_t *beep; // #define BEEP_PIN GET_PIN(A, 7) #define BEEP_PIN GET_PIN(C, 8) #define BEEP_ON agile_led_on(beep) #define BEEP_OFF agile_led_off(beep) #define BEEP_START agile_led_start(beep) #define BEEP_STOP \ do \ { \ BEEP_OFF; \ agile_led_stop(beep); \ } while (0U) #define BEEP_CTRL(light_mode, loop_cnt) \ do \ { \ agile_led_dynamic_change_light_mode(beep, light_mode, loop_cnt); \ } while (0U) /************************预设的一些鸣叫模式**************/ #define BEEP_PREAT_OK \ do \ { \ BEEP_CTRL("400,10", 1); \ BEEP_START; \ } while (0U) // 5s一次 #define BEEP_FAULT \ do \ { \ BEEP_CTRL("200,4800", -1); \ BEEP_START; \ } while (0U) #define BEEP_ALARM \ do \ { \ BEEP_STOP; \ BEEP_CTRL("200,200", -1); \ BEEP_START; \ } while (0U) // 3s #define BEEP_SELF_CHECK \ do \ { \ BEEP_CTRL("500,500", 3); \ BEEP_START; \ } while (0U) // 寿命到期 20s一次 #define BEEP_END_OF_LIFE \ do \ { \ BEEP_CTRL("200,19800", -1); \ BEEP_START; \ } while (0U) int BSP_BEEP_Init(void); #endif // !__BSP_BEEP__