Functions
Peripheral State and Errors Functions
Peripheral Driver » HAL Driver » PDM » Functions

PDM control functions. More...

Collaboration diagram for Peripheral State and Errors Functions:

## Functions
hal_pdm_state_t | hal_pdm_get_state (pdm_handle_t *p_pdm)
| Return the PDM handle state. More...
uint32_t | hal_pdm_get_error (pdm_handle_t *p_pdm)
| Return the PDM error code. More...
hal_status_t | hal_pdm_suspend_reg (pdm_handle_t *p_pdm)
| Suspend some registers related to PDM configuration before sleep. More...
hal_status_t | hal_pdm_resume_reg (pdm_handle_t *p_pdm)
| Restore some registers related to PDM configuration after sleep. More...

## Detailed Description

PDM control functions.

     ===============================================================================
                          ##### Peripheral State and Errors functions #####
     ===============================================================================
        [..]
        This subsection provides a set of functions allowing to control the PDM.
         (+) hal_pdm_get_state() API can be helpful to check in run-time the state of the PDM peripheral.
         (+) hal_pdm_get_error() check in run-time Errors occurring during communication.

## Function Documentation

## ◆ hal_pdm_get_error()

uint32_t hal_pdm_get_error | ( | pdm_handle_t * | p_pdm | ) |

Return the PDM error code.

Parameters

  [in] | p_pdm | Pointer to an PDM handle which contains the configuration information for the specified PDM module.

Returns
  PDM error code in bitmap format

## ◆ hal_pdm_get_state()

hal_pdm_state_t hal_pdm_get_state | ( | pdm_handle_t * | p_pdm | ) |

Return the PDM handle state.

Parameters

  [in] | p_pdm | Pointer to an PDM handle which contains the configuration information for the specified PDM module.

Return values

  HAL_ADC_STATE_RESET | Peripheral not initialized.
  HAL_ADC_STATE_READY | Peripheral initialized and ready for use.
  HAL_ADC_STATE_BUSY | An internal process is ongoing.
  HAL_ADC_STATE_ERROR | Peripheral in error.

## ◆ hal_pdm_resume_reg()

hal_status_t hal_pdm_resume_reg | ( | pdm_handle_t * | p_pdm | ) |

Restore some registers related to PDM configuration after sleep.

This function must be used in conjunction with the hal_adc_suspend_reg().

Parameters

  [in] | p_pdm | Pointer to a PDM handle which contains the configuration information for the specified PDM module.

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_pdm_suspend_reg()

hal_status_t hal_pdm_suspend_reg | ( | pdm_handle_t * | p_pdm | ) |

Suspend some registers related to PDM configuration before sleep.

Parameters

  [in] | p_pdm | Pointer to a PDM handle which contains the configuration information for the specified PDM module.

Return values

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