UNPKG

it8951

Version:

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

224 lines (128 loc) 5.58 kB
[it8951](../README.md) › [Globals](../globals.md) › ["it8951"](../modules/_it8951_.md) › [IT8951](_it8951_.it8951.md) # Class: IT8951 ## Hierarchy * **IT8951** ## Index ### Constructors * [constructor](_it8951_.it8951.md#constructor) ### Accessors * [vcom](_it8951_.it8951.md#vcom) ### Methods * [displayArea](_it8951_.it8951.md#displayarea) * [readRegister](_it8951_.it8951.md#readregister) * [run](_it8951_.it8951.md#run) * [setRegister](_it8951_.it8951.md#setregister) * [sleep](_it8951_.it8951.md#sleep) * [standby](_it8951_.it8951.md#standby) * [systemInfo](_it8951_.it8951.md#systeminfo) * [waitForDisplayReady](_it8951_.it8951.md#waitfordisplayready) * [writePixels](_it8951_.it8951.md#writepixels) ## Constructors ### constructor \+ **new IT8951**(`vcom?`: undefined | number): *[IT8951](_it8951_.it8951.md)* *Defined in [it8951.ts:391](https://github.com/gnzzz/IT8951/blob/604332d/lib/it8951.ts#L391)* Creates an instance of IT8951. If the voltage is omitted then the controller default of -1.5v is used. **Parameters:** Name | Type | Description | ------ | ------ | ------ | `vcom?` | undefined | number | Set the voltage of the display. | **Returns:** *[IT8951](_it8951_.it8951.md)* ## Accessors ### vcom**get vcom**(): *number* *Defined in [it8951.ts:432](https://github.com/gnzzz/IT8951/blob/604332d/lib/it8951.ts#L432)* Return the voltage **Returns:** *number***set vcom**(`vcom`: number): *void* *Defined in [it8951.ts:445](https://github.com/gnzzz/IT8951/blob/604332d/lib/it8951.ts#L445)* Sets the voltage **Parameters:** Name | Type | ------ | ------ | `vcom` | number | **Returns:** *void* ## Methods ### displayArea**displayArea**(`x`: number, `y`: number, `width`: number, `height`: number, `mode`: [WAVEFORM](../enums/_it8951_.waveform.md)): *void* *Defined in [it8951.ts:550](https://github.com/gnzzz/IT8951/blob/604332d/lib/it8951.ts#L550)* Updates a region of the screen with a previously loaded image. **Parameters:** Name | Type | Description | ------ | ------ | ------ | `x` | number | vertical start of area to dsiplay | `y` | number | horizontal start of area to dsiplay | `width` | number | width of data to dsiplay | `height` | number | height of data to dsiplay | `mode` | [WAVEFORM](../enums/_it8951_.waveform.md) | waveform mode to update display | **Returns:** *void* ___ ### readRegister ▸ **readRegister**(`address`: number | SYS_REG): *number* *Defined in [it8951.ts:472](https://github.com/gnzzz/IT8951/blob/604332d/lib/it8951.ts#L472)* Reads register value at `address` **Parameters:** Name | Type | Description | ------ | ------ | ------ | `address` | number | SYS_REG | Address value to read | **Returns:** *number* ___ ### run**run**(): *void* *Defined in [it8951.ts:573](https://github.com/gnzzz/IT8951/blob/604332d/lib/it8951.ts#L573)* Issues the display running command. Enables all clocks and goes to active state. **Returns:** *void* ___ ### setRegister ▸ **setRegister**(`address`: number | SYS_REG, `value`: number): *void* *Defined in [it8951.ts:459](https://github.com/gnzzz/IT8951/blob/604332d/lib/it8951.ts#L459)* Sets register `address` to `value`. **Parameters:** Name | Type | Description | ------ | ------ | ------ | `address` | number | SYS_REG | Address value to set | `value` | number | Value to set | **Returns:** *void* ___ ### sleep**sleep**(): *void* *Defined in [it8951.ts:595](https://github.com/gnzzz/IT8951/blob/604332d/lib/it8951.ts#L595)* Issues the display sleep command. Disables all clocks and goes to sleep state. **Returns:** *void* ___ ### standby ▸ **standby**(): *void* *Defined in [it8951.ts:584](https://github.com/gnzzz/IT8951/blob/604332d/lib/it8951.ts#L584)* Issues the display standby command. Gate off clocks and go to standby state. **Returns:** *void* ___ ### systemInfo**systemInfo**(): *[SystemInfo](../interfaces/_it8951_.systeminfo.md)* *Defined in [it8951.ts:411](https://github.com/gnzzz/IT8951/blob/604332d/lib/it8951.ts#L411)* Queries the controller for the dev info. **Returns:** *[SystemInfo](../interfaces/_it8951_.systeminfo.md)* ___ ### waitForDisplayReady ▸ **waitForDisplayReady**(): *Promise‹unknown›* *Defined in [it8951.ts:606](https://github.com/gnzzz/IT8951/blob/604332d/lib/it8951.ts#L606)* Returns a promise that resolves when all the lut engines are ready. **Returns:** *Promise‹unknown›* ___ ### writePixels**writePixels**(`x`: number, `y`: number, `width`: number, `height`: number, `image`: Buffer, `bpp`: [PIXEL_PACKING](../enums/_it8951_.pixel_packing.md), `rotate`: [IMAGE_ROTATION](../enums/_it8951_.image_rotation.md), `endianism`: [ENDIANNESS](../enums/_it8951_.endianness.md)): *void* *Defined in [it8951.ts:493](https://github.com/gnzzz/IT8951/blob/604332d/lib/it8951.ts#L493)* Loads an image to memory without updating display. **Parameters:** Name | Type | Default | Description | ------ | ------ | ------ | ------ | `x` | number | - | vertical start of area to load | `y` | number | - | horizontal start of area to load | `width` | number | - | width of data to load | `height` | number | - | height of data to load | `image` | Buffer | - | data endianness | `bpp` | [PIXEL_PACKING](../enums/_it8951_.pixel_packing.md) | - | byte packing of image data | `rotate` | [IMAGE_ROTATION](../enums/_it8951_.image_rotation.md) | IMAGE_ROTATION.ROTATE_0 | data for storage | `endianism` | [ENDIANNESS](../enums/_it8951_.endianness.md) | ENDIANNESS.LITTLE | - | **Returns:** *void*