almindor / mipidsi

MIPI Display Serial Interface unified driver
MIT License
108 stars 47 forks source link

Make DCS command constructors const #91

Closed bdolgov closed 5 months ago

bdolgov commented 5 months ago

This will allow to define lists of commands, for example, in per display initialisation sequences:

pub const ILI9488_INIT_SEQ: &[InitOp] = &[
    InitOp::Cmd(&dcs::SetInvertMode(mipidsi::ColorInversion::Inverted)),
    InitOp::Cmd(&dcs::SetAddressMode::new(
        mipidsi::ColorOrder::Bgr,
        mipidsi::Orientation::Landscape(false),
        mipidsi::RefreshOrder {
            vertical: mipidsi::VerticalRefreshOrder::TopToBottom,
            horizontal: mipidsi::HorizontalRefreshOrder::LeftToRight,
        },
    )),
    ...
];
bdolgov commented 5 months ago

Updated the changelog and amended the change into the same commit, please take a look.

Thanks for the quick review!