BSP driver for DISCO_L496AG

Dependents:   DISCO_L496AG-LCD-prova_1 DISCO_L496AG-LCD-prova_2 DISCO_L496AG-LCD-demo DISCO_L496AG-SRAM-demo

Committer:
Jerome Coutant
Date:
Wed Nov 20 16:48:24 2019 +0100
Revision:
2:106c7b82e064
Parent:
0:d83f1c8ca282
Update BSP files with CubeL4 V1.14.0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bcostm 0:d83f1c8ca282 1 /**
bcostm 0:d83f1c8ca282 2 ******************************************************************************
bcostm 0:d83f1c8ca282 3 * @file stm32l496g_discovery_camera.h
bcostm 0:d83f1c8ca282 4 * @author MCD Application Team
bcostm 0:d83f1c8ca282 5 * @brief This file contains the common defines and functions prototypes for
bcostm 0:d83f1c8ca282 6 * the stm32l496g_discovery_camera.c driver.
bcostm 0:d83f1c8ca282 7 ******************************************************************************
bcostm 0:d83f1c8ca282 8 * @attention
bcostm 0:d83f1c8ca282 9 *
Jerome Coutant 2:106c7b82e064 10 * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
Jerome Coutant 2:106c7b82e064 11 * All rights reserved.</center></h2>
bcostm 0:d83f1c8ca282 12 *
Jerome Coutant 2:106c7b82e064 13 * This software component is licensed by ST under BSD 3-Clause license,
Jerome Coutant 2:106c7b82e064 14 * the "License"; You may not use this file except in compliance with the
Jerome Coutant 2:106c7b82e064 15 * License. You may obtain a copy of the License at:
Jerome Coutant 2:106c7b82e064 16 * opensource.org/licenses/BSD-3-Clause
bcostm 0:d83f1c8ca282 17 *
bcostm 0:d83f1c8ca282 18 ******************************************************************************
bcostm 0:d83f1c8ca282 19 */
bcostm 0:d83f1c8ca282 20
bcostm 0:d83f1c8ca282 21 /* Define to prevent recursive inclusion -------------------------------------*/
bcostm 0:d83f1c8ca282 22 #ifndef __STM32L496G_DISCOVERY_CAMERA_H
bcostm 0:d83f1c8ca282 23 #define __STM32L496G_DISCOVERY_CAMERA_H
bcostm 0:d83f1c8ca282 24
bcostm 0:d83f1c8ca282 25 #ifdef __cplusplus
bcostm 0:d83f1c8ca282 26 extern "C" {
bcostm 0:d83f1c8ca282 27 #endif
bcostm 0:d83f1c8ca282 28
bcostm 0:d83f1c8ca282 29 /* Includes ------------------------------------------------------------------*/
bcostm 0:d83f1c8ca282 30 /* Include Camera component Driver */
bcostm 0:d83f1c8ca282 31 #include "../Components/ov9655/ov9655.h"
bcostm 0:d83f1c8ca282 32 #include "stm32l496g_discovery.h"
bcostm 0:d83f1c8ca282 33
bcostm 0:d83f1c8ca282 34 /** @addtogroup BSP
bcostm 0:d83f1c8ca282 35 * @{
bcostm 0:d83f1c8ca282 36 */
bcostm 0:d83f1c8ca282 37
bcostm 0:d83f1c8ca282 38 /** @addtogroup STM32L496G_DISCOVERY
bcostm 0:d83f1c8ca282 39 * @{
bcostm 0:d83f1c8ca282 40 */
bcostm 0:d83f1c8ca282 41
bcostm 0:d83f1c8ca282 42 /** @addtogroup STM32L496G_DISCOVERY_CAMERA
bcostm 0:d83f1c8ca282 43 * @{
bcostm 0:d83f1c8ca282 44 */
bcostm 0:d83f1c8ca282 45
bcostm 0:d83f1c8ca282 46 /** @defgroup STM32L496G_DISCOVERY_CAMERA_Exported_Types STM32L496G_DISCOVERY_CAMERA Exported Types
bcostm 0:d83f1c8ca282 47 * @{
bcostm 0:d83f1c8ca282 48 */
bcostm 0:d83f1c8ca282 49
bcostm 0:d83f1c8ca282 50 /**
bcostm 0:d83f1c8ca282 51 * @brief Camera State structures definition
bcostm 0:d83f1c8ca282 52 */
bcostm 0:d83f1c8ca282 53 typedef enum
bcostm 0:d83f1c8ca282 54 {
bcostm 0:d83f1c8ca282 55 CAMERA_OK = 0x00,
bcostm 0:d83f1c8ca282 56 CAMERA_ERROR = 0x01,
bcostm 0:d83f1c8ca282 57 CAMERA_TIMEOUT = 0x02,
bcostm 0:d83f1c8ca282 58 CAMERA_NOT_DETECTED = 0x03,
bcostm 0:d83f1c8ca282 59 CAMERA_NOT_SUPPORTED = 0x04
bcostm 0:d83f1c8ca282 60
bcostm 0:d83f1c8ca282 61 }
bcostm 0:d83f1c8ca282 62 Camera_StatusTypeDef;
bcostm 0:d83f1c8ca282 63
bcostm 0:d83f1c8ca282 64 #define RESOLUTION_R160x120 CAMERA_R160x120 /* QQVGA Resolution */
bcostm 0:d83f1c8ca282 65 #define RESOLUTION_R320x240 CAMERA_R320x240 /* QVGA Resolution */
bcostm 0:d83f1c8ca282 66 #define RESOLUTION_R480x272 CAMERA_R480x272 /* 480x272 Resolution */
bcostm 0:d83f1c8ca282 67 #define RESOLUTION_R640x480 CAMERA_R640x480 /* VGA Resolution */
bcostm 0:d83f1c8ca282 68 /**
bcostm 0:d83f1c8ca282 69 * @}
bcostm 0:d83f1c8ca282 70 */
bcostm 0:d83f1c8ca282 71
bcostm 0:d83f1c8ca282 72 /** @defgroup STM32L496G_DISCOVERY_CAMERA_Exported_Constants STM32L496G_DISCOVERY_CAMERA Exported Constants
bcostm 0:d83f1c8ca282 73 * @{
bcostm 0:d83f1c8ca282 74 */
bcostm 0:d83f1c8ca282 75 #define BSP_CAMERA_IRQHandler DCMI_IRQHandler
bcostm 0:d83f1c8ca282 76 #define BSP_CAMERA_DMA_IRQHandler DMA2_Channel6_IRQHandler
bcostm 0:d83f1c8ca282 77 #define BSP_CAMERA_DMA_IRQn DMA2_Channel6_IRQn
bcostm 0:d83f1c8ca282 78 #define BSP_CAMERA_DMA_INSTANCE DMA2_Channel6
bcostm 0:d83f1c8ca282 79
bcostm 0:d83f1c8ca282 80 /**
bcostm 0:d83f1c8ca282 81 * @}
bcostm 0:d83f1c8ca282 82 */
bcostm 0:d83f1c8ca282 83
bcostm 0:d83f1c8ca282 84 /**
bcostm 0:d83f1c8ca282 85 * @brief Camera special pins
bcostm 0:d83f1c8ca282 86 */
bcostm 0:d83f1c8ca282 87 /* Camera power up pin */
bcostm 0:d83f1c8ca282 88 #define CAMERA_PWR_EN_PIN IO1_PIN_6
bcostm 0:d83f1c8ca282 89
bcostm 0:d83f1c8ca282 90
bcostm 0:d83f1c8ca282 91 /**
bcostm 0:d83f1c8ca282 92 * @}
bcostm 0:d83f1c8ca282 93 */
bcostm 0:d83f1c8ca282 94
bcostm 0:d83f1c8ca282 95 /** @addtogroup STM32L496G_DISCOVERY_CAMERA_Exported_Functions
bcostm 0:d83f1c8ca282 96 * @{
bcostm 0:d83f1c8ca282 97 */
bcostm 0:d83f1c8ca282 98 uint8_t BSP_CAMERA_Init(uint32_t Resolution);
bcostm 0:d83f1c8ca282 99 uint8_t BSP_CAMERA_DeInit(void);
bcostm 0:d83f1c8ca282 100 void BSP_CAMERA_ContinuousStart(uint8_t *buff);
bcostm 0:d83f1c8ca282 101 void BSP_CAMERA_SnapshotStart(uint8_t *buff);
bcostm 0:d83f1c8ca282 102 void BSP_CAMERA_Suspend(void);
bcostm 0:d83f1c8ca282 103 void BSP_CAMERA_Resume(void);
bcostm 0:d83f1c8ca282 104 uint8_t BSP_CAMERA_Stop(void);
bcostm 0:d83f1c8ca282 105 void BSP_CAMERA_PwrUp(void);
bcostm 0:d83f1c8ca282 106 void BSP_CAMERA_PwrDown(void);
bcostm 0:d83f1c8ca282 107 void BSP_CAMERA_LineEventCallback(void);
bcostm 0:d83f1c8ca282 108 void BSP_CAMERA_VsyncEventCallback(void);
bcostm 0:d83f1c8ca282 109 void BSP_CAMERA_FrameEventCallback(void);
bcostm 0:d83f1c8ca282 110 void BSP_CAMERA_ErrorCallback(void);
bcostm 0:d83f1c8ca282 111
bcostm 0:d83f1c8ca282 112 /* Camera features functions prototype */
bcostm 0:d83f1c8ca282 113 void BSP_CAMERA_ContrastBrightnessConfig(uint32_t contrast_level, uint32_t brightness_level);
bcostm 0:d83f1c8ca282 114 void BSP_CAMERA_BlackWhiteConfig(uint32_t Mode);
bcostm 0:d83f1c8ca282 115 void BSP_CAMERA_ColorEffectConfig(uint32_t Effect);
bcostm 0:d83f1c8ca282 116
bcostm 0:d83f1c8ca282 117 /* These functions can be modified in case the current settings (e.g. DMA stream)
bcostm 0:d83f1c8ca282 118 need to be changed for specific application needs */
bcostm 0:d83f1c8ca282 119 void BSP_CAMERA_MspInit(DCMI_HandleTypeDef *hdcmi, void *Params);
bcostm 0:d83f1c8ca282 120 void BSP_CAMERA_MspDeInit(DCMI_HandleTypeDef *hdcmi, void *Params);
bcostm 0:d83f1c8ca282 121
bcostm 0:d83f1c8ca282 122
bcostm 0:d83f1c8ca282 123 /**
bcostm 0:d83f1c8ca282 124 * @}
bcostm 0:d83f1c8ca282 125 */
bcostm 0:d83f1c8ca282 126
bcostm 0:d83f1c8ca282 127 /**
bcostm 0:d83f1c8ca282 128 * @}
bcostm 0:d83f1c8ca282 129 */
bcostm 0:d83f1c8ca282 130
bcostm 0:d83f1c8ca282 131 /**
bcostm 0:d83f1c8ca282 132 * @}
bcostm 0:d83f1c8ca282 133 */
bcostm 0:d83f1c8ca282 134
bcostm 0:d83f1c8ca282 135 /**
bcostm 0:d83f1c8ca282 136 * @}
bcostm 0:d83f1c8ca282 137 */
bcostm 0:d83f1c8ca282 138
bcostm 0:d83f1c8ca282 139 #ifdef __cplusplus
bcostm 0:d83f1c8ca282 140 }
bcostm 0:d83f1c8ca282 141 #endif
bcostm 0:d83f1c8ca282 142
bcostm 0:d83f1c8ca282 143 #endif /* __STM32L496G_DISCOVERY_CAMERA_H */
bcostm 0:d83f1c8ca282 144
bcostm 0:d83f1c8ca282 145 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/