2024-12-30 11:50:48 +08:00
|
|
|
/***
|
|
|
|
* @Author: mbw
|
|
|
|
* @Date: 2024-10-09 08:42:14
|
|
|
|
* @LastEditors: mbw && 1600520629@qq.com
|
2025-01-17 10:41:37 +08:00
|
|
|
* @LastEditTime: 2025-01-17 10:38:49
|
|
|
|
* @FilePath: \JT-DT-YD4N02A_RTT_MRS-NT26K\bsp\inc\bsp_beep.h
|
2024-12-30 11:50:48 +08:00
|
|
|
* @Description:
|
|
|
|
* @
|
|
|
|
* @Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
|
|
|
|
*/
|
|
|
|
#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(D, 2)
|
|
|
|
|
|
|
|
#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; \
|
2025-01-17 10:41:37 +08:00
|
|
|
BEEP_CTRL("200,200", -1); \
|
|
|
|
BEEP_START; \
|
2024-12-30 11:50:48 +08:00
|
|
|
} while (0U)
|
2025-01-17 10:41:37 +08:00
|
|
|
// #define BEEP_ALARM \
|
|
|
|
// do \
|
|
|
|
// { \
|
|
|
|
// BEEP_STOP; \
|
|
|
|
// BEEP_ON; \
|
|
|
|
// } while (0U)
|
2024-12-30 11:50:48 +08:00
|
|
|
// 3s
|
|
|
|
#define BEEP_SELF_CHECK \
|
|
|
|
do \
|
|
|
|
{ \
|
|
|
|
BEEP_CTRL("500,500", 1); \
|
|
|
|
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__
|