STM32L4xx_HAL_Driver  1.14.0
Peripheral Control functions

Peripheral Control functions. More...

Functions

HAL_StatusTypeDef HAL_DCMI_ConfigCrop (DCMI_HandleTypeDef *hdcmi, uint32_t X0, uint32_t Y0, uint32_t XSize, uint32_t YSize)
 Configure the DCMI crop window coordinates. More...
 
HAL_StatusTypeDef HAL_DCMI_EnableCrop (DCMI_HandleTypeDef *hdcmi)
 Enable the crop feature. More...
 
HAL_StatusTypeDef HAL_DCMI_DisableCrop (DCMI_HandleTypeDef *hdcmi)
 Disable the crop feature. More...
 
HAL_StatusTypeDef HAL_DCMI_ConfigSyncUnmask (DCMI_HandleTypeDef *hdcmi, DCMI_SyncUnmaskTypeDef *SyncUnmask)
 Set embedded synchronization delimiters unmasks. More...
 

Detailed Description

Peripheral Control functions.

 ===============================================================================
                    ##### Peripheral Control functions #####
 ===============================================================================
[..]  This section provides functions allowing to:
      (+) Configure the crop feature.
      (+) Enable/Disable the crop feature.
      (+) Configure the synchronization delimiters unmasks.
      (+) Enable/Disable user-specified DCMI interrupts.

Function Documentation

◆ HAL_DCMI_ConfigCrop()

HAL_StatusTypeDef HAL_DCMI_ConfigCrop ( DCMI_HandleTypeDef hdcmi,
uint32_t  X0,
uint32_t  Y0,
uint32_t  XSize,
uint32_t  YSize 
)

Configure the DCMI crop window coordinates.

Parameters
hdcmipointer to a DCMI_HandleTypeDef structure that contains the configuration information for DCMI.
X0DCMI window crop window X offset (number of pixels clocks to count before the capture).
Y0DCMI window crop window Y offset (image capture starts with this line number, previous line data are ignored).
XSizeDCMI crop window horizontal size (in number of pixels per line).
YSizeDCMI crop window vertical size (in lines count).
Note
For all the parameters, the actual value is the input data + 1 (e.g. YSize = 0x0 means 1 line, YSize = 0x1 means 2 lines, ...)
Return values
HALstatus

Definition at line 905 of file stm32l4xx_hal_dcmi.c.

906 {
907  /* Check the parameters */
908  assert_param(IS_DCMI_WINDOW_COORDINATE(X0));
909  assert_param(IS_DCMI_WINDOW_HEIGHT(Y0));
910  assert_param(IS_DCMI_WINDOW_COORDINATE(XSize));
911  assert_param(IS_DCMI_WINDOW_COORDINATE(YSize));
912 
913  /* Process Locked */
914  __HAL_LOCK(hdcmi);
915 
916  /* Lock the DCMI peripheral state */
917  hdcmi->State = HAL_DCMI_STATE_BUSY;
918 
919  /* Configure CROP */
920  MODIFY_REG(hdcmi->Instance->CWSIZER, (DCMI_CWSIZE_VLINE|DCMI_CWSIZE_CAPCNT), (XSize | (YSize << DCMI_CWSIZE_VLINE_Pos)));
921  MODIFY_REG(hdcmi->Instance->CWSTRTR, (DCMI_CWSTRT_VST|DCMI_CWSTRT_HOFFCNT), (X0 | (Y0 << DCMI_CWSTRT_VST_Pos)));
922 
923  /* Initialize the DCMI state*/
924  hdcmi->State = HAL_DCMI_STATE_READY;
925 
926  /* Process Unlocked */
927  __HAL_UNLOCK(hdcmi);
928 
929  return HAL_OK;
930 }
__IO HAL_DCMI_StateTypeDef State
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_DCMI_ConfigSyncUnmask()

HAL_StatusTypeDef HAL_DCMI_ConfigSyncUnmask ( DCMI_HandleTypeDef hdcmi,
DCMI_SyncUnmaskTypeDef SyncUnmask 
)

Set embedded synchronization delimiters unmasks.

Parameters
hdcmipointer to a DCMI_HandleTypeDef structure that contains the configuration information for DCMI.
SyncUnmaskpointer to a DCMI_SyncUnmaskTypeDef structure that contains the embedded synchronization delimiters unmasks.
Return values
HALstatus

Definition at line 992 of file stm32l4xx_hal_dcmi.c.

993 {
994  /* Process Locked */
995  __HAL_LOCK(hdcmi);
996 
997  /* Lock the DCMI peripheral state */
998  hdcmi->State = HAL_DCMI_STATE_BUSY;
999 
1000  /* Write DCMI embedded synchronization unmask register */
1001  hdcmi->Instance->ESUR = (((uint32_t)SyncUnmask->FrameStartUnmask) |\
1002  ((uint32_t)SyncUnmask->LineStartUnmask << DCMI_ESUR_LSU_Pos)|\
1003  ((uint32_t)SyncUnmask->LineEndUnmask << DCMI_ESUR_LEU_Pos)|\
1004  ((uint32_t)SyncUnmask->FrameEndUnmask << DCMI_ESUR_FEU_Pos));
1005 
1006  /* Change the DCMI state*/
1007  hdcmi->State = HAL_DCMI_STATE_READY;
1008 
1009  /* Process Unlocked */
1010  __HAL_UNLOCK(hdcmi);
1011 
1012  return HAL_OK;
1013 }
__IO HAL_DCMI_StateTypeDef State
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK

◆ HAL_DCMI_DisableCrop()

HAL_StatusTypeDef HAL_DCMI_DisableCrop ( DCMI_HandleTypeDef hdcmi)

Disable the crop feature.

Parameters
hdcmipointer to a DCMI_HandleTypeDef structure that contains the configuration information for DCMI.
Return values
HALstatus

Definition at line 938 of file stm32l4xx_hal_dcmi.c.

939 {
940  /* Process Locked */
941  __HAL_LOCK(hdcmi);
942 
943  /* Lock the DCMI peripheral state */
944  hdcmi->State = HAL_DCMI_STATE_BUSY;
945 
946  /* Disable DCMI Crop feature */
947  CLEAR_BIT(hdcmi->Instance->CR, DCMI_CR_CROP);
948 
949  /* Change the DCMI state*/
950  hdcmi->State = HAL_DCMI_STATE_READY;
951 
952  /* Process Unlocked */
953  __HAL_UNLOCK(hdcmi);
954 
955  return HAL_OK;
956 }
__IO HAL_DCMI_StateTypeDef State
__HAL_UNLOCK(hrtc)
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)
__HAL_LOCK(hrtc)
return HAL_OK

◆ HAL_DCMI_EnableCrop()

HAL_StatusTypeDef HAL_DCMI_EnableCrop ( DCMI_HandleTypeDef hdcmi)

Enable the crop feature.

Parameters
hdcmipointer to a DCMI_HandleTypeDef structure that contains the configuration information for DCMI.
Return values
HALstatus

Definition at line 964 of file stm32l4xx_hal_dcmi.c.

965 {
966  /* Process Locked */
967  __HAL_LOCK(hdcmi);
968 
969  /* Lock the DCMI peripheral state */
970  hdcmi->State = HAL_DCMI_STATE_BUSY;
971 
972  /* Enable DCMI Crop feature */
973  SET_BIT(hdcmi->Instance->CR, DCMI_CR_CROP);
974 
975  /* Change the DCMI state*/
976  hdcmi->State = HAL_DCMI_STATE_READY;
977 
978  /* Process Unlocked */
979  __HAL_UNLOCK(hdcmi);
980 
981  return HAL_OK;
982 }
__IO HAL_DCMI_StateTypeDef State
__HAL_UNLOCK(hrtc)
__HAL_LOCK(hrtc)
return HAL_OK