Skip to content

Class LibreTiny

ClassList > LibreTiny

Main LibreTiny API class.More...

  • #include <LT.h>

Public Functions

Type Name
const char * getBoard ()
Get board code.
const char * getChipCoreType ()
Get CPU core type name as string.
uint8_t getChipCores ()
Get CPU core count.
ChipFamily getChipFamily ()
Get CPU family ID (as lt_cpu_family_t enum member).
const char * getChipFamilyName ()
Get CPU family name as string.
uint32_t getChipId ()
Get CPU ID based on the last three octets of MAC address. Note: the number is 24-bit (with the MSB being zero). The 3rd-to-last octet is least-significant, the last octet is most-significant.
const char * getChipModel ()
Get CPU model name as string (uppercase).
ChipType getChipType ()
Get CPU model ID (as lt_cpu_model_t enum member).
uint32_t getCpuFreq ()
Get CPU frequency in Hz.
uint32_t getCpuFreqMHz ()
Get CPU frequency in MHz.
uint32_t getCycleCount ()
Get CPU cycle count.
const char * getDeviceName ()
Get device friendly name in format "LT-<chip model>-<MAC ID>". Can be used as hostname.
FlashId getFlashChipId ()
Read flash chip ID and return a lt_flash_id_t struct.
uint32_t getFlashChipSize ()
Get flash chip total size.
uint32_t getFreeHeap ()
Get free heap size.
uint32_t getHeapSize ()
Get total heap size.
uint32_t getMaxAllocHeap ()
Get largest block of heap that can be allocated at once.
uint32_t getMaxFreeBlockSize ()
Get largest block of heap that can be allocated at once.
uint32_t getMinFreeHeap ()
Get lowest level of free heap memory.
uint32_t getRamSize ()
Get total RAM size.
ResetReason getResetReason ()
Get the reason of last chip reboot.
const char * getResetReasonName (ResetReason reason=lt_get_reboot_reason())
Get a textual representation of a reboot reason.
const char * getVersion ()
Reset reason enumeration.
void gpioRecover ()
Reconfigure GPIO pins used for debugging (SWD/JTAG), so that they can be used as normal I/O.
void restart ()
Reboot the CPU.
void restartDownloadMode ()
Reboot the CPU and stay in download mode (if possible).

Detailed Description

Since v1.0.0, this class only consists of inline functions, which wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API for more information.

The class is accessible using the LT global object.

Public Functions Documentation

function getBoard

inline const char * LibreTiny::getBoard () 

function getChipCoreType

inline const char * LibreTiny::getChipCoreType () 

function getChipCores

inline uint8_t LibreTiny::getChipCores () 

function getChipFamily

inline ChipFamily LibreTiny::getChipFamily () 

function getChipFamilyName

inline const char * LibreTiny::getChipFamilyName () 

function getChipId

inline uint32_t LibreTiny::getChipId () 

function getChipModel

inline const char * LibreTiny::getChipModel () 

function getChipType

inline ChipType LibreTiny::getChipType () 

function getCpuFreq

inline uint32_t LibreTiny::getCpuFreq () 

function getCpuFreqMHz

inline uint32_t LibreTiny::getCpuFreqMHz () 

function getCycleCount

inline uint32_t LibreTiny::getCycleCount () 

function getDeviceName

inline const char * LibreTiny::getDeviceName () 

function getFlashChipId

inline FlashId LibreTiny::getFlashChipId () 

function getFlashChipSize

Get flash chip total size.

inline uint32_t LibreTiny::getFlashChipSize () 

The default implementation uses the least significant byte of the chip ID to determine the size.

function getFreeHeap

inline uint32_t LibreTiny::getFreeHeap () 

function getHeapSize

inline uint32_t LibreTiny::getHeapSize () 

function getMaxAllocHeap

inline uint32_t LibreTiny::getMaxAllocHeap () 

function getMaxFreeBlockSize

inline uint32_t LibreTiny::getMaxFreeBlockSize () 

function getMinFreeHeap

inline uint32_t LibreTiny::getMinFreeHeap () 

function getRamSize

inline uint32_t LibreTiny::getRamSize () 

function getResetReason

inline ResetReason LibreTiny::getResetReason () 

function getResetReasonName

Get a textual representation of a reboot reason.

inline const char * LibreTiny::getResetReasonName (
    ResetReason reason=lt_get_reboot_reason()


  • reason value to convert to text, pass 0 to read from lt_reboot_get_reason()

function getVersion

inline const char * LibreTiny::getVersion () 

function gpioRecover

inline void LibreTiny::gpioRecover () 

function restart

inline void LibreTiny::restart () 

function restartDownloadMode

Reboot the CPU and stay in download mode (if possible).

inline void LibreTiny::restartDownloadMode () 


whether download-mode reboot is possible

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/LT/LT.h