UNPKG

it8951

Version:

Raspberry Pi node.js module for e-papers controlled by IT8951

69 lines (68 loc) 1.65 kB
/** * Possible pin values when using {@link setPin} or {@link readPin} * * @enum {number} */ export declare enum PIN_VALUE { /** * Pin low, i.e. no voltage. */ LOW = 0, /** * Pin high, i.e. 3.3v on specified pin. */ HIGH = 1 } /** * The SPI class is a convenience class for sending data over SPI. In practice, it only exposes the methods needed for the main {@link IT8951} class. * * @export * @class SPI */ export declare class SPI { /** * Creates an instance of SPI. * * This will initialise the c++ code, then set chip select pin high and trigger a controller reset. */ constructor(); /** * Reset the controller. */ reset(): any; /** * Write the words in `data` over the SPI interface. * * @param data Array of words to write. */ writeWords(data: Uint16Array): void; /** * Reads `length` number of words from the SPI interface. * * @param length Number of words to read. */ readWords(length: number): Uint16Array; /** * Writes a sequence of bytes over the SPI interface. * * @param data Array of bytes to write. */ writeBytes(data: Uint8Array): void; /** * Read pin `pin`. * * @param pin Hardware pin number to read */ readPin(pin: number): PIN_VALUE; /** * Set pin `pin` to `value`. * * @param pin Hardware pin number to set * @param value Value to set */ setPin(pin: number, value: PIN_VALUE): void; /** * Synchronously blocks until the SPI is ready for new messages. */ waitForReady(): void; }