esp32c3: add support for this chip

This change adds support for the ESP32-C3, a new chip from Espressif. It
is a RISC-V core so porting was comparatively easy.

Most peripherals are shared with the (original) ESP32 chip, but with
subtle differences. Also, the SVD file I've used gives some
peripherals/registers a different name which makes sharing code harder.
Eventually, when an official SVD file for the ESP32 is released, I
expect that a lot of code can be shared between the two chips.

More information: https://www.espressif.com/en/products/socs/esp32-c3

TODO:
  - stack scheduler
  - interrupts
  - most peripherals (SPI, I2C, PWM, etc)
This commit is contained in:
Ayke van Laethem
2021-09-04 00:55:35 +02:00
committed by Ron Evans
parent c830f878c6
commit cb147b9475
12 changed files with 660 additions and 70 deletions
+4 -1
View File
@@ -428,11 +428,14 @@ func readSVD(path, sourceURL string) (*Device, error) {
licenseBlock = regexp.MustCompile(`\s+\n`).ReplaceAllString(licenseBlock, "\n")
}
// Remove "-" characters from the device name because such characters cannot
// be used in build tags. Necessary for the ESP32-C3 for example.
nameLower := strings.ReplaceAll(strings.ToLower(device.Name), "-", "")
metadata := &Metadata{
File: filepath.Base(path),
DescriptorSource: sourceURL,
Name: device.Name,
NameLower: strings.ToLower(device.Name),
NameLower: nameLower,
Description: strings.TrimSpace(device.Description),
LicenseBlock: licenseBlock,
}