show binary file, generated by server
All checks were successful
Build and Push Multi-Arch Docker Image / build-and-push (push) Successful in 15m48s

Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
2025-12-07 00:02:36 +01:00
parent d100221876
commit 918efcfa17
8 changed files with 245 additions and 16324 deletions

View File

@@ -2,88 +2,93 @@
LGFX::LGFX(void)
{
{ // バス制御の設定を行います。
auto cfg = _bus_instance.config(); // バス設定用の構造体を取得します。
// 8ビットパラレルバスの設定
// cfg.i2s_port = I2S_NUM_0; // 使用するI2Sポートを選択 (I2S_NUM_0 or I2S_NUM_1) (ESP32I2S LCDモードを使用します)
cfg.freq_write = 20000000; // 送信クロック (最大20MHz, 80MHzを整数で割った値に丸められます)
cfg.pin_wr = 47; // WR を接続しているピン番号
cfg.pin_rd = -1; // RD を接続しているピン番号
cfg.pin_rs = 0; // RS(D/C)を接続しているピン番号
cfg.pin_d0 = 9; // D0を接続しているピン番号
cfg.pin_d1 = 46; // D1を接続しているピン番号
cfg.pin_d2 = 3; // D2を接続しているピン番号
cfg.pin_d3 = 8; // D3を接続しているピン番号
cfg.pin_d4 = 18; // D4を接続しているピン番号
cfg.pin_d5 = 17; // D5を接続しているピン番号
cfg.pin_d6 = 16; // D6を接続しているピン番号
cfg.pin_d7 = 15; // D7を接続しているピン番号
_bus_instance.config(cfg); // 設定値をバスに反映します。
_panel_instance.setBus(&_bus_instance); // バスをパネルにセットします。
{ // Configure bus control settings
auto cfg = _bus_instance.config(); // Get structure for bus configuration
// 8-bit parallel bus configuration
// cfg.i2s_port = I2S_NUM_0; // Select I2S port to use (I2S_NUM_0 or I2S_NUM_1) (ESP32 I2S
// LCD mode is used)
cfg.freq_write = 20000000; // Transmission clock (max 20MHz, rounded to integer division of 80MHz)
cfg.pin_wr = 47; // Pin number connected to WR
cfg.pin_rd = -1; // Pin number connected to RD
cfg.pin_rs = 0; // Pin number connected to RS(D/C)
cfg.pin_d0 = 9; // Pin number connected to D0
cfg.pin_d1 = 46; // Pin number connected to D1
cfg.pin_d2 = 3; // Pin number connected to D2
cfg.pin_d3 = 8; // Pin number connected to D3
cfg.pin_d4 = 18; // Pin number connected to D4
cfg.pin_d5 = 17; // Pin number connected to D5
cfg.pin_d6 = 16; // Pin number connected to D6
cfg.pin_d7 = 15; // Pin number connected to D7
_bus_instance.config(cfg); // Apply configuration values to bus
_panel_instance.setBus(&_bus_instance); // Set bus to panel
}
{ // 表示パネル制御の設定を行います。
auto cfg = _panel_instance.config(); // 表示パネル設定用の構造体を取得します。
{ // Configure display panel control settings
auto cfg = _panel_instance.config(); // Get structure for display panel configuration
cfg.pin_cs = -1; // CSが接続されているピン番号 (-1 = disable)
cfg.pin_rst = 4; // RSTが接続されているピン番号 (-1 = disable)
cfg.pin_busy = -1; // BUSYが接続されているピン番号 (-1 = disable)
cfg.pin_cs = -1; // Pin number connected to CS (-1 = disable)
cfg.pin_rst = 4; // Pin number connected to RST (-1 = disable)
cfg.pin_busy = -1; // Pin number connected to BUSY (-1 = disable)
// ※ 以下の設定値はパネル毎に一般的な初期値が設定されていますので、不明な項目はコメントアウトして試してみてください。
// Note:
// The following configuration values have common default values set for each panel, so please comment out
// unknown items and try them.
cfg.panel_width = 320; // 実際に表示可能な幅
cfg.panel_height = 480; // 実際に表示可能な高さ
cfg.offset_x = 0; // パネルのX方向オフセット量
cfg.offset_y = 0; // パネルのY方向オフセット量
cfg.offset_rotation = 0; // 回転方向の値のオフセット 0~7 (4~7は上下反転)
cfg.dummy_read_pixel = 8; // ピクセル読出し前のダミーリードのビット数
cfg.dummy_read_bits = 1; // ピクセル以外のデータ読出し前のダミーリードのビット数
cfg.readable = true; // データ読出しが可能な場合 trueに設定
cfg.invert = true; // パネルの明暗が反転してしまう場合 trueに設定
cfg.rgb_order = false; // パネルの赤と青が入れ替わってしまう場合 trueに設定
cfg.dlen_16bit = false; // 16bitパラレルやSPIでデータ長を16bit単位で送信するパネルの場合 trueに設定
cfg.bus_shared = true; // SDカードとバスを共有している場合 trueに設定(drawJpgFile等でバス制御を行います)
cfg.panel_width = 320; // Actual displayable width
cfg.panel_height = 480; // Actual displayable height
cfg.offset_x = 0; // Panel X direction offset amount
cfg.offset_y = 0; // Panel Y direction offset amount
cfg.offset_rotation = 0; // Rotation direction value offset 0~7 (4~7 are upside down)
cfg.dummy_read_pixel = 8; // Number of dummy read bits before pixel reading
cfg.dummy_read_bits = 1; // Number of dummy read bits before reading data other than pixels
cfg.readable = true; // Set to true if data reading is possible
cfg.invert = true; // Set to true if panel brightness is inverted
cfg.rgb_order = false; // Set to true if panel red and blue are swapped
cfg.dlen_16bit =
false; // Set to true for panels that send data length in 16-bit units via 16-bit parallel or SPI
cfg.bus_shared = true; // Set to true if sharing bus with SD card (bus control is performed by drawJpgFile etc.)
// 以下はST7735やILI9163のようにピクセル数が可変のドライバで表示がずれる場合にのみ設定してください。
// cfg.memory_width = 240; // ドライバICがサポートしている最大の幅
// cfg.memory_height = 320; // ドライバICがサポートしている最大の高さ
// The following should only be set if the display is misaligned on drivers with variable pixel counts like
// ST7735 or ILI9163.
// cfg.memory_width = 240; // Maximum width supported by driver IC
// cfg.memory_height = 320; // Maximum height supported by driver IC
_panel_instance.config(cfg);
}
//*
{ // バックライト制御の設定を行います。(必要なければ削除)
auto cfg = _light_instance.config(); // バックライト設定用の構造体を取得します。
{ // Configure backlight control settings (delete if not needed)
auto cfg = _light_instance.config(); // Get structure for backlight configuration
cfg.pin_bl = 45; // バックライトが接続されているピン番号
cfg.invert = false; // バックライトの輝度を反転させる場合 true
cfg.freq = 44100; // バックライトのPWM周波数
cfg.pwm_channel = 7; // 使用するPWMのチャンネル番号
cfg.pin_bl = 45; // Pin number connected to backlight
cfg.invert = false; // Set to true to invert backlight brightness
cfg.freq = 44100; // Backlight PWM frequency
cfg.pwm_channel = 7; // PWM channel number to use
_light_instance.config(cfg);
_panel_instance.setLight(&_light_instance); // バックライトをパネルにセットします。
_panel_instance.setLight(&_light_instance); // Set backlight to panel
}
{ // タッチスクリーン制御の設定を行います。(必要なければ削除)
{ // Configure touch screen control settings (delete if not needed)
auto cfg = _touch_instance.config();
cfg.x_min = 0; // タッチスクリーンから得られる最小のX値(生の値)
cfg.x_max = 319; // タッチスクリーンから得られる最大のX値(生の値)
cfg.y_min = 0; // タッチスクリーンから得られる最小のY値(生の値)
cfg.y_max = 479; // タッチスクリーンから得られる最大のY値(生の値)
cfg.pin_int = 7; // INTが接続されているピン番号
cfg.bus_shared = true; // 画面と共通のバスを使用している場合 trueを設定
cfg.offset_rotation = 0; // 表示とタッチの向きのが一致しない場合の調整 0~7の値で設定
// I2C接続の場合
cfg.i2c_port = 1; // 使用するI2Cを選択 (0 or 1)
cfg.i2c_addr = 0x38; // I2Cデバイスアドレス番号
cfg.pin_sda = 6; // SDAが接続されているピン番号
cfg.pin_scl = 5; // SCLが接続されているピン番号
cfg.freq = 400000; // I2Cクロックを設定
cfg.x_min = 0; // Minimum X value obtained from touch screen (raw value)
cfg.x_max = 319; // Maximum X value obtained from touch screen (raw value)
cfg.y_min = 0; // Minimum Y value obtained from touch screen (raw value)
cfg.y_max = 479; // Maximum Y value obtained from touch screen (raw value)
cfg.pin_int = 7; // Pin number connected to INT
cfg.bus_shared = true; // Set to true if using common bus with screen
cfg.offset_rotation = 0; // Adjustment when display and touch orientation don't match, set value 0~7
// For I2C connection
cfg.i2c_port = 1; // Select I2C to use (0 or 1)
cfg.i2c_addr = 0x38; // I2C device address number
cfg.pin_sda = 6; // Pin number connected to SDA
cfg.pin_scl = 5; // Pin number connected to SCL
cfg.freq = 400000; // Set I2C clock
_touch_instance.config(cfg);
_panel_instance.setTouch(&_touch_instance); // タッチスクリーンをパネルにセットします。
_panel_instance.setTouch(&_touch_instance); // Set touch screen to panel
}
//*/
setPanel(&_panel_instance); // 使用するパネルをセットします。
setPanel(&_panel_instance); // Set panel to use
};