STM32Cube BSP FW for STM32F769I-Discovery

Dependents:   mbed-os-example-blinky-5 DISCO-F769NI_TOUCHSCREEN_demo_custom_1 Datarecorder2 DISCO-F769NI_TOUCHSCREEN_demo ... more

Committer:
Jerome Coutant
Date:
Fri Nov 15 14:50:16 2019 +0100
Revision:
8:d13d7c447539
Parent:
4:72a949940ad6
Correct warning

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Jerome Coutant 0:c0f3bbab73d2 1
Jerome Coutant 0:c0f3bbab73d2 2 /**
Jerome Coutant 0:c0f3bbab73d2 3 ******************************************************************************
Jerome Coutant 0:c0f3bbab73d2 4 * @file adv7533.h
Jerome Coutant 0:c0f3bbab73d2 5 * @author MCD Application Team
Jerome Coutant 0:c0f3bbab73d2 6 * @brief This file contains all the constants parameters for the ADV7533
Jerome Coutant 0:c0f3bbab73d2 7 * which is the HDMI bridge between DSI and HDMI
Jerome Coutant 0:c0f3bbab73d2 8 ******************************************************************************
Jerome Coutant 0:c0f3bbab73d2 9 * @attention
Jerome Coutant 0:c0f3bbab73d2 10 *
Jerome Coutant 0:c0f3bbab73d2 11 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
Jerome Coutant 0:c0f3bbab73d2 12 *
Jerome Coutant 0:c0f3bbab73d2 13 * Redistribution and use in source and binary forms, with or without modification,
Jerome Coutant 0:c0f3bbab73d2 14 * are permitted provided that the following conditions are met:
Jerome Coutant 0:c0f3bbab73d2 15 * 1. Redistributions of source code must retain the above copyright notice,
Jerome Coutant 0:c0f3bbab73d2 16 * this list of conditions and the following disclaimer.
Jerome Coutant 0:c0f3bbab73d2 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Jerome Coutant 0:c0f3bbab73d2 18 * this list of conditions and the following disclaimer in the documentation
Jerome Coutant 0:c0f3bbab73d2 19 * and/or other materials provided with the distribution.
Jerome Coutant 0:c0f3bbab73d2 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Jerome Coutant 0:c0f3bbab73d2 21 * may be used to endorse or promote products derived from this software
Jerome Coutant 0:c0f3bbab73d2 22 * without specific prior written permission.
Jerome Coutant 0:c0f3bbab73d2 23 *
Jerome Coutant 0:c0f3bbab73d2 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Jerome Coutant 0:c0f3bbab73d2 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Jerome Coutant 0:c0f3bbab73d2 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Jerome Coutant 0:c0f3bbab73d2 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Jerome Coutant 0:c0f3bbab73d2 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Jerome Coutant 0:c0f3bbab73d2 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Jerome Coutant 0:c0f3bbab73d2 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Jerome Coutant 0:c0f3bbab73d2 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Jerome Coutant 0:c0f3bbab73d2 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Jerome Coutant 0:c0f3bbab73d2 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Jerome Coutant 0:c0f3bbab73d2 34 *
Jerome Coutant 0:c0f3bbab73d2 35 ******************************************************************************
Jerome Coutant 0:c0f3bbab73d2 36 */
Jerome Coutant 0:c0f3bbab73d2 37
Jerome Coutant 0:c0f3bbab73d2 38 /* Define to prevent recursive inclusion -------------------------------------*/
Jerome Coutant 0:c0f3bbab73d2 39 #ifndef __ADV7533_H
Jerome Coutant 0:c0f3bbab73d2 40 #define __ADV7533_H
Jerome Coutant 0:c0f3bbab73d2 41
Jerome Coutant 0:c0f3bbab73d2 42 /* Includes ------------------------------------------------------------------*/
Jerome Coutant 0:c0f3bbab73d2 43 #include "../Common/audio.h"
Jerome Coutant 0:c0f3bbab73d2 44
Jerome Coutant 0:c0f3bbab73d2 45 /** @addtogroup BSP
Jerome Coutant 0:c0f3bbab73d2 46 * @{
Jerome Coutant 0:c0f3bbab73d2 47 */
Jerome Coutant 0:c0f3bbab73d2 48
Jerome Coutant 0:c0f3bbab73d2 49 /** @addtogroup Components
Jerome Coutant 0:c0f3bbab73d2 50 * @{
Jerome Coutant 0:c0f3bbab73d2 51 */
Jerome Coutant 0:c0f3bbab73d2 52
Jerome Coutant 0:c0f3bbab73d2 53 /** @addtogroup adv7533
Jerome Coutant 0:c0f3bbab73d2 54 * @{
Jerome Coutant 0:c0f3bbab73d2 55 */
Jerome Coutant 0:c0f3bbab73d2 56
Jerome Coutant 0:c0f3bbab73d2 57 /** @addtogroup ADV7533_Exported_Types
Jerome Coutant 0:c0f3bbab73d2 58 * @{
Jerome Coutant 0:c0f3bbab73d2 59 */
Jerome Coutant 0:c0f3bbab73d2 60
Jerome Coutant 0:c0f3bbab73d2 61 typedef struct {
Jerome Coutant 0:c0f3bbab73d2 62 uint8_t DSI_LANES;
Jerome Coutant 0:c0f3bbab73d2 63 uint16_t HACT;
Jerome Coutant 0:c0f3bbab73d2 64 uint16_t HSYNC;
Jerome Coutant 0:c0f3bbab73d2 65 uint16_t HBP;
Jerome Coutant 0:c0f3bbab73d2 66 uint16_t HFP;
Jerome Coutant 0:c0f3bbab73d2 67 uint16_t VACT;
Jerome Coutant 0:c0f3bbab73d2 68 uint16_t VSYNC;
Jerome Coutant 0:c0f3bbab73d2 69 uint16_t VBP;
Jerome Coutant 0:c0f3bbab73d2 70 uint16_t VFP;
Jerome Coutant 0:c0f3bbab73d2 71 uint8_t ASPECT_RATIO;
Jerome Coutant 0:c0f3bbab73d2 72 } adv7533ConfigTypeDef;
Jerome Coutant 0:c0f3bbab73d2 73
Jerome Coutant 0:c0f3bbab73d2 74 /** @defgroup ADV7533_Exported_Constants
Jerome Coutant 0:c0f3bbab73d2 75 * @{
Jerome Coutant 0:c0f3bbab73d2 76 */
Jerome Coutant 0:c0f3bbab73d2 77
Jerome Coutant 0:c0f3bbab73d2 78 /**
Jerome Coutant 0:c0f3bbab73d2 79 * @brief HDMI audio output DEVICE
Jerome Coutant 0:c0f3bbab73d2 80 */
Jerome Coutant 0:c0f3bbab73d2 81 #define OUTPUT_DEVICE_ADV7533_HDMI ((uint16_t)0x1000)
Jerome Coutant 0:c0f3bbab73d2 82
Jerome Coutant 0:c0f3bbab73d2 83 /**
Jerome Coutant 0:c0f3bbab73d2 84 * @brief ADV7533 I2C Addresses 0x7A / 0x78
Jerome Coutant 0:c0f3bbab73d2 85 */
Jerome Coutant 0:c0f3bbab73d2 86 #define ADV7533_MAIN_I2C_ADDR ((uint8_t)0x7A)
Jerome Coutant 0:c0f3bbab73d2 87 #define ADV7533_CEC_DSI_I2C_ADDR ((uint8_t)0x78)
Jerome Coutant 0:c0f3bbab73d2 88
Jerome Coutant 0:c0f3bbab73d2 89 /**
Jerome Coutant 0:c0f3bbab73d2 90 * @brief ADV7533 Aspect ratio
Jerome Coutant 0:c0f3bbab73d2 91 */
Jerome Coutant 0:c0f3bbab73d2 92 #define ADV7533_ASPECT_RATIO_16_9 ((uint8_t)0x00)
Jerome Coutant 0:c0f3bbab73d2 93 #define ADV7533_ASPECT_RATIO_4_3 ((uint8_t)0x01)
Jerome Coutant 0:c0f3bbab73d2 94
Jerome Coutant 0:c0f3bbab73d2 95 /**
Jerome Coutant 0:c0f3bbab73d2 96 * @brief ADV7533 Aspect ratio
Jerome Coutant 0:c0f3bbab73d2 97 */
Jerome Coutant 0:c0f3bbab73d2 98 #define ADV7533_MODE_HDMI 0x0
Jerome Coutant 0:c0f3bbab73d2 99 #define ADV7533_MODE_DVI 0x1
Jerome Coutant 0:c0f3bbab73d2 100
Jerome Coutant 0:c0f3bbab73d2 101 /**
Jerome Coutant 0:c0f3bbab73d2 102 * @brief ADV7533 Main Registers
Jerome Coutant 0:c0f3bbab73d2 103 */
Jerome Coutant 0:c0f3bbab73d2 104 #define ADV7533_MAIN_SYNC_REG ((uint8_t)0x17)
Jerome Coutant 0:c0f3bbab73d2 105 #define ADV7533_MAIN_POWER_DOWN_REG ((uint8_t)0x41)
Jerome Coutant 0:c0f3bbab73d2 106 #define ADV7533_MAIN_HPG_REG ((uint8_t)0x42)
Jerome Coutant 0:c0f3bbab73d2 107
Jerome Coutant 0:c0f3bbab73d2 108 /**
Jerome Coutant 0:c0f3bbab73d2 109 * @brief ADV7533 Main Features Parameters
Jerome Coutant 0:c0f3bbab73d2 110 */
Jerome Coutant 0:c0f3bbab73d2 111
Jerome Coutant 0:c0f3bbab73d2 112 /**
Jerome Coutant 0:c0f3bbab73d2 113 * @brief ADV7533 CEC DSI Registers
Jerome Coutant 0:c0f3bbab73d2 114 */
Jerome Coutant 0:c0f3bbab73d2 115 #define ADV7533_CEC_DSI_INTERNAL_TIMING_REG ((uint8_t)0x27)
Jerome Coutant 0:c0f3bbab73d2 116 #define ADV7533_CEC_DSI_TOTAL_WIDTH_H_REG ((uint8_t)0x28)
Jerome Coutant 0:c0f3bbab73d2 117 #define ADV7533_CEC_DSI_TOTAL_WIDTH_L_REG ((uint8_t)0x29)
Jerome Coutant 0:c0f3bbab73d2 118 #define ADV7533_CEC_DSI_HSYNC_H_REG ((uint8_t)0x2A)
Jerome Coutant 0:c0f3bbab73d2 119 #define ADV7533_CEC_DSI_HSYNC_L_REG ((uint8_t)0x2B)
Jerome Coutant 0:c0f3bbab73d2 120 #define ADV7533_CEC_DSI_HFP_H_REG ((uint8_t)0x2C)
Jerome Coutant 0:c0f3bbab73d2 121 #define ADV7533_CEC_DSI_HFP_L_REG ((uint8_t)0x2D)
Jerome Coutant 0:c0f3bbab73d2 122 #define ADV7533_CEC_DSI_HBP_H_REG ((uint8_t)0x2E)
Jerome Coutant 0:c0f3bbab73d2 123 #define ADV7533_CEC_DSI_HBP_L_REG ((uint8_t)0x2F)
Jerome Coutant 0:c0f3bbab73d2 124
Jerome Coutant 0:c0f3bbab73d2 125 #define ADV7533_CEC_DSI_TOTAL_HEIGHT_H_REG ((uint8_t)0x30)
Jerome Coutant 0:c0f3bbab73d2 126 #define ADV7533_CEC_DSI_TOTAL_HEIGHT_L_REG ((uint8_t)0x31)
Jerome Coutant 0:c0f3bbab73d2 127 #define ADV7533_CEC_DSI_VSYNC_H_REG ((uint8_t)0x32)
Jerome Coutant 0:c0f3bbab73d2 128 #define ADV7533_CEC_DSI_VSYNC_L_REG ((uint8_t)0x33)
Jerome Coutant 0:c0f3bbab73d2 129 #define ADV7533_CEC_DSI_VFP_H_REG ((uint8_t)0x34)
Jerome Coutant 0:c0f3bbab73d2 130 #define ADV7533_CEC_DSI_VFP_L_REG ((uint8_t)0x35)
Jerome Coutant 0:c0f3bbab73d2 131 #define ADV7533_CEC_DSI_VBP_H_REG ((uint8_t)0x36)
Jerome Coutant 0:c0f3bbab73d2 132 #define ADV7533_CEC_DSI_VBP_L_REG ((uint8_t)0x37)
Jerome Coutant 0:c0f3bbab73d2 133
Jerome Coutant 0:c0f3bbab73d2 134 /** @Brief adv7533 ID
Jerome Coutant 0:c0f3bbab73d2 135 */
Jerome Coutant 0:c0f3bbab73d2 136 #define ADV7533_ID 0x7533
Jerome Coutant 0:c0f3bbab73d2 137
Jerome Coutant 0:c0f3bbab73d2 138 /** @Brief device ID register
Jerome Coutant 0:c0f3bbab73d2 139 */
Jerome Coutant 0:c0f3bbab73d2 140 #define ADV7533_CHIPID_ADDR0 0x00
Jerome Coutant 0:c0f3bbab73d2 141 #define ADV7533_CHIPID_ADDR1 0x01
Jerome Coutant 0:c0f3bbab73d2 142
Jerome Coutant 0:c0f3bbab73d2 143 /* MUTE commands */
Jerome Coutant 0:c0f3bbab73d2 144 #define AUDIO_MUTE_ON 1
Jerome Coutant 0:c0f3bbab73d2 145 #define AUDIO_MUTE_OFF 0
Jerome Coutant 0:c0f3bbab73d2 146
Jerome Coutant 0:c0f3bbab73d2 147 /* AUDIO FREQUENCY */
Jerome Coutant 0:c0f3bbab73d2 148 #define AUDIO_FREQUENCY_192K ((uint32_t)192000)
Jerome Coutant 0:c0f3bbab73d2 149 #define AUDIO_FREQUENCY_176K ((uint32_t)176400)
Jerome Coutant 0:c0f3bbab73d2 150 #define AUDIO_FREQUENCY_96K ((uint32_t)96000)
Jerome Coutant 0:c0f3bbab73d2 151 #define AUDIO_FREQUENCY_88K ((uint32_t)88200)
Jerome Coutant 0:c0f3bbab73d2 152 #define AUDIO_FREQUENCY_48K ((uint32_t)48000)
Jerome Coutant 0:c0f3bbab73d2 153 #define AUDIO_FREQUENCY_44K ((uint32_t)44100)
Jerome Coutant 0:c0f3bbab73d2 154 #define AUDIO_FREQUENCY_32K ((uint32_t)32000)
Jerome Coutant 0:c0f3bbab73d2 155
Jerome Coutant 0:c0f3bbab73d2 156 /**
Jerome Coutant 0:c0f3bbab73d2 157 * @}
Jerome Coutant 0:c0f3bbab73d2 158 */
Jerome Coutant 0:c0f3bbab73d2 159
Jerome Coutant 0:c0f3bbab73d2 160 /* Exported macro ------------------------------------------------------------*/
Jerome Coutant 0:c0f3bbab73d2 161
Jerome Coutant 0:c0f3bbab73d2 162 /** @defgroup ADV7533_Exported_Macros ADV7533 Exported Macros
Jerome Coutant 0:c0f3bbab73d2 163 * @{
Jerome Coutant 0:c0f3bbab73d2 164 */
Jerome Coutant 0:c0f3bbab73d2 165
Jerome Coutant 0:c0f3bbab73d2 166 /**
Jerome Coutant 0:c0f3bbab73d2 167 * @}
Jerome Coutant 0:c0f3bbab73d2 168 */
Jerome Coutant 0:c0f3bbab73d2 169
Jerome Coutant 0:c0f3bbab73d2 170 /* Exported functions --------------------------------------------------------*/
Jerome Coutant 0:c0f3bbab73d2 171
Jerome Coutant 0:c0f3bbab73d2 172 /** @addtogroup ADV7533_Exported_Functions
Jerome Coutant 0:c0f3bbab73d2 173 * @{
Jerome Coutant 0:c0f3bbab73d2 174 */
Jerome Coutant 0:c0f3bbab73d2 175
Jerome Coutant 0:c0f3bbab73d2 176 /*------------------------------------------------------------------------------
Jerome Coutant 0:c0f3bbab73d2 177 HDMI video functions
Jerome Coutant 0:c0f3bbab73d2 178 ------------------------------------------------------------------------------*/
Jerome Coutant 0:c0f3bbab73d2 179 uint8_t ADV7533_Init(void);
Jerome Coutant 0:c0f3bbab73d2 180 void ADV7533_PowerOn(void);
Jerome Coutant 0:c0f3bbab73d2 181 void ADV7533_PowerDown(void);
Jerome Coutant 0:c0f3bbab73d2 182 void ADV7533_Configure(adv7533ConfigTypeDef * config);
Jerome Coutant 0:c0f3bbab73d2 183 void ADV7533_PatternEnable(void);
Jerome Coutant 0:c0f3bbab73d2 184 void ADV7533_PatternDisable(void);
Jerome Coutant 0:c0f3bbab73d2 185
Jerome Coutant 0:c0f3bbab73d2 186 /*------------------------------------------------------------------------------
Jerome Coutant 0:c0f3bbab73d2 187 HDMI Audio functions
Jerome Coutant 0:c0f3bbab73d2 188 ------------------------------------------------------------------------------*/
Jerome Coutant 0:c0f3bbab73d2 189 uint32_t adv7533_AudioInit(uint16_t DeviceAddr, uint16_t OutputDevice, uint8_t Volume,uint32_t AudioFreq);
Jerome Coutant 0:c0f3bbab73d2 190 void adv7533_DeInit(void);
Jerome Coutant 0:c0f3bbab73d2 191 uint32_t adv7533_ReadID(uint16_t DeviceAddr);
Jerome Coutant 0:c0f3bbab73d2 192 uint32_t adv7533_Play(uint16_t DeviceAddr, uint16_t* pBuffer, uint16_t Size);
Jerome Coutant 0:c0f3bbab73d2 193 uint32_t adv7533_Stop(uint16_t DeviceAddr,uint32_t Cmd);
Jerome Coutant 0:c0f3bbab73d2 194 uint32_t adv7533_Pause(uint16_t DeviceAddr);
Jerome Coutant 0:c0f3bbab73d2 195 uint32_t adv7533_Resume(uint16_t DeviceAddr);
Jerome Coutant 0:c0f3bbab73d2 196 uint32_t adv7533_SetMute(uint16_t DeviceAddr, uint32_t Cmd);
Jerome Coutant 0:c0f3bbab73d2 197 uint32_t adv7533_SetVolume(uint16_t, uint8_t);
Jerome Coutant 0:c0f3bbab73d2 198 uint32_t adv7533_Reset(uint16_t DeviceAddr);
Jerome Coutant 0:c0f3bbab73d2 199 uint32_t adv7533_SetOutputMode(uint16_t DeviceAddr, uint8_t Output);
Jerome Coutant 0:c0f3bbab73d2 200 uint32_t adv7533_SetFrequency(uint16_t DeviceAddr, uint32_t AudioFreq);
Jerome Coutant 0:c0f3bbab73d2 201
Jerome Coutant 0:c0f3bbab73d2 202
Jerome Coutant 0:c0f3bbab73d2 203 /* HDMI IO functions */
Jerome Coutant 0:c0f3bbab73d2 204 void HDMI_IO_Init(void);
Jerome Coutant 0:c0f3bbab73d2 205 void HDMI_IO_Write(uint8_t addr, uint8_t reg, uint8_t value);
Jerome Coutant 0:c0f3bbab73d2 206 uint8_t HDMI_IO_Read(uint8_t addr, uint8_t reg);
Jerome Coutant 0:c0f3bbab73d2 207 void HDMI_IO_Delay(uint32_t delay);
Jerome Coutant 0:c0f3bbab73d2 208 void AUDIO_IO_DeInit(void);
Jerome Coutant 0:c0f3bbab73d2 209
Jerome Coutant 0:c0f3bbab73d2 210 /**
Jerome Coutant 0:c0f3bbab73d2 211 * @}
Jerome Coutant 0:c0f3bbab73d2 212 */
Jerome Coutant 0:c0f3bbab73d2 213
Jerome Coutant 0:c0f3bbab73d2 214 /* HDMI Audio driver structure */
Jerome Coutant 0:c0f3bbab73d2 215 extern AUDIO_DrvTypeDef adv7533_drv;
Jerome Coutant 0:c0f3bbab73d2 216
Jerome Coutant 0:c0f3bbab73d2 217 #endif /* __ADV7533_H */
Jerome Coutant 0:c0f3bbab73d2 218 /**
Jerome Coutant 0:c0f3bbab73d2 219 * @}
Jerome Coutant 0:c0f3bbab73d2 220 */
Jerome Coutant 0:c0f3bbab73d2 221
Jerome Coutant 0:c0f3bbab73d2 222 /**
Jerome Coutant 0:c0f3bbab73d2 223 * @}
Jerome Coutant 0:c0f3bbab73d2 224 */
Jerome Coutant 0:c0f3bbab73d2 225
Jerome Coutant 0:c0f3bbab73d2 226 /**
Jerome Coutant 0:c0f3bbab73d2 227 * @}
Jerome Coutant 0:c0f3bbab73d2 228 */
Jerome Coutant 0:c0f3bbab73d2 229
Jerome Coutant 0:c0f3bbab73d2 230 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/