Mikroelektronika MIKROE-742 데이터 시트

다운로드
페이지 532
PREDEFINED GLOBALS AND CONSTANTS
To facilitate programming of AVR compliant MCUs, the mikroPascal PRO for AVR
implements a number of predefined globals and constants.
All AVR SFR registers are implicitly declared as global variables of volatile word.
These identifiers have an external linkage, and are visible in the entire project.
When creating a project, the mikroPascal PRO for AVR will include an appropriate
(
*.mpas
) file from defs folder, containing declarations of available SFR registers
and constants. 
Math constants
In addition, several commonly used math constants are predefined in mikroPascal
PRO for AVR:
PI    
=  3.1415926
PI_HALF
=  1.5707963
TWO_PI 
=  6.2831853
E     
=  2.7182818
For a complete set of predefined globals and constants, look for “Defs” in the
mikroPascal PRO for AVR installation folder, or probe the Code Assistant for specif-
ic letters (Ctrl+Space in the Code Editor).
Predefined project level defines
These defines are based on a value that you have entered/edited in the current proj-
ect, and it is equal to the name of selected device for the project.
If ATmega16 is selected device, then ATmega16 token will be defined as 1, so it can
be used for conditional compilation:
{$IFDEF ATmega16}
...
{$ENDIF}
Related topics: Project level defines
95
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Specifics
mikroPASCAL PRO for AVR
CHAPTER 3