Configuring interrupt

⚠️
嗨,...感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程https://www.dialog-seminile.com/support.。我们将在未来几天修复错误/优化搜索和标记。
24张/ 0新
最后一篇
Goutham.
离线
最后一次露面:1 year 9 months ago
加入:2017-08-10 12:34
Configuring interrupt

你好团队,

I am trying to integrate a gyro sensor with DA1586 and configure interrupt for the sensor. For basic I2C communication I used P0_2 and P0_3 pins taking i2c_eeprom as a reference and got the desired output .Now for configuring interrupt can I have any reference example and what are the hardware pins to be connected for enabling interrupt?

谢谢,
Goutham.N

Device:
PM_Dialog
离线
最后一次露面:9小时44分钟前
职员
加入:2018-02-08 11:03
你好Goutham.,

你好Goutham.,

请查看DA14585 IOT多传感器开发套件。您可以从我们的支持页面中找到DA14585的参考设计选项卡,或者为您的方便行为按照以下链接=:

https://support.dialog-seminile.com/connectivity/product/da14585?qt-product_rectricted_=5&qt-view_reference_designs__block_1=5#qt-view_reference_designs__block_1.

谢谢,PM_Dialog

Goutham.
离线
最后一次露面:1 year 9 months ago
加入:2017-08-10 12:34
你好团队,

你好团队,

实际上,传感器具有中断引脚,该引脚必须连接到DA14586微控制器。因此,我应该使用哪个小管道的引脚来连接传感器的中断引脚并在程序中配置它们?

谢谢,
Goutham.

PM_Dialog
离线
最后一次露面:9小时44分钟前
职员
加入:2018-02-08 11:03
你好Goutham.,

你好Goutham.,

In order to configure a GPIO as an interrupt you should use the GPIO_EnableIRQ() API. Could you please clarify which your problem is? You should not select any specific GPIO. I think that theSW示例:读出I2C加速度计并发送通知数据来自我们的支持门户的示例可能会帮助您。请按照所描述的步骤进行操作示例:DA1458X示例设置in order to run the example.

谢谢,PM_Dialog

Goutham.
离线
最后一次露面:1 year 9 months ago
加入:2017-08-10 12:34
Actually I'm interfacing a

Actually I'm interfacing a interrupt based sensor with DA1586.Usually for I2c communication between the sensor and the microcontroller I used the P0_2 and P0_3 pins.I am getting the physical information from the sensor.Now to configure interrupt there are different interrupt pins for accelerometer and gyroscope which are to be connected to the microcontroller.So my issue is to which pins should i connect and configure them to enable the interrupt??

Goutham.
离线
最后一次露面:1 year 9 months ago
加入:2017-08-10 12:34
哪个别针

开发套件中的哪些引脚用于配置中断?

PM_Dialog
离线
最后一次露面:9小时44分钟前
职员
加入:2018-02-08 11:03
你好Goutham.,

你好Goutham.,

GPIOS是完全可编程的,因此您可以选择其中的任何一个并将其配置为中断引脚。请查看表1:DA14586数据表的引脚说明。你能澄清你想要完成的事情吗?此外,我建议您查看10.3.6功能参考:中断处理功能部分UM-B-079 DA14585&DA14586软件平台参考(SDK 6.0.8)user manual, in order to find all the available of APIs.

谢谢,PM_Dialog

Goutham.
离线
最后一次露面:1 year 9 months ago
加入:2017-08-10 12:34
你好团队,

你好团队,

Actually I am performing a i2c interface between a gyro sensor and DA14586 MCU. I am receiving sensor values in the terminal after programming taking i2c_eeprom code as a reference. For i2c I have used pins P0_2 and P0_3 of DA14586 connecting them to the sensors SCL and SDA pins respectively.The sensor which I am using is a an interrupt based sensor.To configure the Interrupt I have to connect the interrupt pin of the sensor to the dialog MCU. So to which pin I have to connect?? and how to configure interrupt ?.Should I use the GPIO_enableIRQ API , that's it?
Is there any reference for this?
感谢您的支持。

谢谢,
Goutham.N

Goutham.
离线
最后一次露面:1 year 9 months ago
加入:2017-08-10 12:34
附加查询

附加查询

主要应用是当传感器交叉一个设定的阈值时,它应该产生中断。对于这种类型的应用程序,我应该遵循的api是什么?

PM_Dialog
离线
最后一次露面:9小时44分钟前
职员
加入:2018-02-08 11:03
Goutham.,

你好Goutham.,

You are able to connect the interrupt pin of the sensor to everyone GPIO of the DA14586. You should configure the GPIO as input and use the GPIO_enableIRQ() in order to get the interrupt from the side of DA14586. After that you can register a callback functions since you get the interrupt from the sensor by using the GPIO_RegisterCallback() API.

谢谢,PM_Dialog

Goutham.
离线
最后一次露面:1 year 9 months ago
加入:2017-08-10 12:34
Hello team,

Hello team,

Actually I want to activate the sensor and keep the micro controller in sleep mode and when an interrupt is generated based on the set threshold then the micro controller should become active and notify if interrupt is generated , such that I want to save the micro controller power.How to accomplish this type of task?

谢谢,
Goutham

PM_Dialog
离线
最后一次露面:9小时44分钟前
职员
加入:2018-02-08 11:03
你好Goutham.,

你好Goutham.,

>> activate the sensor and keep the micro controller in sleep mode

你能澄清一下吗?DA14586将处于睡眠模式,传感器将在orde中产生中断以唤醒芯片?那是对的吗?否则,请

谢谢,PM_Dialog

Goutham.
离线
最后一次露面:1 year 9 months ago
加入:2017-08-10 12:34
是的完全每当有

是的完全每当有an interrupt event generated in the sensor it should wake up the microcontroller. I want to read the sensor data then keep the microcontroller in sleep mode and when an interrupt is generated then it should wake up the microcontroller rather than continous monitoring by microcontroller.

谢谢,
Goutham

Goutham.
离线
最后一次露面:1 year 9 months ago
加入:2017-08-10 12:34
Additional Queries

Additional Queries

1)如何在生成中断后实现回调函数。如果我们使用GPIO回调寄存器API?
2)在交叉阈值时要实现的流程是什么流程。
3)启用IRQ和回调中断吗?

PM_Dialog
离线
最后一次露面:9小时44分钟前
职员
加入:2018-02-08 11:03
你好Goutham.,

你好Goutham.,

I would highly recommend you to have a look at the ble_app_sleepmode of the SDK. If the device is configured in any of sleep mode you could wake it up through the wake-up controller. Also, it would be very helpful to read the 7.6 Pillar 5 (Sleep Mode) of the UM-B-080 user manual in order to understand how you can wake the device up. In your case the interrupt will be generated from the sensor and not from the button.

谢谢,PM_Dialog

Goutham.
离线
最后一次露面:1 year 9 months ago
加入:2017-08-10 12:34
你好团队,

你好团队,

I am facing problem in enabling the interrupt pin to which GPIO is configured.

To configure GPIO pin as a interrupt pin I have done
1) In user_periph_setup.h ->defining port and pin using macros
2)在user_periph_setup.c - >使用gpio configurepin配置GPIO
And passing parameters into GPIO_EnableIRQ()
上面的程序是否正确?

PM_Dialog
离线
最后一次露面:9小时44分钟前
职员
加入:2018-02-08 11:03

你好Goutham.,

请检查以下步骤演示如何使用IRQ并从连接到PIN1_1的按钮中检测中断。请注意,通过以下代码片段,您将无法从睡眠中醒来。如果您想要此功能,请告诉我或检查BLE_APP_SLEEPMODE示例。

  1. user_periph_setup.h

#define gpio_button_port gpio_port_1.

#define gpio_button_pin gpio_pin_1.

  1. user_periph_setup.c

void GPIO_reservations(void)

{

RESERVE_GPIO(PUSH_BUTTON, GPIO_BUTTON_PORT, GPIO_BUTTON_PIN, PID_GPIO);

}

void set_pad_functions(void)//设置GPIO端口功能模式

{

GPIO_ConfigurePin(GPIO_BUTTON_PORT, GPIO_BUTTON_PIN, INPUT_PULLUP, PID_GPIO, false);

}

  1. 在您的应用程序代码中

GPIO_RegisterCallback(GPIO0_IRQn, your_callback_function);

gpio_enableirq(gpio_button_port,gpio_button_pin,gpio0_irqn,true,false,0)

If low_input in GPIO_EnableIRQ() is TRUE, it generates an IRQ if the input is low. If the input is low, the your_callback_function will be triggered. Also you should include the gpio.h library.

Regards, PM_Dialog

Goutham.
离线
最后一次露面:1 year 9 months ago
加入:2017-08-10 12:34
你好

你好

感谢GPIO配置步骤。我希望当触发传感器中断时微控制器从睡眠唤醒。触发中断。如何完成此操作?

Goutham.
离线
最后一次露面:1 year 9 months ago
加入:2017-08-10 12:34
你好

你好

感谢GPIO配置步骤。我希望当触发传感器中断时微控制器从睡眠唤醒。触发中断。如何完成此操作?

PM_Dialog
离线
最后一次露面:9小时44分钟前
职员
加入:2018-02-08 11:03
你好Goutham.,

你好Goutham.,

正如我在上一篇文章中提到的那样,如果您想从任何类型的睡眠模式唤醒,则应使用唤醒控制器。如果您的设备进入睡眠模式,我提供的代码片段将无法工作。你能否指示你想要完成的东西?与sdk的ble_app_sleepmode示例相同的功能?你检查了这个例子吗?您可以找到使用唤醒控制器的适当步骤。

谢谢,PM_Dialog

Goutham.
离线
最后一次露面:1 year 9 months ago
加入:2017-08-10 12:34
你好

你好

Actually I am interfacing a gyro interrupt based sensor with DA14586 and I have done the i2c interfacing and got the sensor values output.Whenever it crosses a certain threshold it should notify.To be clear I want to implement the one which I have mentioned in the attached picture.

谢谢,
Goutham.N

PM_Dialog
离线
最后一次露面:9小时44分钟前
职员
加入:2018-02-08 11:03
你好Goutham.,

你好Goutham.,

道歉,但我很困惑。附图是指的?请你附上它吗?

谢谢,PM_Dialog

Goutham.
离线
最后一次露面:1 year 9 months ago
加入:2017-08-10 12:34
Apologies for not attaching

Apologies for not attaching.Here is the image.Please extract the zip file.

谢谢,
Goutham.N

附件:
PM_Dialog
离线
最后一次露面:9小时44分钟前
职员
加入:2018-02-08 11:03
你好Goutham.,

你好Goutham.,

请从DA14585的IOT MultiSensor套件参考设计检查IOT项目。您将在DA14585的支持门户网站中找到此参考设计,以及我正在谈论的项目是位于DA14585_IOT_MULTI_SENSOR_DK_V6.160.2 \ PROJECTS \ TARGET_APPS \ IOT \ IOT_585 \ keil_5路径下的项目。也参见第5.3.3段宣传
DA14585 IOT多传感器开发套件:UM_B_096用户手册。该设备将默认启动广告。广告时间段由ADV_TIME_OUT上的值确定。当定时器到期时,执行user_app_on_add_undirect_complete()以终止广告。如果睡眠模式设置为ARCH_EXT_SLEEP_ON,系统将尝试关闭电源并启用唤醒运动中断。如果alward_advertise未定义,则从该项目中排除运动传感器,因此没有唤醒处理器。为此目的的加速度计配置为具有“AnyMotion”中断功能集的低功率操作。允许处理器扩展睡眠模式,只有在从加速度计接收中断时才会醒来。然后执行中断处理程序WKUP_INTR_NON_CONNECTED_CB()启动广告。请按照ulder_app_on_adv_undirect_complete()函数中调用的wom_acc_setup()以了解如何通过运动中断唤醒

谢谢,PM_Dialog