first commit
This commit is contained in:
commit
e6a42e28e9
4355 changed files with 4626605 additions and 0 deletions
|
|
@ -0,0 +1,20 @@
|
|||
cmake_minimum_required (VERSION 3.8)
|
||||
project(LGFX_LINUX_FB)
|
||||
|
||||
add_definitions(-DLGFX_LINUX_FB)
|
||||
|
||||
file(GLOB Target_Files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} CONFIGURE_DEPENDS
|
||||
*.cpp
|
||||
LovyanGFX/src/lgfx/Fonts/efont/*.c
|
||||
LovyanGFX/src/lgfx/Fonts/IPA/*.c
|
||||
LovyanGFX/src/lgfx/utility/*.c
|
||||
LovyanGFX/src/lgfx/v1/*.cpp
|
||||
LovyanGFX/src/lgfx/v1/misc/*.cpp
|
||||
LovyanGFX/src/lgfx/v1/panel/Panel_Device.cpp
|
||||
LovyanGFX/src/lgfx/v1/platforms/framebuffer/*.cpp
|
||||
)
|
||||
|
||||
add_executable (LGFX_LINUX_FB ${Target_Files})
|
||||
target_include_directories(LGFX_LINUX_FB PUBLIC "LovyanGFX/src/")
|
||||
target_compile_features(LGFX_LINUX_FB PUBLIC cxx_std_17)
|
||||
target_link_libraries(LGFX_LINUX_FB -lpthread)
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
#include <linux/fb.h>
|
||||
#include <thread>
|
||||
|
||||
#define LGFX_USE_V1
|
||||
#include <LovyanGFX.hpp>
|
||||
#include <LGFX_AUTODETECT.hpp>
|
||||
|
||||
void setup(void);
|
||||
void loop(void);
|
||||
|
||||
void loopThread(void)
|
||||
{
|
||||
setup();
|
||||
for (;;)
|
||||
{
|
||||
loop();
|
||||
std::this_thread::yield();
|
||||
}
|
||||
}
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
std::thread sub_thread(loopThread);
|
||||
for (;;)
|
||||
{
|
||||
std::this_thread::yield();
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(5));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
#include <stdio.h> // for drawBmpFile / drawJpgFile / drawPngFile
|
||||
|
||||
#define LGFX_USE_V1
|
||||
#include <LovyanGFX.hpp>
|
||||
#include <LGFX_AUTODETECT.hpp>
|
||||
|
||||
#define SCREEN_X 320
|
||||
#define SCREEN_Y 240
|
||||
#define DEVICE_NAME "/dev/fb0"
|
||||
|
||||
// 引数1 画面の幅
|
||||
// 引数2 画面の高さ
|
||||
// 引数3 操作対象とするフレームバッファのパス名、またはデバイス名称 ("st7789") 等の文字列
|
||||
LGFX lcd ( SCREEN_X, SCREEN_Y, DEVICE_NAME );
|
||||
|
||||
int32_t target_x = (SCREEN_X / 2) * 256;
|
||||
int32_t target_y = (SCREEN_Y / 2) * 256;
|
||||
int32_t current_x = 0;
|
||||
int32_t current_y = 0;
|
||||
int32_t add_x = 0;
|
||||
int32_t add_y = 0;
|
||||
|
||||
void setup()
|
||||
{
|
||||
lcd.init();
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
static int i;
|
||||
++i;
|
||||
lcd.fillCircle(current_x >> 8, current_y >> 8, 5, i);
|
||||
current_x += add_x;
|
||||
current_y += add_y;
|
||||
add_x += (current_x < target_x) ? 1 : -1;
|
||||
add_y += (current_y < target_y) ? 1 : -1;
|
||||
lgfx::delay(1);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue