22#include <esp_chip_info.h>
81inline constexpr bool idfxx::enable_flags_operators<idfxx::chip_feature> =
true;
121 return flags<chip_feature>(
static_cast<std::underlying_type_t<chip_feature>
>(_info.features));
129 [[nodiscard]] uint8_t
cores() const noexcept {
return _info.cores; }
139 [[nodiscard]] uint16_t
revision() const noexcept {
return _info.revision; }
146 [[nodiscard]] uint8_t
major_revision() const noexcept {
return _info.revision / 100; }
153 [[nodiscard]] uint8_t
minor_revision() const noexcept {
return _info.revision % 100; }
156 esp_chip_info_t _info{};
164#include "sdkconfig.h"
165#ifdef CONFIG_IDFXX_STD_FORMAT
172 constexpr auto parse(format_parse_context& ctx) {
return ctx.begin(); }
174 template<
typename FormatContext>
177 return std::copy(s.begin(), s.end(), ctx.out());
Chip identification and hardware information.
uint8_t cores() const noexcept
Returns the number of CPU cores.
uint8_t minor_revision() const noexcept
Returns the minor part of the chip revision.
uint8_t major_revision() const noexcept
Returns the major part of the chip revision.
uint16_t revision() const noexcept
Returns the full chip revision number.
static chip_info get() noexcept
Queries the chip and returns its information.
flags< chip_feature > features() const noexcept
Returns the chip's hardware feature flags.
chip_model model() const noexcept
Returns the chip model.
Type-safe set of flags from a scoped enum.
std::string to_string(core_id c)
Returns a string representation of a CPU core identifier.
chip_model
Identifies the ESP chip model.
chip_feature
Hardware feature flags for chip capabilities.
@ embedded_psram
Chip has embedded PSRAM.
@ ble
Chip has Bluetooth LE.
@ bt_classic
Chip has Bluetooth Classic.
@ wifi
Chip has 2.4GHz WiFi.
@ ieee802154
Chip has IEEE 802.15.4 (Zigbee/Thread).
@ embedded_flash
Chip has embedded flash memory.