You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
devices/experimental/devices/nrzled/nrz_spi.go

454 lines
25 KiB
Go

// Copyright 2016 The Periph Authors. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.
package nrzled
import (
"errors"
"fmt"
"image"
"image/color"
"image/draw"
"periph.io/x/periph/conn/display"
"periph.io/x/periph/conn/physic"
"periph.io/x/periph/conn/spi"
)
// SPIDev represents a strip of WS2812b LEDs as a strip connected over a SPI port.
// It accepts a stream of raw RGB pixels and converts it to a bit pattern consistent
// with the WS812b protocol.
// Includes intensity and temperature correction.
type SPIDev struct {
s spi.Conn //
numPixels int //
rawBuf []byte // Raw buffer sent over SPI. Cached to reduce heap fragmentation.
pixels []byte // Double buffer of pixels, to enable partial painting via Draw(). Effectively points inside rawBuf.
rect image.Rectangle // Device bounds
pixelMap map[image.Point]int
}
// NewSPI returns a strip that communicates over SPI to NRZ encoded LEDs.
//
// Due to the tight timing demands of these LEDs,
// the SPI port speed must be a reliable 2.5MHz
//
// Note that your SPI buffer should be at least 12*num_pixels+2 bytes long
func NewSPI(p spi.Port, o *Opts) (*SPIDev, error) {
c, err := p.Connect(2500*physic.KiloHertz, spi.Mode3|spi.NoCS, 8)
if err != nil {
return nil, err
}
rawBCt := 4 * (3 * o.NumPixels) //3 bytes per pixel, 4 symbol bytes per byte
buf := make([]byte, rawBCt+3) //3 bytes for latch. 24*400ns = 9600ns.
tail := buf[rawBCt:]
for i := range tail {
tail[i] = 0x00
}
return &SPIDev{
s: c,
numPixels: o.NumPixels,
rawBuf: buf,
pixels: buf[:rawBCt],
rect: image.Rect(0, 0, o.NumPixels, 1),
}, nil
}
func (d *SPIDev) String() string {
return fmt.Sprintf("nrzled: {%d, %s}", d.numPixels, d.s)
}
// ColorModel implements display.Drawer. There's no surprise, it is
// color.NRGBAModel.
func (d *SPIDev) ColorModel() color.Model {
return color.NRGBAModel
}
// Bounds implements display.Drawer. Min is guaranteed to be {0, 0}.
func (d *SPIDev) Bounds() image.Rectangle {
return d.rect
}
// Draw implements display.Drawer.
//
// Using something else than image.NRGBA is 10x slower. When using image.NRGBA,
// the alpha channel is ignored.
func (d *SPIDev) Draw(r image.Rectangle, src image.Image, sp image.Point) error {
if r = r.Intersect(d.rect); r.Empty() {
return nil
}
srcR := src.Bounds()
srcR.Min = srcR.Min.Add(sp)
if dX := r.Dx(); dX < srcR.Dx() {
srcR.Max.X = srcR.Min.X + dX
}
if dY := r.Dy(); dY < srcR.Dy() {
srcR.Max.Y = srcR.Min.Y + dY
}
if srcR.Empty() {
return nil
}
d.rasterImg(d.pixels, r, src, srcR)
return d.s.Tx(d.rawBuf, nil)
}
// Write accepts a stream of raw RGB pixels and sends it as WS2812b encoded
// stream.
func (d *SPIDev) Write(pixels []byte) (int, error) {
if len(pixels)%3 != 0 || len(pixels)/3 > d.numPixels {
return 0, errors.New("ws2812b: invalid RGB stream length")
}
// Do not touch footer.
d.raster(d.pixels, pixels, false)
err := d.s.Tx(d.rawBuf, nil)
return len(pixels), err
}
// Halt turns off all the lights.
func (d *SPIDev) Halt() error {
// Zap out the buffer.
for i := range d.pixels {
d.pixels[i] = 0x88
}
return d.s.Tx(d.rawBuf, nil)
}
// raster serializes a buffer of RGB bytes to the WS2812b SPI format.
//
// It is expected to be given the part where pixels are, not the header nor
// footer.
//
// dst is in WS2812b SPI 32 bits word format. src is in RGB 24 bits, or 32 bits
// word format when srcHasAlpha is true. The src alpha channel is ignored in
// this case.
//
// src cannot be longer in pixel count than dst.
func (d *SPIDev) raster(dst []byte, src []byte, srcHasAlpha bool) {
pBytes := 3
if srcHasAlpha {
pBytes = 4
}
length := len(src) / pBytes
if l := len(dst) / 4; l < length {
length = l
}
if length == 0 {
// Save ourself some unneeded processing.
return
}
stride := 4 //number of spi-bytes in color-byte
for i := 0; i < length; i++ {
sOff := pBytes * i
dOff := 3 * stride * i //3 channels * stride
r, g, b := src[sOff], src[sOff+1], src[sOff+2]
//grb color order, msb first
copy(dst[dOff+stride*0:dOff+stride*1], bitlut[r])
copy(dst[dOff+stride*1:dOff+stride*2], bitlut[g])
copy(dst[dOff+stride*2:dOff+stride*3], bitlut[b])
}
}
// rasterImg is the generic version of raster that converts an image instead of raw RGB values.
//
// It has 'fast paths' for image.RGBA and image.NRGBA that extract and convert the RGB values
// directly. For other image types, it converts to image.RGBA and then does the same. In all
// cases, alpha values are ignored.
//
// rect specifies where into the output buffer to draw.
//
// srcR specifies what portion of the source image to use.
func (d *SPIDev) rasterImg(dst []byte, rect image.Rectangle, src image.Image, srcR image.Rectangle) {
// Render directly into the buffer for maximum performance and to keep
// untouched sections intact.
switch im := src.(type) {
case *image.RGBA:
start := im.PixOffset(srcR.Min.X, srcR.Min.Y)
// srcR.Min.Y since the output display has only a single column
end := im.PixOffset(srcR.Max.X, srcR.Min.Y)
// Offset into the output buffer using rect
d.raster(dst[4*rect.Min.X:], im.Pix[start:end], true)
case *image.NRGBA:
// Ignores alpha
start := im.PixOffset(srcR.Min.X, srcR.Min.Y)
// srcR.Min.Y since the output display has only a single column
end := im.PixOffset(srcR.Max.X, srcR.Min.Y)
// Offset into the output buffer using rect
d.raster(dst[4*rect.Min.X:], im.Pix[start:end], true)
default:
// Slow path. Convert to RGBA
b := im.Bounds()
m := image.NewRGBA(image.Rect(0, 0, b.Dx(), b.Dy()))
draw.Draw(m, m.Bounds(), src, b.Min, draw.Src)
start := m.PixOffset(srcR.Min.X, srcR.Min.Y)
// srcR.Min.Y since the output display has only a single column
end := m.PixOffset(srcR.Max.X, srcR.Min.Y)
// Offset into the output buffer using rect
d.raster(dst[4*rect.Min.X:], m.Pix[start:end], true)
}
}
var _ display.Drawer = &Dev{}
// The bit lookup table converts a single byte into its 4 byte SPI symbol
// 0 => 1000 and 1 => 1110
var bitlut = [][]byte{
{0x88, 0x88, 0x88, 0x88}, // 0 | 0x00 | 10001000100010001000100010001000
{0x88, 0x88, 0x88, 0x8E}, // 1 | 0x01 | 10001000100010001000100010001110
{0x88, 0x88, 0x88, 0xE8}, // 2 | 0x02 | 10001000100010001000100011101000
{0x88, 0x88, 0x88, 0xEE}, // 3 | 0x03 | 10001000100010001000100011101110
{0x88, 0x88, 0x8E, 0x88}, // 4 | 0x04 | 10001000100010001000111010001000
{0x88, 0x88, 0x8E, 0x8E}, // 5 | 0x05 | 10001000100010001000111010001110
{0x88, 0x88, 0x8E, 0xE8}, // 6 | 0x06 | 10001000100010001000111011101000
{0x88, 0x88, 0x8E, 0xEE}, // 7 | 0x07 | 10001000100010001000111011101110
{0x88, 0x88, 0xE8, 0x88}, // 8 | 0x08 | 10001000100010001110100010001000
{0x88, 0x88, 0xE8, 0x8E}, // 9 | 0x09 | 10001000100010001110100010001110
{0x88, 0x88, 0xE8, 0xE8}, // 10 | 0x0A | 10001000100010001110100011101000
{0x88, 0x88, 0xE8, 0xEE}, // 11 | 0x0B | 10001000100010001110100011101110
{0x88, 0x88, 0xEE, 0x88}, // 12 | 0x0C | 10001000100010001110111010001000
{0x88, 0x88, 0xEE, 0x8E}, // 13 | 0x0D | 10001000100010001110111010001110
{0x88, 0x88, 0xEE, 0xE8}, // 14 | 0x0E | 10001000100010001110111011101000
{0x88, 0x88, 0xEE, 0xEE}, // 15 | 0x0F | 10001000100010001110111011101110
{0x88, 0x8E, 0x88, 0x88}, // 16 | 0x10 | 10001000100011101000100010001000
{0x88, 0x8E, 0x88, 0x8E}, // 17 | 0x11 | 10001000100011101000100010001110
{0x88, 0x8E, 0x88, 0xE8}, // 18 | 0x12 | 10001000100011101000100011101000
{0x88, 0x8E, 0x88, 0xEE}, // 19 | 0x13 | 10001000100011101000100011101110
{0x88, 0x8E, 0x8E, 0x88}, // 20 | 0x14 | 10001000100011101000111010001000
{0x88, 0x8E, 0x8E, 0x8E}, // 21 | 0x15 | 10001000100011101000111010001110
{0x88, 0x8E, 0x8E, 0xE8}, // 22 | 0x16 | 10001000100011101000111011101000
{0x88, 0x8E, 0x8E, 0xEE}, // 23 | 0x17 | 10001000100011101000111011101110
{0x88, 0x8E, 0xE8, 0x88}, // 24 | 0x18 | 10001000100011101110100010001000
{0x88, 0x8E, 0xE8, 0x8E}, // 25 | 0x19 | 10001000100011101110100010001110
{0x88, 0x8E, 0xE8, 0xE8}, // 26 | 0x1A | 10001000100011101110100011101000
{0x88, 0x8E, 0xE8, 0xEE}, // 27 | 0x1B | 10001000100011101110100011101110
{0x88, 0x8E, 0xEE, 0x88}, // 28 | 0x1C | 10001000100011101110111010001000
{0x88, 0x8E, 0xEE, 0x8E}, // 29 | 0x1D | 10001000100011101110111010001110
{0x88, 0x8E, 0xEE, 0xE8}, // 30 | 0x1E | 10001000100011101110111011101000
{0x88, 0x8E, 0xEE, 0xEE}, // 31 | 0x1F | 10001000100011101110111011101110
{0x88, 0xE8, 0x88, 0x88}, // 32 | 0x20 | 10001000111010001000100010001000
{0x88, 0xE8, 0x88, 0x8E}, // 33 | 0x21 | 10001000111010001000100010001110
{0x88, 0xE8, 0x88, 0xE8}, // 34 | 0x22 | 10001000111010001000100011101000
{0x88, 0xE8, 0x88, 0xEE}, // 35 | 0x23 | 10001000111010001000100011101110
{0x88, 0xE8, 0x8E, 0x88}, // 36 | 0x24 | 10001000111010001000111010001000
{0x88, 0xE8, 0x8E, 0x8E}, // 37 | 0x25 | 10001000111010001000111010001110
{0x88, 0xE8, 0x8E, 0xE8}, // 38 | 0x26 | 10001000111010001000111011101000
{0x88, 0xE8, 0x8E, 0xEE}, // 39 | 0x27 | 10001000111010001000111011101110
{0x88, 0xE8, 0xE8, 0x88}, // 40 | 0x28 | 10001000111010001110100010001000
{0x88, 0xE8, 0xE8, 0x8E}, // 41 | 0x29 | 10001000111010001110100010001110
{0x88, 0xE8, 0xE8, 0xE8}, // 42 | 0x2A | 10001000111010001110100011101000
{0x88, 0xE8, 0xE8, 0xEE}, // 43 | 0x2B | 10001000111010001110100011101110
{0x88, 0xE8, 0xEE, 0x88}, // 44 | 0x2C | 10001000111010001110111010001000
{0x88, 0xE8, 0xEE, 0x8E}, // 45 | 0x2D | 10001000111010001110111010001110
{0x88, 0xE8, 0xEE, 0xE8}, // 46 | 0x2E | 10001000111010001110111011101000
{0x88, 0xE8, 0xEE, 0xEE}, // 47 | 0x2F | 10001000111010001110111011101110
{0x88, 0xEE, 0x88, 0x88}, // 48 | 0x30 | 10001000111011101000100010001000
{0x88, 0xEE, 0x88, 0x8E}, // 49 | 0x31 | 10001000111011101000100010001110
{0x88, 0xEE, 0x88, 0xE8}, // 50 | 0x32 | 10001000111011101000100011101000
{0x88, 0xEE, 0x88, 0xEE}, // 51 | 0x33 | 10001000111011101000100011101110
{0x88, 0xEE, 0x8E, 0x88}, // 52 | 0x34 | 10001000111011101000111010001000
{0x88, 0xEE, 0x8E, 0x8E}, // 53 | 0x35 | 10001000111011101000111010001110
{0x88, 0xEE, 0x8E, 0xE8}, // 54 | 0x36 | 10001000111011101000111011101000
{0x88, 0xEE, 0x8E, 0xEE}, // 55 | 0x37 | 10001000111011101000111011101110
{0x88, 0xEE, 0xE8, 0x88}, // 56 | 0x38 | 10001000111011101110100010001000
{0x88, 0xEE, 0xE8, 0x8E}, // 57 | 0x39 | 10001000111011101110100010001110
{0x88, 0xEE, 0xE8, 0xE8}, // 58 | 0x3A | 10001000111011101110100011101000
{0x88, 0xEE, 0xE8, 0xEE}, // 59 | 0x3B | 10001000111011101110100011101110
{0x88, 0xEE, 0xEE, 0x88}, // 60 | 0x3C | 10001000111011101110111010001000
{0x88, 0xEE, 0xEE, 0x8E}, // 61 | 0x3D | 10001000111011101110111010001110
{0x88, 0xEE, 0xEE, 0xE8}, // 62 | 0x3E | 10001000111011101110111011101000
{0x88, 0xEE, 0xEE, 0xEE}, // 63 | 0x3F | 10001000111011101110111011101110
{0x8E, 0x88, 0x88, 0x88}, // 64 | 0x40 | 10001110100010001000100010001000
{0x8E, 0x88, 0x88, 0x8E}, // 65 | 0x41 | 10001110100010001000100010001110
{0x8E, 0x88, 0x88, 0xE8}, // 66 | 0x42 | 10001110100010001000100011101000
{0x8E, 0x88, 0x88, 0xEE}, // 67 | 0x43 | 10001110100010001000100011101110
{0x8E, 0x88, 0x8E, 0x88}, // 68 | 0x44 | 10001110100010001000111010001000
{0x8E, 0x88, 0x8E, 0x8E}, // 69 | 0x45 | 10001110100010001000111010001110
{0x8E, 0x88, 0x8E, 0xE8}, // 70 | 0x46 | 10001110100010001000111011101000
{0x8E, 0x88, 0x8E, 0xEE}, // 71 | 0x47 | 10001110100010001000111011101110
{0x8E, 0x88, 0xE8, 0x88}, // 72 | 0x48 | 10001110100010001110100010001000
{0x8E, 0x88, 0xE8, 0x8E}, // 73 | 0x49 | 10001110100010001110100010001110
{0x8E, 0x88, 0xE8, 0xE8}, // 74 | 0x4A | 10001110100010001110100011101000
{0x8E, 0x88, 0xE8, 0xEE}, // 75 | 0x4B | 10001110100010001110100011101110
{0x8E, 0x88, 0xEE, 0x88}, // 76 | 0x4C | 10001110100010001110111010001000
{0x8E, 0x88, 0xEE, 0x8E}, // 77 | 0x4D | 10001110100010001110111010001110
{0x8E, 0x88, 0xEE, 0xE8}, // 78 | 0x4E | 10001110100010001110111011101000
{0x8E, 0x88, 0xEE, 0xEE}, // 79 | 0x4F | 10001110100010001110111011101110
{0x8E, 0x8E, 0x88, 0x88}, // 80 | 0x50 | 10001110100011101000100010001000
{0x8E, 0x8E, 0x88, 0x8E}, // 81 | 0x51 | 10001110100011101000100010001110
{0x8E, 0x8E, 0x88, 0xE8}, // 82 | 0x52 | 10001110100011101000100011101000
{0x8E, 0x8E, 0x88, 0xEE}, // 83 | 0x53 | 10001110100011101000100011101110
{0x8E, 0x8E, 0x8E, 0x88}, // 84 | 0x54 | 10001110100011101000111010001000
{0x8E, 0x8E, 0x8E, 0x8E}, // 85 | 0x55 | 10001110100011101000111010001110
{0x8E, 0x8E, 0x8E, 0xE8}, // 86 | 0x56 | 10001110100011101000111011101000
{0x8E, 0x8E, 0x8E, 0xEE}, // 87 | 0x57 | 10001110100011101000111011101110
{0x8E, 0x8E, 0xE8, 0x88}, // 88 | 0x58 | 10001110100011101110100010001000
{0x8E, 0x8E, 0xE8, 0x8E}, // 89 | 0x59 | 10001110100011101110100010001110
{0x8E, 0x8E, 0xE8, 0xE8}, // 90 | 0x5A | 10001110100011101110100011101000
{0x8E, 0x8E, 0xE8, 0xEE}, // 91 | 0x5B | 10001110100011101110100011101110
{0x8E, 0x8E, 0xEE, 0x88}, // 92 | 0x5C | 10001110100011101110111010001000
{0x8E, 0x8E, 0xEE, 0x8E}, // 93 | 0x5D | 10001110100011101110111010001110
{0x8E, 0x8E, 0xEE, 0xE8}, // 94 | 0x5E | 10001110100011101110111011101000
{0x8E, 0x8E, 0xEE, 0xEE}, // 95 | 0x5F | 10001110100011101110111011101110
{0x8E, 0xE8, 0x88, 0x88}, // 96 | 0x60 | 10001110111010001000100010001000
{0x8E, 0xE8, 0x88, 0x8E}, // 97 | 0x61 | 10001110111010001000100010001110
{0x8E, 0xE8, 0x88, 0xE8}, // 98 | 0x62 | 10001110111010001000100011101000
{0x8E, 0xE8, 0x88, 0xEE}, // 99 | 0x63 | 10001110111010001000100011101110
{0x8E, 0xE8, 0x8E, 0x88}, //100 | 0x64 | 10001110111010001000111010001000
{0x8E, 0xE8, 0x8E, 0x8E}, //101 | 0x65 | 10001110111010001000111010001110
{0x8E, 0xE8, 0x8E, 0xE8}, //102 | 0x66 | 10001110111010001000111011101000
{0x8E, 0xE8, 0x8E, 0xEE}, //103 | 0x67 | 10001110111010001000111011101110
{0x8E, 0xE8, 0xE8, 0x88}, //104 | 0x68 | 10001110111010001110100010001000
{0x8E, 0xE8, 0xE8, 0x8E}, //105 | 0x69 | 10001110111010001110100010001110
{0x8E, 0xE8, 0xE8, 0xE8}, //106 | 0x6A | 10001110111010001110100011101000
{0x8E, 0xE8, 0xE8, 0xEE}, //107 | 0x6B | 10001110111010001110100011101110
{0x8E, 0xE8, 0xEE, 0x88}, //108 | 0x6C | 10001110111010001110111010001000
{0x8E, 0xE8, 0xEE, 0x8E}, //109 | 0x6D | 10001110111010001110111010001110
{0x8E, 0xE8, 0xEE, 0xE8}, //110 | 0x6E | 10001110111010001110111011101000
{0x8E, 0xE8, 0xEE, 0xEE}, //111 | 0x6F | 10001110111010001110111011101110
{0x8E, 0xEE, 0x88, 0x88}, //112 | 0x70 | 10001110111011101000100010001000
{0x8E, 0xEE, 0x88, 0x8E}, //113 | 0x71 | 10001110111011101000100010001110
{0x8E, 0xEE, 0x88, 0xE8}, //114 | 0x72 | 10001110111011101000100011101000
{0x8E, 0xEE, 0x88, 0xEE}, //115 | 0x73 | 10001110111011101000100011101110
{0x8E, 0xEE, 0x8E, 0x88}, //116 | 0x74 | 10001110111011101000111010001000
{0x8E, 0xEE, 0x8E, 0x8E}, //117 | 0x75 | 10001110111011101000111010001110
{0x8E, 0xEE, 0x8E, 0xE8}, //118 | 0x76 | 10001110111011101000111011101000
{0x8E, 0xEE, 0x8E, 0xEE}, //119 | 0x77 | 10001110111011101000111011101110
{0x8E, 0xEE, 0xE8, 0x88}, //120 | 0x78 | 10001110111011101110100010001000
{0x8E, 0xEE, 0xE8, 0x8E}, //121 | 0x79 | 10001110111011101110100010001110
{0x8E, 0xEE, 0xE8, 0xE8}, //122 | 0x7A | 10001110111011101110100011101000
{0x8E, 0xEE, 0xE8, 0xEE}, //123 | 0x7B | 10001110111011101110100011101110
{0x8E, 0xEE, 0xEE, 0x88}, //124 | 0x7C | 10001110111011101110111010001000
{0x8E, 0xEE, 0xEE, 0x8E}, //125 | 0x7D | 10001110111011101110111010001110
{0x8E, 0xEE, 0xEE, 0xE8}, //126 | 0x7E | 10001110111011101110111011101000
{0x8E, 0xEE, 0xEE, 0xEE}, //127 | 0x7F | 10001110111011101110111011101110
{0xE8, 0x88, 0x88, 0x88}, //128 | 0x80 | 11101000100010001000100010001000
{0xE8, 0x88, 0x88, 0x8E}, //129 | 0x81 | 11101000100010001000100010001110
{0xE8, 0x88, 0x88, 0xE8}, //130 | 0x82 | 11101000100010001000100011101000
{0xE8, 0x88, 0x88, 0xEE}, //131 | 0x83 | 11101000100010001000100011101110
{0xE8, 0x88, 0x8E, 0x88}, //132 | 0x84 | 11101000100010001000111010001000
{0xE8, 0x88, 0x8E, 0x8E}, //133 | 0x85 | 11101000100010001000111010001110
{0xE8, 0x88, 0x8E, 0xE8}, //134 | 0x86 | 11101000100010001000111011101000
{0xE8, 0x88, 0x8E, 0xEE}, //135 | 0x87 | 11101000100010001000111011101110
{0xE8, 0x88, 0xE8, 0x88}, //136 | 0x88 | 11101000100010001110100010001000
{0xE8, 0x88, 0xE8, 0x8E}, //137 | 0x89 | 11101000100010001110100010001110
{0xE8, 0x88, 0xE8, 0xE8}, //138 | 0x8A | 11101000100010001110100011101000
{0xE8, 0x88, 0xE8, 0xEE}, //139 | 0x8B | 11101000100010001110100011101110
{0xE8, 0x88, 0xEE, 0x88}, //140 | 0x8C | 11101000100010001110111010001000
{0xE8, 0x88, 0xEE, 0x8E}, //141 | 0x8D | 11101000100010001110111010001110
{0xE8, 0x88, 0xEE, 0xE8}, //142 | 0x8E | 11101000100010001110111011101000
{0xE8, 0x88, 0xEE, 0xEE}, //143 | 0x8F | 11101000100010001110111011101110
{0xE8, 0x8E, 0x88, 0x88}, //144 | 0x90 | 11101000100011101000100010001000
{0xE8, 0x8E, 0x88, 0x8E}, //145 | 0x91 | 11101000100011101000100010001110
{0xE8, 0x8E, 0x88, 0xE8}, //146 | 0x92 | 11101000100011101000100011101000
{0xE8, 0x8E, 0x88, 0xEE}, //147 | 0x93 | 11101000100011101000100011101110
{0xE8, 0x8E, 0x8E, 0x88}, //148 | 0x94 | 11101000100011101000111010001000
{0xE8, 0x8E, 0x8E, 0x8E}, //149 | 0x95 | 11101000100011101000111010001110
{0xE8, 0x8E, 0x8E, 0xE8}, //150 | 0x96 | 11101000100011101000111011101000
{0xE8, 0x8E, 0x8E, 0xEE}, //151 | 0x97 | 11101000100011101000111011101110
{0xE8, 0x8E, 0xE8, 0x88}, //152 | 0x98 | 11101000100011101110100010001000
{0xE8, 0x8E, 0xE8, 0x8E}, //153 | 0x99 | 11101000100011101110100010001110
{0xE8, 0x8E, 0xE8, 0xE8}, //154 | 0x9A | 11101000100011101110100011101000
{0xE8, 0x8E, 0xE8, 0xEE}, //155 | 0x9B | 11101000100011101110100011101110
{0xE8, 0x8E, 0xEE, 0x88}, //156 | 0x9C | 11101000100011101110111010001000
{0xE8, 0x8E, 0xEE, 0x8E}, //157 | 0x9D | 11101000100011101110111010001110
{0xE8, 0x8E, 0xEE, 0xE8}, //158 | 0x9E | 11101000100011101110111011101000
{0xE8, 0x8E, 0xEE, 0xEE}, //159 | 0x9F | 11101000100011101110111011101110
{0xE8, 0xE8, 0x88, 0x88}, //160 | 0xA0 | 11101000111010001000100010001000
{0xE8, 0xE8, 0x88, 0x8E}, //161 | 0xA1 | 11101000111010001000100010001110
{0xE8, 0xE8, 0x88, 0xE8}, //162 | 0xA2 | 11101000111010001000100011101000
{0xE8, 0xE8, 0x88, 0xEE}, //163 | 0xA3 | 11101000111010001000100011101110
{0xE8, 0xE8, 0x8E, 0x88}, //164 | 0xA4 | 11101000111010001000111010001000
{0xE8, 0xE8, 0x8E, 0x8E}, //165 | 0xA5 | 11101000111010001000111010001110
{0xE8, 0xE8, 0x8E, 0xE8}, //166 | 0xA6 | 11101000111010001000111011101000
{0xE8, 0xE8, 0x8E, 0xEE}, //167 | 0xA7 | 11101000111010001000111011101110
{0xE8, 0xE8, 0xE8, 0x88}, //168 | 0xA8 | 11101000111010001110100010001000
{0xE8, 0xE8, 0xE8, 0x8E}, //169 | 0xA9 | 11101000111010001110100010001110
{0xE8, 0xE8, 0xE8, 0xE8}, //170 | 0xAA | 11101000111010001110100011101000
{0xE8, 0xE8, 0xE8, 0xEE}, //171 | 0xAB | 11101000111010001110100011101110
{0xE8, 0xE8, 0xEE, 0x88}, //172 | 0xAC | 11101000111010001110111010001000
{0xE8, 0xE8, 0xEE, 0x8E}, //173 | 0xAD | 11101000111010001110111010001110
{0xE8, 0xE8, 0xEE, 0xE8}, //174 | 0xAE | 11101000111010001110111011101000
{0xE8, 0xE8, 0xEE, 0xEE}, //175 | 0xAF | 11101000111010001110111011101110
{0xE8, 0xEE, 0x88, 0x88}, //176 | 0xB0 | 11101000111011101000100010001000
{0xE8, 0xEE, 0x88, 0x8E}, //177 | 0xB1 | 11101000111011101000100010001110
{0xE8, 0xEE, 0x88, 0xE8}, //178 | 0xB2 | 11101000111011101000100011101000
{0xE8, 0xEE, 0x88, 0xEE}, //179 | 0xB3 | 11101000111011101000100011101110
{0xE8, 0xEE, 0x8E, 0x88}, //180 | 0xB4 | 11101000111011101000111010001000
{0xE8, 0xEE, 0x8E, 0x8E}, //181 | 0xB5 | 11101000111011101000111010001110
{0xE8, 0xEE, 0x8E, 0xE8}, //182 | 0xB6 | 11101000111011101000111011101000
{0xE8, 0xEE, 0x8E, 0xEE}, //183 | 0xB7 | 11101000111011101000111011101110
{0xE8, 0xEE, 0xE8, 0x88}, //184 | 0xB8 | 11101000111011101110100010001000
{0xE8, 0xEE, 0xE8, 0x8E}, //185 | 0xB9 | 11101000111011101110100010001110
{0xE8, 0xEE, 0xE8, 0xE8}, //186 | 0xBA | 11101000111011101110100011101000
{0xE8, 0xEE, 0xE8, 0xEE}, //187 | 0xBB | 11101000111011101110100011101110
{0xE8, 0xEE, 0xEE, 0x88}, //188 | 0xBC | 11101000111011101110111010001000
{0xE8, 0xEE, 0xEE, 0x8E}, //189 | 0xBD | 11101000111011101110111010001110
{0xE8, 0xEE, 0xEE, 0xE8}, //190 | 0xBE | 11101000111011101110111011101000
{0xE8, 0xEE, 0xEE, 0xEE}, //191 | 0xBF | 11101000111011101110111011101110
{0xEE, 0x88, 0x88, 0x88}, //192 | 0xC0 | 11101110100010001000100010001000
{0xEE, 0x88, 0x88, 0x8E}, //193 | 0xC1 | 11101110100010001000100010001110
{0xEE, 0x88, 0x88, 0xE8}, //194 | 0xC2 | 11101110100010001000100011101000
{0xEE, 0x88, 0x88, 0xEE}, //195 | 0xC3 | 11101110100010001000100011101110
{0xEE, 0x88, 0x8E, 0x88}, //196 | 0xC4 | 11101110100010001000111010001000
{0xEE, 0x88, 0x8E, 0x8E}, //197 | 0xC5 | 11101110100010001000111010001110
{0xEE, 0x88, 0x8E, 0xE8}, //198 | 0xC6 | 11101110100010001000111011101000
{0xEE, 0x88, 0x8E, 0xEE}, //199 | 0xC7 | 11101110100010001000111011101110
{0xEE, 0x88, 0xE8, 0x88}, //200 | 0xC8 | 11101110100010001110100010001000
{0xEE, 0x88, 0xE8, 0x8E}, //201 | 0xC9 | 11101110100010001110100010001110
{0xEE, 0x88, 0xE8, 0xE8}, //202 | 0xCA | 11101110100010001110100011101000
{0xEE, 0x88, 0xE8, 0xEE}, //203 | 0xCB | 11101110100010001110100011101110
{0xEE, 0x88, 0xEE, 0x88}, //204 | 0xCC | 11101110100010001110111010001000
{0xEE, 0x88, 0xEE, 0x8E}, //205 | 0xCD | 11101110100010001110111010001110
{0xEE, 0x88, 0xEE, 0xE8}, //206 | 0xCE | 11101110100010001110111011101000
{0xEE, 0x88, 0xEE, 0xEE}, //207 | 0xCF | 11101110100010001110111011101110
{0xEE, 0x8E, 0x88, 0x88}, //208 | 0xD0 | 11101110100011101000100010001000
{0xEE, 0x8E, 0x88, 0x8E}, //209 | 0xD1 | 11101110100011101000100010001110
{0xEE, 0x8E, 0x88, 0xE8}, //210 | 0xD2 | 11101110100011101000100011101000
{0xEE, 0x8E, 0x88, 0xEE}, //211 | 0xD3 | 11101110100011101000100011101110
{0xEE, 0x8E, 0x8E, 0x88}, //212 | 0xD4 | 11101110100011101000111010001000
{0xEE, 0x8E, 0x8E, 0x8E}, //213 | 0xD5 | 11101110100011101000111010001110
{0xEE, 0x8E, 0x8E, 0xE8}, //214 | 0xD6 | 11101110100011101000111011101000
{0xEE, 0x8E, 0x8E, 0xEE}, //215 | 0xD7 | 11101110100011101000111011101110
{0xEE, 0x8E, 0xE8, 0x88}, //216 | 0xD8 | 11101110100011101110100010001000
{0xEE, 0x8E, 0xE8, 0x8E}, //217 | 0xD9 | 11101110100011101110100010001110
{0xEE, 0x8E, 0xE8, 0xE8}, //218 | 0xDA | 11101110100011101110100011101000
{0xEE, 0x8E, 0xE8, 0xEE}, //219 | 0xDB | 11101110100011101110100011101110
{0xEE, 0x8E, 0xEE, 0x88}, //220 | 0xDC | 11101110100011101110111010001000
{0xEE, 0x8E, 0xEE, 0x8E}, //221 | 0xDD | 11101110100011101110111010001110
{0xEE, 0x8E, 0xEE, 0xE8}, //222 | 0xDE | 11101110100011101110111011101000
{0xEE, 0x8E, 0xEE, 0xEE}, //223 | 0xDF | 11101110100011101110111011101110
{0xEE, 0xE8, 0x88, 0x88}, //224 | 0xE0 | 11101110111010001000100010001000
{0xEE, 0xE8, 0x88, 0x8E}, //225 | 0xE1 | 11101110111010001000100010001110
{0xEE, 0xE8, 0x88, 0xE8}, //226 | 0xE2 | 11101110111010001000100011101000
{0xEE, 0xE8, 0x88, 0xEE}, //227 | 0xE3 | 11101110111010001000100011101110
{0xEE, 0xE8, 0x8E, 0x88}, //228 | 0xE4 | 11101110111010001000111010001000
{0xEE, 0xE8, 0x8E, 0x8E}, //229 | 0xE5 | 11101110111010001000111010001110
{0xEE, 0xE8, 0x8E, 0xE8}, //230 | 0xE6 | 11101110111010001000111011101000
{0xEE, 0xE8, 0x8E, 0xEE}, //231 | 0xE7 | 11101110111010001000111011101110
{0xEE, 0xE8, 0xE8, 0x88}, //232 | 0xE8 | 11101110111010001110100010001000
{0xEE, 0xE8, 0xE8, 0x8E}, //233 | 0xE9 | 11101110111010001110100010001110
{0xEE, 0xE8, 0xE8, 0xE8}, //234 | 0xEA | 11101110111010001110100011101000
{0xEE, 0xE8, 0xE8, 0xEE}, //235 | 0xEB | 11101110111010001110100011101110
{0xEE, 0xE8, 0xEE, 0x88}, //236 | 0xEC | 11101110111010001110111010001000
{0xEE, 0xE8, 0xEE, 0x8E}, //237 | 0xED | 11101110111010001110111010001110
{0xEE, 0xE8, 0xEE, 0xE8}, //238 | 0xEE | 11101110111010001110111011101000
{0xEE, 0xE8, 0xEE, 0xEE}, //239 | 0xEF | 11101110111010001110111011101110
{0xEE, 0xEE, 0x88, 0x88}, //240 | 0xF0 | 11101110111011101000100010001000
{0xEE, 0xEE, 0x88, 0x8E}, //241 | 0xF1 | 11101110111011101000100010001110
{0xEE, 0xEE, 0x88, 0xE8}, //242 | 0xF2 | 11101110111011101000100011101000
{0xEE, 0xEE, 0x88, 0xEE}, //243 | 0xF3 | 11101110111011101000100011101110
{0xEE, 0xEE, 0x8E, 0x88}, //244 | 0xF4 | 11101110111011101000111010001000
{0xEE, 0xEE, 0x8E, 0x8E}, //245 | 0xF5 | 11101110111011101000111010001110
{0xEE, 0xEE, 0x8E, 0xE8}, //246 | 0xF6 | 11101110111011101000111011101000
{0xEE, 0xEE, 0x8E, 0xEE}, //247 | 0xF7 | 11101110111011101000111011101110
{0xEE, 0xEE, 0xE8, 0x88}, //248 | 0xF8 | 11101110111011101110100010001000
{0xEE, 0xEE, 0xE8, 0x8E}, //249 | 0xF9 | 11101110111011101110100010001110
{0xEE, 0xEE, 0xE8, 0xE8}, //250 | 0xFA | 11101110111011101110100011101000
{0xEE, 0xEE, 0xE8, 0xEE}, //251 | 0xFB | 11101110111011101110100011101110
{0xEE, 0xEE, 0xEE, 0x88}, //252 | 0xFC | 11101110111011101110111010001000
{0xEE, 0xEE, 0xEE, 0x8E}, //253 | 0xFD | 11101110111011101110111010001110
{0xEE, 0xEE, 0xEE, 0xE8}, //254 | 0xFE | 11101110111011101110111011101000
{0xEE, 0xEE, 0xEE, 0xEE}, //255 | 0xFF | 11101110111011101110111011101110
}