本文整理汇总了C++中Nop函数的典型用法代码示例。如果您正苦于以下问题:C++ Nop函数的具体用法?C++ Nop怎么用?C++ Nop使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Nop函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LCD_i_write
void LCD_i_write(BYTE v)
{
LCDWritePortA(0);
DelayMs(1);
LCDWritePortB(v);
Nop();
Nop();
Nop();
Nop();
LCDWritePortA(0x40);
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
LCDWritePortA(0x00);
return;
}
示例2: wait
void wait(unsigned int count)
{
/* count of 1 is approx 10.5us */
volatile unsigned int x;
for(x = 0; x < count; x++)
{
Nop();
}
}
示例3: LCD_i_write
void LCD_i_write(uint8_t v)
{
LCDWritePortA(0);
DELAY_ms(1);
LCDWritePortB(v);
Nop();
Nop();
Nop();
Nop();
LCDWritePortA(0x40);
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
LCDWritePortA(0x00);
return;
}
示例4: LCD_d_write
void LCD_d_write(uint8_t v)
{
DELAY_ms(1);
LCDWritePortA(0x80);
LCDWritePortB(v);
Nop();
Nop();
Nop();
Nop();
LCDWritePortA(0xC0);
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
LCDWritePortA(0);
}
示例5: RestartI2C
/*********************************************************************
* Function: RestartI2C()
* Overview: Generates a restart condition and optionally returns status
********************************************************************/
unsigned int RestartI2C(void)
{
//This function generates an I2C Restart condition and returns status
//of the Restart.
I2C1CONbits.RSEN = 1; //Generate Restart
Nop();
while (I2C1CONbits.RSEN); //Wait for restart
//return(I2C1STATbits.S); //Optional - return status
}
示例6: StopI2C
/*********************************************************************
* Function: StopI2C()
* Overview: Generates a bus stop condition
********************************************************************/
unsigned int StopI2C(void)
{
//This function generates an I2C stop condition and returns status
//of the Stop.
I2C1CONbits.PEN = 1; //Generate Stop Condition
Nop();
while (I2C1CONbits.PEN); //Wait for Stop
//return(I2C1STATbits.P); //Optional - return status
}
示例7: LCD_d_write
void LCD_d_write(BYTE v)
{
DelayMs(1);
LCDWritePortA(0x80);
LCDWritePortB(v);
Nop();
Nop();
Nop();
Nop();
LCDWritePortA(0xC0);
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
LCDWritePortA(0);
}
示例8: StartI2C
unsigned int StartI2C(void)
{
//This function generates an I2C start condition and returns status
//of the Start.
I2C1CONbits.SEN = 1; //Generate Start Condition
Nop();
while (I2C1CONbits.SEN); //Wait for Start Condition
//return(I2C1STATbits.S); //Optionally return status
}
示例9: fpga_0clear
void fpga_0clear(void)
{
// while(BUSY!=0){}
SLC=memory0set;
SLT=0;
SLT=1;
Nop();
SLT=0;
}
示例10: i2c_Start
void i2c_Start(char addr, char rw){
I2C2CONbits.ACKDT = 0;
int i=0;
for(i=0;i<1000;i++)
Nop();
I2C2CONbits.SEN = 1;
while(I2C2CONbits.SEN){};
i2c_Write(addr | rw);
}
示例11: adxl345_get_xyz
void adxl345_get_xyz(PACC_XYZ adxl345) {
ACC_CS = 0;
SD_CS = 1;
Nop();
Nop();
Nop();
SPI_INTERRUPT_FLAG = 0;
SPIBUF = 0xF2; // do a multiread of all 6 bytes (0b11[0x32: DATAX0])
while (!SPI_INTERRUPT_FLAG);
SPI_INTERRUPT_FLAG = 0;
SPIBUF = 0x00;
while (!SPI_INTERRUPT_FLAG);
SPI_INTERRUPT_FLAG = 0;
SPIBUF = 0x00;
while (!SPI_INTERRUPT_FLAG);
adxl345->x = SPIBUF;
adxl345->x ^= 0x80;
SPI_INTERRUPT_FLAG = 0;
SPIBUF = 0x00;
while (!SPI_INTERRUPT_FLAG);
SPI_INTERRUPT_FLAG = 0;
SPIBUF = 0x00;
while (!SPI_INTERRUPT_FLAG);
adxl345->y = SPIBUF;
adxl345->y ^= 0x80;
SPI_INTERRUPT_FLAG = 0;
SPIBUF = 0x00;
while (!SPI_INTERRUPT_FLAG);
SPI_INTERRUPT_FLAG = 0;
SPIBUF = 0x00;
while (!SPI_INTERRUPT_FLAG);
adxl345->z = SPIBUF;
adxl345->z ^= 0x80;
ACC_CS = 1;
}
示例12: K9F1208_Wdata
void K9F1208_Wdata(unsigned char data)//写数据
{
K9F_Odata;//输出
K9F_CLE=0;
K9F_ALE=0;
K9F_WE=0;
K9F_O_data=data;
Nop();
K9F_WE=1;
}
示例13: GetCommand
/********************************************************************
* Function: void GetCommand()
*
* Precondition: UART Setup
*
* Input: None.
*
* Output: None.
*
* Side Effects: None.
*
* Overview: Polls the UART to recieve a complete AN851 command.
* Fills buffer[1024] with recieved data.
*
* Note: None.
********************************************************************/
void GetCommand()
{
BYTE RXByte;
BYTE checksum;
WORD dataCount;
while(1){
#ifndef USE_AUTOBAUD
GetChar(&RXByte); //Get first STX
if(RXByte == STX){
#else
AutoBaud(); //Get first STX and calculate baud rate
RXByte = UxRXREG; //Dummy read
#endif
T2CONbits.TON = 0; //Disable timer - data received
GetChar(&RXByte); //Read second byte
if(RXByte == STX){ //2 STX, beginning of data
checksum = 0; //Reset checksum
dataCount = 0; //Reset datacount
while(dataCount <= MAX_PACKET_SIZE+1){ //Maximum num bytes to receive
GetChar(&RXByte);
switch(RXByte){
case STX: //Start over if STX
checksum = 0;
dataCount = 0;
break;
case ETX: //End of packet if ETX
checksum = ~checksum +1; //Test checksum
Nop();
if(checksum == 0) return; //Return if OK
dataCount = 0xFFFF; //Otherwise restart
break;
case DLE: //If DLE, treat next as data
GetChar(&RXByte);
default: //Get data, put in buffer
checksum += RXByte;
buffer[dataCount++] = RXByte;
break;
} //End switch(RXByte)
} //End while(byteCount <= 1024)
} //End if(RXByte == STX)
#ifndef USE_AUTOBAUD
} //End if(RXByte == STX)
#endif
} //End while(1)
} //End GetCommand()
示例14: GetTickCopy
/*****************************************************************************
Function:
static void GetTickCopy(void)
Summary:
Reads the tick value.
Description:
This function performs an interrupt-safe and synchronized read of the
48-bit Tick value.
Precondition:
None
Parameters:
None
Returns:
None
***************************************************************************/
static void GetTickCopy(void)
{
// Perform an Interrupt safe and synchronized read of the 48-bit
// tick value
#if defined(__18CXX) || defined (__SDCC__)
do
{
INTCONbits.TMR0IE = 1; // Enable interrupt
Nop();
INTCONbits.TMR0IE = 0; // Disable interrupt
vTickReading[0] = TMR0L;
vTickReading[1] = TMR0H;
*((DWORD*)&vTickReading[2]) = dwInternalTicks;
} while(INTCONbits.TMR0IF);
INTCONbits.TMR0IE = 1; // Enable interrupt
#else
do
{
DWORD dwTempTicks;
IEC0bits.T1IE = 1; // Enable interrupt
Nop();
IEC0bits.T1IE = 0; // Disable interrupt
// Get low 2 bytes
((WORD*)vTickReading)[0] = TMR1;
// Correct corner case where interrupt increments byte[4+] but
// TMR1 hasn't rolled over to 0x0000 yet
dwTempTicks = dwInternalTicks;
if(((WORD*)vTickReading)[0] == 0xFFFFu)
dwTempTicks--;
// Get high 4 bytes
vTickReading[2] = ((BYTE*)&dwTempTicks)[0];
vTickReading[3] = ((BYTE*)&dwTempTicks)[1];
vTickReading[4] = ((BYTE*)&dwTempTicks)[2];
vTickReading[5] = ((BYTE*)&dwTempTicks)[3];
} while(IFS0bits.T1IF);
IEC0bits.T1IE = 1; // Enable interrupt
#endif
}
示例15: r_cv_read
Uint8 r_cv_read(){
R_CV_Tris = 1;
Nop();
if(R_CV_Read){
delayus(100);
if(R_CV_Read){
return true;
}
}
return false;
}