1.2 (Cat.1 module) M601 software resource introduction

1 Introduction


      OpenCPU is an embedded development solution for M2M product applications, which can use an LTE module as the main processor. This design can help customers quickly design and develop applications. OpenCPU makes it possible for customers to implement innovative applications, and can be directly embedded in the M601 LTE module to run without using an external MCU as a processor.


Two OpenCPU platform


2.1 Open resources
2.1.1 Processor
structure: Cortex A5 Application processor with 32KB ICache and 32KB DCache, NEON/FPU
clock frequency: 500MHz
2.1.2 Storage space
M601-OpenCPU module contains 8MB flash and 32MB RAM
file system space: 3.2MB , User available space is about 1MB
RAM space: about 2MB dynamic storage space

2.2 Development Environment
2.2.1 SDK
OpenCPU SDK provides developers with the following resources: "M601-OpenCPU User Manual", development example source code, individual routines with example codes, secondary development tutorial documents, function libraries, compilation and programming files, debug tool.


Three API functions


3.1 System API The
zyf_system.h file defines system related APIs. These functions are necessary for all customers, so please make sure to include this header file in your project.
Mainly introduce system related API functions, including system version information, get device IMEI number, read SIM card IMEI, ICCID, query device signal value, network status, etc.

3.2 Time-related APIs The
OpenCPU module provides time-related APIs, including setting local time, obtaining local time, converting calendar time to seconds or converting seconds to calendar time, etc.
The calendar time calculation is the number of seconds from the base time point of 00:00:00 on January 1, 1970 to the present.

3.3 Timer API
OpenCPU provides common timer API, which is convenient for users to create according to their needs.
Before using the timer, first create a timer instance through ZYF_CreateTimer, and then start the timer through ZYF_StartTimer.

3.4 Power Management API
Power management includes power-related operations, such as shutdown, restart, power control and low power enable/disable.

3.5 Thread API
OpenCPU multi-thread API is developed on FreeRTOS, supports customers to create tasks according to their needs, and provides a series of commonly used APIs under multi-tasking systems, such as: thread creation, message queue, semaphore, mutual exclusion, etc.
Each type of API corresponds to create and delete operations. After each instance is created, if it is no longer used, resources need to be released.

3.6 File System API
OpenCPU supports user file systems and provides a complete set of API functions to create, access, and delete files and directories. The API and usage are described here.
Storage only supports FLASH storage. When you want to create or open a file or directory, you must use an absolute path. For example, if you want to create a file, you can set "/" like this.

3.7 Hardware interface API
In OpenCPU, serial ports include physical serial ports and virtual serial ports. The physical serial port can be connected to external devices, and the virtual serial port is used for communication between the application program and the underlying operating system. One of the physical serial ports has a hardware handshake function, and the others are three-wire interfaces.
OpenCPU supports 2 virtual serial ports for communication between App and Core. These serial ports are designed with RI and DCD information according to the characteristics of physical serial ports. The DCD level can indicate whether the virtual serial port is in data mode or AT command mode.

3.8 GPRS API
API functions are defined in the "zyf_gprs.h" file.
The module only supports the definition and activation of 1 PDP context, and this PDP context supports up to 6 socket links, including the socket used by EPO.

3.9 Socket API
In the OpenCPU solution, developers can use Socket API interface functions to implement TCP/UDP programming, and up to 8 Socket connections can be established. These API interface functions are defined in the zyf_socket.h file.

3.10 SMS API
In the OpenCPU solution, developers can call SMS API interface functions for SMS sending and receiving processing. These API interface functions are defined in the zyf_sms.h file.
Call ZYF_SmsRegister to register the new SMS notification callback function, and there will be a notification in the callback function after receiving the SMS. If you need to send a short message, call the ZYF_SmsSend interface function to send, you can send English (TEXT) short messages and Chinese (UCS2) format short messages.


3.11 Phone API
In the OpenCPU solution, developers can call the phone-related API interface functions to make, answer and hang up calls. These API interface functions are defined in zyf_call.h.
Call ZYF_TelephoneRegister to register the callback function of incoming call notification and various status notifications during the call.

3.12 Software Watchdog
In the OpenCPU solution, a hardware watchdog is enabled in the library by default, and it will feed the dog regularly, so developers don't need to deal with this logic. In addition, this solution wants developers to provide a software watchdog.

3.13 Audio playback API
In the OpenCPU solution, developers can call audio-related API interface functions to play audio files, and can play audio files in mp3, wav, and amr formats. These API interface functions are defined in the zyf_audio.h file.


3.14 Bluetooth 3.0 API
In the OpenCPU solution, developers can call Bluetooth related API interface functions for Bluetooth scanning, pairing, SPP connection, and sending and receiving data. These API interface functions are defined in the zyf_bluetooth.h file.
Call ZYF_BT_Register to register the callback function of various status notifications during Bluetooth pairing and connection.

3.15 SSL/TLS API
SSL (Secure Sockets Layer), and its successor Transport Layer Security (Transport Layer Security, TLS) is a security protocol that provides security and data integrity for network communications. SSL/TLS encrypts the network connection at the transport layer. Supported versions include: TLS V1.0, TLS V1.1, TLS V1.2. In the OpenCPU solution, corresponding API interface functions are provided to implement SSL/TLS functions. These API interface functions are defined in the zyf_tls.h file.
Call ZYF_MbedTlsRegister to register the callback function of various status notifications in the initialization. You must first use the interface in the Socket API to create a socket connection, and then use ZYF_MbedTlsConnect for handshake, and then you can send and receive data.
Note: This set of interfaces supports the establishment of up to 3 SSL/TLS connections at the same time.

3.16 TTS API
In the OpenCPU solution, developers can broadcast characters by calling TTS related interface functions, up to 63 Chinese characters can be played. (Using unicode format)


List of four routines


The example folder contains the secondary development routines of M601. The routine details are as follows:

BSP:
    1 GPIO usage
    2 UART communication/RS485 communication
    3 IIC usage
    4 SPI usage
    5 ADC usage
    6 PWM usage
    
Basic functions:   
    7 RTC usage
    8 Timer usage
    9 NTP network time usage
    10 FS file system Use
    
network:
    11 Get SIM card information
    12 TCP/UDP basic network connection
    13 HTTP use
    14 SSL use
    15 Standard MQTT connection
    16 Alibaba Cloud MQTT connection triples and SSL method
    17 FTP/HTTP download and upload of files
    18 FOTA remote Upgrade
    
OS:
    19 Multitasking establishment and task scheduling
    20 Use of semaphore and mailbox
    21 Use of message queue and mutex
    
POWER:
    22 Module enters deep sleep mode (shutdown mode)
    23 Keep low power consumption state under long connection
    24 Multitask How to maintain low power consumption under
    25 Can not enter the problem and reason of low power consumption
    
Comprehensive routines:
    26 comprehensive routines (multitasking + MQTT + low power consumption + FOTA)

 

 

QQ exchange group: 657996991

Guess you like

Origin blog.csdn.net/w_hizyf_m/article/details/106574986