唤醒HW中断 - 哪个例子?

了解更多常见问题解答教程

6个帖子/ 0新
最后一篇
3hl3rt.
离线
最后一次露面:1周5天前
加入:2021-01-23 10:57
唤醒HW中断 - 哪个例子?

您好,

我必须制作一个极简的应用程序:

设备将在睡眠时间为99.99%的时间,但是当按下HW按钮时,它应该醒来,等待手机连接,然后发送小的有效载荷(4bytes)

之后应该恢复睡眠,并且如果手机从未连接,则需要进行超时。

但是我不确定从中开始哪个例子 - 我在日食上,但基本上只有Prox_reporter项目就在框中运行 - 但我会喜欢这里的一些提示。

best regards,

亨利克

设备:
PM_DIALOG.
离线
最后一次露面:13小时5分钟前
员工
加入:2018-02-08 11:03
嗨3hl3rt,

嗨3hl3rt,

谢谢你的问题在线。

您可以使用DA1453A和SDK6开始的最佳项目是SDK的Prox_reporter示例。

这也是包含基于Eclipse项目的唯一示例。请参阅下面您如何使用SmartSnippet Studio编译,运行和调试它的方式:

https://support.dialog-seminile.com/forums/post/dialog-smartbond-bluetooth-low-energy-%2%80%93-software/wake-hw-interrupt- whigh-example.

When the device boots, it will start advertising. The default sleep mode is set to extended sleep ( see app_default_sleep_mode in user_config.h ) , so this meant that the DA14531 sleeps between the adverting or connection intervals and will wake up automatically via the BLE timer.

在一个预定义的时间(见.advertise_period item in user_default_hnd_conf is user_config.h) , it will stop advertising and go to the permanent sleep mope. The app_advertise_complete() will be triggered once the advertisement has been stopped. Then the device can wakeup via an external interrupt in the WKAE-UP controller – see app_button_enable(). Specifically, the GPIO_BUTTON_PORT / _PIN (P0_11) is configured as a wake up pin with low polarity.

如果您使用的是PRO-DK,则此引脚映射到SW2,因此,一旦设备停止广告,您就可以唤醒它并通过按SW2按钮再次启动广告。

当设备广告时,它是可连接的,因此您可以使用BLE通用移动应用程序来连接。

我会推荐使用SDK6(HTML)入门DA14531睡眠模式教程(HTML)教程也!

谢谢,PM_DIALOG.

3hl3rt.
离线
最后一次露面:1周5天前
加入:2021-01-23 10:57
非常感谢你做的这些 -

非常感谢您的这一点 - 一个问题:

之后“请参阅下面的方式如何编译,运行和调试它与smartsnippets studio:”您链接到这个论坛帖子 - 这是为了指出其他地方?

PM_DIALOG.
离线
最后一次露面:13小时5分钟前
员工
加入:2018-02-08 11:03
嗨3hl3rt,

嗨3hl3rt,

我的道歉 - 这是一个错误的副本粘贴。您可以在下面找到文件:

http://lpccs-docs.dialog-semicondiondum/tutorial_sdk6/eclipse_gcc.html.

谢谢,PM_DIALOG.

3hl3rt.
离线
最后一次露面:1周5天前
加入:2021-01-23 10:57
thanks for your answer, I am

感谢您的答案,我正在取得良好的进展 - 代码符合(Prox_reporter),我可以更改设备名称等,更改睡眠时机,按钮按下按钮等。

遵循DA145xx_Advertising_tutorial,我试图弄清楚广告数据如何工作。

“user_advertise_data”和“user_advertise_scan_response_data”之间的差异是什么 - 他们的用途是什么?

I am experimenting with the code below, but I am unsure where I can expect this data to end up?

I am testing with the LightBlue BLE app, the attached pictures shows the output from the app.

///广告数据#define man_data_1“\ x11”#define man_data_2“\ x22”#define man_data_len“\ x01”#define user_advertise_data man_data_len \ adv_type_manufactureer_specific_data \ man_data_1 ///广告数据长度 - 最多28个字节,保留3个字节3个字节设置#define user_advertise_data_len(sizeof(user_advertise_data)-1)///扫描响应数据#define user_advertise_scan_response_dath man_data_len \ adv_type_manufacture _specific_data \ man_data_2 ///扫描响应数据长度 - 最大31字节#define user_advertise_scan_response_data_len(sizeof(user_advertise_scan_response_data)-1)

附件:
PM_DIALOG.
离线
最后一次露面:13小时5分钟前
员工
加入:2018-02-08 11:03
嗨3hl3rt,

嗨3hl3rt,

广告字符串和扫描响应数据应遵循特定格式。制造商特定数据是开发人员可以包含自己的数据并在设备广告时填充它们的标志。要将自定义数据添加到广告字符串中,格式应该像 。中央发送扫描请求以读取扫描响应数据。

找到以下示例:

///广告数据#define man_data_1“\ x11 \ x11”#define man_data_2“\ x22 \ x22”#define man_data_len“\ x03”#define user_advertise_data man_data_len \ adv_type_manufacturer_specific_data \ man_data_1 ///广告数据长度 - 最多28个字节,3字节被保留设置的#define USER_ADVERTISE_DATA_LEN(的sizeof(USER_ADVERTISE_DATA)-1)///扫描响应数据的#define USER_ADVERTISE_SCAN_RESPONSE_DATA MAN_DATA_LEN \ ADV_TYPE_MANUFACTURER_SPECIFIC_DATA \ MAN_DATA_2 ///扫描响应数据长度 - 最大31个字节的#define USER_ADVERTISE_SCAN_RESPONSE_DATA_LEN(的sizeof(USER_ADVERTISE_SCAN_RESPONSE_DATA) -1)

我在我身边使用了BLE Scanner应用程序。在特定的设备名称中,如果单击原始数据,您将看到man_data_1和man_data_2。

在附加的屏幕截图中,我假设您处于已连接状态,那么您所看到的是配置文件,服务等。

如果您有任何后续问题,请提出一个新的论坛线程。

谢谢,PM_DIALOG.