Functions
HAL Control functions
Peripheral Driver » HAL Driver » HAL | Peripheral Driver » HAL Driver » BR » Functions

HAL Control functions. More...

## Functions
void | hal_increment_tick (void)
| This function is called to increment a global variable "g_tick" used as application time base. More...
uint32_t | hal_get_tick (void)
| Povides a tick value in millisecond. More...
void | hal_delay (__IO uint32_t delay)
| This function provides accurate delay (in milliseconds) based on variable incremented. More...
void | hal_suspend_tick (void)
| Suspend Tick increment. More...
void | hal_resume_tick (void)
| Resume Tick increment. More...
uint32_t | hal_get_hal_version (void)
| This function returns the HAL revision. More...
void | hal_dwt_enable (uint32_t _demcr_initial, uint32_t _dwt_ctrl_initial)
| This function enable the DWT function. More...
void | hal_dwt_disable (uint32_t _demcr_initial, uint32_t _dwt_ctrl_initial)
| This function disable the DWT function. More...

## Detailed Description

HAL Control functions.

     ===============================================================================
                          ##### HAL Control functions #####
     ===============================================================================
        [..]  This section provides functions allowing to:
          (+) Provide a tick value in millisecond
          (+) Provide a blocking delay in millisecond
          (+) Suspend the time base source interrupt
          (+) Resume the time base source interrupt
          (+) Get the HAL API driver version

## Function Documentation

## ◆ hal_delay()

void hal_delay | ( | __IO uint32_t | delay | ) |

This function provides accurate delay (in milliseconds) based on variable incremented.

Note
  In the default implementation , SysTick timer is the source of time base. It is used to generate interrupts at regular time intervals where g_tick is incremented. The function is declared as __WEAK to be overwritten in case of other implementations in user file.

Parameters

  [in] | delay | Specify the delay time length, in milliseconds.

## ◆ hal_dwt_disable()

void hal_dwt_disable | ( | uint32_t | _demcr_initial,
|  | uint32_t | _dwt_ctrl_initial
| ) |  |

This function disable the DWT function.

Returns
  none

## ◆ hal_dwt_enable()

void hal_dwt_enable | ( | uint32_t | _demcr_initial,
|  | uint32_t | _dwt_ctrl_initial
| ) |  |

This function enable the DWT function.

Returns
  none

## ◆ hal_get_hal_version()

uint32_t hal_get_hal_version | ( | void |  | ) |

This function returns the HAL revision.

Returns
  version: 0xXYZR (8 bits for each decimal, R for RC)

## ◆ hal_get_tick()

uint32_t hal_get_tick | ( | void |  | ) |

Povides a tick value in millisecond.

Note
  The function is declared as __WEAK to be overwritten in case of other implementations in user file.

Returns
  Tick value

## ◆ hal_increment_tick()

void hal_increment_tick | ( | void |  | ) |

This function is called to increment a global variable "g_tick" used as application time base.

Note
  In the default implementation, this variable is incremented by 1 each 1ms in Systick ISR. This function is declared as __WEAK to be overwritten in case of other implementations in user file.

## ◆ hal_resume_tick()

void hal_resume_tick | ( | void |  | ) |

Resume Tick increment.

Note
  In the default implementation , SysTick timer is the source of time base. It is used to generate interrupts at regular time intervals. Once hal_resume_tick() is called, the SysTick interrupt will be enabled and so Tick increment is resumed. The function is declared as __WEAK to be overwritten in case of other implementations in user file.

## ◆ hal_suspend_tick()

void hal_suspend_tick | ( | void |  | ) |

Suspend Tick increment.

Note
  In the default implementation , SysTick timer is the source of time base. It is used to generate interrupts at regular time intervals. Once hal_suspend_tick() is called, the SysTick interrupt will be disabled and so Tick increment is suspended. This function is declared as __WEAK to be overwritten in case of other implementations in user file.