mn::device::basic_system Class Reference
Get system infos and useful system functins of the using platform. More...
#include <mn_system.hpp>
Static Private Member Functions | |
public static void | shutdown (power_state_code code, mn::timespan_t span=mn::timespan_t(0)) |
Halt the CPU. More... | |
static void | restart (power_state_code code, mn::timespan_t span=mn::timespan_t(0)) |
Restart the CPU. More... | |
static void | deepsleep (power_state_code code, uint64_t time_us, mn::timespan_t span=mn::timespan_t(0)) |
Enter deep sleep with wakeup by timer. More... | |
static randomAccessMemory | get_internal () |
Return the infos from the internal RAM. More... | |
static randomAccessMemory | get_external () |
Return the infos from the external RAM. More... | |
static uint8_t | get_core_speed (const uint8_t core) |
Get the speed of a core in Mhz. More... | |
static uint8_t | get_speed () |
Get the mega hertz of the cpu. More... | |
static void | set_core_speed (const uint8_t core, const uint8_t speed) |
Set the speed of a given core. More... | |
static void | set_speed (const uint8_t speed) |
Set the speed in Mhz of the cpu. More... | |
static const char * | get_sdk_version () |
Get the version of the using platform SDKs. More... | |
static const char * | get_name () |
Get the name of the using Platform. More... | |
static system_stream * | get_partition_stream (const char *name) |
Get a system stream to write/read to a partition. More... | |
Private Attributes | |
public | __pad0__: public : enum class power_state_code : int { normal |
public | error |
public | __pad1__: union randomAccessMemory { struct { uint32_t size |
uint32_t | free |
uint32_t | min_freeSinceBoot |
uint32_t | maxAlloc |
uint32_t | data [3] |
public | __pad2__: static uint8_t get_num_cores() |
public | __pad3__: static system_stream* get_flash() |
Detailed Description
Get system infos and useful system functins of the using platform.
Member Function Documentation
◆ deepsleep()
|
staticprivate |
Enter deep sleep with wakeup by timer.
- Parameters
-
time_us deep-sleep time, unit: microsecond. span how many time to wait to deepsleep the system.
◆ get_core_speed()
|
staticprivate |
◆ get_external()
|
staticprivate |
Return the infos from the external RAM.
- Note
- ESP32: psram.
◆ get_internal()
|
staticprivate |
Return the infos from the internal RAM.
◆ get_name()
|
staticprivate |
Get the name of the using Platform.
- Returns
- The name.
◆ get_partition_stream()
|
staticprivate |
Get a system stream to write/read to a partition.
- Parameters
-
name The name of partition.
- Returns
- The stream to a partiotion or nullptr if the partition mith the given name not exist.
◆ get_sdk_version()
|
staticprivate |
Get the version of the using platform SDKs.
- Returns
- The version of the using platform SDKs.
◆ get_speed()
|
staticprivate |
Get the mega hertz of the cpu.
- Returns
- The speed in Mhz of the cpu.
◆ restart()
|
staticprivate |
Restart the CPU.
- Note
- ESP32: Peripherals (except for WiFi, BT, UART0, SPI1, and legacy timers) are not reset.
- Parameters
-
code span how many time to wait to shutdown the system.
◆ set_core_speed()
|
staticprivate |
Set the speed of a given core.
- Note
- On ESP32 is the same with set_speed(speed);
◆ set_speed()
|
staticprivate |
Set the speed in Mhz of the cpu.
◆ shutdown()
|
staticprivate |
Halt the CPU.
- Parameters
-
code span how many time to wait to shutdown the system.
- Note
- ESP32: Enter to the deepsleep mode with wakeup with any gpio pin.
Member Data Documentation
◆ __pad0__
|
private |
normal code, no error.
◆ __pad1__
|
private |
Total size of the RAM.
◆ __pad2__
|
private |
◆ __pad3__
|
private |
◆ data
|
private |
◆ error
|
private |
on error
◆ free
|
private |
Current available RAM.
◆ maxAlloc
|
private |
largest block of bytes that can be allocated at once.
◆ min_freeSinceBoot
|
private |
lowest size of free RAM since boot
The documentation for this class was generated from the following files: