PicGIM 0.5 documentation    
Copyright (C) 2002, 2013 - [AsYntote-SkyMatrix] gKript.org    
Generated on Sun Apr 26 2015 11:03:33 with DoxyGen 1.8.8    
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Delay
clessidra.gif

The DELAY module provides a set of functions for delay in different units of time ( seconds, milliseconds, microseconds) but not accuracy.
You only need one parameter for the use of this module : The system frequency



Module configuration


In order to use this module, it must be enabled and configured in:


    

Attention
Here a link to the file : pgim_caldelay.h
This is not a file defined as public and therefore would not be edited.
We suggest that you edit this file only if necessary and only if you know what you are doing.




Module enabling


#define PGIM_CAL_DELAY PG_DISABLE

This define enables or disables the module.
It must be:

  • PG_ENABLE : Delay module enabled.
  • PG_DISABLE : Delay module disabled.

References

System frequency


#define PG_CLOCK 48.000

The CORE FREQUENCY of the MCU in your project.
Unit of measure is expressed in [MHz]. Accuracy: X.XXX.
They must be:

  • PG_CLOCK >= 4.000 : 4 MHz is the minimum clock frequency managed by PicGIM.

By default is set to 0.000

References

Note
The working frequency is the CORE FREQUENCY of the MCU in your project. To set it correctly, you need to consider the value of the oscillator/crystal and eventually of the PLL.
Attention
4MHz is the minimum clock frequency managed by PicGIM.
If you set a lower frequency 4MHz functions of delay will definitely inaccurate.



Functions


After it has been enabled and configured the module you can refer to this set of functions to use it.


Private functions

Note
With "private" we mean a function that should not be used by the user in its code.
In this documentation the private functions are marked as Deprecate.
PicGIM internally uses these functions to properly manage the module.
Of course you are always free to use them if you think they are useful.
Note
The working frequency is the CORE FREQUENCY of the MCU in your project. To set it correctly, you need to consider the value of the oscillator/crystal and eventually of the PLL.
Attention
4MHz is the minimum clock frequency managed by PicGIM.
If you set a lower frequency 4MHz functions of delay will definitely inaccurate.



Public functions

  • pg_delay_sec() : To do a delay in seconds.
  • pg_delay_msec() : To do a delay in milliseconds.
  • pg_delay_usec() : To do a delay in microseconds.
  • pg_delay_high_priority() : To do a delay in various units of time. This function is uninterruptable.
    Attention
    "high priority" means that during the delay interrupts are not enabled.
    Note
    This function will compiled only if the Interrupts module is enabled.
  • pg_delay() : To do a delay in various units of time.