Hi Dialog,
we are using a custom board with DA14585 and the SDK 6.0.10 . we want to add a buzzer and control it through a service. We have added the service but we want continuous beeps and not a musical note. We saw the timer0_pwm example and implemented by taking it as a reference. we are using the extended sleep mode. Can you please tell me how can i configure it so that i can hear continuous beep sounds ?
设备:

Hi blebot,
Let me ask you some questions in under to understand deeper which your requirements are and what would you like to accomplish.
谢谢,PM_Dialog
Hi,
谢谢回复。
1. Yes, exactly.
2. In the timer0_pwm example, as you said the timer0_pwm_test_expiration_counter decrements everytime and when it goes to zero the timer_0 will be stopped but i don't want it to stop unless i give the command to stop.i want the buzzer to make continuous beep sounds until i stop. Is there a way to do that ? and also there is a musical note in the example but i don't want to play notes just a simple beep sounds .
3.Can i make the timer block not powered down when the device enters sleep mode? if yes, How ?
谢谢,
Blebot.
Hi blebot,
Please check the ble_app_peripheral example of the SDK and focus on user_catch_rest_hndl() callback function which handles the messages that are not handled by the SDK internal mechanisms. Suppose that you have a writable characteristic in order to send the START/STOP command. In the ble_app_peripheral example, when writing to the “Control Point” characteristic, you will get a SVC1_IDX_CONTROL_POINT_VAL and the user_svc1_ctrl_wr_ind_handler() will be fired up which is the control point write indication handler. The “Control Point” characteristic has 1-byte length. The same you should implement for your case: START: 0x01 – STOP: 0x00 for example. The value that is written to the characteristic is stored into ¶m->value[0], so you should copy it to the “val”.
关于Timer0_PWM示例,正如我之前提到的那样,每次生成中断时,触发PWM0_USER_CALLBACH_FUNCTION()。Notes存储在Notes []数组中。在您案例中,您应该发现哪个是蜂鸣声的适当波形,并相应地修改回调。关于你的最后一个问题,这是不可能的。如果您发现任何答案有用,请将其标记为“已接受”。
谢谢,PM_Dialog
Hi Dialog,
Thanks for the reply . we know how to write and handle a 'control point' characteristic.
Is there a way we can workout the functionality in sleep mode ?
谢谢,
Blebot
Hi blebot,
As it is already mentioned, as soon as the device goes into sleep, all the peripheral blocks are powered down.
谢谢,PM_Dialog
Hi,
Thanks . Can i make the buzzer sound whenever the device gets out of sleep and and shut it off when the device enters sleep mode ?
问候,
BLEBOT..
Hi blebot,
通常,该设备在广告和连接间隔之间进入睡眠。在睡眠前的销的状态,保留但不是PIN的配置或功能。当设备唤醒即将调用PeripH_Init()函数时,以便在每个唤醒中重新配置引脚,引脚返回其默认应用程序状态。因此,如果任何GPIO在睡眠前高,它会在睡眠期间保持高,并且将通过PERIPH_INIT()函数唤醒重新配置。您是否希望在SDK的BLE_APP_SLEEPMODE示例中实现永久睡眠?
谢谢,PM_Dialog
Hi,
Yes , we are using permanent sleep as implemented in the ble_app_sleepmode example but not copying from OTP. We just want to make the buzzer sound everytime the device wakes up .
谢谢,Blebot。
Hi blebot,
好吧,让我描述你可能的实现。请检查SDK的BLE_APP_SLEEPMODE示例。
这是一个可能的实现。如果您发现它有用,请将答案标记为“已接受”
谢谢,PM_Dialog