beep_demo.h 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2021 Talkweb Co., Ltd.
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. #ifndef _BEEP_DEMO_H
  16. #define _BEEP_DEMO_H
  17. #include "iot_gpio.h"
  18. #include "iot_pwm.h"
  19. struct BEEPCTRLATTR{
  20. unsigned int times; //响的次数
  21. float duty; //每次响的占空比
  22. unsigned int period; //每响一次的时间周期
  23. unsigned int callTime; //控制函数的调用周期
  24. };
  25. void BeepInit(void);
  26. void BeepStart(void);
  27. void BeepStop(void);
  28. void BeepCtrl(struct BEEPCTRLATTR* ctrlAttr);
  29. #endif