adv7533.h
Go to the documentation of this file.
1 
22 /* Define to prevent recursive inclusion -------------------------------------*/
23 #ifndef ADV7533_H
24 #define ADV7533_H
25 
26 /* Includes ------------------------------------------------------------------*/
27 #include "adv7533_reg.h"
28 #include <stddef.h>
29 
45 typedef int32_t (*ADV7533_Init_Func) (void);
46 typedef int32_t (*ADV7533_DeInit_Func) (void);
47 typedef int32_t (*ADV7533_GetTick_Func) (void);
48 typedef int32_t (*ADV7533_Delay_Func) (uint32_t);
49 typedef int32_t (*ADV7533_WriteReg_Func)(uint16_t, uint16_t, uint8_t*, uint16_t);
50 typedef int32_t (*ADV7533_ReadReg_Func) (uint16_t, uint16_t, uint8_t*, uint16_t);
51 
52 typedef struct
53 {
54  uint32_t Frequency;
56 
57 typedef struct
58 {
61  uint16_t Address;
65 } ADV7533_IO_t;
66 
67 typedef struct
68 {
71  uint8_t IsInitialized;
73 
74  typedef struct
75 {
76  int32_t ( *Init ) ( ADV7533_Object_t *, ADV7533_Init_t* );
77  int32_t ( *DeInit ) ( ADV7533_Object_t * );
78  int32_t ( *ReadID ) ( ADV7533_Object_t *, uint32_t *);
79  int32_t ( *Play ) ( ADV7533_Object_t * );
80  int32_t ( *Pause ) ( ADV7533_Object_t * );
81  int32_t ( *Resume ) ( ADV7533_Object_t * );
82  int32_t ( *Stop ) ( ADV7533_Object_t *, uint32_t );
83  int32_t ( *SetFrequency ) ( ADV7533_Object_t *, uint32_t );
84  int32_t ( *GetFrequency ) ( ADV7533_Object_t *, uint32_t* );
85  int32_t ( *SetVolume ) ( ADV7533_Object_t *, uint8_t, uint8_t );
86  int32_t ( *GetVolume ) ( ADV7533_Object_t *, uint8_t );
87  int32_t ( *SetMute ) ( ADV7533_Object_t *, uint16_t );
88  int32_t ( *SetOutputMode ) ( ADV7533_Object_t *, uint16_t );
89  int32_t ( *SetResolution ) ( ADV7533_Object_t *, uint32_t );
90  int32_t ( *GetResolution ) ( ADV7533_Object_t *, uint32_t *);
91  int32_t ( *SetProtocol ) ( ADV7533_Object_t *, uint16_t );
92  int32_t ( *GetProtocol ) ( ADV7533_Object_t *);
93  int32_t ( *Reset ) ( ADV7533_Object_t * );
95 
96  typedef struct
97 {
98  /* Control functions */
99  int32_t (*Init )(ADV7533_Object_t*, uint32_t, uint32_t);
100  int32_t (*DeInit )(ADV7533_Object_t*);
101  int32_t (*ReadID )(ADV7533_Object_t*, uint32_t*);
102  int32_t (*DisplayOn )(ADV7533_Object_t*);
103  int32_t (*DisplayOff )(ADV7533_Object_t*);
104  int32_t (*SetBrightness )(ADV7533_Object_t*, uint32_t);
105  int32_t (*GetBrightness )(ADV7533_Object_t*, uint32_t*);
106  int32_t (*SetOrientation )(ADV7533_Object_t*, uint32_t);
107  int32_t (*GetOrientation )(ADV7533_Object_t*, uint32_t*);
108 
109  /* Drawing functions*/
110  int32_t ( *SetCursor ) (ADV7533_Object_t*, uint32_t, uint32_t);
111  int32_t ( *DrawBitmap ) (ADV7533_Object_t*, uint32_t, uint32_t, uint8_t *);
112  int32_t (*FillRGBRect ) (ADV7533_Object_t*, uint32_t, uint32_t, uint8_t *, uint32_t, uint32_t);
113  int32_t ( *DrawHLine ) (ADV7533_Object_t*, uint32_t, uint32_t, uint32_t, uint32_t);
114  int32_t ( *DrawVLine ) (ADV7533_Object_t*, uint32_t, uint32_t, uint32_t, uint32_t);
115  int32_t ( *FillRect ) (ADV7533_Object_t*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t);
116  int32_t ( *GetPixel ) (ADV7533_Object_t*, uint32_t, uint32_t, uint32_t*);
117  int32_t ( *SetPixel ) (ADV7533_Object_t*, uint32_t, uint32_t, uint32_t);
118  int32_t ( *GetXSize ) (ADV7533_Object_t*, uint32_t *);
119  int32_t ( *GetYSize ) (ADV7533_Object_t*, uint32_t *);
121 
129 #define ADV7533_OK (0)
130 #define ADV7533_ERROR (-1)
131 
135 #define ADV7533_FREQUENCY_192K 192000
136 #define ADV7533_FREQUENCY_176K 176400
137 #define ADV7533_FREQUENCY_96K 96000
138 #define ADV7533_FREQUENCY_88K 88200
139 #define ADV7533_FREQUENCY_48K 48000
140 #define ADV7533_FREQUENCY_44K 44100
141 #define ADV7533_FREQUENCY_32K 32000
142 #define ADV7533_FREQUENCY_22K 22050
143 #define ADV7533_FREQUENCY_16K 16000
144 #define ADV7533_FREQUENCY_11K 11025
145 #define ADV7533_FREQUENCY_8K 8000
146 
150 #define OUTPUT_DEVICE_ADV7533_HDMI 0x1000U
151 
155 #define ADV7533_MAIN_I2C_ADDR 0x7AU
156 #define ADV7533_CEC_DSI_I2C_ADDR 0x78U
157 
161 #define ADV7533_ASPECT_RATIO_16_9 00U
162 #define ADV7533_ASPECT_RATIO_4_3 01U
163 
167 #define ADV7533_MODE_HDMI 00U
168 #define ADV7533_MODE_DVI 01U
169 
176 #define ADV7533_ID 0x7533U
177 
178 /* MUTE commands */
179 #define ADV7533_MUTE_ON 1U
180 #define ADV7533_MUTE_OFF 0U
181 
182 
187 /* Exported macro ------------------------------------------------------------*/
188 
197 /* Exported functions --------------------------------------------------------*/
198 
203 /*------------------------------------------------------------------------------
204  HDMI video functions
205 ------------------------------------------------------------------------------*/
206 int32_t ADV7533_Init(ADV7533_Object_t *pObj, uint32_t ColorCoding, uint32_t Orientation);
207 int32_t ADV7533_DisplayOn(ADV7533_Object_t *pObj);
208 int32_t ADV7533_DisplayOff(ADV7533_Object_t *pObj);
209 int32_t ADV7533_Configure(ADV7533_Object_t *pObj, uint8_t LaneNumber);
212 
213 int32_t ADV7533_SetBrightness(ADV7533_Object_t *pObj, uint32_t Brightness);
214 int32_t ADV7533_GetBrightness(ADV7533_Object_t *pObj, uint32_t *Brightness);
215 int32_t ADV7533_SetOrientation(ADV7533_Object_t *pObj, uint32_t Orientation);
216 int32_t ADV7533_GetOrientation(ADV7533_Object_t *pObj, uint32_t *Orientation);
217 
218 
219 int32_t ADV7533_SetCursor(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos);
220 int32_t ADV7533_DrawBitmap(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint8_t *pBmp);
221 int32_t ADV7533_FillRGBRect(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint8_t *pData, uint32_t Width, uint32_t Height);
222 int32_t ADV7533_DrawHLine(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color);
223 int32_t ADV7533_DrawVLine(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color);
224 int32_t ADV7533_FillRect(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Width, uint32_t Height, uint32_t Color);
225 int32_t ADV7533_SetPixel(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Color);
226 int32_t ADV7533_GetPixel(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t *Color);
227 int32_t ADV7533_GetXSize(ADV7533_Object_t *pObj, uint32_t *XSize);
228 int32_t ADV7533_GetYSize(ADV7533_Object_t *pObj, uint32_t *YSize);
229 /*------------------------------------------------------------------------------
230  HDMI Audio functions
231 ------------------------------------------------------------------------------*/
232 int32_t ADV7533_AudioInit(ADV7533_Object_t *pObj, ADV7533_Init_t *pInit);
233 int32_t ADV7533_DeInit(ADV7533_Object_t *pObj);
234 int32_t ADV7533_ReadID(ADV7533_Object_t *pObj, uint32_t *Id);
235 int32_t ADV7533_Play(ADV7533_Object_t *pObj);
236 int32_t ADV7533_Pause(ADV7533_Object_t *pObj);
237 int32_t ADV7533_Resume(ADV7533_Object_t *pObj);
238 int32_t ADV7533_Stop(ADV7533_Object_t *pObj, uint32_t CodecPdwnMode);
239 int32_t ADV7533_SetVolume(ADV7533_Object_t *pObj, uint8_t Volume, uint8_t InputOutput);
240 int32_t ADV7533_GetVolume(ADV7533_Object_t *pObj, uint8_t InputOutput);
241 int32_t ADV7533_SetMute(ADV7533_Object_t *pObj, uint16_t Cmd);
242 int32_t ADV7533_SetOutputMode(ADV7533_Object_t *pObj, uint16_t Output);
243 int32_t ADV7533_SetResolution(ADV7533_Object_t *pObj, uint32_t Resolution);
244 int32_t ADV7533_GetResolution(ADV7533_Object_t *pObj, uint32_t *Resolution);
245 int32_t ADV7533_SetProtocol(ADV7533_Object_t *pObj, uint16_t Protocol);
247 int32_t ADV7533_SetFrequency(ADV7533_Object_t *pObj, uint32_t AudioFreq);
248 int32_t ADV7533_GetFrequency(ADV7533_Object_t *pObj, uint32_t *Frequency);
249 int32_t ADV7533_Reset(ADV7533_Object_t *pObj);
250 
255 /* Audio driver structure */
257 /* LCD driver structure */
259 #endif /* ADV7533_H */
260 
272 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
ADV7533_Init_t::Frequency
uint32_t Frequency
Definition: adv7533.h:54
ADV7533_Pause
int32_t ADV7533_Pause(ADV7533_Object_t *pObj)
Pauses playing on the audio hdmi.
Definition: adv7533.c:770
ADV7533_SetResolution
int32_t ADV7533_SetResolution(ADV7533_Object_t *pObj, uint32_t Resolution)
Set Audio resolution.
Definition: adv7533.c:902
ADV7533_SetPixel
int32_t ADV7533_SetPixel(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Color)
Set pixel color.
Definition: adv7533.c:690
ADV7533_Driver
ADV7533_Drv_t ADV7533_Driver
Definition: adv7533.c:55
Init
napi_value Init(napi_env env, napi_value exports)
Definition: porcupine/demo/c/pvrecorder/node/pv_recorder_napi.c:197
ADV7533_Init
int32_t ADV7533_Init(ADV7533_Object_t *pObj, uint32_t ColorCoding, uint32_t Orientation)
Initializes the audio codec and the control interface.
Definition: adv7533.c:167
ADV7533_IO_t::GetTick
ADV7533_GetTick_Func GetTick
Definition: adv7533.h:64
ADV7533_IO_t::DeInit
ADV7533_DeInit_Func DeInit
Definition: adv7533.h:60
adv7533_reg.h
This file contains all the constants parameters for the ADV7533 which is the HDMI bridge between DSI ...
ADV7533_SetBrightness
int32_t ADV7533_SetBrightness(ADV7533_Object_t *pObj, uint32_t Brightness)
Set the display brightness.
Definition: adv7533.c:496
ADV7533_SetVolume
int32_t ADV7533_SetVolume(ADV7533_Object_t *pObj, uint8_t Volume, uint8_t InputOutput)
Sets volumee.
Definition: adv7533.c:869
ADV7533_ReadID
int32_t ADV7533_ReadID(ADV7533_Object_t *pObj, uint32_t *Id)
Get the adv7533 ID.
Definition: adv7533.c:221
ADV7533_IO_t::ReadReg
ADV7533_ReadReg_Func ReadReg
Definition: adv7533.h:63
ADV7533_DrawBitmap
int32_t ADV7533_DrawBitmap(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint8_t *pBmp)
Draw Bitmap image.
Definition: adv7533.c:599
ADV7533_Delay_Func
int32_t(* ADV7533_Delay_Func)(uint32_t)
Definition: adv7533.h:48
ADV7533_SetCursor
int32_t ADV7533_SetCursor(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos)
Set the display cursor.
Definition: adv7533.c:583
ADV7533_RegisterBusIO
int32_t ADV7533_RegisterBusIO(ADV7533_Object_t *pObj, ADV7533_IO_t *pIO)
Function.
Definition: adv7533.c:123
ADV7533_Stop
int32_t ADV7533_Stop(ADV7533_Object_t *pObj, uint32_t CodecPdwnMode)
Stop playing on the audio hdmi.
Definition: adv7533.c:801
ADV7533_DrawHLine
int32_t ADV7533_DrawHLine(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color)
Draw Horizontal Line.
Definition: adv7533.c:623
ADV7533_ReadReg_Func
int32_t(* ADV7533_ReadReg_Func)(uint16_t, uint16_t, uint8_t *, uint16_t)
Definition: adv7533.h:50
ADV7533_DeInit
int32_t ADV7533_DeInit(ADV7533_Object_t *pObj)
Deinitializes the adv7533.
Definition: adv7533.c:202
ADV7533_Object_t::Ctx
adv7533_ctx_t Ctx
Definition: adv7533.h:70
ADV7533_IO_t::WriteReg
ADV7533_WriteReg_Func WriteReg
Definition: adv7533.h:62
ADV7533_SetFrequency
int32_t ADV7533_SetFrequency(ADV7533_Object_t *pObj, uint32_t AudioFreq)
Sets new frequency.
Definition: adv7533.c:963
ADV7533_Init_t
Definition: adv7533.h:52
ADV7533_Drv_t
Definition: adv7533.h:74
ADV7533_GetFrequency
int32_t ADV7533_GetFrequency(ADV7533_Object_t *pObj, uint32_t *Frequency)
Sets new frequency.
Definition: adv7533.c:1029
ADV7533_AudioInit
int32_t ADV7533_AudioInit(ADV7533_Object_t *pObj, ADV7533_Init_t *pInit)
Initializes the audio codec and the control interface.
Definition: adv7533.c:707
ADV7533_IO_t::Address
uint16_t Address
Definition: adv7533.h:61
ADV7533_GetVolume
int32_t ADV7533_GetVolume(ADV7533_Object_t *pObj, uint8_t Volume)
Sets volumee.
Definition: adv7533.c:886
ADV7533_Reset
int32_t ADV7533_Reset(ADV7533_Object_t *pObj)
Resets adv7533 registers.
Definition: adv7533.c:1089
ADV7533_GetXSize
int32_t ADV7533_GetXSize(ADV7533_Object_t *pObj, uint32_t *Xsize)
Set the display Width.
Definition: adv7533.c:553
ADV7533_DisplayOff
int32_t ADV7533_DisplayOff(ADV7533_Object_t *pObj)
Power off the ADV7533 bridge.
Definition: adv7533.c:278
ADV7533_GetProtocol
int32_t ADV7533_GetProtocol(ADV7533_Object_t *pObj)
Get Audio Protocol.
Definition: adv7533.c:948
adv7533_ctx_t
Definition: adv7533_reg.h:106
ADV7533_SetOrientation
int32_t ADV7533_SetOrientation(ADV7533_Object_t *pObj, uint32_t Orientation)
Set the display Orientation.
Definition: adv7533.c:525
ADV7533_Init_Func
int32_t(* ADV7533_Init_Func)(void)
Definition: adv7533.h:45
ADV7533_GetTick_Func
int32_t(* ADV7533_GetTick_Func)(void)
Definition: adv7533.h:47
ADV7533_SetProtocol
int32_t ADV7533_SetProtocol(ADV7533_Object_t *pObj, uint16_t Protocol)
Set Audio Protocol.
Definition: adv7533.c:933
ADV7533_SetOutputMode
int32_t ADV7533_SetOutputMode(ADV7533_Object_t *pObj, uint16_t Output)
Sets output mode.
Definition: adv7533.c:853
ADV7533_Resume
int32_t ADV7533_Resume(ADV7533_Object_t *pObj)
Resumes playing on the audio hdmi.
Definition: adv7533.c:780
ADV7533_WriteReg_Func
int32_t(* ADV7533_WriteReg_Func)(uint16_t, uint16_t, uint8_t *, uint16_t)
Definition: adv7533.h:49
ADV7533_IO_t::Init
ADV7533_Init_Func Init
Definition: adv7533.h:59
ADV7533_FillRect
int32_t ADV7533_FillRect(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Width, uint32_t Height, uint32_t Color)
Fill rectangle.
Definition: adv7533.c:658
ADV7533_GetPixel
int32_t ADV7533_GetPixel(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t *Color)
Get pixel color.
Definition: adv7533.c:674
ADV7533_Configure
int32_t ADV7533_Configure(ADV7533_Object_t *pObj, uint8_t LaneNumber)
Configure the DSI-HDMI ADV7533 bridge for video.
Definition: adv7533.c:307
ADV7533_SetMute
int32_t ADV7533_SetMute(ADV7533_Object_t *pObj, uint16_t Cmd)
Enables or disables the mute feature on the audio hdmi.
Definition: adv7533.c:816
ADV7533_GetOrientation
int32_t ADV7533_GetOrientation(ADV7533_Object_t *pObj, uint32_t *Orientation)
Set the display Orientation.
Definition: adv7533.c:539
ADV7533_Object_t
Definition: adv7533.h:67
ADV7533_Play
int32_t ADV7533_Play(ADV7533_Object_t *pObj)
Start the audio hdmi play feature.
Definition: adv7533.c:791
ADV7533_DisplayOn
int32_t ADV7533_DisplayOn(ADV7533_Object_t *pObj)
Power on the ADV7533 bridge.
Definition: adv7533.c:250
ADV7533_IO_t
Definition: adv7533.h:57
ADV7533_GetBrightness
int32_t ADV7533_GetBrightness(ADV7533_Object_t *pObj, uint32_t *Brightness)
Get the display brightness.
Definition: adv7533.c:510
ADV7533_LCD_Driver
ADV7533_LcdDrv_t ADV7533_LCD_Driver
Definition: adv7533.c:77
ADV7533_GetYSize
int32_t ADV7533_GetYSize(ADV7533_Object_t *pObj, uint32_t *Ysize)
Set the display Height.
Definition: adv7533.c:568
ADV7533_GetResolution
int32_t ADV7533_GetResolution(ADV7533_Object_t *pObj, uint32_t *Resolution)
Get Audio resolution.
Definition: adv7533.c:917
ADV7533_LcdDrv_t
Definition: adv7533.h:96
ADV7533_PatternEnable
int32_t ADV7533_PatternEnable(ADV7533_Object_t *pObj)
Enable video pattern generation.
Definition: adv7533.c:431
ADV7533_Object_t::IO
ADV7533_IO_t IO
Definition: adv7533.h:69
ADV7533_PatternDisable
int32_t ADV7533_PatternDisable(ADV7533_Object_t *pObj)
Disable video pattern generation.
Definition: adv7533.c:473
ADV7533_FillRGBRect
int32_t ADV7533_FillRGBRect(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint8_t *pData, uint32_t Width, uint32_t Height)
Definition: adv7533.c:607
ADV7533_Object_t::IsInitialized
uint8_t IsInitialized
Definition: adv7533.h:71
ADV7533_DrawVLine
int32_t ADV7533_DrawVLine(ADV7533_Object_t *pObj, uint32_t Xpos, uint32_t Ypos, uint32_t Length, uint32_t Color)
Draw Vertical line.
Definition: adv7533.c:640
ADV7533_DeInit_Func
int32_t(* ADV7533_DeInit_Func)(void)
Definition: adv7533.h:46


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:13:47