eink_SSD1765_waveform setting

 """Inky Lookup Tables.
        These lookup tables comprise of two sets of values.
        The first set of values, formatted as binary, describe the voltages applied during the six update phases:
          Phase 0     Phase 1     Phase 2     Phase 3     Phase 4     Phase 5     Phase 6
          A B C D
        0b01001000, 0b10100000, 0b00010000, 0b00010000, 0b00010011, 0b00000000, 0b00000000,  LUT0 - Black
        0b01001000, 0b10100000, 0b10000000, 0b00000000, 0b00000011, 0b00000000, 0b00000000,  LUT1 - White
        0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000,  NOT USED BY HARDWARE
        0b01001000, 0b10100101, 0b00000000, 0b10111011, 0b00000000, 0b00000000, 0b00000000,  LUT3 - Yellow or Red
        0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000,  LUT4 - VCOM
        There are seven possible phases, arranged horizontally, and only the phases with duration/repeat information
        (see below) are used during the update cycle.
        Each phase has four steps: A, B, C and D. Each step is represented by two binary bits and these bits can
        have one of four possible values representing the voltages to be applied. The default values follow:
        0b00: VSS or Ground
        0b01: VSH1 or 15V
        0b10: VSL or -15V
        0b11: VSH2 or 5.4V
        During each phase the Black, White and Yellow (or Red) stages are applied in turn, creating a voltage
        differential across each display pixel. This is what moves the physical ink particles in their suspension.
        The second set of values, formatted as hex, describe the duration of each step in a phase, and the number
        of times that phase should be repeated:
          Duration                Repeat
          A     B     C     D
        0x10, 0x04, 0x04, 0x04, 0x04,  <-- Timings for Phase 0
        0x10, 0x04, 0x04, 0x04, 0x04,  <-- Timings for Phase 1
        0x04, 0x08, 0x08, 0x10, 0x10,      etc
        0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00,
        The duration and repeat parameters allow you to take a single sequence of A, B, C and D voltage values and
        transform them into a waveform that - effectively - wiggles the ink particles into the desired position.
        In all of our LUT definitions we use the first and second phases to flash/pulse and clear the display to
        mitigate image retention. The flashing effect is actually the ink particles being moved from the bottom to
        the top of the display repeatedly in an attempt to reset them back into a sensible resting position.
        """
        self._luts = {
            'black': [
                0b01001000, 0b10100000, 0b00010000, 0b00010000, 0b00010011, 0b00000000, 0b00000000,
                0b01001000, 0b10100000, 0b10000000, 0b00000000, 0b00000011, 0b00000000, 0b00000000,
                0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000,
                0b01001000, 0b10100101, 0b00000000, 0b10111011, 0b00000000, 0b00000000, 0b00000000,
                0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000,
                0x10, 0x04, 0x04, 0x04, 0x04,
                0x10, 0x04, 0x04, 0x04, 0x04,
                0x04, 0x08, 0x08, 0x10, 0x10,
                0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00,
            ],
            'red': [
                0b01001000, 0b10100000, 0b00010000, 0b00010000, 0b00010011, 0b00000000, 0b00000000,
                0b01001000, 0b10100000, 0b10000000, 0b00000000, 0b00000011, 0b00000000, 0b00000000,
                0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000,
                0b01001000, 0b10100101, 0b00000000, 0b10111011, 0b00000000, 0b00000000, 0b00000000,
                0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000,
                0x40, 0x0C, 0x20, 0x0C, 0x06,
                0x10, 0x08, 0x04, 0x04, 0x06,
                0x04, 0x08, 0x08, 0x10, 0x10,
                0x02, 0x02, 0x02, 0x40, 0x20,
                0x02, 0x02, 0x02, 0x02, 0x02,
                0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00
            ],
            'red_ht': [
                0b01001000, 0b10100000, 0b00010000, 0b00010000, 0b00010011, 0b00010000, 0b00010000,
                0b01001000, 0b10100000, 0b10000000, 0b00000000, 0b00000011, 0b10000000, 0b10000000,
                0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000,
                0b01001000, 0b10100101, 0b00000000, 0b10111011, 0b00000000, 0b01001000, 0b00000000,
                0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000,
                0x43, 0x0A, 0x1F, 0x0A, 0x04,
                0x10, 0x08, 0x04, 0x04, 0x06,
                0x04, 0x08, 0x08, 0x10, 0x0B,
                0x01, 0x02, 0x01, 0x10, 0x30,
                0x06, 0x06, 0x06, 0x02, 0x02,
                0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00
            ],
            'yellow': [
                0b11111010, 0b10010100, 0b10001100, 0b11000000, 0b11010000, 0b00000000, 0b00000000,
                0b11111010, 0b10010100, 0b00101100, 0b10000000, 0b11100000, 0b00000000, 0b00000000,
                0b11111010, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000,
                0b11111010, 0b10010100, 0b11111000, 0b10000000, 0b01010000, 0b00000000, 0b11001100,
                0b10111111, 0b01011000, 0b11111100, 0b10000000, 0b11010000, 0b00000000, 0b00010001,
                0x40, 0x10, 0x40, 0x10, 0x08,
                0x08, 0x10, 0x04, 0x04, 0x10,
                0x08, 0x08, 0x03, 0x08, 0x20,
                0x08, 0x04, 0x00, 0x00, 0x10,
                0x10, 0x08, 0x08, 0x00, 0x20,
                0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00,
            ]
        }
##从github上抓的波表,https://github.com/pimoroni/inky/blob/master/library/inky/inky.py


另一份波表,黑白双色

const unsigned char EPD_2IN13_V2_lut_full_update[]= {
    0x80,0x60,0x40,0x00,0x00,0x00,0x00,             //LUT0: BB:     VS 0 ~7
    0x10,0x60,0x20,0x00,0x00,0x00,0x00,             //LUT1: BW:     VS 0 ~7
    0x80,0x60,0x40,0x00,0x00,0x00,0x00,             //LUT2: WB:     VS 0 ~7
     
    0x10,0x60,0x20,0x00,0x00,0x00,0x00,             //LUT3: WW:     VS 0 ~7
    
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,             //LUT4: VCOM:   VS 0 ~7

    0x03,0x03,0x00,0x00,0x02,                       // TP0 A~D RP0
    0x09,0x09,0x00,0x00,0x02,                       // TP1 A~D RP1
    0x03,0x03,0x00,0x00,0x02,                       // TP2 A~D RP2
    0x00,0x00,0x00,0x00,0x00,                       // TP3 A~D RP3
    0x00,0x00,0x00,0x00,0x00,                       // TP4 A~D RP4
    0x00,0x00,0x00,0x00,0x00,                       // TP5 A~D RP5
    0x00,0x00,0x00,0x00,0x00,                       // TP6 A~D RP6

    0x15,0x41,0xA8,0x32,0x30,0x0A,
};

补一张datasheet图

 

 

 

 

 

  发现每一份波表初始化都不一样,,,

目前只能实现黑白双色刷新,而不能实现三色刷新orz

 

数据手册、democode、reference https://www.buydisplay.com/chinese/2-13-inch-color-e-paper-display-module-manufacturers-104x212-ssd1675a

https://www.zephray.me/post/stm32_epd_calendar

 

转载于:https://www.cnblogs.com/beyondsdo/p/11222969.html

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
void EinkMessageHandler::producesEinkBuffersByGpu(int startFrameIndex, int totalFrames) { const nsecs_t start = systemTime(); // EinkBufferQueue ALOGD("producesEinkBuffersByGpu # startFrameIndex:%d, totalFrames:%d, wiskyWaveform:%d", startFrameIndex, totalFrames, mCurrentWaveform->mode); // Dequeue using DequeueBufferInput = IGraphicBufferProducer::DequeueBufferInput; using DequeueBufferOutput = IGraphicBufferProducer::DequeueBufferOutput; DequeueBufferInput dequeueInput; dequeueInput.width = mCurrentGrayBuffer->getWidth(); dequeueInput.height = mCurrentGrayBuffer->getHeight(); dequeueInput.format = HAL_PIXEL_FORMAT_RGBA_8888; dequeueInput.usage = EINK_GRALLOC_USAGE; dequeueInput.getTimestamps = false; vector<DequeueBufferInput> dequeueInputs(totalFrames, dequeueInput); vector<DequeueBufferOutput> dequeueOutputs; mEinkProducer->dequeueBuffers(dequeueInputs, &dequeueOutputs); // Request vector<int32_t> requestInputs; requestInputs.reserve(totalFrames); for (const DequeueBufferOutput &dequeueOutput : dequeueOutputs) { ALOGE_IF(dequeueOutput.result != NO_ERROR, "producesEinkBuffersByGpu # EinkBufferQueue dequeueBuffers slot%d:%s (%d)", dequeueOutput.slot, strerror(-dequeueOutput.result), dequeueOutput.result); requestInputs.emplace_back(dequeueOutput.slot); } using RequestBufferOutput = IGraphicBufferProducer::RequestBufferOutput; vector<RequestBufferOutput> requestOutputs; mEinkProducer->requestBuffers(requestInputs, &requestOutputs); sp<GraphicBuffer> graphicBuffers[totalFrames]; int j = 0; for (const RequestBufferOutput &requestOutput : requestOutputs) { ALOGE_IF(requestOutput.result != NO_ERROR, "producesEinkBuffersByGpu # EinkBufferQueue requestBuffers:%s (%d)", strerror(-requestOutput.result), requestOutput.result); graphicBuffers[j++] = requestOutput.buffer; } mGpuDecodeEink->composeEinkBuffersByGpu(graphicBuffers, mCurrentGrayBuffer, mPreviousGrayBuffer, startFrameIndex, totalFrames, mCurrentWaveform); // Queue using QueueBufferInput = IGraphicBufferProducer::QueueBufferInput; using QueueBufferOutput = IGraphicBufferProducer::QueueBufferOutput; vector<QueueBufferInput> queueInputs; queueInputs.reserve(totalFrames); for (const DequeueBufferOutput &dequeueOutput : dequeueOutputs) { queueInputs .emplace_back(systemTime(), false, HAL_DATASPACE_UNKNOWN, Rect(mCurrentGrayBuffer->getWidth(), mCurrentGrayBuffer->getHeight()), NATIVE_WINDOW_SCALING_MODE_FREEZE, 0, Fence::NO_FENCE) .slot = dequeueOutput.slot; } vector<QueueBufferOutput> queueOutputs; mEinkProducer->queueBuffers(queueInputs, &queueOutputs); for (const QueueBufferOutput &queueOutput : queueOutputs) { ALOGE_IF(queueOutput.result != NO_ERROR, "producesEinkBuffersByGpu # EinkBufferQueue queueBuffers:%s (%d)", strerror(-queueOutput.result), queueOutput.result); } ALOGD("producesEinkBuffersByGpu # total time:%ld ms", long(ns2ms(systemTime() - start))); }
最新发布
06-10

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值