mipi, dsi, dbi, dpi

需求 mipi, dsi, dbi, dpi 分别是啥,有啥区别? 解决 mipi 是一整套的标准,包含了 dbi-2, dpi-2, dsi, dcs dbi DBI(Display Bus Interface), 一般叫做 MCU接口或 8080 接口。 DBI 的特点是: LCM 自带 framebuffer,存储 host 发过来的数据,并且内部的 Driver controller 会不断的把数据刷新到 LCD 上, host 只需要发送一次数据既可,没有同步时钟线。 一般的 MCU 按照时序发送数据就可以显示,可以使用 GPIO, SPI, FMC 等接口来驱动。 dpi DPI(Display Pixel Interface), 一般叫做 RGB 接口或者像素接口。 DPI 的特点是: LCM 没有 framebuffer, Host 有 framebuffer, 并且 Host 需要不断的把屏幕数据发送到 LCM 来显示,需要有 Vsync/Hsync 这样的同步信号。有点类似于以前的 CRT 显示器。如果 MCU 需要使用,必须要额外的外设来支持,比如说 STM32 部分高端芯片自带的 LTDC 外设,就是用来驱动这种接口的。...

<span title='2023-11-15 17:13:00 +0800 CST'>2023-11-15</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;77 words&nbsp;·&nbsp;RamLife

c++ 实现类似 java 的 interface

需求 cpp 实现类似 java 的 interface 解决 interface 关键字 因为 interface 所有声明默认都是 public=,所以选择 =struct. #define interface struct; #define implements public 使用 #include "Interface.h" Interface IBar { public: virtual ~IBar(){} virtual int getBarData() const = 0; virtual void setBarData(int nData) = 0; }; class Bar :public BasicBar,implements IBar { public: Bar(int x=0) : BasicBar(x) { } ~Bar(){} virtual int getBarData() const { std::cout <<"Get Bar!"; return 0; } virtual void setBarData(int nData) { } }; class DataAccess { // Construction & Destruction public: DataAccess() { } ~DataAccess() { } static IBar* createBar() { //返回对象给IBar接口 return(new Bar()); } }; int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); //IBar *bar = new Bar(); IBar *bar = DataAccess::createBar(); bar->getBarData(); delete bar; return a....

<span title='2023-07-28 10:43:00 +0800 CST'>2023-07-28</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;143 words&nbsp;·&nbsp;RamLife

c++ impl 使用接口类

需求 cpp impl ? 解决 impl 使用接口类有两种方式: 接口类只是作为一个壳,需要什么都是直接调用原来的类来实现 接口类是使用虚函数,实现类通过继承来实现 代理类 代理类非常简单,下面这个 WeightProxy 就是壳,具体的实现都在 Weight 里面。 #ifndef WEIGHTPROXY_H #define WEIGHTPROXY_H #include <string> #include <memory> class Weight; class WeightProxy { public: WeightProxy(); ~WeightProxy(); std::string GetInfo(); std::unique_ptr<Weight> m_proxy; }; #endif // WEIGHTPROXY_H #include "Weightproxy.h" #include "Weight.h" WeightProxy::WeightProxy() : m_proxy(new Weight()) { } WeightProxy::~WeightProxy() = default; std::string WeightProxy::GetInfo() { return m_proxy->GetInfo(); } #include <iostream> // std::streambuf, std::cout #include "Weightproxy.h" int main () { WeightProxy w; std::cout << w....

<span title='2023-07-27 18:07:00 +0800 CST'>2023-07-27</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;207 words&nbsp;·&nbsp;RamLife