<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>which changes are require in code when use of wakeup button ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/46320/which-changes-are-require-in-code-when-use-of-wakeup-button</link><description>Respected sir, 
 There is added external reset button at SRU532 module, and changes are given according to it using wakeup button at code.When wakeup button is used then some part is uncommented and want to reset only one pin using one button of nRF51422</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 15 Apr 2019 12:22:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/46320/which-changes-are-require-in-code-when-use-of-wakeup-button" /><item><title>RE: which changes are require in code when use of wakeup button ?</title><link>https://devzone.nordicsemi.com/thread/182606?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2019 12:22:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:167c3c8a-2218-4a10-ab40-cfd3bc4027f9</guid><dc:creator>VSN</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;**@brief Application&amp;#39;s Stack ANT event handler.
 *
 * @param[in]   p_ant_evt   Event received from the stack.
 */
static void on_ant_evt(ant_evt_t * p_ant_evt)
{
	uint32_t err_code;
    /*if (p_ant_evt-&amp;gt;channel == ANT_HRMRX_ANT_CHANNEL)// oeration of the HRT channel
    {
        switch (p_ant_evt-&amp;gt;event)
        {
            case EVENT_RX:
                on_ant_evt_rx(p_ant_evt);
                break;

            case EVENT_CHANNEL_CLOSED:
                on_ant_evt_channel_closed();
                break;

            default:
                // No implementation needed.
                break;
        }
    }*/
		
		if (p_ant_evt-&amp;gt;channel == ANT_FALCOTX_ANT_CHANNEL) // operation of the falco-motor channel 
		{
			 switch (p_ant_evt-&amp;gt;event)
        {
						case EVENT_TX: // if transmisson 
                 //channel_event_handle(event); // boradcast the Hx_M motor  data  
									on_ant_evt_tx(p_ant_evt);		
                 break;	
					
            case EVENT_RX:
                on_ant_evt_rx(p_ant_evt);
                break;

            case EVENT_CHANNEL_CLOSED:
                on_ant_evt_channel_closed();

						err_code = sd_ant_channel_open(ANT_FALCOTX_ANT_CHANNEL); // open the Motor CH0 
								APP_ERROR_CHECK(err_code);
	            
              
                break;

            default:
                // No implementation needed.
                break;
        }
			
			
		}
   else if (p_ant_evt-&amp;gt;channel == ANT_FALCOTTX_ANT_CHANNEL) // operation of the falco-motor channel 
		{
			 switch (p_ant_evt-&amp;gt;event)
        {
						case EVENT_TX: // if transmisson 
                 //channel_event_handle(event); // boradcast the Hx_M TS sensor data
									on_ant_evt_tx(p_ant_evt);	
                 break;
						
            case EVENT_RX:
                on_ant_evt_rx(p_ant_evt);
                break;

            case EVENT_CHANNEL_CLOSED:
                on_ant_evt_channel_closed();
						
								err_code = sd_ant_channel_open(ANT_FALCOTTX_ANT_CHANNEL);// open the TS CH1 
								APP_ERROR_CHECK(err_code);				
							
                break;

            default:
                // No implementation needed.
                break;
        }
			
			
		}		&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: which changes are require in code when use of wakeup button ?</title><link>https://devzone.nordicsemi.com/thread/182605?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2019 12:18:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ccf231ba-0ac0-4ed0-8ba2-bfa308e47144</guid><dc:creator>VSN</dc:creator><description>&lt;p&gt;There is need to reopen channel of ANT to receive data then how this function reinitialize at main() ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: which changes are require in code when use of wakeup button ?</title><link>https://devzone.nordicsemi.com/thread/182604?ContentTypeID=1</link><pubDate>Mon, 15 Apr 2019 12:10:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:072f980e-f556-45b8-a8b9-f86c71a21299</guid><dc:creator>VSN</dc:creator><description>&lt;p&gt;yes sir I checked it.But what exact changes are required in main() file&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: which changes are require in code when use of wakeup button ?</title><link>https://devzone.nordicsemi.com/thread/182603?ContentTypeID=1</link><pubDate>Mon, 08 Apr 2019 09:16:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:acf79401-a4c8-4115-be3c-64a22fea84e7</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After wakeup from system OFF the code execution will start from the beginning of main() - same as Power On and soft reset. You need to check NRF_POWER -&amp;gt; RESETREAS register to find the cause of reset (e.g. wakeup from System OFF).&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: which changes are require in code when use of wakeup button ?</title><link>https://devzone.nordicsemi.com/thread/182602?ContentTypeID=1</link><pubDate>Fri, 05 Apr 2019 07:36:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a79b5890-a3ee-4656-98d6-b880bb5960aa</guid><dc:creator>VSN</dc:creator><description>&lt;p&gt;Hello sir,After system power off reset button is activated at p0.23 and SRU532 module is on but data will not come.There is any re-initialization is required after system power off? e.g channel re-initialization.&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-be8d4018d87c4d2b9eb359ffb6f5d7b5/ble_5F00_ant_5F00_app_5F00_hrm_5F00_s310_5F00_pca10028.uvprojx"&gt;devzone.nordicsemi.com/.../ble_5F00_ant_5F00_app_5F00_hrm_5F00_s310_5F00_pca10028.uvprojx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I have attached my source code please find this attachment&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: which changes are require in code when use of wakeup button ?</title><link>https://devzone.nordicsemi.com/thread/182601?ContentTypeID=1</link><pubDate>Thu, 14 Mar 2019 12:50:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ccf0ba7c-380e-4be9-b8f5-caacb89d65b2</guid><dc:creator>VSN</dc:creator><description>&lt;p&gt;Ok I will check it.Thank you for response&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: which changes are require in code when use of wakeup button ?</title><link>https://devzone.nordicsemi.com/thread/182600?ContentTypeID=1</link><pubDate>Thu, 14 Mar 2019 12:19:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1aca3618-3761-4553-acb8-ff959f9abd90</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I don&amp;#39;t have a good suggestion than to study the ble_app_uart example to try to find the cause. Maybe you can add debug output, and for instance print out the BLE events that occurs, and compare if some events are missing or changed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: which changes are require in code when use of wakeup button ?</title><link>https://devzone.nordicsemi.com/thread/182599?ContentTypeID=1</link><pubDate>Thu, 14 Mar 2019 11:13:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e9c3d40-b121-4726-8c9d-55fe400caf33</guid><dc:creator>VSN</dc:creator><description>&lt;p&gt;Thank you for response.I have define &amp;quot;#define WAKEUP_BUTTON_ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BUTTON_A&amp;quot; and uncomment lines &amp;quot;err_code = bsp_buttons_enable((1 &amp;lt;&amp;lt; WAKEUP_BUTTON_ID) | (1 &amp;lt;&amp;lt; BOND_DELETE_ALL_BUTTON_ID));&lt;br /&gt; APP_ERROR_CHECK(err_code); &amp;quot; and reset button is added externally to SRU532 module at pin p0.23.When systems power on then module become on and after 3 minutes it will auto off.after that press rest button then it gives data when connected with Android App.First time of reset pressing data is given but after that it is connected with App but not gives data.Please give me solution for that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: which changes are require in code when use of wakeup button ?</title><link>https://devzone.nordicsemi.com/thread/182598?ContentTypeID=1</link><pubDate>Mon, 11 Mar 2019 15:16:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b61129b0-c951-416b-b0cf-b69e3e0722a3</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;The easiest may just be to have a global variable that&amp;nbsp;you set&amp;nbsp;on button press, and when advertisement time-out (BLE_ADV_EVT_IDLE event), then check if the global variable is set, and if set then clear global variable and start advertisement again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: which changes are require in code when use of wakeup button ?</title><link>https://devzone.nordicsemi.com/thread/182597?ContentTypeID=1</link><pubDate>Fri, 08 Mar 2019 09:50:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebe73a35-71c1-4a7c-802e-c8c3a47e6fc4</guid><dc:creator>VSN</dc:creator><description>&lt;p&gt;Thank you for response.I want only one button in use #define BUTTON_A&amp;nbsp; &amp;nbsp; &amp;nbsp;23&amp;nbsp; &amp;nbsp; for reset&amp;nbsp;#define APP_ADV_TIMEOUT_IN_SECONDS&amp;nbsp; &amp;nbsp; &amp;nbsp; 180,&amp;nbsp; &amp;nbsp; this time.Then what exact changes are require to do that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: which changes are require in code when use of wakeup button ?</title><link>https://devzone.nordicsemi.com/thread/182596?ContentTypeID=1</link><pubDate>Thu, 07 Mar 2019 09:20:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3947c48c-abbe-499b-b0fc-d3789181504b</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;There is an old tutorial on board support package, maybe you can take a look at it:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/tutorials/b/software-development-kit/posts/board-support-package-bsp"&gt;https://devzone.nordicsemi.com/tutorials/b/software-development-kit/posts/board-support-package-bsp&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: which changes are require in code when use of wakeup button ?</title><link>https://devzone.nordicsemi.com/thread/182595?ContentTypeID=1</link><pubDate>Wed, 06 Mar 2019 05:35:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa835fc3-96c8-47a2-94ea-3319ebb72df5</guid><dc:creator>VSN</dc:creator><description>&lt;p&gt;Thanks for it.I want one button used for reset BLE advertising time which is by default 180 sec in given code.Here used SRU532 module,SDK 9.0 and softdevice s310 for nRF51422.How one pin of SRU532 module is configured from software as well as hardware side?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;
#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;string.h&amp;gt;
#include &amp;quot;app_uart.h&amp;quot;
#include &amp;quot;app_error.h&amp;quot;
#include &amp;quot;nrf_delay.h&amp;quot;
#include &amp;quot;nordic_common.h&amp;quot;
#include &amp;quot;nrf.h&amp;quot;
#include &amp;quot;app_error.h&amp;quot;
#include &amp;quot;nrf_gpio.h&amp;quot;
#include &amp;quot;nrf51_bitfields.h&amp;quot;
#include &amp;quot;ble.h&amp;quot;
#include &amp;quot;ble_hci.h&amp;quot;
#include &amp;quot;ble_srv_common.h&amp;quot;
#include &amp;quot;ble_advdata.h&amp;quot;
#include &amp;quot;ble_hrs.h&amp;quot;
#include &amp;quot;ble_dis.h&amp;quot;
#include &amp;quot;ble_conn_params.h&amp;quot;
#include &amp;quot;ble_nus.h&amp;quot;
#include &amp;quot;boards.h&amp;quot;
#include &amp;quot;sensorsim.h&amp;quot;
#include &amp;quot;softdevice_handler.h&amp;quot;
#include &amp;quot;app_timer.h&amp;quot;
#include &amp;quot;device_manager.h&amp;quot;
#include &amp;quot;ant_parameters.h&amp;quot;
#include &amp;quot;ant_interface.h&amp;quot;
#include &amp;quot;pstorage.h&amp;quot;
#include &amp;quot;app_trace.h&amp;quot;
#include &amp;quot;bsp.h&amp;quot;
#include &amp;quot;ant_error.h&amp;quot;
#include &amp;quot;ant_stack_config.h&amp;quot;
#include &amp;quot;ant_stack_handler_types.h&amp;quot;




//#include &amp;quot;nrf_drv_rtc.h&amp;quot;
//#include &amp;quot;nrf_drv_clock.h&amp;quot;





#define WAKEUP_BUTTON_ID               	0                                            /**&amp;lt; Button used to wake up the application. */
#define BOND_DELETE_ALL_BUTTON_ID       1                                            /**&amp;lt; Button used for deleting all bonded centrals during startup. */

#define DEVICE_NAME                     &amp;quot;Nordic_UART&amp;quot;                               /**&amp;lt; Name of device. Will be included in the advertising data. */

//#define DEVICE_NAME                     &amp;quot;nrf51422_HRM&amp;quot;                               /**&amp;lt; Name of device. Will be included in the advertising data. */
#define MANUFACTURER_NAME               &amp;quot;NordicSemiconductor&amp;quot;                        /**&amp;lt; Manufacturer. Will be passed to Device Information Service. */
#define APP_ADV_INTERVAL                40                                           /**&amp;lt; The advertising interval (in units of 0.625 ms. This value corresponds to 25 ms). */
#define APP_ADV_TIMEOUT_IN_SECONDS      3600                                          /**&amp;lt; The advertising timeout in units of seconds. */
#define NUS_SERVICE_UUID_TYPE           BLE_UUID_TYPE_VENDOR_BEGIN                  /**&amp;lt; UUID type for the Nordic UART Service (vendor specific). */

#define IS_SRVC_CHANGED_CHARACT_PRESENT 0                                            /**&amp;lt; Whether or not to include the service_changed characteristic. If not enabled, the server&amp;#39;s database cannot be changed for the lifetime of the device */
#define APP_TIMER_PRESCALER             0                                            /**&amp;lt; Value of the RTC1 PRESCALER register. */
//#define APP_TIMER_MAX_TIMERS            (2 + BSP_APP_TIMERS_NUMBER)                  /**&amp;lt; Maximum number of simultaneously created timers. */
#define APP_TIMER_MAX_TIMERS            	(4 + BSP_APP_TIMERS_NUMBER)                  /**&amp;lt; Maximum number of simultaneously created timers. */
#define APP_TIMER_OP_QUEUE_SIZE         	4                                            /**&amp;lt; Size of timer operation queues. */

#define MOTOR_DATA_MEAS_INTERVAL          APP_TIMER_TICKS(500, APP_TIMER_PRESCALER) /**&amp;lt; MOTOR data measurement interval (ticks). */
//#define TS_DATA_MEAS_INTERVAL             APP_TIMER_TICKS(1000, APP_TIMER_PRESCALER) /**&amp;lt; Torque sensor data measurement interval (ticks). */

#define SECOND_1_25_MS_UNITS            800                                          /**&amp;lt; Definition of 1 second, when 1 unit is 1.25 ms. */
#define SECOND_10_MS_UNITS              100                                          /**&amp;lt; Definition of 1 second, when 1 unit is 10 ms. */
#define MIN_CONN_INTERVAL               (SECOND_1_25_MS_UNITS / 2)                   /**&amp;lt; Minimum acceptable connection interval (0.5 seconds), Connection interval uses 1.25 ms units. */
#define MAX_CONN_INTERVAL               (SECOND_1_25_MS_UNITS)                       /**&amp;lt; Maximum acceptable connection interval (1 second), Connection interval uses 1.25 ms units. */
#define SLAVE_LATENCY                   0                                            /**&amp;lt; Slave latency. */
#define CONN_SUP_TIMEOUT                (4 * SECOND_10_MS_UNITS)                     /**&amp;lt; Connection supervisory timeout (4 seconds), Supervision Timeout uses 10 ms units. */

#define FIRST_CONN_PARAMS_UPDATE_DELAY  APP_TIMER_TICKS(5000, APP_TIMER_PRESCALER)   /**&amp;lt; Time from initiating event (connect or start of notification) to first time sd_ble_gap_conn_param_update is called (5 seconds). */
#define NEXT_CONN_PARAMS_UPDATE_DELAY   APP_TIMER_TICKS(30000, APP_TIMER_PRESCALER)  /**&amp;lt; Time between each call to sd_ble_gap_conn_param_update after the first call (30 seconds). */
#define MAX_CONN_PARAMS_UPDATE_COUNT    3                                            /**&amp;lt; Number of attempts before giving up the connection parameter negotiation. */

#define SEC_PARAM_TIMEOUT               30                                           /**&amp;lt; Timeout for Pairing Request or Security Request (in seconds). */
#define SEC_PARAM_BOND                  1                                            /**&amp;lt; Perform bonding. */
#define SEC_PARAM_MITM                  0                                            /**&amp;lt; Man In The Middle protection not required. */
#define SEC_PARAM_IO_CAPABILITIES       BLE_GAP_IO_CAPS_NONE                         /**&amp;lt; No I/O capabilities. */
#define SEC_PARAM_OOB                   0                                            /**&amp;lt; Out Of Band data not available. */
#define SEC_PARAM_MIN_KEY_SIZE          7                                            /**&amp;lt; Minimum encryption key size. */
#define SEC_PARAM_MAX_KEY_SIZE          16                                           /**&amp;lt; Maximum encryption key size. */

#define DEAD_BEEF                       0xDEADBEEF                                   /**&amp;lt; Value used as error code on stack dump, can be used to identify stack location on stack unwind. */
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;#define BOND_DELETE_ALL_BUTTON_ID, It is require when wakeup button in use?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uint32_t bsp_buttons_enable()
{
#if (BUTTONS_NUMBER &amp;gt; 0) &amp;amp;&amp;amp; !defined(BSP_SIMPLE)
    return app_button_enable();
#else
    return NRF_ERROR_NOT_SUPPORTED;
#endif
}

uint32_t bsp_buttons_disable()
{
#if (BUTTONS_NUMBER &amp;gt; 0) &amp;amp;&amp;amp; !defined(BSP_SIMPLE)
    return app_button_disable();
#else
    return NRF_ERROR_NOT_SUPPORTED;
#endif
}

uint32_t bsp_wakeup_buttons_set(uint32_t wakeup_buttons)
{
#if (BUTTONS_NUMBER &amp;gt; 0) &amp;amp;&amp;amp; !defined(BSP_SIMPLE)
    for (uint32_t i = 0; i &amp;lt; BUTTONS_NUMBER; i++)
    {
        uint32_t new_cnf = NRF_GPIO-&amp;gt;PIN_CNF[m_buttons_list[i]];
        uint32_t new_sense = ((1 &amp;lt;&amp;lt; i) &amp;amp; wakeup_buttons) ? GPIO_PIN_CNF_SENSE_Low : GPIO_PIN_CNF_SENSE_Disabled;
        new_cnf &amp;amp;= ~GPIO_PIN_CNF_SENSE_Msk;
        new_cnf |= (new_sense &amp;lt;&amp;lt; GPIO_PIN_CNF_SENSE_Pos);
        NRF_GPIO-&amp;gt;PIN_CNF[m_buttons_list[i]] = new_cnf;
    }
    return NRF_SUCCESS;
#else
    return NRF_ERROR_NOT_SUPPORTED;
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;There is need of change in bsp.c file?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define BUTTONS_NUMBER 4

//IO board pull-up buttons
/*#define BUTTON_A     23 //BUTTON A on N5 Starter Kit IO Board
#define BUTTON_B     2  //BUTTON B on N5 Starter Kit IO Board
#define BUTTON_C     12 //BUTTON C on N5 Starter Kit IO Board
#define BUTTON_D     11 //BUTTON D on N5 Starter Kit IO Board
#define BUTTON_PULL  NRF_GPIO_PIN_PULLUP*/

//SRU532 board pull-up buttons
#define BUTTON_A     23 //BUTTON A on N5 Starter Kit IO Board
#define BUTTON_B     2  //BUTTON B on N5 Starter Kit IO Board
#define BUTTON_C     30 //BUTTON C on N5 Starter Kit IO Board
#define BUTTON_D     10 //BUTTON D on N5 Starter Kit IO Board
#define BUTTON_PULL  NRF_GPIO_PIN_PULLUP




#define BSP_BUTTON_0   BUTTON_A
#define BSP_BUTTON_1   BUTTON_B
#define BSP_BUTTON_2   BUTTON_C
#define BSP_BUTTON_3   BUTTON_D

#define BSP_BUTTON_0_MASK (1&amp;lt;&amp;lt;BSP_BUTTON_0)
#define BSP_BUTTON_1_MASK (1&amp;lt;&amp;lt;BSP_BUTTON_1)
#define BSP_BUTTON_2_MASK (1&amp;lt;&amp;lt;BSP_BUTTON_2)
#define BSP_BUTTON_3_MASK (1&amp;lt;&amp;lt;BSP_BUTTON_3)

#define BUTTONS_MASK   0x00801804 // b100000000001100000000100
#define BUTTONS_LIST { BUTTON_A, BUTTON_B, BUTTON_C, BUTTON_D }

//Battery board pull-up switches
#define SWITCH_1     5  // Switch 1 on N5 Starter Kit Battery Board
#define SWITCH_2     0  // Switch 2 on N5 Starter Kit Battery Board
#define SWITCH_3     6  // Switch 3 on N5 Starter Kit Battery Board
#define SWITCH_4     24 // Switch 4 on N5 Starter Kit Battery Board
#define SWITCH_5     9  // Switch 5 on N5 Starter Kit Battery Board
#define SWITCH_PULL  NRF_GPIO_PIN_PULLUP

#define SWITCHES_NUMBER 5

#define BSP_SWITCH_0 SWITCH_1
#define BSP_SWITCH_1 SWITCH_2
#define BSP_SWITCH_2 SWITCH_3
#define BSP_SWITCH_3 SWITCH_4
#define BSP_SWITCH_4 SWITCH_5

#define SWITCHES_MASK 0x01000261

#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Want to use one button from it,how can I use it at hardware as well as in software?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: which changes are require in code when use of wakeup button ?</title><link>https://devzone.nordicsemi.com/thread/182594?ContentTypeID=1</link><pubDate>Tue, 05 Mar 2019 14:25:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5316deb-d53d-4c32-8ed9-337b9b93789f</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Please refer for instance to the&amp;nbsp;\examples\ble_peripheral\ble_app_hids_keyboard on how to achieve this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;[...]

uint32_t bsp_btn_ble_sleep_mode_prepare(void)
{
    uint32_t err_code = bsp_wakeup_button_enable(BTN_ID_WAKEUP); 
    RETURN_ON_ERROR_NOT_NOT_SUPPORTED(err_code);

    err_code = bsp_wakeup_button_enable(BTN_ID_WAKEUP_BOND_DELETE); 
    RETURN_ON_ERROR_NOT_NOT_SUPPORTED(err_code);
    
    return NRF_SUCCESS;
}

[...]

static void sleep_mode_enter(void)
{
    uint32_t err_code = bsp_indication_set(BSP_INDICATE_IDLE);

    APP_ERROR_CHECK(err_code);

    // Prepare wakeup buttons.
    err_code = bsp_btn_ble_sleep_mode_prepare();
    APP_ERROR_CHECK(err_code);

    // Go to system-off mode (this function will not return; wakeup will cause a reset).
    err_code = sd_power_system_off();
    APP_ERROR_CHECK(err_code);
}

[...]

sleep_mode_enter();
while(1);

[...]&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>