Silicon Laboratories Si4010 Software Programming Manual page 34

Hide thumbs Also See for Si4010:
Table of Contents

Advertisement

AN370
/* Disable the Matrix and Roff modes */
PORT_CTRL &= ~(M_PORT_MATRIX | M_PORT_ROFF | M_PORT_STROBE);
PORT_CTRL |=
M_PORT_STROBE;
PORT_CTRL &= ~M_PORT_STROBE;
/* Clear the master time */
vSys_SetMasterTime( 0UL );
/* Prepare the BSR for debouncing .. interested to monitor buttons
* at GPIO1 and GPIO2 */
rBsrSetup.bButtonMask = (1 << B_GPIO1) | (1 << B_GPIO2);
rBsrSetup.pbPtsReserveHead = (BYTE *) arPtsArray;
rBsrSetup.bPtsSize = bPtsSize_c;
rBsrSetup.bPushQualThresh = 3;
/* Setup the BSR */
vBsr_Setup( &rBsrSetup );
/* Setup the RTC to tick every 5ms and clear it. Keep it disabled. */
RTC_CTRL = (0x07 << B_RTC_DIV) | M_RTC_CLR;
/* Enable the RTC */
RTC_CTRL |= M_RTC_ENA;
/* Enable the RTC interrupt and global interrupt enable */
ERTC = 1;
EA = 1;
/* Waiting for a button change */
while ( 1 )
{
/*
Wait for a button push */
while ( 0 == bBsr_GetPtsItemCnt() ) {}
/*
Get the button data */
34
/* 3 same consecutive samples to qualify */
Rev. 1.0

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Si4010 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents