DSP使用GPIO控制延长睡眠并唤醒。

13个帖子/ 0新
最后一篇
车道
离线
最后一次露面:1 month 20 hours ago
加入:2015-07-14 14:21
DSP使用GPIO控制延长睡眠并唤醒。

嗨对话框

有一些问题是我使用DSP 3.150.2设备项目来数据传输。DA4580_CONFIG.H已设置为:
#define cfg_ext_sleep.
#undef.CFG_DEEP_SLEEP
但是,当我与我的同伴角度联系时,它也进入睡眠模式,数据传输将会丢失,所以我想知道如何设置一个gpio唤醒,以确保da没有进入睡眠。我被设置为“AN-B-026DA14580外部唤醒机制”根据配置:

#define external_wakeup 1
......
ext_wakeup_enable(UART1_CTSN_GPIO_PORT, UART1_CTSN_GPIO_PIN, 1);
......
是我修改的任何其他设置以由GPIO唤醒。

TKS

设备:
mt_dialog.
离线
最后一次露面:2个月3周前
职员
加入:2015-06-08 11:34
嗨巷,

嗨巷,

为了检查您如何启用外部唤醒机制以及如何注册回调功能,请查看App_button_press_cb()函数中的智能标记参考设计。另请参阅10.7唤醒定时器的文档UM-B-051。

谢谢mt_dialog.

车道
离线
最后一次露面:1 month 20 hours ago
加入:2015-07-14 14:21
嗨对话框,

嗨对话框,
have read the section 10.7 in document UM-B-051, and setup the program as it. But DA14580 still in sleep
这是我之前去睡觉之前的代码:
app_set_extended_sleep();
app_ble_ext_wakeup_on();
ext_wakeup_enable(uart1_cts_port,uart1_cts_pin,1);
SCB->SCR |= 1<<2; // enable sleepdeep mode bit in System Control Register (SCR[2]=SLEEPDEEP)
SetBits16(SYS_CTRL_REG, PAD_LATCH_EN, 1); // activate PAD latches
setbits16(pmu_ctrl_reg,radio_sleep,1);//关闭收音机
setBits16(PMU_CTRL_REG,PERIPH_SLEEP,0);//关闭外围电源域
setbits16(sys_ctrl_reg,ret_sysram,1);//关闭系统RAM =>所有数据都将丢失
the function "ext_wakeup_enable()":
void ext_wakeup_enable(uint32_t端口,uint32_t pin,uint8_t极性)
{
rwip_env.ext_wakeup_enable = 2;
#if development_debug.
Letail_GPIO(ext_wakeup_gpio,(gpio_port)端口,(gpio_pin)pin,pid_gpio);
#万一
Letail_GPIO(ext_wakeup_gpio,(gpio_port)端口,(gpio_pin)pin,pid_gpio);
if(极性== 0)//高电平
gpio_configurepin((gpio_port)端口,(gpio_pin)引脚,input_pullup,pid_gpio,false);//电源低。设置默认值以输入高。
else // active high
gpio_configurepin((gpio_port)端口,(gpio_pin)引脚,input_pulldown,pid_gpio,false);//主动高。将默认值设置为低电平。

wkupct_register_callback(ext_wakeup_cb);

wkupct_enable_irq(1 <

车道
离线
最后一次露面:1 month 20 hours ago
加入:2015-07-14 14:21
(无主题)
mt_dialog.
离线
最后一次露面:2个月3周前
职员
加入:2015-06-08 11:34
嗨巷,

嗨巷,

请按照智能标记参考设计中的示例进行唤醒,检查App_button_press_cb()函数(从按钮唤醒da)。您可以通过使用按钮唤醒并唤醒CTS唤醒来检查配置是否正常。

谢谢mt_dialog.

车道
离线
最后一次露面:1 month 20 hours ago
加入:2015-07-14 14:21
比k you very much,I have

非常感谢你,我发现了问题,它已经解决了.AS跟随:
在功能中,“wkupct_enable_irq()”说:@param [in] sel_pins选择已启用的输入。位0-7 - >端口0(p00..p07),位8-13 - >端口1(p10..p15),位14-15 - >端口2(p28,p29),位 - > 16-23端口2(p00..p07),位24-31 - >端口3(p30..p37)。0禁用,1启用。
我使用p2_3端口唤醒,但在函数“ext_wakeup_enable()”中,行为wkupct_enable_irq(1 <

光盘
离线
最后一次露面:3年10个月前
加入:2015-11-18 02:51
谢谢Lane和MT_Dialog,

谢谢Lane和MT_Dialog,

我刚遇到了同样的问题。车道应该是对的。在SDK 5.0.3中的函数遵循(也是SDK 3.x.x)似乎有问题......


void ext_wakeup_enable(uint32_t端口,uint32_t pin,uint8_t极性)
{
rwip_env.ext_wakeup_enable = 2;
#if development_debug.
Letail_GPIO(ext_wakeup_gpio,(gpio_port)端口,(gpio_pin)pin,pid_gpio);
#万一
if(极性== 0)//高电平
gpio_configurepin((gpio_port)端口,(gpio_pin)引脚,input_pullup,pid_gpio,false);//电源低。设置默认值以输入高。
else // active high
gpio_configurepin((gpio_port)端口,(gpio_pin)引脚,input_pulldown,pid_gpio,false);//主动高。将默认值设置为低电平。

wkupct_register_callback(ext_wakeup_cb);

wkupct_enable_irq(1 <}

如果我们称之为:
ext_wakeup_enable(gpio_port_2,gpio_pin_3,0)
此方法呼叫wkupct_enable_irq()功能错误的参数到底。
wkupct_enable_irq()function needs following parameters:

/**
****************************************************************************************
* @brief启用唤醒IRQ。
*
* @param [in] sel_pins选择已启用的输入。位0-7 - >端口0(端口00..p07),位8-13 - >端口1(p10..p15),位14-15 - >端口2(p28,p29),位 - > 16-23端口2(端口00..p07),位24-31 - >端口3(P30..p37)。0禁用,1启用。
* @param [in] pol_pins输入的极性。位0-7 - >端口0(端口00..p07),位8-13 - >端口1(p10..p15),位14-15 - >端口2(p28,p29),位 - > 16-23端口2(端口00..p07),位24-31 - >端口3(P30..p37)。0高,1低。
* @param [in] event_num唤醒中断前的事件数。最多255。
* @param [in] deb_time debouncing时间。最大0x3f。
*
* @return void.
****************************************************************************************
* /
void wkupct_enable_irq(uint32_t sel_pins,uint32_t pol_pins,uint16_t events_num,uint16_t deb_time)

如果有良好的解决方案来解决这个问题,请告诉我。

Thanks for your support in advance.

Best regards,
光盘

mt_dialog.
离线
最后一次露面:2个月3周前
职员
加入:2015-06-08 11:34
嗨CD,

嗨CD,

ext_wakeup_enable是一个应该只使用完整的嵌入式设计时使用的函数,但这种实现不是由于您尝试使用它的原因。For using the wake up controller please use the API implementation of the wakeup driver. You can find examples in the reference designs which is similar to the implementation of the ext_wakeup_enable.

谢谢mt_dialog.

光盘
离线
最后一次露面:3年10个月前
加入:2015-11-18 02:51
嗨mt_dialog,

嗨mt_dialog,

感谢您的快速回复。

对不起,我变得困惑......请让我确认那里的东西....

1. My environment: I would like to use DA14583 as the FULL EMBEDDED design.
你的评论是:

ext_wakeup_enable是一个应该只使用完整的嵌入式设计时使用的函数,但这种实现不是由于您尝试使用它的原因。

我可以使用全嵌入式设计系统的ext_wakeup_enable()函数吗?或者您想要表示ext_wakeup_enable()函数应该与“运行主机应用程序的外部处理器”一起使用?
In source code, there are some comments about these things, but it's really confusing to me...

- da1458x_config_advanced.h -
LINE
64 / *************************************************** /
65 / *唤醒外部处理器运行主机应用程序。* /
66 / *************************************************** /
67 #undef cfg_external_wakeup.

- arch.h -
LINE
210 #f定义(CFG_EXTERNAL_WAKEUP)
211 #define external_wakeup 1
212 #else.
213 #define external_wakeup 0
214 #ENDIF.
.....
388 #f((hyperent_wakeup)&&(!ble_app_present))//外部唤醒,只在full embedded设计
389 void ext_wakeup_enable(uint32_t port, uint32_t pin, uint8_t polarity);
390 void ext_wakeup_disable(void);
391 void ext_wakeup_cb(void);
392 #ENDIF.

- arch_main.c -
静态内联void arch_goto_sleep(sleep_mode_t current_sleep_mode)
{
sleep_mode_t sleep_mode = current_sleep_mode;
ble_turn_radio_off ();
//关闭收音机并检查我们是否可以深入睡眠
sleep_mode = ble_validate_sleep_mode(sleep_mode);
//授予对申请的访问检查我们是否可以睡觉
app_sleep_prepare_proc(&sleep_mode);// SDK的均匀性改进此一个应该改变这个?
//根据当前睡眠模式关闭外设
ARCH_TURN_PERITITALLE_OFF(Sleep_Mode);
#if(use_power_optimizations)
fine_hit = false;
#万一
// hook for app specific tasks just before sleeping
app_sleep_entry_proc(sleep_mode);
#if((hyperent_wakeup)&&(!ble_app_present))//外部唤醒,只有外部处理器设计
ext_wakeup_enable(gpio_port_2,gpio_pin_2,0);
#万一
//做最后一个房子保持钟表并睡觉
ARCH_SWITCH_CLOCK_GOTO_SLEEP(Sleep_Mode);
}

- arch_system.c -
#if((hyperent_wakeup)&&(!ble_app_present))//只有full embedded设计
/**
****************************************************************************************
*@brief Enable external wake up GPIO Interrupt.
* @param [in] gpio_port。外部唤醒信号的GPIO端口
* @param [in] gpio_pin。外部唤醒信号的GPIO引脚
* @param [in]极性。外部唤醒中断的极性。0 =电源低。1 =活跃高
* @return void。
****************************************************************************************
* /
void ext_wakeup_enable(uint32_t端口,uint32_t pin,uint8_t极性)
{
rwip_env.ext_wakeup_enable = 2;
if(development_debug)
Letail_GPIO(ext_wakeup_gpio,(gpio_port)端口,(gpio_pin)pin,pid_gpio);
if(极性== 0)//高电平
gpio_configurepin((gpio_port)端口,(gpio_pin)引脚,input_pullup,pid_gpio,false);//电源低。设置默认值以输入高。
else // active high
gpio_configurepin((gpio_port)端口,(gpio_pin)引脚,input_pulldown,pid_gpio,false);//主动高。将默认值设置为低电平。
wkupct_register_callback(ext_wakeup_cb);
wkupct_enable_irq(1 <}

正如我上面所列出的那样,有相同的#if语句“#if((hyperent_wakeup)&&(!ble_app_present))”,但是,每文件或函数都与全嵌入和外部处理器混合的注释。
如果我使用DA1458x作为一个完整的嵌入式设计,我应该代码如下,是对吗???:

#undef.cfg_external_wakeup.

And ext_wakeup_enable() in arch_goto_sleep() function is NOT called when full embedded design system, isn't it?! Is my understanding right?!?
因此,如上所述,我们必须使用唤醒控制器来唤醒全嵌入式设计系统。我相信醒来的代码将是如下所示:
1st:在系统唤醒时注册回调函数:使用wkupct_register_callback()
2nd: Enable IRQ for wakeup: wkupct_enable_irq(0x40000, 0x40000, 1, 0); // i.e. P2_2, active low for P2_2, 1 event, debouncing time = 0ms
My systems seems to wake up when I coded above. ( Let me check some sample projects from Dialog regarding GPIO wakeup.)

3.即使ext_wakeup_enable()只是仅为完整的嵌入式(或外部处理器主机?)设计,exch_system.c的ext_wakeup_enable()函数似乎是错误的,因为我认为车道也是如此。
ext_wakeup_enable()函数需要3个参数,唤醒gpio端口,引脚和极性。因此,如果用户想要唤醒具有低活动事件的P2_2,则用户调用这样:ext_wakeup_enable(gpio_port_2,gpio_pin_2,0)。
另一方面,在ext_wakeup_enable()函数中,端口信息(即gpio_port_2)完全丢失。wkupct_enable_irq()函数需要位表达式,以选择端口和引脚,包括端口信息。ext_wakeup_enable()的当前代码可以仅处理Port_0的信号更改。(换句话说,ext_wakeup_enable(gpio_port_2,gpio_pin_2,0)将被修改为gpio_port_0,gpio_pin_2,在ext_wakeup_enable()函数中具有低活动事件。

抱歉我的长期回复,但如果您能提供任何意见,那就非常感谢。

谢谢你的支持。

Best regards,
光盘

mt_dialog.
离线
最后一次露面:2个月3周前
职员
加入:2015-06-08 11:34
嗨CD,

嗨CD,

只是一些澄清完全蒙上的澄清 - >应用程序在外部MCU上运行,完全托管 - >应用程序在DA上运行

我没有意识到您使用完全嵌入的设计(从外部主机运行),因为您是,那么是的,您可以使用该函数。这是代码假定您只能从端口0中使用引脚。此部分必须更正,并将在将来的SDK版本中。如果您要使用完全嵌入的设计,并且您将应用程序从外部主机运行,并且希望您的设备从外部MCU唤醒,那么您必须配置外部唤醒。ext_wakeup_enable()用于完全嵌入式设计(因为应用程序应从外部Proccessor唤醒)。如果您的设计完全托管,那么您应该使用您提到的代码。

谢谢mt_dialog.

光盘
离线
最后一次露面:3年10个月前
加入:2015-11-18 02:51
嗨MT,

嗨MT,

非常感谢您的意见。
是的,你是对的。我混淆了“完全托管”的“完全嵌入式”。我很抱歉......

如您所提到的,我们希望使用DA1458x作为“完全托管”的设计(使用DA作为集成处理器)。

所以我必须像下面的代码一样,是对吗?

#undef.cfg_external_wakeup.
Register callback function when system wakes up:using wkupct_register_callback()
启用IRQ唤醒:WKUPCT_ENABLE_IRQ(0x40000,0x40000,1,0);// i.e.p2_2,p2_2的高电平为低电平,1个事件,debouncing time = 0ms

Thanks again,
光盘

mt_dialog.
离线
最后一次露面:2个月3周前
职员
加入:2015-06-08 11:34
嗨CD,

嗨CD,

是的,就是正确的,注册回调(Wkupct_register_callback(您的函数))并使引脚和极性为适当的PIN(WKUPCT_ENABLE_IRQ())。

谢谢mt_dialog.

光盘
离线
最后一次露面:3年10个月前
加入:2015-11-18 02:51
嗨MT,

嗨MT,

非常感谢您的确认。
现在,很清楚!!

非常感谢,
光盘

主题锁定