Skip to content

Commit

Permalink
Merge branch 'sophgo:main' into sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
jzlynn authored Jul 5, 2024
2 parents 4bf4b31 + 97bb540 commit 4c4f808
Show file tree
Hide file tree
Showing 23 changed files with 594 additions and 301 deletions.
8 changes: 7 additions & 1 deletion SG200X/TRM/contents/cn/peripherals/saradc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ SARADC 为模拟信号数字转换控制器。本芯片有最多 2 个 SARADC

CPU 配置扫描信道,每个 SARADC 控制器可同时配置 3 个信道,启动 SARADC 进行通道扫描。通道扫描完成所有使能通道后, 通过中断通知系统扫描完成, CPU 可以获取转换结果。

系统上电后,为确保 SARADC 测量精度,建议对芯片的 SARADC 模块进行校准。校准通过离线方式执行,具体方法是先设置 saradc_test.reg_saradc_vrefsel 为 external 方式,然后手动反复调整 saradc_trim.reg_saradc_trim, 直至实际读出采样值经换算后与外部参考电压值比较接近至满足精度要求。校准完成后将 saradc_trim.reg_saradc_trim 的值记录下来,每次上电时通过软件设置 saradc_test.reg_saradc_vrefsel 为 external 方式后再将该记录的值设置到 saradc_trim.reg_saradc_trim 即可。

.. _section_saradc_register_overview:

SARADC 寄存器概览
Expand All @@ -53,7 +55,7 @@ No-die Domain 下 1 组(RTCSYS_SARADC),Base address:0x0502C000
+======================+=========+====================================+
| saradc_ctrl | 0x004 | control register |
+----------------------+---------+------------------------------------+
| saradc_status | 0x008 | staus register |
| saradc_status | 0x008 | status register |
+----------------------+---------+------------------------------------+
| saradc_cyc_set | 0x00c | saradc waveform setting register |
+----------------------+---------+------------------------------------+
Expand All @@ -71,6 +73,10 @@ No-die Domain 下 1 组(RTCSYS_SARADC),Base address:0x0502C000
+----------------------+---------+------------------------------------+
| saradc_intr_raw | 0x02c | interrupt raw status register |
+----------------------+---------+------------------------------------+
| saradc_test | 0x030 | test register |
+----------------------+---------+------------------------------------+
| saradc_trim | 0x034 | trim register |
+----------------------+---------+------------------------------------+

SARADC 寄存器描述
~~~~~~~~~~~~~~~~~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,45 @@ saradc_intr_raw
+------+----------------------+-------+------------------------+------+
| 31:1 | Reserved | | | |
+------+----------------------+-------+------------------------+------+

saradc_test
^^^^^^^^^^^

.. _table_saradc_test:
.. table:: saradc_test, Offset Address: 0x030
:widths: 1 2 1 4 1

+------+----------------------+-------+------------------------+------+
| Bits | Name | Access| Description | Reset|
+======+======================+=======+========================+======+
| 0:1 | Reserved | | | |
+------+----------------------+-------+------------------------+------+
| 2 | reg_saradc_vrefsel | RW | 1'b0:internal | 0 |
| | | | | |
| | | | 1'b1:external(from | |
| | | | VDD18A) | |
+------+----------------------+-------+------------------------+------+
| 31:3 | Reserved | | | |
+------+----------------------+-------+------------------------+------+

saradc_trim
^^^^^^^^^^^

.. _table_saradc_trim:
.. table:: saradc_trim, Offset Address: 0x034
:widths: 1 2 1 4 1

+------+----------------------+-------+------------------------+------+
| Bits | Name | Access| Description | Reset|
+======+======================+=======+========================+======+
| 3:0 | reg_saradc_trim | RW | bit[0:2]: The larger | 0x0 |
| | | | the value, the smaller | |
| | | | the vref, and the | |
| | | | larger the reading. | |
| | | | | |
| | | | bit[3]: reverse, | |
| | | | from b1000 to b0111 | |
| | | | vref decreases | |
+------+----------------------+-------+------------------------+------+
| 31:4 | Reserved | | | |
+------+----------------------+-------+------------------------+------+
60 changes: 30 additions & 30 deletions SG200X/TRM/contents/cn/peripherals/uart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,41 @@ UART

UART (Universal Asynchronous Receiver Transmitter) 是一个非同步串行的通信接口, 主要功能是将来自外围设备的资料进行串并转换之后传入内部总线, 以及将资料进行并串转换之后输出到外部设备。UART 的主要功能是和外部芯片的 UART 进行对接,从而实现两芯片间的通信。

本芯片提供 5 个 UART 控制器,相关概述如下表
本芯片提供 5 个 UART 控制器,相关概述如下表。注意:使用前以具体的引脚输出定义为准。因为芯片不同的封装(QFN/BGA),某些功能可能未导出。引脚定义参考 :ref:`section_pinmux_pinctrl`。

.. 这个表比较小,就不单独文件 include 了
.. _table_uart_io_infodescribe:
.. table:: UART IO pin information
:widths: 1 1 3

+------------+-------------+----------------------------------------------+
| Controller | Mode | IO Pin |
+============+=============+==============================================+
| UART0 | 2-line UART | UART0_TX/UART0_RX |
+------------+-------------+----------------------------------------------+
| UART1 |2/4-line UART| UART1_TX/UART1_RX/UART1_CTS/UART1_RTS |
| | +----------------------------------------------+
| | | XGPIOA[20]/ XGPIOA[21]/ XGPIOA[22]/ |
| | | XGPIOA[26] |
+------------+-------------+----------------------------------------------+
| UART2 |2/4-line UART| UART2_TX/UART2_RX/UART2_CTS/UART2_RTS |
| | +----------------------------------------------+
| | | XGPIOA[20]/ XGPIOA[21]/ XGPIOA[22]/ |
| | | XGPIOA[26] |
| | +----------------------------------------------+
| | | IIC2_SDA/IIC2_SCL |
+------------+-------------+----------------------------------------------+
| UART3 |2/4-line UART| SPI0_CS_X/SPI0_SCK/SPI0_SDI/SPI0_SDO |
| | +----------------------------------------------+
| | | VI_DATA22/VI_DATA21/VI_DATA24/VI_DATA23 |
| | +----------------------------------------------+
| | | PWM3/PWM2 |
+------------+-------------+----------------------------------------------+
| UART4 | 2-line UART | XGPIOA[22]/ XGPIOA[26] |
| | +----------------------------------------------+
| | | UART1_RTS/UART1_CTS |
+------------+-------------+----------------------------------------------+
:widths: 1 1

+------------+-------------+
| Controller | Mode |
+============+=============+
| UART0 | 2-line UART |
+------------+-------------+
| UART1 |2/4-line UART|
| | +
| | |
| | |
+------------+-------------+
| UART2 |2/4-line UART|
| | +
| | |
| | |
| | +
| | |
+------------+-------------+
| UART3 |2/4-line UART|
| | +
| | |
| | +
| | |
+------------+-------------+
| UART4 | 2-line UART |
| | +
| | |
+------------+-------------+

特点
~~~~
Expand Down
2 changes: 2 additions & 0 deletions SG200X/TRM/contents/cn/pinmux-pinctrl/0.index.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _section_pinmux_pinctrl:

管脚复用与控制
==============

Expand Down
Loading

0 comments on commit 4c4f808

Please sign in to comment.