Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 

HardwareSerial wrapper to enable 9-bit TX/RX

Provides Serial9b1 object that wraps the standard Serial1 object, and defines the following additional methods:

int16_t   read9b();
void      write9b(uint16_t b);

Usage:

void setup() {
    // Configure Serial1 for 9-bit data.
    // Do NOT use Serial1 while this is in use!
    Serial9b1.begin(9600);
}

void loop() {
    Serial9b1.write9b(0x1AA); // bit9 = 1
    Serial9b1.write9b(0x0AA); // bit9 = 0
    Serial9b1.write9b(0xAA | BIT8); // bit9 = 1 (alternative method)
    delay(10);
}

About

Extends HardwareSerial to support 9-bit data (AVR)

Topics

Resources

License

Releases

No releases published

Packages

No packages published