Functions
Peripheral Control and State functions
Peripheral Driver » HAL Driver » DUAL TIMER » Functions

DUAL TIMER Peripheral State functions. More...

Collaboration diagram for Peripheral Control and State functions:

## Functions
hal_dual_timer_state_t | hal_dual_timer_get_state (dual_timer_handle_t *p_dual_timer)
| Return the DUAL TIMER handle state. More...
hal_status_t | hal_dual_timer_set_config (dual_timer_handle_t *p_dual_timer, dual_timer_init_t *p_structure)
| DUAL TIMER configuration. More...
hal_status_t | hal_dual_timer_set_background_reload (dual_timer_handle_t *p_dual_timer, uint32_t reload_value)
| DUAL TIMER set background reload value The background reload value contains the value from which the counter is to decrement. More...
hal_status_t | hal_dual_timer_set_reload_background_reload (dual_timer_handle_t *p_dual_timer, uint32_t reload_value, uint32_t bg_reload_value)
| DUAL TIMER set current reload value and next background reload value The background reload value contains the value from which the counter is to decrement. More...
uint32_t | hal_dual_timer_get_counter_value (dual_timer_handle_t *p_dual_timer)
| Return the DUAL TIMER counter value. More...

## Detailed Description

DUAL TIMER Peripheral State functions.

      ==============================================================================
                ##### Peripheral Control and State functions #####
      ==============================================================================
        [..]
        This subsection provides functions allowing to :
          (+) Return the DUAL TIMER handle state.
          (+) Configure the DUAL TIMER.

## Function Documentation

## ◆ hal_dual_timer_get_counter_value()

uint32_t hal_dual_timer_get_counter_value | ( | dual_timer_handle_t * | p_dual_timer | ) |

Return the DUAL TIMER counter value.

Parameters

  [in] | p_dual_timer | Pointer to a DUAL_TIMER handle which contains the configuration information for the specified DUAL TIMER.

Returns
  Dual Timer counter.

## ◆ hal_dual_timer_get_state()

hal_dual_timer_state_t hal_dual_timer_get_state | ( | dual_timer_handle_t * | p_dual_timer | ) |

Return the DUAL TIMER handle state.

Parameters

  [in] | p_dual_timer | Pointer to a DUAL_TIMER handle which contains the configuration information for the specified DUAL TIMER.

Return values

  HAL_DUAL_TIMER_STATE_RESET | Peripheral not yet initialized or disabled.
  HAL_DUAL_TIMER_STATE_READY | Peripheral Initialized and ready for use.
  HAL_DUAL_TIMER_STATE_BUSY | An internal process is ongoing.
  HAL_DUAL_TIMER_STATE_ERROR | Reception process is ongoing.

## ◆ hal_dual_timer_set_background_reload()

hal_status_t hal_dual_timer_set_background_reload | ( | dual_timer_handle_t * | p_dual_timer,
|  | uint32_t | reload_value
| ) |  |

DUAL TIMER set background reload value The background reload value contains the value from which the counter is to decrement.

This is the value used to reload the counter when Periodic mode is enabled, and the current count reaches 0. The difference is that writes to background reload value do not cause the counter to immediately restart from the new value.

Parameters

  [in] | p_dual_timer | Pointer to a DUAL_TIMER handle which contains the configuration information for the specified DUAL TIMER.
  [in] | reload_value | Background reload value

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.

## ◆ hal_dual_timer_set_config()

hal_status_t hal_dual_timer_set_config | ( | dual_timer_handle_t * | p_dual_timer,
|  | dual_timer_init_t * | p_structure
| ) |  |

DUAL TIMER configuration.

Parameters

  [in] | p_dual_timer | Pointer to a DUAL_TIMER handle which contains the configuration information for the specified DUAL TIMER.
  [in] | p_structure | The DUAL TIMER configuration structure

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_dual_timer_set_reload_background_reload()

hal_status_t hal_dual_timer_set_reload_background_reload | ( | dual_timer_handle_t * | p_dual_timer,
|  | uint32_t | reload_value,
|  | uint32_t | bg_reload_value
| ) |  |

DUAL TIMER set current reload value and next background reload value The background reload value contains the value from which the counter is to decrement.

This is the value used to reload the counter when Periodic mode is enabled, and the current count reaches 0. The difference is that writes to background reload value do not cause the counter to immediately restart from the new value.

Parameters

  [in] | p_dual_timer | Pointer to a DUAL_TIMER handle which contains the configuration information for the specified DUAL TIMER.
  [in] | reload_value | Current Background reload value
  [in] | bg_reload_value | Next Background reload value

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.