forked from yhczc/MaixPy_DOC
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
75 changed files
with
1,640 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/config/ | ||
gulpfile.js | ||
.markdownlint.json | ||
package.json | ||
.gitignore | ||
.bookignore | ||
/README.md | ||
/zh/CONTRIBUTING.md | ||
*.xlsx | ||
*.orig | ||
*.less | ||
*.ai |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
npm-debug.log | ||
.DS_Store | ||
node_modules/ | ||
output/ | ||
.vscode/ | ||
_book/ | ||
*.epub | ||
*.mobi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"fenced-code-language": false, | ||
"ol-prefix": false, | ||
"line-length": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- [English](/en) | ||
- [中文](/zh) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Documentation Of MaixPy | ||
=========== | ||
|
||
|
||
|[Read me online](https://sipeed.github.io/MaixPy_DOC/en/) | [在线阅读](https://sipeed.github.io/MaixPy_DOC/zh/) | | ||
| ------------------------ | ----------- | | ||
| | | | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
{ | ||
"title": "MaixPy DOC", | ||
"description": "MaixPy documentation", | ||
"author":"sipeed", | ||
"plugins": [ | ||
"my-toolbar", | ||
"-lunr", | ||
"-search", | ||
"search-title", | ||
"anchor-navigation-ex", | ||
"anchorjs", | ||
"sharing", | ||
"splitter", | ||
"edit-link", | ||
"ga", | ||
"theme-default-customize@git+https://github.com/cocos-creator/theme-default.git", | ||
"expandable-chapters-small@git+https://github.com/cocos-creator/gitbook-plugin-expandable-chapters-small.git" | ||
], | ||
"styles": { | ||
"website": "./styles/website.css" | ||
}, | ||
"pluginsConfig": { | ||
"github": { | ||
"url": "https://github.com/sipeed/MaixPy" | ||
}, | ||
"my-toolbar": { | ||
"buttons": [ | ||
{ | ||
"label": "Github", | ||
"text":" ", | ||
"icon": "fa fa-github", | ||
"position": "left", | ||
"target": "_blank", | ||
"url": "https://github.com/sipeed/MaixPy" | ||
} | ||
] | ||
}, | ||
"search": { | ||
"maxIndexSize": 1000000000 | ||
}, | ||
|
||
"lunr": { | ||
"maxIndexSize": 1000000000 | ||
}, | ||
"edit-link": { | ||
"base": "https://github.com/sipeed/MaixPy_DOC/blob/master", | ||
"label": "" | ||
}, | ||
"sharing": { | ||
"douban": false, | ||
"facebook": true, | ||
"google": true, | ||
"hatenaBookmark": false, | ||
"instapaper": false, | ||
"line": false, | ||
"linkedin": false, | ||
"messenger": false, | ||
"pocket": false, | ||
"qq": false, | ||
"qzone": false, | ||
"stumbleupon": false, | ||
"twitter": true, | ||
"viber": false, | ||
"vk": false, | ||
"weibo": true, | ||
"whatsapp": false, | ||
"all": [ | ||
"weibo", | ||
"facebook", | ||
"google", | ||
"twitter", | ||
"vk" | ||
] | ||
}, | ||
"anchor-navigation-ex": { | ||
"associatedWithSummary": false, | ||
"showLevel": true, | ||
"multipleH1": false, | ||
"mode": "float", | ||
"pageTop": { | ||
"showLevelIcon": true, | ||
"level1Icon": "fa fa-angle-double-right", | ||
"level2Icon": "fa fa-angle-double-right", | ||
"level3Icon": "fa fa-angle-double-right" | ||
} | ||
}, | ||
"ga": { | ||
"token": "UA-119047820-2" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
MaixPy Documentation | ||
====== | ||
|
||
<div> | ||
<img src="../assets/micropython.png"> <img src="../assets/icon_sipeed2.png" height="60"> | ||
</div> | ||
|
||
|
||
## What is MaixPy | ||
|
||
MaixPy is a [Micropython](http://micropython.org/) port on 64Bit Dual-Core RISC-V CPU [K210](https://kendryte.com/), | ||
|
||
> MicroPython is a lean and efficient implementation of the Python 3 programming language that includes a small subset of the Python standard library and is optimised to run on microcontrollers and in constrained environments. | ||
> K210 created for AIOT(AI+IOT) use, It's powerful performance and low cost are very competitive. | ||
|
||
Micropython make program on hardware(K210) easier, so we build this and open source on [github]((https://github.com/sipeed/MaixPy)) | ||
|
||
For example if we want to find I2C device, we just need code: | ||
```python | ||
from machine import I2C | ||
|
||
i2c = I2C(I2C.I2C0, freq=100000, scl=28, sda=29) | ||
devices = i2c.scan() | ||
print(devices) | ||
``` | ||
|
||
|
||
If we want to make a `breathing light` by PWM, we just need code: | ||
```python | ||
from machine import Timer,PWM | ||
import time | ||
|
||
tim = Timer(Timer.TIMER0, Timer.CHANNEL0, mode=Timer.MODE_PWM) | ||
ch = PWM(tim, freq=500000, duty=50, pin=board_info.LED_G) | ||
duty=0 | ||
dir = True | ||
while True: | ||
if dir: | ||
duty += 10 | ||
else: | ||
duty -= 10 | ||
if duty>100: | ||
duty = 100 | ||
dir = False | ||
elif duty<0: | ||
duty = 0 | ||
dir = True | ||
time.sleep(0.05) | ||
ch.duty(duty) | ||
``` | ||
|
||
## About this documentation | ||
|
||
Everything related to Maixpy, mainly about | ||
* How to get a hardware( board ) | ||
* How to get start with MaixPy even we are not so be expert in program for hardware. | ||
* Learn Micropython basic knowledge | ||
* Libriaries(API) reference | ||
|
||
## Let's get started | ||
|
||
To get started, we need one dev board, there's three kind of board as follow: | ||
|
||
* Dan dock with Sipeed M1(Dan) module | ||
|
||
 | ||
|
||
* Sipeed Maix BiT | ||
|
||
 | ||
|
||
* Sipeed Go | ||
|
||
 | ||
|
||
To get these board, visit [Sipeed official website](https://sipeed.com/) | ||
|
||
More hardware infomation [here](en/hardware/hardware.md) | ||
|
||
Then we can write software, refer to [get started](en/get_started.md) | ||
|
||
## Source code | ||
|
||
MaixPy source code [on github](https://github.com/sipeed/MaixPy) | ||
|
||
|
||
------------ | ||
|
||
Maintained by ©<a href="https://www.sipeed.com" style="color: #f14c42">Sipeed</a> Co.,Ltd. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
Summary | ||
===== | ||
|
||
## Introduction | ||
|
||
- [Introduction](README.md) | ||
|
||
## Hardware | ||
|
||
- [K210](hardware/k210.md) | ||
- [Module](hardware/module.md) | ||
- [Sipeed M1](hardware/m1.md) | ||
- [Board](hardware/board.md) | ||
- [Dan Dock](hardware/dan_dock.md) | ||
- [BiT](hardware/bit.md) | ||
- [Go](hardware/go.md) | ||
|
||
## Getting Started | ||
|
||
- [Prepare](get_started/prepare.md) | ||
- [Get Hardware](get_started/get_hardware.md) | ||
- [Upgrade Firmware](get_started/upgrade_firmware.md) | ||
- [Power On](get_started/power_on.md) | ||
- [LED Blink](get_started/led_blink.md) | ||
- [How To Read Docs](get_started/how_to_read.md) | ||
|
||
## Reference | ||
|
||
- [Basic Syntax](mpy_basic_syntax/README.md) | ||
- [Libraries](libs/README.md) | ||
- [standard](libs/standard/README.md) | ||
- [cmath](libs/standard/cmath.md) | ||
- [gc](libs/standard/gc.md) | ||
- [math](libs/standard/math.md) | ||
- [sys](libs/standard/sys.md) | ||
- [ubinascii](libs/standard/ubinascii.md) | ||
- [ucollections](libs/standard/ucollections.md) | ||
- [uerrno](libs/standard/uerrno.md) | ||
- [uheapq](libs/standard/uheapq.md) | ||
- [uos](libs/standard/uos.md) | ||
- [ure](libs/standard/ure.md) | ||
- [uselect](libs/standard/uselect.md) | ||
- [ustruct](libs/standard/ustruct.md) | ||
- [utime](libs/standard/utime.md) | ||
- [uzlib](libs/standard/uzlib.md) | ||
- [machine](libs/machine/README.md) | ||
- [I2C](libs/machine/i2c.md) | ||
- [PWM](libs/machine/pwm.md) | ||
- [SPI](libs/machine/spi.md) | ||
- [Timer](libs/machine/timer.md) | ||
- [UART](libs/machine/uart.md) | ||
|
||
## Others | ||
|
||
- [Contribute](contribute/README.md) | ||
- [doc convention](contribute/doc_convention.md) | ||
- [code convention](contribute/code_convention.md) | ||
- [Open Source Projects](others/open_projects.md) | ||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{% extends template.self %} | ||
{% block book_header %} | ||
<div class="sipeed-navbar navbar-collapse" id="navbar" role="navigation"> | ||
<ul class="nav navbar-nav"> | ||
<li><a href="https://www.sipeed.com" class="btn" target="_blank"><img src="/assets/icon_sipeed2.png" height="30" /></a></li> | ||
<li><a href="#" class="btn autohide" onclick="toggleLanguage()">中文</a></li> | ||
{% for item in book.items %} | ||
{% if item.links %} | ||
<li> | ||
<a href="#" class="btn autohide"><i ></i>{{item.name}}</a> | ||
<ul class="hovershow"> | ||
{% for entry in item.links %} | ||
<li><a href="{{entry.link}}" class="btn" target="_blank">{{entry.name}}</a></li> | ||
{% endfor %} | ||
</ul> | ||
</li> | ||
{% else %} | ||
<li><a href="{{item.link}}" class="btn autohide" target="_blank"><i ></i>{{item.name}}</a></li> | ||
{% endif %} | ||
{% endfor %} | ||
{% for item in book.version %} | ||
{% if item.links %} | ||
<li class="version-link"> | ||
<a class="btn" style="color:#444">Version: <span style="font-weight:bold">{{item.name}}</span></a> | ||
<ul class="hovershow"> | ||
{% for entry in item.links %} | ||
<li><a href="{{entry.link}}" class="btn">Version: <span style="font-weight:bold">{{entry.name}}</span></a></li> | ||
{% endfor %} | ||
</ul> | ||
</li> | ||
{% else %} | ||
<li><a href="{{item.link}}" class="btn">{{item.name}}</a></li> | ||
{% endif %} | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
<div class="book-header" role="navigation"> | ||
{% if glossary.path %} | ||
<a href="{{ ('/' + glossary.path)|resolveFile }}" class="btn pull-left" aria-label="{{ "GLOSSARY_OPEN"|t }}"><i class="fa fa-sort-alpha-asc"></i></a> | ||
{% endif %} | ||
<!-- Title --> | ||
<h1> | ||
<i class="fa fa-circle-o-notch fa-spin"></i> | ||
<a href="{{ "/"|resolveFile }}" >{{ page.title }}</a> | ||
</h1> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{% extends template.self %} | ||
{% block book_sidebar %} | ||
<nav role="navigation" class="autoshow"> | ||
<ul class="summary"> | ||
<li><a href="https://www.sipeed.com" class="btn" target="_blank"><img src="/assets/icon_sipeed2.png" height="30" /></a></li> | ||
<li><a href="#" class="btn" onclick="toggleLanguage()">中文</a></li> | ||
{% for item in book.version %} | ||
{% if item.links %} | ||
<li class="version-link"> | ||
<a href="#" class="btn" style="color:#444"></i>Version: <span style="font-weight: bold; display: inline">{{item.name}}</span></a> | ||
<ul class="hovershow"> | ||
{% for entry in item.links %} | ||
<li><a href="{{entry.link}}" class="btn">Version: <span style="font-weight:bold; display: inline">{{entry.name}}</span></a></li> | ||
{% endfor %} | ||
</ul> | ||
</li> | ||
{% else %} | ||
<li><a href="{{item.link}}" class="btn"></i>{{item.name}}</a></li> | ||
{% endif %} | ||
{% endfor %} | ||
{% for item in book.items %} | ||
{% if item.links %} | ||
<li> | ||
<a href="#" class="btn"><i ></i>{{item.name}}</a> | ||
<ul> | ||
{% for entry in item.links %} | ||
<li><a href="{{entry.link}}" class="btn" target="_blank">{{entry.name}}</a></li> | ||
{% endfor %} | ||
</ul> | ||
</li> | ||
{% else %} | ||
<li><a href="{{item.link}}" class="btn" target="_blank"><i></i>{{item.name}}</a></li> | ||
{% endif %} | ||
{% endfor %} | ||
</ul> | ||
</nav> | ||
{{ super() }} | ||
{% endblock %} | ||
{% block javascript %} | ||
{{ super() }} | ||
<script type="text/javascript"> | ||
function toggleLanguage () { | ||
var path = location.href; | ||
// console.log(path); | ||
if (path.indexOf('/zh') !== -1) { | ||
path = path.replace(/\/zh[\/$\s]/i, '/en/'); | ||
} else if (path.indexOf('/en') !== -1) { | ||
path = path.replace(/\/en[\/$\s]/i, '/zh/'); | ||
} | ||
// console.log('after: ' + path); | ||
location.assign(path); | ||
} | ||
</script> | ||
{% endblock %} |
Oops, something went wrong.