idfxx 1.0.0
Modern C++23 components for ESP-IDF
Loading...
Searching...
No Matches
idfxx::chip_info Class Reference

Chip identification and hardware information. More...

Public Member Functions

chip_model model () const noexcept
 Returns the chip model.
 
flags< chip_featurefeatures () const noexcept
 Returns the chip's hardware feature flags.
 
uint8_t cores () const noexcept
 Returns the number of CPU cores.
 
uint16_t revision () const noexcept
 Returns the full chip revision number.
 
uint8_t major_revision () const noexcept
 Returns the major part of the chip revision.
 
uint8_t minor_revision () const noexcept
 Returns the minor part of the chip revision.
 

Static Public Member Functions

static chip_info get () noexcept
 Queries the chip and returns its information.
 

Detailed Description

Chip identification and hardware information.

Provides model identification, silicon revision, core count, and hardware feature detection.

auto info = idfxx::chip_info::get();
auto model = info.model(); // e.g. chip_model::esp32s3
auto cores = info.cores(); // e.g. 2
auto rev = info.revision(); // e.g. 100 (v1.0)
uint8_t cores() const noexcept
Returns the number of CPU cores.
Definition chip.hpp:129
static chip_info get() noexcept
Queries the chip and returns its information.
chip_model model() const noexcept
Returns the chip model.
Definition chip.hpp:113
std::expected< T, std::error_code > result
result type wrapping a value or error code.
Definition error.hpp:120

Definition at line 99 of file chip.hpp.

Member Function Documentation

◆ cores()

uint8_t idfxx::chip_info::cores ( ) const
inlinenoexcept

Returns the number of CPU cores.

Returns
The core count (e.g. 1 or 2).

Definition at line 129 of file chip.hpp.

◆ features()

flags< chip_feature > idfxx::chip_info::features ( ) const
inlinenoexcept

Returns the chip's hardware feature flags.

Returns
A flags set of chip_feature values.

Definition at line 120 of file chip.hpp.

◆ get()

static chip_info idfxx::chip_info::get ( )
staticnoexcept

Queries the chip and returns its information.

Returns
A chip_info object populated with the current chip's data.

◆ major_revision()

uint8_t idfxx::chip_info::major_revision ( ) const
inlinenoexcept

Returns the major part of the chip revision.

Returns
The major revision number (revision / 100).

Definition at line 146 of file chip.hpp.

◆ minor_revision()

uint8_t idfxx::chip_info::minor_revision ( ) const
inlinenoexcept

Returns the minor part of the chip revision.

Returns
The minor revision number (revision % 100).

Definition at line 153 of file chip.hpp.

◆ model()

chip_model idfxx::chip_info::model ( ) const
inlinenoexcept

Returns the chip model.

Returns
The chip model identifier.

Definition at line 113 of file chip.hpp.

◆ revision()

uint16_t idfxx::chip_info::revision ( ) const
inlinenoexcept

Returns the full chip revision number.

The revision is encoded as major * 100 + minor. For example, revision 100 means v1.0, and revision 301 means v3.1.

Returns
The chip revision number.

Definition at line 139 of file chip.hpp.


The documentation for this class was generated from the following file: