Dear Dialog
我有一个问题,达14580。我把the IC for ON and Off a LED. I read your site and I found that I need to define two commands for the work. First, determining output for the pin and second high or low being the pin.
1- gpio_configurepin(gpio_port_1,gpio_pin_0,输出,pid_gpio,false);
2- GPIO_SetActive(GPIO_PORT_1, GPIO_PIN_0);
I putted these two command in void set_pad_functions(void) in user_periph_setup.c. However, the output is not high and it is always low (0 V). I do not know why it cannot work.
I would be pleased if you could help me.
问候,
Reza.
Device:

Hi reza.abbasi67,
#define GPIO_LED_PORT GPIO_PORT_1
#define GPIO_LED_PIN GPIO_PIN_0
But let me ask you something. In which SDK project are you working on? Are you using any of sleep modes?
Thanks, PM_Dialog
Dear PM_Dialog,
Thank you so much for your responses.
我试图根据您的评论解决问题,但获得的结果不合适(输出为0 V)。我不明白GPIO_ESTACTION的位置在哪里。在void periph_init(void)中,我将gpio_setactive放在user_periph_setup.c中。我调查了你对我说的命令的顺序。首先,输出的定义,第二次预留和第三个设置高或低。我使用具有SDK 5.0.4的Smart Spippets工具,我更改了睡眠命令,如下所示:
in used config.
const static sleep_state_t app_default_sleep_mode = ARCH_SLEEP_OFF;
in da1458X_config_basic.h:
#undef CFG_MEM_MAP_EXT_SLEEP
#undef CFG_MEM_MAP_DEEP_SLEEP
in user_periph_setup.h
#define cfg_uart_sw_flow_ctrl.
#undef cfg_uart_hw_flow_ctrl.
Thank you for your attention.
Reza.
Hi reza.abbasi67,
表明您在哪个项目工作是非常有帮助的。在我们的SKD或我们参考设计中的任何一个示例中,如DSPS?此外,您是否拥有我们的开发板或者您已经根据DA14580设备设计了您的定制板?您对LED的要求是什么?只是打开它?
Thanks, PM_Dialog
Hi PM_Dialog
非常感谢您的回复消息。
我准备了标题YH-007_V1.0的模块(被添加到附件)。模块尚未编程。虽然我与它沟通有问题,但我解决了它。实际上,我的主要目的是开发与蓝牙配合使用的LED电路。例如,如果我用DSPS应用向蓝牙设备发送1,LED朝向启动,如果我向蓝牙设备发送2,则LED将变为OFF。我已经使用了您的信息,并且可以使用DSP和所述模块与蓝牙通信,仅用于将数据从PC发送到电话单元,反之亦然。下一相打开和关闭LED,最终阶段是获得的数据的比较(如果1 = ON和2 = OFF)。
如果你能帮助我的项目,我会很高兴。
Best wishes
Reza.
Hi reza.abbasi67,
Have you ever checked the Codeless project? If not, I would highly suggest you to have a look at this reference design. Please follow the link below :
//www.wsdof.com/products/smartbondtm-codeless-commands
With the Codeless project, you could send AT commands wirelessly to the DA14580. The CodeLess AT commands platform allows control over a local UART connected device as well as a remote device via BLE. The comprehensive set of AT-Commands enables control of the BLE connectivity, sensor read-out and battery check of the device. Control over issuing the AT commands can be on a PC or integrated in a 3rd party microcontroller. For example you can toggle a GPIO from your mobile phone without implementing any code snippet. If you have any specific reason to use the DSPS project, you will have to modify it a little bit more. Please download the source code of the Codeless and read tutorial.
Thanks, PM_Dialog
Dear PM_Dialog,
Thank you for your answer in detail. I read the pages. However, I did not you what app has used for sending the AT++10.0. I didn't find any app in the page in which you put.
如果您为网站提供下载软件,我也很感激。
问候,
Reza
Hi reza.abbasi58,
Could you please clarify you question? You asked about which mobile application you should use? If yes, you could use any of the BLE generic mobile applications.
Thanks, PM_Dialog
Hi PM_Dialog,
Thank you so much for helping me. Although the Codeless projects are very better, I decided to switch to DSPS .
According to your guidance, I could turn on the LED. I really appreciate for the purpose. Now, I wanted to send number 1 for turning On and number 2 for turning off the LED.
I read the uart_sps.c and I could turn on the LED with my code (I added it as follows and it wrote it in static void uart_sps_thr_empty_isr(void) in uart_sps.c). However, I found that when the Tx buffer is filled, the code work and it is not important what type of number reach to the buffer. The LED wait to send every number or character to the DA14580. When the character or number received, the LED turn on for always and I can't turn off it. Could you help me?
if (uart_txfifo_full_getf()==1)
{
GPIO_SetActive(GPIO_LED_PORT, GPIO_LED_PIN);
}
if (uart_txfifo_full_getf()==2)
{
GPIO_SetInactive(GPIO_LED_PORT, GPIO_LED_PIN);
}
Regard,
Reza
Hi reza.abbasi67,
我假设您想从中央设备发送“1”或“2”,并且您希望在外围设备上DSP进行解析并打开/关闭LED。因此,当设备从中央侧获取数据时,消息SPS_SERVER_DATA_RX_IND将发生消息附加到USER_SPS_SERVER_DATA_RX_IND_HANDLER(),以便您能够在上面提到的回调中发送中央发送的任何内容。默认功能只会调用user_ble_push()以便将数据推在缓冲区中。因此,一个想法是检查传入的数据,要么要做你的东西,要么将数据推入缓冲区,以便在UART侧打印出来。如果您想要在特定命令的情况下将返回某些内容发送备份的情况下,您可以使用user_send_ble_data()函数,直接向中央发送通知而不通过缓冲区。
Thanks, PM_Dialog