Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add control of PixelPattern for imxrt elcdif driver #193

Open
glory-man opened this issue May 3, 2024 · 1 comment
Open

add control of PixelPattern for imxrt elcdif driver #193

glory-man opened this issue May 3, 2024 · 1 comment

Comments

@glory-man
Copy link

glory-man commented May 3, 2024

Is it possible to add ELCDIF_SetPixelPattern() function to drivers/pxp/fsl_pxp.c

/*!
 * @brief eLCDIF configure pixel pattern.
 */
typedef enum _elcdif_pixel_pattern_config
{
    kELCDIF_PixelPatternRGB = 0x0,  /*!<  0b000..RGB. */
    kELCDIF_PixelPatternRBG = 0x1,  /*!<  0b001..RBG. */
    kELCDIF_PixelPatternGBR = 0x2,  /*!<  0b010..GBR. */
    kELCDIF_PixelPatternGRB = 0x3,  /*!<  0b011..GRB. */
    kELCDIF_PixelPatternBRG = 0x4,  /*!<  0b100..BRG. */
    kELCDIF_PixelPatternBGR = 0x5,  /*!<  0b101..BGR. */
    kELCDIF_PixelPatternLast,       /*!<  unavalable configuration. */
} elcdif_pixel_pattern_config_t;

/*!
 *  brief Set the order of the RGB components of each pixel in lines.
 *
 * param base eLCDIF peripheral base address.
 * param pixelPattern The pixel pattern
 */
void ELCDIF_SetPixelPattern(LCDIF_Type *base, elcdif_pixel_pattern_config_t pixelPattern)
{
    assert((uint32_t)pixelPattern < kELCDIF_PixelPatternLast);
    
    base->CTRL2_CLR = (LCDIF_CTRL2_CLR_EVEN_LINE_PATTERN_MASK | LCDIF_CTRL2_CLR_ODD_LINE_PATTERN_MASK);
    base->CTRL2_SET = ( (pixelPattern << LCDIF_CTRL2_SET_ODD_LINE_PATTERN_SHIFT) | (pixelPattern << LCDIF_CTRL2_SET_EVEN_LINE_PATTERN_SHIFT) );
}

Current version of driver doesn't have such function while imxrt elcdif module can control pixel pattern.

@glory-man glory-man changed the title add control of PixelPattern for imxrt pxp driver add control of PixelPattern for imxrt elcdif driver May 5, 2024
@mcuxsusan
Copy link
Contributor

Thanks for the suggestion of improvement, already forwarded to development team for check. Appreciate your patience since reply could be delayed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants