after the first two sections of the bedding, in the grammatical estimation of no problem, now formally entered the ClassA20 Class library link.
First download the file: https://github.com/tjCFeng/ClassA20, it is recommended to download the zip file directly. Extract...
A20.pas-the base of the entire class library, for calculating the cells that map addresses, does not need to be used directly
Clock.pas-Turn off the clock control of the closed part of the peripheral, do not need to use directly
Gp.pas-Backup Register control unit
Gpio.pas-gpio Control Unit
LRADC.PAS-LRADC Low Precision ADC control unit
PWM.PAS-PWM Control Unit
Rtc.pas-Real-time clock control unit
TWI.PAS-I2C Control Unit
Timer.pas-Timer Control unit
at present, the implementation of these several, follow-up to achieve SPI, interrupt and so on. Because Linux interrupts can not be directly response to the user-state program, so some trouble, this is not as good as wince.
Project Establishment:
Refer to the establishment of the first section of the project, after saving all the files, put the ClassA20 folder in the project folder (easy to manage). Selecting Project Options from the Project menu in the IDE pops up the form for the project configuration.
You'll see a lot of options in this pop-up form. After selecting "Path", on the right "supplemental unit" You can enter the name of the folder you want to reference directly, or click the button below to select the folder in the pop-up form.
Once you have chosen it, you can reference the desired unit file in the cell.
Tip: If you want to open a cell file, or want to see a function, definition, etc., just move the mouse over the top, hold down the CTRL key, the mouse will become a hand, and then click the mouse, you can open the file directly and jump to the corresponding location, very convenient. If the mouse does not open or jump after clicking, prove that the file is not found or write errors.
In addition, when an object is created, enter "." After the object name, the method or property that the object can invoke will pop up, and the private member of the object class is not displayed, which can greatly improve the efficiency of code writing.
Tip: If you want to open a cell file, or want to see a function, definition, etc., just move the mouse over the top, hold down the CTRL key, the mouse will become a hand, and then click the mouse, you can open the file directly and jump to the corresponding location, very convenient. If the mouse does not open or jump after clicking, prove that the file is not found or write errors.
In addition, when an object is created, enter "." After the object name, the method or property that the object can invoke will pop up, and the private member of the object class is not displayed, which can greatly improve the efficiency of code writing.
Program Structure:
CLASSA20 class library Each unit is generally divided into two parts, a singleton class and a general class. Taking Lradc.pas as an example,
Tip: If you want to open a cell file, or want to see a function, definition, etc., just move the mouse over the top, hold down the CTRL key, the mouse will become a hand, and then click the mouse, you can open the file directly and jump to the corresponding location, very convenient. If the mouse does not open or jump after clicking, prove that the file is not found or write errors.
In addition, when an object is created, enter "." After the object name, the method or property that the object can invoke will pop up, and the private member of the object class is not displayed, which can greatly improve the efficiency of code writing.
Program Structure:
CLASSA20 class library Each unit is generally divided into two parts, a singleton class and a general class. Taking Lradc.pas as an example,
The Singleton class is generally used for the encapsulation of critical resources or unified control resources, and without the simplification of functions, the corresponding registers can be manipulated directly, while the common class is the encapsulation of a channel or a port, and the common settings and functions are encapsulated, which can be directly invoked to simplify the operation.
For example, Allwinner's A20, two channels of LRADC start and stop acquisition by the same set of registers control, so they are encapsulated in a singleton class, to avoid the control of one channel inadvertently affect the work of another channel, and a specific channel to read the data operation, because it can be operated separately, So it is encapsulated in the ordinary class.
please download the ClassA20 class library at https://github.com/tjCFeng/ClassA20.
Tip: If you want to open a cell file, or want to see a function, definition, etc., just move the mouse over the top, hold down the CTRL key, the mouse will become a hand, and then click the mouse, you can open the file directly and jump to the corresponding location, very convenient. If the mouse does not open or jump after clicking, prove that the file is not found or write errors.
In addition, when an object is created, enter "." After the object name, the method or property that the object can invoke will pop up, and the private member of the object class is not displayed, which can greatly improve the efficiency of code writing.
Program Structure:
CLASSA20 class library Each unit is generally divided into two parts, a singleton class and a general class. Taking Lradc.pas as an example,
3.CLASSA20 function and structure of "Allwinner ClassA20 class Library Analysis"