API Overview_Rev1.0
Document Revision History
Document Version |
Revision Date |
Revised By |
Reviewed By |
Changes |
|---|---|---|---|---|
Rev1.0 |
26-03-13 |
zlc |
Initial release |
1 Introduction
This chapter mainly introduces the Lierda LTE-EC71X OPENCPU base package separated API list of self-developed functions supported by Lierda. Other platform support is not covered in this document. This document serves as a reference for customers when developing features.
2 API Function Description
2.1 Basic Information APIs
2.1.1 Dev API
Function |
Description |
|---|---|
|
Get device IMEI number |
|
Get device firmware version |
|
Get device serial number |
|
Get device manufacturer ID |
|
Get device sub-firmware version |
|
Get device model |
|
Set device modem function |
|
Get device modem function |
|
Query heap space status information |
|
Configure watchdog (timer) switch |
|
Feed system watchdog (reset timer to zero) |
|
Get hardware model |
|
Set available frequency bands |
|
Query available bands and supported band list |
|
Lock frequency point, cell and clear priority frequency points |
|
Enable fast release |
|
Set primary and backup DNS server addresses |
|
Query primary and backup DNS server addresses |
2.1.2 datacall API
Function |
Description |
|---|---|
|
Get network registration status |
|
Set or query default bearer (CID 1) APN and IP type |
|
Register system event notification callback |
2.1.3 SIM API
Function |
Description |
|---|---|
|
Get SIM card IMSI |
|
Get SIM card ICCID |
|
Get SIM card phone number |
|
Get SIM card cached status information |
2.1.4 NW API
Function |
Description |
|---|---|
|
Query CSQ signal strength information |
|
Get current registered network operator information |
|
Get current network registration information |
|
Set operator |
|
Get selected operator information |
|
Get detailed signal strength information |
|
Get current base station time |
|
Get current serving and neighboring cell information |
|
Register event callback function |
|
Get uplink and downlink data count |
|
Reset uplink and downlink data count |
|
Set base station time synchronization switch |
|
Get base station time synchronization switch status |
2.1.5 SMS API
Function |
Description |
|---|---|
|
Send text format short message |
|
Send PDU format short message |
|
Get short message list |
|
Read single short message |
|
Delete single message |
|
Get short message center number |
|
Set short message center number |
|
Get SM and ME storage information |
|
Set SMS storage location |
|
Get SMS storage location |
2.1.6 Custom AT API
Function |
Description |
|---|---|
|
This function is used to open AT functionality |
|
This function is used to register AT command table |
|
This interface is for AT command response |
2.2 Driver API List
2.2.1 OS API
2.2.1.1 Tasks
Function |
Description |
|---|---|
|
Create task |
|
Delete task |
|
Release CPU usage rights |
|
Get current task handle |
|
Change task priority |
|
Get task status information |
|
Set task sleep time in milliseconds |
|
Set task sleep time in seconds |
|
Get task stack free space |
|
Suspend task |
|
Resume suspended task, restore to schedulable running state |
|
Get RTOS system clock ticks converted to time, unit: ms |
|
Get RTOS system clock ticks |
|
Get total size of FreeRTOS heap |
|
Get free size of FreeRTOS heap |
|
Get minimum free size of FreeRTOS heap during runtime |
|
Get maximum allocatable memory block size of FreeRTOS |
|
Get total size of PSRAM |
|
Get free size of PSRAM |
|
Get minimum free size of PSRAM during runtime |
|
Get maximum allocatable memory block size of PSRAM during runtime |
|
Check if task is in running state |
|
Create task using static method |
2.2.1.2 Critical Sections
Function |
Description |
|---|---|
|
Enter critical section |
|
Enter critical section from interrupt |
|
Exit critical section |
|
Exit critical section from interrupt |
2.2.1.3 Semaphores
Function |
Description |
|---|---|
|
Create semaphore |
|
Create semaphore (extended) |
|
Set semaphore wait time |
|
Release semaphore |
|
Get semaphore count value |
|
Delete semaphore |
2.2.1.4 Mutexes
Function |
Description |
|---|---|
|
Create mutex |
|
Acquire mutex, wait time can be customized according to requirements |
|
Try to acquire mutex, wait time is permanent |
|
Release mutex |
|
Delete mutex |
2.2.1.5 Message Queues
Function |
Description |
|---|---|
|
Create message queue |
|
Wait for message in queue |
|
Release message queue |
|
Get number of messages in queue |
|
Delete message queue |
|
Reset elements in queue and change queue length |
|
Query available space count in queue |
2.2.1.6 Timers
Function |
Description |
|---|---|
|
Create timer |
|
Start timer |
|
Check if timer is running |
|
Stop timer |
|
Delete timer |
|
Stop timer in interrupt |
2.2.1.7 Event Groups
Function |
Description |
|---|---|
|
Create event group |
|
Get current bit status of event group |
|
Wait for event group bits to meet specified conditions |
|
Set event bits in event group |
|
Clear event bits in event group |
|
Delete event group |
2.2.1.8 PSRAM API
Function |
Description |
|---|---|
|
Allocate memory from PSRAM |
|
Free memory allocated from PSRAM |
|
Resize the memory block previously allocated by |
|
Get total HEAP size of PSRAM |
|
Get remaining available memory size of PSRAM |
2.2.1.9 Others
Function |
Description |
|---|---|
|
Dynamically allocate memory |
|
Allocate memory and initialize to 0 |
|
Free dynamically allocated memory |
|
Reallocate memory |
|
Hardware random number |
2.2.2 UART API
Function |
Description |
|---|---|
|
UART initialization interface |
|
UART de-initialization interface |
|
UART send interface |
2.2.3 USB API
Function |
Description |
|---|---|
|
Register USB event callback function |
|
Get USB hot-plug state |
|
Get USB initialization state |
|
Initialize USB driver |
|
De-initialize USB driver |
2.2.4 ADC API
Function |
Description |
|---|---|
|
Read analog voltage raw data from ADC channel |
2.2.5 GPIO API
Function |
Description |
|---|---|
|
GPIO initialization interface |
|
GPIO get level interface |
|
GPIO set level |
|
Enable general GPIO interrupt source |
|
Disable general GPIO interrupt source |
|
Control AGPIO power domain switch |
|
Set power domain voltage |
|
Set module pin multiplexing function |
|
Get module pin multiplexing function |
|
Initialize wakeup pin interrupt |
|
De-initialize wakeup pin interrupt |
|
Get wakeup pin level |
2.2.6 PWM API
Function |
Description |
|---|---|
|
Open PWM function |
|
Close PWM function |
|
Enable PWM and configure PWM pulse period and duty cycle |
|
Disable PWM function |
|
Set PWM duty cycle |
2.2.7 APWM API
Function |
Description |
|---|---|
|
Configure APWM function |
|
Enable APWM function |
2.2.8 I2C API
Function |
Description |
|---|---|
|
Initialize I2C bus |
|
Release I2C bus |
|
Write data to I2C bus, slave device register address length is 8 bits |
|
Read data from I2C bus, slave device register address length is 8 bits |
|
Write data to I2C bus, slave device register address length is 16 bits |
|
Read data from I2C bus, slave device register address length is 16 bits |
2.2.9 FLASH API
Function |
Description |
|---|---|
|
Erase data in flash |
|
Read data from flash |
|
Write data to flash |
2.2.10 RTC API
Function |
Description |
|---|---|
|
Set RTC time |
|
Get RTC time |
|
Get RTC time converted to seconds |
|
Get local RTC time |
|
Set timezone, in units of 15 minutes |
|
Get timezone, in units of 15 minutes |
|
Print RTC time |
|
Set RTC alarm time |
|
Get RTC alarm time |
|
Enable and disable RTC alarm |
|
Register RTC alarm callback function |
|
Get RTC time converted to milliseconds |
2.2.11 FS API
Function |
Description |
|---|---|
|
Open a file based on file path or filename |
|
Close an opened file |
|
Delete a file |
|
Read file content |
|
Write content to file |
|
Set file pointer position |
|
Set file position pointer to the beginning of the file |
|
Get current file pointer position |
|
Get file status based on file descriptor |
|
Get file information based on filename |
|
Truncate file to specified length |
|
Get file size |
|
Check if file exists based on filename |
|
Create a directory |
|
Open a directory |
|
Close an opened directory |
|
Get directory information |
|
Rename directory |
|
Synchronize file data |
|
Get remaining filesystem size |
2.2.12 NV API
Function |
Description |
|---|---|
|
Write simple configuration file |
|
Read simple configuration file |
|
Write user-defined simple configuration file |
|
Read user-defined simple configuration file |
2.2.14 PowerKey API
Function |
Description |
|---|---|
|
Module shutdown |
|
Module reset |
|
Get pwrkey level status |
|
Register pwrkey interrupt callback |
|
Set pwrkey shutdown timeout time |
|
Get reset reason |
|
Set pwrkey pull-up/pull-down |
|
Set pwrkey initialization state |
2.2.15 GNSS API
Function |
Description |
|---|---|
|
Configure GNSS module parameters |
|
Configure A-GNSS function parameters |
|
Open GNSS module |
|
Close GNSS module |
|
Get location information |
|
Get NMEA sentences |
|
Close GNSS chip backup power |
2.2.16 SPI API
Function |
Description |
|---|---|
|
This function is used to initialize SPI |
|
This function is used to initialize SPI (configure SPI bus parameters) |
|
This function is used to simultaneously send and receive data via SPI |
|
This function is used to receive data via SPI |
|
This function is used to send data via SPI |
|
This function is used to release SPI bus |
2.3 Application Protocol APIs
2.3.1 HTTP API
Function |
Description |
|---|---|
|
Create a new HTTP client handle and initialize HTTP client resources |
|
Send HTTP request |
|
Stop HTTP request |
|
Release HTTP client resources |
|
Configure HTTP client properties |
|
Get HTTP message header information |
|
Configure HTTP form properties |
|
Check if HTTP client is in running state |
|
Parse URL |
2.3.2 SSL API
Function |
Description |
|---|---|
|
Configure SSL related parameters |
|
Create SSL connection |
|
Send data |
|
Query SSL connection status |
|
Close SSL connection |
2.3.3 MQTT API
Function |
Description |
|---|---|
|
Initialize MQTT client resources and create a new MQTT client handle |
|
Configure MQTT context and establish connection with server |
|
Publish message to specified topic |
|
Subscribe/unsubscribe topic |
|
Disconnect |
|
Set callback function for receiving messages published by server |
|
Query MQTT connection status |
|
Release MQTT client resources |
|
Send ping message |
|
Get OneNET platform token |
2.3.4 FTP API
Function |
Description |
|---|---|
|
Create FTP client |
|
Release FTP client |
|
Set client options |
|
Connect to FTP server |
|
Disconnect from FTP server |
|
Download file |
|
Upload file |
|
Delete file |
|
Get current directory path |
|
Change current directory path |
|
Create new directory |
|
Delete directory |
|
Get directory information |
|
Get file size |
|
Rename file |
|
Set transfer file type |
2.3.5 NTP API
Function |
Description |
|---|---|
|
Open NTP time synchronization function |
2.3.6 PING API
Function |
Description |
|---|---|
|
Enable ping function |
2.3.7 LBS API
Function |
Description |
|---|---|
|
This function is used to request location information |
2.3.8 WifiScan API
Function |
Description |
|---|---|
|
Enable Wi-Fi Scan |
|
Disable Wi-Fi Scan |
|
Configure Wi-Fi Scan scan parameters |
|
Perform Wi-Fi Scan synchronous mode scanning |
|
Start Wi-Fi Scan asynchronous mode scanning |
|
Register callback function |
2.3.9 FOTA API
Function |
Description |
|---|---|
|
Differential upgrade module interface |
|
Verify upgrade package information stored in filesystem, write to FOTA partition after verification |
|
Initialize and clear module upgrade area |
|
Get FOTA upgrade result |
|
Restart module |
|
Initialize and clear module upgrade FOTA partition |
|
Write module file directly to FOTA partition |
|
Get FOTA partition size |
|
Verify upgrade package information stored in FOTA partition |
2.3.10 APP OTA API
Function |
Description |
|---|---|
|
Full upgrade APP partition upgrade package detection interface |
2.4 Multimedia APIs
2.4.1 AUDIO API
Function |
Description |
|---|---|
|
Audio initialization interface |
|
Audio de-initialization interface |
|
Set volume level |
|
Get volume level |
|
Set microphone volume |
|
Play audio |
|
Record audio |
|
Pause playback |
|
Resume playback |
|
Play MP3 file |
2.4.2 TTS API
Function |
Description |
|---|---|
|
Initialize TTS engine |
|
Set configuration options before playing TTS |
|
Get TTS configuration options |
|
Start playing TTS |
|
Release occupied resources when TTS playback is complete |
|
Interrupt TTS playback and exit TTS |
|
Return TTS running status |
|
Set TTS resources |
|
Convert UTF-8 encoded string to GBK encoded string |
2.4.3 LCD API
Function |
Description |
|---|---|
|
LCD initialization |
|
LCD full screen refresh |
|
LCD draw point |
|
LCD draw line |
|
LCD draw rectangle |
|
LCD draw circle |
|
LCD display image |
|
LCD set brightness |
|
LCD enable display |
|
LCD disable display |
|
LCD enter sleep mode |
|
LCD exit sleep mode |
2.4.4 KeyPad API
Function |
Description |
|---|---|
|
Initialize matrix keyboard |
|
Get matrix keyboard status |
2.4.5 Camera API
Function |
Description |
|---|---|
|
Initialize camera function |
|
Close camera function |
|
Capture one image |
|
Open camera for preview on LCD screen (not currently supported) |
|
Stop camera preview on LCD screen (not currently supported) |
2.4.6 Decode API
Function |
Description |
|---|---|
|
Set decoder library authentication key |
|
Get decoder library version information |
|
Initialize decoder library |
|
Close decoder library |
|
Decode photo |
|
Get decode result |
2.4.7 VoLTE API
Function |
Description |
|---|---|
|
IMS registration status report |
|
IMS registration status get |
|
Set voice domain options |
|
Get voice domain options |
|
Set module usage |
|
Get module usage |
|
Set codec type |
|
Set auto answer |
|
Make phone call |
|
Answer phone call |
|
Hang up phone call |
|
Send DTMF |
|
Get current call list |
|
Get current phone number |
|
Register callback function |