差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 | ||
mp_hsadc [2021/10/06 19:05] 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 | ### 1. DMA | ||
行 125: | 行 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 ) | ||
行 140: | 行 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 ), | ||
行 152: | 行 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 ) | ||
行 526: | 行 529: | ||
</code> | </code> | ||
- | ### build & run demo | + | ### 6. build & run demo |
<code python> | <code python> | ||
def cb_btn( event ): | def cb_btn( event ): |