diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2017-03-27 15:20:09 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2017-05-17 11:06:26 +0300 |
commit | 42e433c17db2f386ec3f93ec83802bbe86e1d5ab (patch) | |
tree | e460f7d51378b6bdf68ad3959759d2c6c5523c13 | |
parent | 248a58888dae562b3a9f636fecc5bbb46307cd9b (diff) |
pykms: add videomode related features
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r-- | py/pykms/pykmsbase.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
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_<SyncPolarity>(m, "SyncPolarity") + .value("Undefined", SyncPolarity::Undefined) + .value("Positive", SyncPolarity::Positive) + .value("Negative", SyncPolarity::Negative) + ; + py::class_<Videomode>(m, "Videomode") .def(py::init<>()) @@ -172,8 +178,14 @@ void init_pykmsbase(py::module &m) .def("__repr__", [](const Videomode& vm) { return "<pykms.Videomode " + to_string(vm.hdisplay) + "x" + to_string(vm.vdisplay) + ">"; }) .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_<AtomicReq>(m, "AtomicReq") .def(py::init<Card&>(), py::keep_alive<1, 2>()) // Keep Card alive until this is destructed |