mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Added peripheral classes from the raspi.js suite. * Refactored type names to match style guide
35 lines
479 B
TypeScript
35 lines
479 B
TypeScript
import {
|
|
PARITY_NONE,
|
|
PARITY_EVEN,
|
|
PARITY_ODD,
|
|
PARITY_MARK,
|
|
PARITY_SPACE,
|
|
DEFAULT_PORT,
|
|
Options,
|
|
Serial
|
|
} from 'raspi-serial';
|
|
|
|
let options: Options = {};
|
|
options = {
|
|
parity: PARITY_EVEN
|
|
};
|
|
options = {
|
|
parity: PARITY_ODD
|
|
};
|
|
options = {
|
|
parity: PARITY_MARK
|
|
};
|
|
options = {
|
|
parity: PARITY_SPACE
|
|
};
|
|
options = {
|
|
portId: DEFAULT_PORT,
|
|
baudRate: 9600,
|
|
dataBits: 8,
|
|
stopBits: 1,
|
|
parity: PARITY_NONE
|
|
};
|
|
|
|
new Serial();
|
|
const serial = new Serial(options);
|