Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
qitas committed Nov 7, 2024
1 parent c786dc5 commit 47dd19f
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 2 deletions.
119 changes: 119 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: docs

on:
workflow_dispatch:
schedule:
- cron: '02 12 * * *'
push:
branches:
- master

env:
DOCS_FOR: wch

jobs:
build:
if: github.repository_owner == 'SoCXin'
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
with:
submodules: "recursive"
fetch-depth: 1

- name: Checkout Docs
uses: actions/checkout@v4
with:
repository: SoCXin/docs
token: ${{ secrets.SOC_XIN_TOCKEN }}
ref: ${{ env.DOCS_FOR }}
fetch-depth: 1
path: www

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install dependencies
working-directory: www
run: |
python -m pip install --upgrade pip
pip install tox
- name: Build docs
working-directory: www
run: |
tox -e docs
- name: Preserve Docs
run: |
tar -czvf docs.tar.gz -C www/_build html rtdpage
- name: Save artifact
uses: actions/upload-artifact@v4
with:
name: docs
path: ./docs.tar.gz

deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
env:
DOCS_REPO: SoCXin/web
DOCS_DIR: docs
LATEST_DOCS_DIR: latest
RELEASE_BUILD: ${{ startsWith(github.ref, 'refs/tags/v') }}
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: docs

- name: Unpack artifact
run: |
mkdir ./${{ env.LATEST_DOCS_DIR }}
tar -xzf ./docs.tar.gz -C ./${{ env.LATEST_DOCS_DIR }}
- name: Delete Artifact
uses: geekyeggo/delete-artifact@v5
with:
name: docs

- name: Checkout latest Docs
continue-on-error: true
uses: actions/checkout@v4
with:
repository: ${{ env.DOCS_REPO }}
path: ${{ env.DOCS_DIR }}
ref: gh-pages

- name: Synchronize Docs
run: |
rm -rf ${{ env.DOCS_DIR }}/.git
rm -rf ${{ env.DOCS_DIR }}/${{ env.DOCS_FOR }}/
mkdir -p ${{ env.DOCS_DIR }}/${{ env.DOCS_FOR }}/
cp -rf ${{ env.LATEST_DOCS_DIR }}/html/* ${{ env.DOCS_DIR }}/${{ env.DOCS_FOR }}/
if [[ ${{ env.RELEASE_BUILD }} == false ]]; then
rm -rf ${{ env.DOCS_DIR }}/${{ env.DOCS_FOR }}/page
mkdir -p ${{ env.DOCS_DIR }}/${{ env.DOCS_FOR }}/page
cp -rf ${{ env.LATEST_DOCS_DIR }}/rtdpage/* ${{ env.DOCS_DIR }}/${{ env.DOCS_FOR }}/page
fi
- name: Validate Docs
run: |
if [ -z "$(ls -A ${{ env.DOCS_DIR }})" ]; then
echo "Docs folder is empty. Aborting!"
exit 1
fi
- name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ secrets.SOC_XIN_TOCKEN }}
external_repository: ${{ env.DOCS_REPO }}
publish_dir: ./${{ env.DOCS_DIR }}
commit_message: Sync Docs
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Xindex

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

## [简介](https://github.com/SoCXin/CH641/wiki)

[CH641](https://www.wch.cn/products/CH641.html)系列是基于青稞RISC-V2A内核设计的PD无线充电专用微控制器。该系列具有宽压、单线调试、低功耗、外围精简等特点。CH641内置PD PHY、BC接口、差分输入电流采样和交流小信号放大解码器,支持USB PD及Type-C快充功能、BC1.2及DCP等多种高压充电协议,提供了DMA控制器、10位模数转换ADC、多组定时器、USART串口、I2C等丰富的外设资源,提供过压保护和过温保护。
[CH641](https://www.wch.cn/products/CH641.html)系列是基于[QingKe-青稞RISC-V2A](https://www.wch.cn/products/QingKe.html)内核设计的PD无线充电专用微控制器。该系列具有宽压、单线调试、低功耗、外围精简等特点。CH641内置PD PHY、BC接口、差分输入电流采样和交流小信号放大解码器,支持USB PD及Type-C快充功能、BC1.2及DCP等多种高压充电协议,提供了DMA控制器、10位模数转换ADC、多组定时器、USART串口、I2C等丰富的外设资源,提供过压保护和过温保护。

[![sites](docs/ch641.jpg)](http://www.wch.cn/products/CH641.html)

``` mermaid
gantt
Expand Down Expand Up @@ -41,5 +43,5 @@ gantt

## [选型建议](https://github.com/SoCXin)

[CH641](https://github.com/SoCXin/CH641) 基于[QingKe](https://www.wch.cn/products/QingKe.html)内核
[CH641](https://github.com/SoCXin/CH641)

Binary file added docs/CH641DS0.PDF
Binary file not shown.
Binary file added docs/ch641.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 47dd19f

Please sign in to comment.