loading

Simple Routine Based on Aworks LED Lighting

Aworks is the next generation embedded development platform developed by ZLG for 12 years. It supports components that are "pluggable, replaceable and configurable". Users only need to modify the corresponding header file to realize "one-time programming, lifelong use and cross platform". This paper introduces a simple routine for aworks to light up an LED light, which will take you to feel the charm of aworks!

1 Introduction to core board

The rt1050 processor of cortex-m7 on m1052 cross-border core board not only has the strong processing performance of MPU, but also has the advantages of simplicity and real-time of MCU microcontroller! M1052 integrates WiFi / Lora / ZigBee / Mifare wireless functions and is pre installed with aworks real-time operating system. It is designed for application in the direction of intelligent hardware and industrial Internet of things.

M1052 core board

2aworks LED lighting process

The aworks development environment eclipse and hardware evaluation backplane we use in this routine are shown in the figure:

Eclipse development environment

Hardware evaluation backplane

The construction of aworks development environment has been described in detail in Section 2 of the aworks m1050 SDK quick start document v1.01 provided by our company. The data can be downloaded free of charge on the official website of ZLG Ligong technology · Zhiyuan electronics, and will not be repeated here. Let's introduce how to light an LED lamp from the perspective of software and hardware.

3 Introduction to hardware circuit:

LED lamp circuit diagram

M1052 core board control LED lamp interface pin circuit diagram

The LED light on the m105x EV board backplane is connected to the b42 pin of the core board, which can be multiplexed into UART2 receiving signal and USB_ OTG1_ OC、QTIMER3_ Timer3 and other functions. At this time, we do not turn on the multiplexing function, and treat this pin value as an ordinary gpio1_ Io19 use.

4introduction to aworks software interface:

Aworks uniformly abstracts common external devices and defines the general interface of azimuth external devices. Such as LED, buzzer, nixie tube, key, etc. The application program is based on general interface programming, which will make the application program not bound with specific hardware devices. In other words, the application program can be reused across platforms and run on any hardware platform running aworks.

General LED interface, as shown in the figure:

Universal LED interface

In this example, we use all the above four interface functions. Let's briefly introduce these four interface functions below (for details, please refer to Section 6.1 of Chapter 6 of programming for aworks framework and interface (I)).

1. Set LED status

aw_ err_ t aw_ led_ set(int id,aw_bool_t on);

ID is the LED number, and the system assigns a unique ID to each LED. The boolean type on parameter indicates whether the LED is lit, and the value is aw_ True indicates that the LED is on, aw_ False indicates that the LED is off.

2. Turn on the LED

aw_ err_ t aw_ led_ on(int id);

ID is the LED number, and the return value of the function is the standard error number.

3. Turn off the LED

aw_ err_ t aw_ led_ off(int id);

ID is the LED number, and the return value of the function is the standard error number.

4. Flip LED status

aw_ err_ t aw_ led_ toggle(int id);

Flipping the LED state is to change the LED from on state to off state or from off state to on state, where id is the LED number.

The above LED interface function is in aw_ There are declarations in the LED. H header file. If these LED interface functions are used, the header file must be included in the code. In addition, we need to be in aw_ prj_ In params. H file, open the macro definition of LED, as shown in the figure:

Turn on macro definition of LED

The demo program code of LED is as follows:

Leddemo program

At this time, we make this function into a task (for task creation and management, please refer to Section 10.1 of Chapter 10 of programming for aworks framework and interface (I))

Led task code

Then we were at aw_ The task is called in the main function.

aw_ Main function

Finally, we compile the project to generate an. ELF file, as shown in the figure

Project compiled successfully

The compiled code can be burned into the board through the debugging window. The final phenomenon is that the LED light is on every 500ms.

Leddemo debug window

Processing performance of 5mpu and development mode of MCU

The m1052 cross-border core board is equipped with NXP i.MX rt105x processor with a main frequency of 528mhz. Based on the architecture of application processor, rt105x adopts MCU core, which can not only realize the high performance, rich functional peripherals and diversified network access interface modes of application processor, but also have the ease of use and real-time low-power operation characteristics of traditional MCU.

M1052 core board

6aworks IOT real time operating system

The m1052 cross-border core board has built-in aworks IOT real-time operating system. Aworks IOT real-time operating system adopts a framework oriented design architecture and supports the design of platform components that are "pluggable, replaceable and configurable", independent of hardware and operating system types. Users only need to modify the corresponding header file to realize cross platform reuse of application code.

GET IN TOUCH WITH Us
recommended articles
Related Blogs Info Center
Insights network launched the install blockchain, which is one of the most unique blockchain technology use cases seen in the world. In this article, we will discuss...
Reasons why we should impose tariffs on goods from China...?I really see no good so I will give you things to prepare for. 1.) Trade is good for everyone 2.) This wo...
On March 8, the new surface Pro X was officially launched in China. As Microsoft's lightest, strongest and most connected surface product so far, surface Pro x adopt...
Well there is a lot of empty space in an atom.They actually say that if you take all the space out of atoms then the Empire State building would shrink to the size o...
Beijing, August 4, 2011 - Texas Instruments (TI) recently announced the launch of a 50 Ma, 60 V synchronous swift â„¢ The step-down regulator can pr...
This is the wiki text version of lesson 1 and lesson 2 of arm bare metal phase 1 enhanced version.Why do you want to learn SCM without a future?Because it's a good e...
Since the outbreak of the epidemic, health codes, online diagnosis and treatment, infrared thermometers, etc. have been gradually known by the public. They share a "...
Both begin with S.And the word Soul also begins with the letter S as well.Songs have hooks, bass lines, riddim, lyrics, chord progression, solos and song structure.S...
Recently, the Ministry of education, the national development and Reform Commission and the Ministry of Finance jointly issued several opinions on building "double f...
As users and enthusiasts of traditional cars, facing the rapid development of new energy vehicles, there will indeed be a period of pain. However, from a macro persp...
no data
Contact Us
Contact Person: AI customer service
Tel: +86 0757-23368757
Address: No.4 Of Xingye Road, Shafu Industrial Park, Longjiang Town, Shunde District, Foshan 
WHATSAPP: +86-15919090839
WECHAT: w87735492
Better Touch Better Business
Contact Sales at JuJiao.
Call Us
+86 0757-23368757
  
Customer service
detect