/* param base LCDIFv2 peripheral base address. param layerIndex Layer layerIndex. param config Pointer to the configuration.  */
void LCDIFV2_SetLayerBufferConfig(LCDIFV2_Type *base, uint8_t layerIndex, const lcdifv2_buffer_config_t *config)
/* param base LCDIFv2 peripheral base address. param layerIndex Layer layerIndex. param config Pointer to the configuration.  */
void LCDIFV2_SetLayerBufferConfig(LCDIFV2_Type *base, uint8_t layerIndex, const lcdifv2_buffer_config_t *config)
{
    assert(NULL != config);
    uint32_t reg;
    base->LAYER[layerIndex].CTRLDESCL3 = config->strideBytes;
    reg = base->LAYER[layerIndex].CTRLDESCL5;
    reg = (reg & ~(LCDIFV2_CTRLDESCL5_BPP_MASK | LCDIFV2_CTRLDESCL5_YUV_FORMAT_MASK)) | (uint32_t)config->pixelFormat;
    if (0U == (reg & LCDIFV2_CTRLDESCL5_AB_MODE_MASK))
    {
        reg |= LCDIFV2_CTRLDESCL5_SAFETY_EN_MASK;
    }
    base->LAYER[layerIndex].CTRLDESCL5 = reg;
}