<?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>How to add custom button using BSP?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/29042/how-to-add-custom-button-using-bsp</link><description>Hello, 
 How to ass custom button using BSP? In the default setting, there are only 4 buttons. But my custom board has more than 4 buttons. How to add more button using BSP??
I increase &amp;quot;BUTTONS_NUMBER&amp;quot; and corresponding other values also, like BUTTON_x</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 23 Aug 2019 17:29:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/29042/how-to-add-custom-button-using-bsp" /><item><title>RE: How to add custom button using BSP?</title><link>https://devzone.nordicsemi.com/thread/205953?ContentTypeID=1</link><pubDate>Fri, 23 Aug 2019 17:29:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b449f6b-a063-4d4f-8e55-be906ed11987</guid><dc:creator>Ptd006</dc:creator><description>&lt;p&gt;Thank you Sigurd!&amp;nbsp; I spent over an hour trying to figure out why only 4 of my buttons worked&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add custom button using BSP?</title><link>https://devzone.nordicsemi.com/thread/115035?ContentTypeID=1</link><pubDate>Mon, 26 Sep 2016 12:35:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7870f06a-ab4a-4f6c-871c-46d35a505cd7</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;A button press is a low power event, so you will need to increase GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add custom button using BSP?</title><link>https://devzone.nordicsemi.com/thread/115034?ContentTypeID=1</link><pubDate>Mon, 26 Sep 2016 12:13:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d0c6305-dc07-488e-aa55-36e44be4b2d8</guid><dc:creator>sosse</dc:creator><description>&lt;p&gt;is it something related to &amp;quot;NUMBER_OF_GPIO_TE = 4&amp;quot;??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add custom button using BSP?</title><link>https://devzone.nordicsemi.com/thread/115036?ContentTypeID=1</link><pubDate>Mon, 26 Sep 2016 09:39:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff8c0e51-e9dd-4eac-a247-e36ef62ad520</guid><dc:creator>sosse</dc:creator><description>&lt;p&gt;I did exactly what you said. here is my code related the the buttons in my custom bsp header file.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define BUTTONS_NUMBER 5
#define BUTTON_START   1
#define BUTTON_1       1
#define BUTTON_2       2
#define BUTTON_3       3
#define BUTTON_4       4
#define BUTTON_5       5
#define BUTTON_STOP    5
#define BUTTON_PULL    NRF_GPIO_PIN_PULLUP

#define BUTTONS_LIST { BUTTON_1, BUTTON_2, BUTTON_3, BUTTON_4, BUTTON_5}

#define BSP_BUTTON_0   BUTTON_1
#define BSP_BUTTON_1   BUTTON_2
#define BSP_BUTTON_2   BUTTON_3
#define BSP_BUTTON_3   BUTTON_4
#define BSP_BUTTON_4   BUTTON_5

#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 BSP_BUTTON_4_MASK (1&amp;lt;&amp;lt;BSP_BUTTON_4)

//#define BUTTONS_MASK   0x000007FE
#define BUTTONS_MASK   0x0000003E
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;What is wrong with the code? FYI, I am using S130, 2.0.1, and ble_app_uart_c_s130 example.&lt;/p&gt;
&lt;p&gt;I got&lt;/p&gt;
&lt;p&gt;NRF_ERROR_INVALID_STATE (If button or GPIOTE has not been initialized). error from bsp_init.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add custom button using BSP?</title><link>https://devzone.nordicsemi.com/thread/115033?ContentTypeID=1</link><pubDate>Mon, 26 Sep 2016 08:37:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44a6d9a2-4331-4285-aa13-2f257a77d473</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;With a custom board you will need to modify the board files.&lt;/p&gt;
&lt;p&gt;You can find the board files under:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;\SDK_INSTALL_FOLDER\examples\bsp
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When creating a new board file, simply copy the pca10028.h file, rename it, and modify it after your requirements.
Then you have to modify boards.h to support your new file, and add a new define that you can specify in the Keil options to include your modified file.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>