本文整理汇总了C++中HWREGBITW函数的典型用法代码示例。如果您正苦于以下问题:C++ HWREGBITW函数的具体用法?C++ HWREGBITW怎么用?C++ HWREGBITW使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HWREGBITW函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SoundCallback
//*****************************************************************************
//
// The callback function that is called by the sound driver to indicate that
// half of the sound buffer has been played.
//
//*****************************************************************************
void
SoundCallback(uint32_t ui32Half)
{
//
// See which half of the sound buffer has been played.
//
if(ui32Half == 0)
{
//
// The first half of the sound buffer needs to be filled.
//
HWREGBITW(&g_ui32Flags, FLAG_PING) = 1;
}
else
{
//
// The second half of the sound buffer needs to be filled.
//
HWREGBITW(&g_ui32Flags, FLAG_PONG) = 1;
}
}
示例2: Delay
//*****************************************************************************
//
// Delay for a multiple of the system tick clock rate.
//
//*****************************************************************************
static void
Delay(unsigned long ulCount)
{
//
// Loop while there are more clock ticks to wait for.
//
while(ulCount--)
{
//
// Wait until a SysTick interrupt has occurred.
//
while(!HWREGBITW(&g_ulFlags, FLAG_CLOCK_TICK))
{
}
//
// Clear the SysTick interrupt flag.
//
HWREGBITW(&g_ulFlags, FLAG_CLOCK_TICK) = 0;
}
}
示例3: DataReadyIntHandler
void DataReadyIntHandler(void)
{
uint8_t p = ROM_GPIOPinIntStatus(ADS_DRY_PORT, true) & 0xFF;
MAP_IntDisable(INT_GPIOC);
MAP_GPIOPinIntDisable(ADS_DRY_PORT, ADS_DRY_PIN);
GPIOPinIntClear(ADS_DRY_PORT, p);
HWREGBITW(&g_ulFlags, FLAG_ADS_INT) = 1;
}
示例4: OLED_Init
//! Initialize the OLED display.
//! \param ulFrequency specifies the SSI Clock Frequency to be used.
//OLED初始化
void OLED_Init(unsigned long ulFrequency)
{
unsigned long ulIdx;
//
// Enable the SSI0 and GPIO port blocks as they are needed by this driver.
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIO_OLEDDC);
//
// Configure the SSI0CLK and SSIOTX pins for SSI operation.
//
GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_5);
GPIOPadConfigSet(GPIO_PORTA_BASE, GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_5,
GPIO_STRENGTH_8MA, GPIO_PIN_TYPE_STD_WPU);
//
// Configure the GPIO port pin used as a D/Cn signal for OLED device,
// and the port pin used to enable power to the OLED panel.
//
GPIOPinTypeGPIOOutput(GPIO_OLEDDC_BASE, GPIO_OLEDDC_PIN | GPIO_OLEDEN_PIN);
GPIOPadConfigSet(GPIO_OLEDDC_BASE, GPIO_OLEDDC_PIN | GPIO_OLEDEN_PIN,
GPIO_STRENGTH_8MA, GPIO_PIN_TYPE_STD);
GPIOPinWrite(GPIO_OLEDDC_BASE, GPIO_OLEDDC_PIN | GPIO_OLEDEN_PIN,
GPIO_OLEDDC_PIN | GPIO_OLEDEN_PIN);
HWREGBITW(&g_ulSSIFlags, FLAG_DC_HIGH) = 1;
//
// Configure and enable the SSI0 port for master mode.
//
OLED_Enable(ulFrequency);
//
// Clear the frame buffer.
//
OLED_Clear();
//
// Initialize the SSD1329 controller. Loop through the initialization
// sequence array, sending each command "string" to the controller.
//
for(ulIdx = 0; ulIdx < sizeof(OLED_INIT_CMD);
ulIdx += OLED_INIT_CMD[ulIdx] + 1)
{
//
// Send this command.
//
RITWriteCommand(OLED_INIT_CMD + ulIdx + 1,
OLED_INIT_CMD[ulIdx] - 1);
}
}
示例5: Delay
//*****************************************************************************
//
// This function delays for the specified number of milliseconds.
//
//*****************************************************************************
static void
Delay(unsigned long ulNumMS)
{
//
// Loop one time per millisecond.
//
for(; ulNumMS != 0; ulNumMS--)
{
//
// Clear the tick flag.
//
HWREGBITW(&g_ulFlags, FLAG_TICK) = 0;
//
// Wait until the tick flag is set.
//
while(HWREGBITW(&g_ulFlags, FLAG_TICK) == 0)
{
}
}
}
示例6: Timer0IntHandler
//*****************************************************************************
//
// The interrupt handler for the first timer interrupt.
//
//*****************************************************************************
void
Timer0IntHandler(void)
{
//
// Clear the timer interrupt.
//
ROM_TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
//
// Toggle the flag for the first timer.
//
HWREGBITW(&g_ui32Flags, 0) ^= 1;
//
// Update the interrupt status on the display.
//
ROM_IntMasterDisable();
GrStringDraw(&g_sContext, (HWREGBITW(&g_ui32Flags, 0) ? "1" : "0"), -1, 68,
26, 1);
ROM_IntMasterEnable();
}
示例7: EventHandler
//****************************************************************************
//
// Generic event handler for the composite device.
//
//****************************************************************************
unsigned long
EventHandler(void *pvCBData, unsigned long ulEvent, unsigned long ulMsgData,
void *pvMsgData)
{
switch(ulEvent)
{
//
// The host has connected to us and configured the device.
//
case USB_EVENT_CONNECTED:
{
//
// Now connected.
//
HWREGBITW(&g_ulFlags, FLAG_CONNECTED) = 1;
break;
}
//
// Handle the disconnect state.
//
case USB_EVENT_DISCONNECTED:
{
//
// No longer connected.
//
HWREGBITW(&g_ulFlags, FLAG_CONNECTED) = 0;
break;
}
default:
{
break;
}
}
return(0);
}
示例8: EthClientTCPConnect
//*****************************************************************************
//
// TCP connect
//
// This function attempts to connect to a TCP endpoint.
//
// \return None.
//
//*****************************************************************************
err_t
EthClientTCPConnect(uint32_t ui32Port)
{
err_t eTCPReturnCode;
//
// Enable the TCP timer function calls.
//
HWREGBITW(&g_sEnet.ui32Flags, FLAG_TIMER_TCP_EN) = 1;
if(g_sEnet.psTCP)
{
//
// Initially clear out all of the TCP callbacks.
//
tcp_sent(g_sEnet.psTCP, NULL);
tcp_recv(g_sEnet.psTCP, NULL);
tcp_err(g_sEnet.psTCP, NULL);
//
// Make sure there is no lingering TCP connection.
//
tcp_close(g_sEnet.psTCP);
}
//
// Create a new TCP socket.
//
g_sEnet.psTCP = tcp_new();
//
// Check if you need to go through a proxy.
//
if(g_sEnet.pcProxyName != 0)
{
//
// Attempt to connect through the proxy server.
//
eTCPReturnCode = tcp_connect(g_sEnet.psTCP, &g_sEnet.sServerIP,
ui32Port, TCPConnected);
}
else
{
//
// Attempt to connect to the server directly.
//
eTCPReturnCode = tcp_connect(g_sEnet.psTCP, &g_sEnet.sServerIP,
ui32Port, TCPConnected);
}
return(eTCPReturnCode);
}
示例9: LimitPositionReverseSet
//*****************************************************************************
//
// This function sets the position and comparison of the reverse soft limit
// switch.
//
//*****************************************************************************
void
LimitPositionReverseSet(long lPosition, unsigned long ulLessThan)
{
//
// Save the positino of the reverse limit switch.
//
g_lLimitReverse = lPosition;
//
// Save the comparison flag.
//
HWREGBITW(&g_ulLimitFlags, LIMIT_FLAG_REV_LT) = ulLessThan ? 1 : 0;
}
示例10: LimitPositionForwardSet
//*****************************************************************************
//
// This function sets the position and comparison of the forward soft limit
// switch.
//
//*****************************************************************************
void
LimitPositionForwardSet(long lPosition, unsigned long ulLessThan)
{
//
// Save the position of the forward limit switch.
//
g_lLimitForward = lPosition;
//
// Save the comparison flag.
//
HWREGBITW(&g_ulLimitFlags, LIMIT_FLAG_FWD_LT) = ulLessThan ? 1 : 0;
}
示例11: ProcessInterrupt
//*****************************************************************************
//
// In this particular example, this function merely updates an interrupt
// count and sets a flag which tells the main loop to update the display.
//
// TODO: Update or remove this function as required by your specific
// application.
//
//*****************************************************************************
void
ProcessInterrupt(void)
{
//
// Update our interrupt counter.
//
g_ui32IntCount++;
//
// Toggle the interrupt flag telling the main loop to update the display.
//
HWREGBITW(&g_ui32Flags, 0) ^= 1;
}
示例12: SysTickHandler
//****************************************************************************
//
// This is the interrupt handler for the SysTick interrupt. It is called
// periodically and updates a global tick counter then sets a flag to tell the
// main loop to move the mouse.
//
//****************************************************************************
void
SysTickHandler(void)
{
//
// Increment the current tick count.
//
g_ulSysTickCount++;
//
// Set a tick event for the mouse device.
//
HWREGBITW(&g_ulFlags, FLAG_MOVE_UPDATE) = 1;
}
示例13: SysTickIntHandler
//*****************************************************************************
//
// The interrupt handler for the SysTick interrupt.
//
//*****************************************************************************
void
SysTickIntHandler(void)
{
//
// Increment the system tick count.
//
g_ui32TickCounter++;
//
// Indicate that a SysTick interrupt has occurred.
//
HWREGBITW(&g_ui32Flags, FLAG_SYSTICK) = 1;
}
示例14: SysTickIntHandler
//*****************************************************************************
//
// This function is called by SysTick once every millisecond.
//
//*****************************************************************************
void
SysTickIntHandler(void)
{
unsigned long ulButtons, ulIdx;
//
// Set the flag that indicates that a timer tick has occurred.
//
HWREGBITW(&g_ulFlags, FLAG_TICK) = 1;
//
// Increment the count of ticks.
//
g_ulTickCount++;
//
// Call the CAN periodic tick function.
//
CANTick();
//
// Call the push button periodic tick function.
//
ulButtons = ButtonsTick();
//
// Set the appropriate button press flags if the corresponding button was
// pressed.
//
for(ulIdx = 0;
ulIdx < (sizeof(g_ppulButtonMap) / sizeof(g_ppulButtonMap[0]));
ulIdx++)
{
if(ulButtons & g_ppulButtonMap[ulIdx][0])
{
HWREGBITW(&g_ulFlags, g_ppulButtonMap[ulIdx][1]) = 1;
}
}
}
示例15: adcIsr
//adc ISR function
void adcIsr(UArg a0) {
// Pop sample from FIFO to allow clearing ADC_IRQ event
singleSample = AUXADCReadFifo();
printf ("ADC: %d\r\n",singleSample);
// Clear ADC_IRQ flag. Note: Missing driver for this.
HWREGBITW(AUX_EVCTL_BASE + AUX_EVCTL_O_EVTOMCUFLAGSCLR, AUX_EVCTL_EVTOMCUFLAGSCLR_ADC_IRQ_BITN) = 1;
// Post semaphore to wakeup task
Semaphore_post(hSem);
}