Da14580 Button Input Event

17 posts / 0 new
Last post
hantig
Offline
Last seen: 1 day 18 hours ago
Joined: 2017-07-03 17:01
Da14580 Button Input Event

Da14580 don't act button input event.

Device: 
SDK: 
hantig
Offline
Last seen: 1 day 18 hours ago
Joined: 2017-07-03 17:01
Dear, dialog.

Dear, dialog.
In order to use button input event, I program as below.
In set_pad_functions(),
GPIO_ConfigurePin(GPIO_KEY1_PORT, GPIO_KEY1_PIN, INPUT, PID_GPIO, false);

uint8_t ReadKeyDown(void)
{
/* 1 key is pressed */
if(!GPIO_GetPinStatus(GPIO_KEY1_PORT, GPIO_KEY1_PIN))
{
Delay(800);
if(GPIO_GetPinStatus(GPIO_KEY1_PORT, GPIO_KEY1_PIN))
{
return NOKEY;
}
while(!GPIO_GetPinStatus(GPIO_KEY1_PORT, GPIO_KEY1_PIN))
{
;//reserved
}
return KEY1;
}
}

and in main()
while(1){
ukey = ReadKeyDown();
... ....
}

Is this right? Button Input event don't act. Reason?

hantig
Offline
Last seen: 1 day 18 hours ago
Joined: 2017-07-03 17:01
How have to I do to

How have to I do to manipulate button press ?

LC_Dialog
Offline
Last seen: 5 days 17 hours ago
Staff
Joined: 2016-09-19 23:20
Hi Hantig,

Hi Hantig,

In order to detect the button press you will need to enable the interrupt for the GPIO that is connected to the external Button.

Please refer to the code snipped below for a simple implementation on using the interrupts to detect an external event.

For extensive implementation, reveiw the following query on the support portal.
https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/da14580-interrupt

 

Best,
LC

hantig
Offline
Last seen: 1 day 18 hours ago
Joined: 2017-07-03 17:01
Thank you very much!

Thank you very much!
Dear dialog!
I describe as the method that you told me, By the way I don't press button, every time my_ btn_handler() is called 2 ~ 3 times. What reason?

hantig
Offline
Last seen: 1 day 18 hours ago
Joined: 2017-07-03 17:01
#define GPIO_KEY1_PORT

#define GPIO_KEY1_PORT GPIO_PORT_2
#define GPIO_KEY1_PIN GPIO_PIN_7

void my_btn_handler(void)
{
GPIO_SetActive(GPIO_LED_PORT, GPIO_LED_PIN);
}

void periph_init(void)
{
GPIO_ConfigurePin(GPIO_KEY1_PORT, GPIO_KEY1_PIN, INPUT, PID_GPIO, false);
GPIO_RegisterCallback(GPIO2_IRQn, my_btn_handler);
GPIO_EnableIRQ(GPIO_KEY1_PORT, GPIO_KEY1_PIN, GPIO2_IRQn, true, false, 2);
}

I don't press button, but my_btn_handler() is called several time(about 3 time).

hantig
Offline
Last seen: 1 day 18 hours ago
Joined: 2017-07-03 17:01
I want to purchase smart tag

I want to purchase many (several hundreds~ several thousands)smart tag mold. I saw plastic enclosure as below picture in sdk manual (UM-B-018).
Dear, dialog. Could you help me out so that I can purchase the enclosure ? I live in America. Good luck! Help me! I will wait for you.

Attachment: 
JE_Dialog
Offline
Last seen: 17 hours 1 min ago
Staff
Joined: 2013-12-05 14:02
Dear Hantiq,

Dear Hantiq,

we are unable to sell the tags in high volume. All the design files are on the web site that you can download.  I would suggest to engage the services of a 3rd party design house to support your design who can guide you on mechanical, hardware, electrical, software and production features.

BR JE_Dialog

hantig
Offline
Last seen: 1 day 18 hours ago
Joined: 2017-07-03 17:01
Dear, dialog! I want to

Dear, dialog! I want to purchase only several proximity tag enclosure. Please tell me contact address. I hope you will help me. Many thanks.

hantig
Offline
Last seen: 1 day 18 hours ago
Joined: 2017-07-03 17:01
Dear dialog!

Dear dialog!
I describe as the method that you told me, By the way I don't press button, every time my_ btn_handler() is called 2 ~ 3 times. What reason?
#define GPIO_KEY1_PORT GPIO_PORT_2
#define GPIO_KEY1_PIN GPIO_PIN_7

void my_btn_handler(void)
{
GPIO_SetActive(GPIO_LED_PORT, GPIO_LED_PIN);
}

void periph_init(void)
{
GPIO_ConfigurePin(GPIO_KEY1_PORT, GPIO_KEY1_PIN, INPUT, PID_GPIO, false);
GPIO_RegisterCallback(GPIO2_IRQn, my_btn_handler);
GPIO_EnableIRQ(GPIO_KEY1_PORT, GPIO_KEY1_PIN, GPIO2_IRQn, true, false, 2);
}

I don't press button, but my_btn_handler() is called several time(about 3 time).

And I want to purchase only several proximity tag enclosure. Please tell me contact address. I hope you will help me. Many thanks.

hantig
Offline
Last seen: 1 day 18 hours ago
Joined: 2017-07-03 17:01
I want to help me. . I’m

Hi, dialog!
You didn't answer anything about my many questions.
I want to help me. . I’m sorry about what I’ve done.

JE_Dialog
Offline
Last seen: 17 hours 1 min ago
Staff
Joined: 2013-12-05 14:02
Dear Hantiq, 

Dear Hantiq, 

We are a little bit confused abotu what you need : firstly you want hundreds/thousands. Then you would like a few.  I would recommend that you could engage the services of a 3rd party to help you wih your development - we can recommend one that is close to you. 

BR JE_Dialog

hantig
Offline
Last seen: 1 day 18 hours ago
Joined: 2017-07-03 17:01
Dear, dialog!

Dear, dialog!
I want to enrage the services of 3rd party for me.
I want hundreds/thousands. If it is difficult, I only need several. Please tell me services of 3rd party. Many thanks in advance.

hantig
Offline
Last seen: 1 day 18 hours ago
Joined: 2017-07-03 17:01
Hi, dialog! Please help me!

Hi, dialog! Please help me!

JE_Dialog
Offline
Last seen: 17 hours 1 min ago
Staff
Joined: 2013-12-05 14:02
Which city / country are you

Which city / country are you located in ? BR JE_Dialog 

hantig
Offline
Last seen: 1 day 18 hours ago
Joined: 2017-07-03 17:01
I live in china.

I live in china.

JE_Dialog
Offline
Last seen: 17 hours 1 min ago
Staff
Joined: 2013-12-05 14:02
Hi Hantiq, i would suggest to

Hi Hantiq, i would suggest to talk to our partners at Skynoon / Avnet / Cytech  : all have a lot of experience on our DA1458x devices and also have design services to support customers in design/manufacture.  You can find the contact details on our web page .

https://www.dialog-semiconductor.com/distributors-and-representatives

BR JE_Dialog