差别
这里会显示出您选择的修订版和当前版本之间的差别。
后一修订版 | 前一修订版 | ||
mp_hsadc [2021/10/06 19:03] gongyusu 创建 |
mp_hsadc [2021/10/16 16:06] (当前版本) gongyusu [2. ST7789] |
||
---|---|---|---|
行 1: | 行 1: | ||
## 100Msps ADC | ## 100Msps ADC | ||
+ | <code python> | ||
+ | import machine | ||
+ | machine.freq(200_000_000 ) | ||
+ | print( "done" ) | ||
+ | </code> | ||
+ | |||
+ | ### 1. DMA | ||
+ | |||
<code python> | <code python> | ||
import time | import time | ||
行 80: | 行 88: | ||
</code> | </code> | ||
+ | ### 2. ST7789 | ||
<code python> | <code python> | ||
import time | import time | ||
行 121: | 行 130: | ||
) | ) | ||
| | ||
- | def write_register( self, reg, buf ): | + | def write_register( self, reg, buf ): # reg for command, buf for data |
self.buf1[0] = reg | self.buf1[0] = reg | ||
self.cs.value( 0 ) | self.cs.value( 0 ) | ||
- | |||
self.dc.value( 0 ) | self.dc.value( 0 ) | ||
self.spi.write( self.buf1 ) | self.spi.write( self.buf1 ) | ||
行 136: | 行 144: | ||
def write_register_dma( self, reg, buf, is_blocking=True ): | def write_register_dma( self, reg, buf, is_blocking=True ): | ||
SPI1_BASE = 0x40040000 | SPI1_BASE = 0x40040000 | ||
- | SSPDR = 0x008 | + | SSPDR = 0x008. #address of 16bit SPI1 TX FIFO |
self.dma.config( | self.dma.config( | ||
src_addr = uctypes.addressof( buf ), | src_addr = uctypes.addressof( buf ), | ||
行 148: | 行 156: | ||
self.buf1[0] = reg | self.buf1[0] = reg | ||
self.cs.value( 0 ) | self.cs.value( 0 ) | ||
- | |||
self.dc.value( 0 ) | self.dc.value( 0 ) | ||
self.spi.write( self.buf1 ) | self.spi.write( self.buf1 ) | ||
行 266: | 行 273: | ||
</code> | </code> | ||
+ | ### 3. XPT2046 - Touch Screen LCD | ||
<code python> | <code python> | ||
import time | import time | ||
行 371: | 行 379: | ||
print("done") | print("done") | ||
</code> | </code> | ||
+ | |||
+ | ### 4. Draw | ||
<code python> | <code python> | ||
行 490: | 行 500: | ||
* done | * done | ||
- | ### Setup Demo | + | ### 5. Setup Demo |
<code python> | <code python> | ||
行 519: | 行 529: | ||
</code> | </code> | ||
- | ### build & run demo | + | ### 6. build & run demo |
<code python> | <code python> | ||
def cb_btn( event ): | def cb_btn( event ): |