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:
Thu Feb 23 14:14:08 2017 +0100
Revision:
1:3e58f8a39705
Parent:
0:c0f3bbab73d2
Child:
4:72a949940ad6
STM32Cube_FW_F7_V1.6.0 BSP_DISCO_F769NI

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