Skip to content

Instantly share code, notes, and snippets.

@thibthibaut
Created January 16, 2020 14:20
Show Gist options
  • Save thibthibaut/ed922886c1f8001245cf1269d84e8b9d to your computer and use it in GitHub Desktop.
Save thibthibaut/ed922886c1f8001245cf1269d84e8b9d to your computer and use it in GitHub Desktop.
/**
* @brief Enable or disable mirror mode for camera
* @param boolean value, 0 disable, other enable
* @retval void
*/
void BSP_CAMERA_Mirror(int enable){
const uint8_t MVFP_REG = 0x1E;
uint8_t reg_val = CAMERA_IO_Read(CameraHwAddress, MVFP_REG);
if(enable){
CAMERA_IO_Write(CameraHwAddress, MVFP_REG, reg_val | 0x20 );
} else {
CAMERA_IO_Write(CameraHwAddress, MVFP_REG, reg_val & (0xDF) );
}
}
/**
* @brief Enable or disable vflip mode for camera
* @param boolean value, 0 disable, other enable
* @retval void
*/
void BSP_CAMERA_VFlip(int enable){
const uint8_t MVFP_REG = 0x1E;
uint8_t reg_val = CAMERA_IO_Read(CameraHwAddress, MVFP_REG);
if(enable){
CAMERA_IO_Write(CameraHwAddress, MVFP_REG, reg_val | 0x30);
} else {
CAMERA_IO_Write(CameraHwAddress, MVFP_REG, reg_val & (0xEF));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment