mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 03:53:42 +00:00
Esp32s3 implement spi (#5169)
* esp32s3 spi * stabilization freq cpu * cheange clacl freq for spi * fix linters * esp32s3-spi: change default pins for esp32s3 xiao * set default configuration * esp32s3-spi: extends smoketests for esp32s3
This commit is contained in:
@@ -49,8 +49,22 @@ func main() {
|
||||
// Change CPU frequency from 80MHz to 240MHz by setting SYSTEM_PLL_FREQ_SEL to
|
||||
// 1 and SYSTEM_CPUPERIOD_SEL to 2 (see table "CPU Clock Frequency" in the
|
||||
// reference manual).
|
||||
// We do this gradually to allow PLL and system to stabilize.
|
||||
esp.SYSTEM.SetCPU_PER_CONF_PLL_FREQ_SEL(1)
|
||||
|
||||
// First switch to 160MHz (intermediate step)
|
||||
esp.SYSTEM.SetCPU_PER_CONF_CPUPERIOD_SEL(1)
|
||||
// Small delay to let PLL stabilize at 160MHz
|
||||
for i := 0; i < 1000; i++ {
|
||||
_ = esp.SYSTEM.CPU_PER_CONF.Get()
|
||||
}
|
||||
|
||||
// Now switch to 240MHz
|
||||
esp.SYSTEM.SetCPU_PER_CONF_CPUPERIOD_SEL(2)
|
||||
// Small delay to let PLL stabilize at 240MHz
|
||||
for i := 0; i < 1000; i++ {
|
||||
_ = esp.SYSTEM.CPU_PER_CONF.Get()
|
||||
}
|
||||
|
||||
// Clear bss. Repeat many times while we wait for cpu/clock to stabilize
|
||||
for x := 0; x < 30; x++ {
|
||||
|
||||
Reference in New Issue
Block a user