NB-IoT Module Series
BC26-OpenCPU User Guide
BC26-OpenCPU_User_Guide 1 / 81
Our aim is to provide customers with timely and comprehensive service. For any
assistance, please contact our company headquarters:
Quectel Wireless Solutions Co., Ltd.
7
th
Floor, Hongye Building, No.1801 Hongmei Road, Xuhui District, Shanghai 200233, China
Tel: +86 21 5108 6236
Email: info@quectel.com
Or our local office. For more information, please visit:
http://quectel.com/support/sales.htm
For technical support, or to report documentation errors, please visit:
http://quectel.com/support/technical.htm
Or Email to: support@quectel.com
GENERAL NOTES
QUECTEL OFFERS THE INFORMATION AS A SERVICE TO ITS CUSTOMERS. THE INFORMATION
PROVIDED IS BASED UPON CUSTOMERS’ REQUIREMENTS. QUECTEL MAKES EVERY EFFORT
TO ENSURE THE QUALITY OF THE INFORMATION IT MAKES AVAILABLE. QUECTEL DOES NOT
MAKE ANY WARRANTY AS TO THE INFORMATION CONTAINED HEREIN, AND DOES NOT ACCEPT
ANY LIABILITY FOR ANY INJURY, LOSS OR DAMAGE OF ANY KIND INCURRED BY USE OF OR
RELIANCE UPON THE INFORMATION. ALL INFORMATION SUPPLIED HEREIN IS SUBJECT TO
CHANGE WITHOUT PRIOR NOTICE.
COPYRIGHT
THE INFORMATION CONTAINED HERE IS PROPRIETARY TECHNICAL INFORMATION OF
QUECTEL WIRELESS SOLUTIONS CO., LTD. TRANSMITTING, REPRODUCTION, DISSEMINATION
AND EDITING OF THIS DOCUMENT AS WELL AS UTILIZATION OF THE CONTENT ARE
FORBIDDEN WITHOUT PERMISSION. OFFENDERS WILL BE HELD LIABLE FOR PAYMENT OF
DAMAGES. ALL RIGHTS ARE RESERVED IN THE EVENT OF A PATENT GRANT OR
REGISTRATION OF A UTILITY MODEL OR DESIGN.
Copyright © Quectel Wireless Solutions Co., Ltd. 2018. All rights reserved.
NB-IoT Module Series
BC26-OpenCPU User Guide
BC26-OpenCPU_User_Guide 2 / 81
About the Document
History
Revision
Date
Author
Description
1.0
2018-04-23
Lebron LIU
Initial
NB-IoT Module Series
BC26-OpenCPU User Guide
BC26-OpenCPU_User_Guide Confidential / Released 3 / 81
Contents
About the Document ................................................................................................................................... 2
Contents ....................................................................................................................................................... 3
Table Index ................................................................................................................................................... 5
Figure Index ................................................................................................................................................. 6
1 Introduction .......................................................................................................................................... 7
2 OpenCPU Platform ............................................................................................................................... 8
2.1. System Architecture .................................................................................................................... 8
2.2. Open Resources ......................................................................................................................... 9
2.2.1. Processor ......................................................................................................................... 9
2.2.2. Memory Scheme .............................................................................................................. 9
2.3. Interfaces..................................................................................................................................... 9
2.3.1. Serial Interfaces ............................................................................................................... 9
2.3.2. GPIO .............................................................................................................................. 10
2.3.3. EINT ............................................................................................................................... 10
2.3.4. PWM ............................................................................................................................... 10
2.3.5. ADC ................................................................................................................................ 10
2.3.6. IIC ................................................................................................................................... 10
2.3.7. SPI .................................................................................................................................. 10
2.4. Development Environment ........................................................................................................ 10
2.4.1. SDK ................................................................................................................................ 10
2.4.2. Editor .............................................................................................................................. 11
2.4.3. Compiler & Compiling .................................................................................................... 11
2.4.4. Download ....................................................................................................................... 12
2.4.5. How to Program ............................................................................................................. 12
3 Basic Data Types ............................................................................................................................... 16
3.1. Required Header ....................................................................................................................... 16
3.2. Base Data Type ......................................................................................................................... 16
4 System Configuration ........................................................................................................................ 18
4.1. Configuration for Tasks ............................................................................................................. 18
4.2. Configuration for GPIO ............................................................................................................. 19
4.3. Configuration for Customizations .............................................................................................. 19
5 API Functions ..................................................................................................................................... 20
5.1. System API ................................................................................................................................ 20
5.1.1. Usage ............................................................................................................................. 20
5.1.2. API Functions ................................................................................................................. 22
5.1.3. Possible Error Code ....................................................................................................... 30
5.1.4. Example ......................................................................................................................... 31
5.2. Time API .................................................................................................................................... 32
5.2.1. Usage ............................................................................................................................. 32
NB-IoT Module Series
BC26-OpenCPU User Guide
BC26-OpenCPU_User_Guide Confidential / Released 4 / 81
5.2.2. API Functions ................................................................................................................. 32
5.2.3. Example ......................................................................................................................... 34
5.3. Timer API ................................................................................................................................... 35
5.3.1. Usage ............................................................................................................................. 35
5.3.2. API Functions ................................................................................................................. 36
5.3.3. Example ......................................................................................................................... 38
5.4. Memory API ............................................................................................................................... 39
5.4.1. Usage ............................................................................................................................. 39
5.4.2. API Functions ................................................................................................................. 39
5.4.3. Example ......................................................................................................................... 40
5.5. Hardware Interface API ............................................................................................................. 40
5.5.1. UART .............................................................................................................................. 40
5.5.2. GPIO .............................................................................................................................. 46
5.5.3. EINT ............................................................................................................................... 53
5.5.4. PWM ............................................................................................................................... 59
5.5.5. ADC ................................................................................................................................ 62
5.5.6. IIC ................................................................................................................................... 65
5.5.7. SPI .................................................................................................................................. 71
5.6. Debug API ................................................................................................................................. 76
5.6.1. Usage ............................................................................................................................. 76
5.6.2. API Functions ................................................................................................................. 76
5.7. RIL API ...................................................................................................................................... 77
5.7.1. AT API ............................................................................................................................. 78
6 Appendix ............................................................................................................................................. 80
6.1. Reference .................................................................................................................................. 80