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显示的信号类型。

  • 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

信号类型。国家电视系统委员会制式的日本标准。

PAL = 2

信号类型。逐行扫描制式。

PAL_M = 3

信号类型。逐行扫描制式 M格式。

PAL_N = 4

信号类型。逐行扫描制式 N格式。