DOCUMENTATION DRIVERS LS013B4DN04 display
Overview
Getting Started
BASE
Reference
Worker
Setup modules
COMMODETTO
Reference
Poco Renderer
Outlines
Creating Fonts
Crypt
Data
DEVICES
Moddable One
Moddable Two
Moddable Three
Moddable Four
ESP32
ESP8266
nRF52
nRF52 Low Power Notes
Raspberry Pi Pico
M5Core Ink
M5Paper
Wasm
SiLabs Gecko
QCA4020
Moddable Zero
DISPLAYS
Overview
Adafruit 1.8" ST7735
Adafruit OLED Display
BuyDisplay 2.8" CTP - ESP8266
Crystalfontz ePaper
DotStar
Generic 1.44"
Generic 2.4" & 2.8" (Resistive Touch) - ESP32
Generic 2.4" & 2.8" (Resistive Touch) - ESP8266
Generic 2.4" & 2.8" (Resistive Touch) - Pico
Sharp Memory
Sharp Memory Screen 1.3"
SparkFun TeensyView
Switch Science Reflective LCD
DRIVERS
DESTM32S display
DotStar display
ILI9341 display
LPM013M126A display
LS013B4DN04 display
MCP230XX GPIO expander
NeoStrand
SSD1306 display
SSD1351 display
ST7735 display
Files
IO
TC53 IO
Firmata
NETWORK
Reference
TLS (SecureSocket)
BLE
Ethernet
Web Things
PINS
Reference
Audio Output
PIU
Reference
Localization
Keyboard
Expanding Keyboard
Die Cut
Using After Effects Motion Data
TOOLS
Reference
Manifest
Defines in Manifests
Testing
XS
Handle
JavaScript language considerations on embedded devices using the XS engine
Mods – User Installed Extensions
ROM Colors
Using XS Preload to Optimize Applications
XS Conformance
XS Marshalling
XS Platforms
XS in C
XS linker warnings
xsbug
xst
XS Compartment
XS Profiler

LS013B4DN04 display driver

Copyright 2017 Moddable Tech, Inc.
Revised: December 28, 2017

The LS013B4DN04 Sharp memory display controller drives 1-bit per pixel (black and white) displays. Displays are up to 400 pixels wide and 240 pixels high.

Adding LS013B4DN04 to a project

To add the LS013B4DN04 driver to a project, include its manifest:

"include": [
	/* other includes here */
	"$(MODULES)/drivers/ls013b4dn04/manifest.json",
],

If using Commodetto or Piu, set the screen property of the config object in the manifest to ls013b4dn04 to make LS013B4DN04 the default display driver. Since there is no touch input, set the touch driver name to an empty string to disable it.

"config": {
	"screen": "ls013b4dn04",
	"touch": "",
},

Pixel format

The LS013B4DN04 driver requires 8-bit gray pixels as input. When building with mcconfig, set the pixel format to gray256 on the command line:

mcconfig -m -p esp -f gray256

Defines

In the defines object, declare the pixel width and height.

"defines": {
	"ls013b4dn04": {
		"width": 400,
		"height": 240,
	}
}

Configuring SPI

The defines object must contain the spi_port, along with the CS pin number. If the cs_port property is not provided, it defaults to NULL.

"defines": {
	"ls013b4dn04": {
		/* other properties here */
		"cs_pin": 4,
		"spi_port": "#HSPI",
	}
}

The hz property, when present, specifies the SPI bus speed. The default value is 10,000,000 Hz which is near the maximum SPI speed supported by the LS013B4DN04.

Drawing

The LS013B4DN04 driver always updates full scan lines, but can update arbitrary scan lines. This allows for partial updates of full rows. Piu automatically takes care of this, so script using Piu do not need to take this into account. Scripts using Poco need to ensure when calling poco.begin() that the x parameter is zero and the width parameter is equal to poco.width.