雷竞技电竞平台Dialog半导体客户支持定时器 https://support.dialog-semiconductor.com/resource-keywords/timer 关闭BLE并进入睡眠模式 https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/close-ble-and-go-sleep-mode

Hi,
I am using DA14585 and SDK6.4.2。我们的客户设计了一种名为“LOW POWER mode”的模式,一旦发现电压过低,DA14585将关闭除RTC外的所有功能(BLE, RF,外围设备…等)。
表示日期&时间应该放在某个地方,关闭所有功能,直到电池开始充电。以下是我的计划,我不确定它是否有效。你能给我一些建议吗?
1。声明“uint32_t seconds”以UNIX时间戳格式保存时间,并确保该变量存储在“retention_mem_area0”中。
使用TIMER0或TIMER2每秒钟向变量添加1。
停止BLE广告,去延长睡眠。
当设备正在充电时,唤醒并开始发布广告。顺便问一下,我很好奇,DA14585里面有TIMER1吗? I can find TIMER0 and Timer2 but no TIMER1 in documents, why?

Thank you very much.

Device: 
2017年7月27日星期四05:24:44 +0000 stanley_yeh 72634, https://support.dialog-semiconductor.com https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/close-ble-and-go-sleep-mode#comments
App_easy_timer_cancel检查是否过期 https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/appeasytimercancel-checking-if-expired

Hi there,

我在app_on_connection上启动一个定时器。该计时器在给定时间后终止连接。如果用户在定时器失效前断开连接,则定时器应取消。这适用于用户在计时器失效之前断开连接的情况,但当计时器处理程序终止连接时,它会给我一个错误。根据我的理解,这是因为当计时器过期时,传递给app_easy_timer_cancel的timer_id是无效的。然而,我想添加一个检查,如if(conn_timeout != EASY_TIMER_INVALID_TIMER){..会解决这个问题的。< / p > < p > 1)。有人能告诉我为什么app_easy_timer_cancel仍然执行,即使我检查之前的有效性?这是在app_on_disconnect处执行的代码片段。
if(conn_timeout != EASY_TIMER_INVALID_TIMER){
//cancel timer
printf_string("conn_timeout was cancelled because disconnection by user\n\r");
app_easy_timer_cancel(conn_timeout);
}

2.) I used the watch tool from Keil to keep an eye on the value of conn_timeout. It is 0x00 initially and stays this value if I connect and disconnect before the timer elapses. However when the timer does elapse and the callback of conn_timeout is executed, conn_timeout keeps the value 0x03. It stays at this value even if I proceed the software (after it gets stuck on ASSERT_WARNING(0) in void app_easy_timer_cancel(const timer_hnd timer_id)). Also connecting and disconnecting is still possible. Doing this ( quicker than the timer period) also does not make a change to the value 0x03.
What does this value mean? Isn't this value supposed to be reset to 0x00 when the timer elapses or when the timer is cancelled?

Kind regards,
Niek

Device: 
2017年7月19日星期三19:38:13 +0000 Niekvdd 69370 https://support.dialog-semiconductor.com https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/appeasytimercancel-checking-if-expired#comments
无法通过OS_TIMER停止继续ADC采样 https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/cant-stop-continue-adc-sampling-ostimer

我想在1min后停止继续ADC采样。< / p > < p > 1,配置gpio < br / > hw_gpio_set_pin_function (HW_GPIO_PORT_1, < br / > HW_GPIO_PIN_3, < br / > HW_GPIO_MODE_INPUT, < br / > HW_GPIO_FUNC_ADC); < / p > < p > 2,配置dma < br / > DMA_setup dma_conf = {< br / > .channel_number = HW_DMA_CHANNEL_0 < br / > .bus_width = HW_DMA_BW_HALFWORD < br / > .irq_enable = false, < br / > .irq_nr_of_trans = 1, < br / > .dreq_mode = HW_DMA_DREQ_TRIGGERED < br / > .a_inc = HW_DMA_AINC_FALSE < br / > .b_inc = HW_DMA_BINC_TRUE < br / > .circular = HW_DMA_MODE_CIRCULAR < br / > .dma_prio =HW_DMA_PRIO_7,
.dma_idle = HW_DMA_IDLE_BLOCKING_MODE,
.dma_init = HW_DMA_INIT_AX_BX_AY_BY,
.dma_req_mux = HW_DMA_TRIG_ADC,
.src_address = (uint32_t)(&GPADC->GP_ADC_RESULT_REG),
.dest_address = (uint32_t)mg_ad_samp_ret_buf,
.length = 60,
};
hw_dma_channel_initialization(&dma_conf);
hw_dma_channel_enable(HW_DMA_CHANNEL_0,HW_DMA_STATE_ENABLED); < / p > < p > 3,配置gpadc < br / > source_handle = ad_gpadc_open (MY_GPADC); < br / > ad_gpadc_acquire (); < br / > hw_gpadc_reset (); < br / > hw_gpadc_set_clock (HW_GPADC_CLOCK_DIGITAL); < br / > hw_gpadc_set_input_mode (HW_GPADC_INPUT_MODE_SINGLE_ENDED); < br / > hw_gpadc_set_input (MG_CFG_SAMP_PW_GPADC); < br / > hw_gpadc_set_sample_time (7); < br / > hw_gpadc_set_oversampling (2), < br / > hw_gpadc_set_continuous(真正);< br / > hw_gpadc_set_interval (8); < br / > hw_gpadc_set_input_attenuator_state(假);< br / >hw_gpadc_set_chopping(true);
hw_gpadc_set_ldo_constant_current(true);
hw_gpadc_set_ldo_dynamic_current(true);
hw_gpadc_set_ldo_delay(100);
REG_SETF(GPADC, GP_ADC_CTRL2_REG, GP_ADC_DMA_EN, true);
hw_gpadc_enable();
hw_gpadc_start();

4、config os_timer
tmr_handle = OS_TIMER_CREATE("myTimer", OS_MS_2_TICKS(60000), pdFALSE, NULL, my_timer_cb);
ASSERT_ERROR(tmr_handle );
OS_TIMER_RESET(tmr_handle , OS_TIMER_FOREVER);
……
static void my_timer_cb(OS_TIMER timer_handle)
{
OS_TASK_NOTIFY_FROM_ISR(my_task_handle, MY_TASK_NOTIFY_TIMER, OS_NOTIFY_SET_BITS);
}

1+2+3: The timer doesn't work.
1+2: The timer can operate properly.

Keywords: 
Device: 
2017年5月24日星期三07:26:35 +0000 首歌 39933, https://support.dialog-semiconductor.com https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/cant-stop-continue-adc-sampling-ostimer#comments
计时器 https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-42-%E2%80%93-software/timer

Hi

I'm new to DA14580。有没有关于“app_easy_timer”的例子?我需要同时设置几个定时器,那么我需要哪种定时器呢?Easy_timer, systick还是timer0?

谢谢

关键词: 
2016年10月8日星期六04:17:20 +0000 ericzhao 4743 https://support.dialog-semiconductor.com https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-42-%E2%80%93-software/timer#comments Hot在不使用SDK的情况下测试深度睡眠和扩展深度睡眠 https://support.dialog-semiconductor.com/hot-test-deep-sleep-and-extended-deep-sleep-without-using-sdk

你好,

我想测试我的系统的深度睡眠/扩展睡眠模式下的功耗,要做到这一点,我希望能够使用一个简单的外挂样例激活此模式。
因此无需加载BLE应用程序所需的整个SDK。

可能吗?另外,TIMER0/2在深度睡眠和扩展深度睡眠模式下工作吗?

感谢你的帮助,

Andrea