本文整理汇总了C++中USARTClass类的典型用法代码示例。如果您正苦于以下问题:C++ USARTClass类的具体用法?C++ USARTClass怎么用?C++ USARTClass使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了USARTClass类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readPacket
/**
* Reads in a packet from the buffer
*
* @param serialPort Which serial port to read from
*
* @return PacketStatus indicating validity of packet
*/
PacketStatus RXPacket::readPacket(USARTClass serialPort) {
serialPort.readBytes(_data, RX_PACKET_SIZE);
uint16_t checksum = _data[RXCHECKSUM+1] << 8;
checksum += _data[RXCHECKSUM];
if (computeChecksum() == checksum) {
return VALID_PACKET;
} else {
return INVALID_PACKET;
}
}
示例2: serialEventRun
void serialEventRun(void)
{
if (Serial.available()) serialEvent();
if (Serial1.available()) serialEvent1();
if (Serial2.available()) serialEvent2();
if (Serial3.available()) serialEvent3();
}
示例3: USART3_Handler
void USART3_Handler(void)
{
Serial3.IrqHandler();
}
示例4: USART1_Handler
void USART1_Handler(void)
{
Serial2.IrqHandler();
}
示例5: USART0_Handler
// IT handlers
void USART0_Handler(void)
{
Serial1.IrqHandler();
}
示例6: USART3_IRQHandler
//Serial.begin() mapped to USART3(PC10,PC11)
void USART3_IRQHandler(void)
{
Serial.IrqHandler();
}
示例7: USART1_IRQHandler
// IT handlers
void USART1_IRQHandler(void)
{
Serial.IrqHandler();//USART1 must be Serial,for usart flash programming.
}