From 42e433c17db2f386ec3f93ec83802bbe86e1d5ab Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 27 Mar 2017 15:20:09 +0300 Subject: pykms: add videomode related features Signed-off-by: Tomi Valkeinen --- py/pykms/pykmsbase.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'py') diff --git a/py/pykms/pykmsbase.cpp b/py/pykms/pykmsbase.cpp index c371a0b..d013f1f 100644 --- a/py/pykms/pykmsbase.cpp +++ b/py/pykms/pykmsbase.cpp @@ -147,6 +147,12 @@ void init_pykmsbase(py::module &m) .value("BGR565", PixelFormat::BGR565) ; + py::enum_(m, "SyncPolarity") + .value("Undefined", SyncPolarity::Undefined) + .value("Positive", SyncPolarity::Positive) + .value("Negative", SyncPolarity::Negative) + ; + py::class_(m, "Videomode") .def(py::init<>()) @@ -172,8 +178,14 @@ void init_pykmsbase(py::module &m) .def("__repr__", [](const Videomode& vm) { return ""; }) .def("to_blob", &Videomode::to_blob) + + .def_property("hsync", &Videomode::hsync, &Videomode::set_hsync) + .def_property("vsync", &Videomode::vsync, &Videomode::set_vsync) ; + + m.def("videomode_from_timings", &videomode_from_timings); + py::class_(m, "AtomicReq") .def(py::init(), py::keep_alive<1, 2>()) // Keep Card alive until this is destructed -- cgit v1.2.3