RCA 单元

Unit RCA 是一种用于传输复合视频(音频或视频)的母头插孔接线端子排,是最常见的 A/V 连接器之一,用于将组件设备的视频或音频信号传输到输出设备(例如显示器或扬声器)。

支持以下产品:

RCAUnit

UiFlow2 应用示例

绘制文本

在 UiFlow2 中打开 core2_rca_example.m5f2 项目。

该示例在屏幕上显示文本 “RCA”。

UiFlow2 代码块:

example.png

示例输出:

None

MicroPython 应用示例

绘制文本

该示例在屏幕上显示文本 “RCA”。

MicroPython 代码块:

 1# SPDX-FileCopyrightText: 2024 M5Stack Technology CO LTD
 2#
 3# SPDX-License-Identifier: MIT
 4
 5import os, sys, io
 6import M5
 7from M5 import *
 8from unit import RCAUnit
 9
10
11label0 = None
12label1 = None
13rca_0 = None
14
15
16def setup():
17    global label0, label1, rca_0
18
19    M5.begin()
20    Widgets.fillScreen(0x222222)
21    label0 = Widgets.Label("Core2", 133, 109, 1.0, 0xFFFFFF, 0x222222, Widgets.FONTS.DejaVu18)
22
23    rca_0 = RCAUnit(
24        (36, 26),
25        216,
26        144,
27        output_width=0,
28        output_height=0,
29        signal_type=RCAUnit.NTSC,
30        use_psram=0,
31        output_level=0,
32    )
33    label1 = Widgets.Label("RCA", 88, 61, 1.0, 0xFFFFFF, 0x222222, Widgets.FONTS.DejaVu18, rca_0)
34
35
36def loop():
37    global label0, label1, rca_0
38    M5.update()
39
40
41if __name__ == "__main__":
42    try:
43        setup()
44        while True:
45            loop()
46    except (Exception, KeyboardInterrupt) as e:
47        try:
48            from utility import print_error_msg
49
50            print_error_msg(e)
51        except ImportError:
52            print("please update to latest firmware")

示例输出:

None

API参考

Class RCAUnit

class unit.rca.RCAUnit(port=(36, 26), width=216, height=144, output_width=0, output_height=0, signal_type=0, use_psram=0, output_level=0)

基类:object

初始化 RCA Unit。

参数:
  • port (tuple) – RCA Unit 连接到的端口。port[0]:未使用,port[1]:dac 引脚。

  • width (int) – RCA 显示屏的宽度。

  • height (int) – RCA 显示屏的高度。

  • output_width (int) – RCA 显示屏输出的宽度。

  • output_height (int) – RCA 显示器输出的高度。

  • signal_type (int) – RCA 显示屏的信号类型。NTSC=0、NTSC_J=1、PAL=2、PAL_M=3、PAL_N=4。

  • use_psram (int) – RCA 显示屏的 PSRAM 使用方法。

  • output_level (int) – RCA 显示屏的输出电平。

UiFlow2 代码块:

init.png

MicroPython 代码块:

from module import RCAModule
module_rca = RCAModule(26, width=216, height=144, output_width=0, output_height=0, signal_type=RCAModule.NTSC, use_psram=0, output_level=0)

RCAUnit 类继承自 Display 类,更多详情请参阅 hardware.Display

NTSC = 0

信号类型。国家电视系统委员会。

NTSC_J = 1

信号类型。日本国家电视系统委员会(NTSC-J)。

PAL = 2

信号类型。逐行倒相(Phase Alternating Line,PAL)。

PAL_M = 3

信号类型。相位交替线制 M(PAL-M)。

PAL_N = 4

信号类型。相位交替线路 N。