Class 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
function getChipCoreType
function getChipCores
function getChipFamily
function getChipFamilyName
function getChipId
function getChipModel
function getChipType
function getCpuFreq
function getCpuFreqMHz
function getCycleCount
function getDeviceName
function getFlashChipId
function getFlashChipSize
Get flash chip total size.
The default implementation uses the least significant byte of the chip ID to determine the size.
function getFreeHeap
function getHeapSize
function getMaxAllocHeap
function getMaxFreeBlockSize
function getMinFreeHeap
function getRamSize
function getResetReason
function getResetReasonName
Get a textual representation of a reboot reason.
Parameters:
reason
value to convert to text, pass 0 to read from lt_reboot_get_reason()
function getVersion
function gpioRecover
function restart
function restartDownloadMode
Reboot the CPU and stay in download mode (if possible).
Returns:
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