Get info of XIAO ESP32C3 (Arduino)
XiaoESP32C3_info.ino, Arduino code to read info of XIAO ESP32C3.
#include <Esp.h>
void setup() {
delay(500);
Serial.begin(9600);
delay(500);
Serial.println("\n\n================================");
Serial.println("Seeed Studio XIAO ESP32C3");
Serial.println("================================");
Serial.printf("Chip Model: %s\n", ESP.getChipModel());
Serial.printf("Chip Revision: %d\n", ESP.getChipRevision());
Serial.printf("with %d core\n", ESP.getChipCores());
Serial.printf("Flash Chip Size : %d \n", ESP.getFlashChipSize());
Serial.printf("Flash Chip Speed : %d \n", ESP.getFlashChipSpeed());
esp_chip_info_t chip_info;
esp_chip_info(&chip_info);
Serial.printf("\nFeatures included:\n %s\n %s\n %s\n %s\n %s\n",
(chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded flash" : "",
(chip_info.features & CHIP_FEATURE_WIFI_BGN) ? "2.4GHz WiFi" : "",
(chip_info.features & CHIP_FEATURE_BLE) ? "Bluetooth LE" : "",
(chip_info.features & CHIP_FEATURE_BT) ? "Bluetooth Classic" : "",
(chip_info.features & CHIP_FEATURE_IEEE802154) ? "IEEE 802.15.4" : "");
Serial.println();
/*
* print pre-defined pins, defined in:
* /home/pi/.arduino15/packages/esp32/hardware/esp32/2.0.4/variants/XIAO_ESP32C3
*/
Serial.println("================================");
Serial.println("UART pins:");
Serial.printf("\tTX: %d\n", TX);
Serial.printf("\tRX: %d\n", RX);
Serial.println("I2C pins:");
Serial.printf("\tSDA: %d\n", SDA);
Serial.printf("\tSCL: %d\n", SCL);
Serial.println("SPI pins:");
Serial.printf("\tSS : %d\n", SS);
Serial.printf("\tMOSI: %d\n", MOSI);
Serial.printf("\tMISO: %d\n", MISO);
Serial.printf("\tSCK : %d\n", SCK);
Serial.println("A pins:");
Serial.printf("\tA0 : %d\n", A0);
Serial.printf("\tA1 : %d\n", A1);
Serial.printf("\tA2 : %d\n", A2);
Serial.printf("\tA3 : %d\n", A3);
Serial.println("D pins:");
Serial.printf("\tD0 : %d\n", D0);
Serial.printf("\tD1 : %d\n", D1);
Serial.printf("\tD2 : %d\n", D2);
Serial.printf("\tD3 : %d\n", D3);
Serial.printf("\tD4 : %d\n", D4);
Serial.printf("\tD5 : %d\n", D5);
Serial.printf("\tD6 : %d\n", D6);
Serial.printf("\tD7 : %d\n", D7);
Serial.printf("\tD8 : %d\n", D8);
Serial.printf("\tD9 : %d\n", D9);
Serial.printf("\tD10 : %d\n", D10);
Serial.println("\n- end -");
}
void loop() {
// put your main code here, to run repeatedly:
}
output:
================================
Seeed Studio XIAO ESP32C3
================================
Chip Model: ESP32-C3
Chip Revision: 3
with 1 core
Flash Chip Size : 4194304
Flash Chip Speed : 80000000
Features included:
2.4GHz WiFi
Bluetooth LE
================================
UART pins:
TX: 21
RX: 20
I2C pins:
SDA: 6
SCL: 7
SPI pins:
SS : 20
MOSI: 10
MISO: 9
SCK : 8
A pins:
A0 : 2
A1 : 3
A2 : 4
A3 : 5
D pins:
D0 : 2
D1 : 3
D2 : 4
D3 : 5
D4 : 6
D5 : 7
D6 : 21
D7 : 20
D8 : 8
D9 : 9
D10 : 10
- end -
Comments
Post a Comment