no-OS
wrapper.h
Go to the documentation of this file.
1 /**********************************************************************************************
2 * *
3 * Copyright (c) 2012 Analog Devices, Inc. All Rights Reserved. *
4 * This software is proprietary and confidential to Analog Devices, Inc. and its licensors. *
5 * *
6 ***********************************************************************************************/
7 #ifndef _WRAPPER_H_
8 #define _WRAPPER_H_
9 
10 #include <stdlib.h>
11 #include <stdint.h>
12 #include <stdbool.h>
13 #include <stdio.h>
14 #include <string.h>
15 #include "xil_printf.h"
16 
17 /* The values of these definitions are currently set as per ADI evaluation platforms and the ADI example application*/
18 /* If the ADI example application is ported and customised it is important to review and set these options accordingly*/
19 /* Please refer to release build options file and DVP documentation for futher information*/
20 
21 #define RX_DEVICE 0 /*Set the Target Rx device. Tv Driver supports the following devices: 7844, 7842, 7604, 7840, 7612, 7611, 7614, 7622/3, 7619 */
22 
23 #define TX_DEVICE 7511 /*Set the Target Tx Device. Tv Driver supports the following Tx devices: 7623/2, 7511, 7510, 7520 */
24 #define TX_USER_CONFIG 1 /*Always set to 1 when using ADI REP Middleware and ADI REP Application. */
25 #define TX_USER_INIT 0 /*Always set to 0. Set to 1 for customer initialisation custimization only. */
26 #define TX_CALLBACK_FUNCTION TRANSMITTER_Notification
27 
28 #define UART_DEBUG 1 /*Set to 1 to enable Debug message Printouts. Set to 0 to disable. */
29 #define IGNORE_INT_LINES 1 /*Set to 1 to ignore hw interrupt pin status to determine if interrupt is pending. Software method used only*/
30 #define ADVANTIV 1
31 /*=======================================
32  * Data types
33  *======================================*/
34 
35 #define STATIC static
36 #define INLINE inline
37 #define CONSTANT const
38 #define EXTERNAL extern
39 #define PACKED __attribute__((packed))
40 #define PACKED_STR struct PACKED
41 
42 typedef unsigned char UCHAR; /* unsigned 8-bit */
43 typedef unsigned short UINT16; /* unsigned 16-bit */
44 typedef unsigned long UINT32; /* unsigned 32-bit */
45 typedef short int INT16;
46 typedef long int INT32;
47 typedef char CHAR;
48 
49 #define UINT8 UCHAR
50 
51 #ifndef BOOL
52 #define BOOL UCHAR
53 #endif
54 
55 #ifndef TRUE
56 #define TRUE 1
57 #endif
58 
59 #ifndef FALSE
60 #define FALSE 0
61 #endif
62 
63 #ifndef NULL
64 #define NULL ((void *)0)
65 #endif
66 
67 #define ADV7511_MAIN_I2C_ADDR 0x39
68 
69 #define ADV7511_MAIN_CEC_TX_STATUS 0x97
70 #define ADV7511_MAIN_CEC_TX_STATUS_RDY(x) (((x) << 5) & 0x20)
71 #define ADV7511_MAIN_CEC_TX_STATUS_ALI(x) (((x) << 4) & 0x10)
72 #define ADV7511_MAIN_CEC_TX_STATUS_RTI(x) (((x) << 3) & 0x08)
73 
74 #define ADV7511_MAIN_CEC_PWRDWN 0xe2
75 #define ADV7511_MAIN_CEC_PWRDWN_SET(x) (((x) << 1) & 0x01)
76 
77 #define ADV7511_CEC_I2C_ADDR 0x3c
78 
79 #define ADV7511_CEC_TX_FRAME_HEADER 0x00
80 
81 #define ADV7511_CEC_TX_FRAME_LENGTH 0x10
82 #define ADV7511_CEC_TX_FRAME_LENGTH_MASK 0x1f
83 #define ADV7511_CEC_TX_FRAME_LENGTH_SHIFT 0x00
84 
85 #define ADV7511_CEC_TX_TRANS_ENABLE 0x11
86 #define ADV7511_CEC_TX_TRANS_ENABLE_MASK 0x01
87 #define ADV7511_CEC_TX_TRANS_ENABLE_SHIFT 0x00
88 
89 #define ADV7511_CEC_TX_TRANSMISSION_EN 0x11
90 #define ADV7511_CEC_TX_TRANSMISSION_EN_SET(x) (((x) << 0) & 0x1)
91 
92 #define ADV7511_CEC_TX_RETRY_COUNT 0x12
93 #define ADV7511_CEC_TX_RETRY_COUNT_MASK 0x70
94 #define ADV7511_CEC_TX_RETRY_COUNT_SHIFT 0x04
95 #define ADV7511_CEC_TX_RETRY_COUNT_SET(x) (((x) << 4) & 0x70)
96 
97 #define ADV7511_CEC_TX_NACK_CNT 0x14
98 #define ADV7511_CEC_TX_NACK_CNT_MASK 0x0f
99 #define ADV7511_CEC_TX_NACK_CNT_SHIFT 0x00
100 
101 #define ADV7511_CEC_RX_BUFF1_HDR 0x15
102 
103 #define ADV7511_CEC_RX_ENABLE 0x26
104 #define ADV7511_CEC_RX_ENABLE_MASK 0x40
105 #define ADV7511_CEC_RX_ENABLE_SHIFT 0x06
106 
107 #define ADV7511_CEC_RX_BUFF2_HDR 0x27
108 #define ADV7511_CEC_RX_BUFF3_HDR 0x38
109 
110 #define ADV7511_CEC_RX_BUFFER_NUMBER 0x4a
111 #define ADV7511_CEC_RX_BUFFER_NUMBER_MASK 0x08
112 #define ADV7511_CEC_RX_BUFFER_NUMBER_SHIFT 0x03
113 
114 #define ADV7511_CEC_RX_BUFFER1_RDY 0x4a
115 #define ADV7511_CEC_RX_BUFFER1_RDY_MASK 0x01
116 #define ADV7511_CEC_RX_BUFFER1_RDY_SHIFT 0x00
117 #define ADV7511_CEC_RX_BUFFER2_RDY 0x4a
118 #define ADV7511_CEC_RX_BUFFER2_RDY_MASK 0x02
119 #define ADV7511_CEC_RX_BUFFER2_RDY_SHIFT 0x01
120 #define ADV7511_CEC_RX_BUFFER3_RDY 0x4a
121 #define ADV7511_CEC_RX_BUFFER3_RDY_MASK 0x04
122 #define ADV7511_CEC_RX_BUFFER3_RDY_SHIFT 0x02
123 
124 #define ADV7511_CEC_LOGICADDR_DEV01_REG 0x4c
125 #define ADV7511_CEC_LOGICADDR_DEV2_REG 0x4d
126 
127 #define ADV7511_CEC_LOGICADDR_MASK 0x4b
128 #define ADV7511_CEC_LOGICADDR_MASK_MASK 0x70
129 #define ADV7511_CEC_LOGICADDR_MASK_SHIFT 0x04
130 #define ADV7511_CEC_LOGICADDR_MASK_ADDR0 0x01
131 #define ADV7511_CEC_LOGICADDR_MASK_ADDR1 0x02
132 #define ADV7511_CEC_LOGICADDR_MASK_ADDR2 0x04
133 
134 #define ADV7511_CEC_LOGICADDR0 0x4c
135 #define ADV7511_CEC_LOGICADDR0_MASK 0x0f
136 #define ADV7511_CEC_LOGICADDR0_SHIFT 0x00
137 #define ADV7511_CEC_LOGICADDR1 0x4c
138 #define ADV7511_CEC_LOGICADDR1_MASK 0xf0
139 #define ADV7511_CEC_LOGICADDR1_SHIFT 0x04
140 #define ADV7511_CEC_LOGICADDR2 0x4d
141 #define ADV7511_CEC_LOGICADDR2_MASK 0x0f
142 #define ADV7511_CEC_LOGICADDR2_SHIFT 0x00
143 
144 #define ADV7511_CEC_POWER_MODE 0x4e
145 #define ADV7511_CEC_POWER_MODE_MASK 0x03
146 #define ADV7511_CEC_POWER_MODE_SHIFT 0x00
147 #define ADV7511_CEC_POWER_MODE_SET(x) (((x) << 0) & 0x01)
148 
149 #define ADV7511_CEC_SOFT_RESET 0x50
150 #define ADV7511_CEC_SOFT_RESET_MASK 0x01
151 #define ADV7511_CEC_SOFT_RESET_SHIFT 0x00
152 #define ADV7511_CEC_SOFT_RESET_SET(x) (((x) << 0) & 0x01)
153 
154 typedef unsigned short u16;
155 typedef unsigned long u32;
156 typedef unsigned char u8;
157 
158 /*===========================================================
159  * Defines and Macros
160  *==========================================================*/
161 #define MAX_VIC_VALUE 64
162 #define NUM_OF_VICS (MAX_VIC_VALUE+1)
163 #define CEC_RETRY_COUNT 3
164 #define CEC_MAX_MSG_SIZE 16
165 #define CEC_TX_BUF_LEN 30
166 
168 
169 #define PKT_AV_INFO_FRAME 0x0001
170 #define PKT_AUDIO_INFO_FRAME 0x0002
171 #define PKT_ACP_PACKET 0x0004
172 #define PKT_SPD_PACKET 0x0008
173 #define PKT_ISRC1_PACKET 0x0010
174 #define PKT_ISRC2_PACKET 0x0020
175 #define PKT_GMD_PACKET 0x0040
176 #define PKT_GC_PACKET 0x0080
177 #define PKT_MPEG_PACKET 0x0100
178 #define PKT_VS_PACKET 0x0200
179 #define PKT_AUDIO_SAMPLE_PACKET 0x0800
180 #define PKT_ACR_PACKET 0x1000
181 #define PKT_ALL_PACKETS 0xffff
182 
183 #define CEC_TRIPLE_NUMBER 3
184 
185 #if UART_DEBUG
186 #define DBG_MSG xil_printf
187 #else
188 #define DBG_MSG(...)
189 #endif
190 
191 //#define memcpy adi_memcpy
192 //#define memset adi_memset
193 
194 
195 //void adi_memcpy(void *dst,void* src, UINT32 count);
196 //void adi_memset(void *dst,UINT8 data, UINT32 count);
197 
198 
199 #if (RX_DEVICE == 7623) || (RX_DEVICE == 7622) || (RX_DEVICE == 76221)
200 #define RX_I2C_IO_MAP_ADDR 0xB2
201 #define RX2_I2C_IO_MAP_ADDR 0xB0
202 #elif (RX_DEVICE == 7612) || (RX_DEVICE == 7611) || (RX_DEVICE == 7619)
203 #define RX_I2C_IO_MAP_ADDR 0x98
204 #define RX2_I2C_IO_MAP_ADDR 0x98
205 #elif (RX_DEVICE == 7630)
206 #define RX_I2C_IO_MAP_ADDR 0xB0
207 #else
208 #define RX_I2C_IO_MAP_ADDR 0x40
209 #define RX2_I2C_IO_MAP_ADDR 0xB4
210 #endif
211 
212 #define RX_I2C_SDP_VDP_MAP_ADDR 0x22
213 #define RX_I2C_AFE_DPLL_MAP_ADDR 0x30
214 #define RX_I2C_ESDP_MAP_ADDR 0x34 /* Def 0x70 */
215 #define RX_I2C_SDP_IO_MAP_ADDR 0x42
216 #define RX_I2C_CP_MAP_ADDR 0x44
217 #define RX_I2C_VDP_MAP_ADDR 0x48
218 #define RX_I2C_TEST_MAP3_ADDR 0x52
219 #define RX_I2C_TEST_MAP1_ADDR 0x60
220 #define RX_I2C_TEST_MAP2_ADDR 0x62
221 #define RX_I2C_REPEATER_MAP_ADDR 0x64
222 #define RX_I2C_HDMI_MAP_ADDR 0x68
223 #define RX_I2C_EDID_MAP_ADDR 0x6C
224 #define RX_I2C_DPP_MAP_ADDR 0x74 /* Def 0x78 */
225 #define RX_I2C_INFOFRAME_MAP_ADDR 0x76 /* 0x7C on ATV_MB seems to cause readback of all 0x00, occasionally. Happens more often when no Sink is connected */
226 #define RX_I2C_CEC_MAP_ADDR 0x80
227 #define RX_I2C_SDP_MAP_ADDR 0x82
228 #define RX_I2C_AVLINK_MAP_ADDR 0x84
229 #define RX_I2C_OSD_MAP_ADDR 0x88
230 #define RX_I2C_AUDIO_CODEC_MAP_ADDR 0x5C
231 #define RX_I2C_XMEM_MAP_ADDR 0xA8
232 #define RX_I2C_VFE_MAP_ADDR 0xA0
233 
234 
235 
236 #define RX2_I2C_SDP_VDP_MAP_ADDR 0xC0
237 #define RX2_I2C_AFE_DPLL_MAP_ADDR 0xC2
238 #define RX2_I2C_ESDP_MAP_ADDR 0xC4 /* Def 0x70 */
239 #define RX2_I2C_SDP_IO_MAP_ADDR 0xC6
240 #define RX2_I2C_CP_MAP_ADDR 0xC8
241 #define RX2_I2C_VDP_MAP_ADDR 0xCA
242 #define RX2_I2C_TEST_MAP3_ADDR 0xCC
243 #define RX2_I2C_TEST_MAP1_ADDR 0xCE
244 #define RX2_I2C_TEST_MAP2_ADDR 0xD0
245 #define RX2_I2C_REPEATER_MAP_ADDR 0xD2
246 #define RX2_I2C_HDMI_MAP_ADDR 0xD4
247 #define RX2_I2C_EDID_MAP_ADDR 0xD6
248 #define RX2_I2C_DPP_MAP_ADDR 0xD8 /* Def 0x78 */
249 #define RX2_I2C_INFOFRAME_MAP_ADDR 0xDA
250 #define RX2_I2C_CEC_MAP_ADDR 0xDC
251 #define RX2_I2C_SDP_MAP_ADDR 0xDE
252 #define RX2_I2C_AVLINK_MAP_ADDR 0xE0
253 #define RX2_I2C_OSD_MAP_ADDR 0xE2
254 #define RX2_I2C_VFE_MAP_ADDR RX_I2C_VFE_MAP_ADDR
255 #define RX2_I2C_AUDIO_CODEC_MAP_ADDR RX_I2C_AUDIO_CODEC_MAP_ADDR
256 #define RX2_I2C_XMEM_GAMMA_MAP_ADDR RX_I2C_XMEM_MAP_ADDR
257 
258 
259 #if ( (TX_DEVICE == 7511) && (MULTI_RX_NUM))
260 #define TX_I2C_MAIN_MAP_ADDR 0x7A
261 #define TX2_I2C_MAIN_MAP_ADDR 0x72
262 #else
263 #define TX_I2C_MAIN_MAP_ADDR 0x72
264 #define TX2_I2C_MAIN_MAP_ADDR 0x7A
265 #endif
266 
267 #define TX_I2C_PKT_MEM_MAP_ADDR 0x70
268 #define TX_I2C_CEC_MAP_ADDR 0x78
269 #if ( (TX_DEVICE == 7511) && (TX_NUM_OF_DEVICES > 1))
270 #define TX_I2C_EDID_MAP_ADDR 0xFE
271 #else
272 #define TX_I2C_EDID_MAP_ADDR 0x7E
273 #endif
274 #if ( RX_NUM_OF_DEVICES > 1 )
275 #define TX2_I2C_PKT_MEM_MAP_ADDR 0x7C
276 #else
277 #define TX2_I2C_PKT_MEM_MAP_ADDR 0x76
278 #endif
279 #define TX2_I2C_CEC_MAP_ADDR 0x82
280 #define TX2_I2C_EDID_MAP_ADDR 0x86
281 
282 #define TX_INCLUDE_CEC 1
283 #define TX_EDID_RETRY_COUNT 8
284 
285 #define TX_NUM_OF_DEVICES 1
286 
287 /*==========================================
288  * System wide configurations
289  *=========================================*/
290 #if (RX_DEVICE == 7612) || (RX_DEVICE == 7611) || (RX_DEVICE == 7619)
291 #define REP_SUPPORTED_DS_DEVICE_COUNT 12
292 #elif (RX_DEVICE == 7850)
293 #define REP_SUPPORTED_DS_DEVICE_COUNT 127
294 #else
295 #define REP_SUPPORTED_DS_DEVICE_COUNT 12
296 /* Maximum is 24, limited by RX capacity */
297 #endif
298 
299 #define REP_SUPPORTED_EDID_SEGMENTS 2
300 /* Maximum is 2, limited by RX capacity */
301 
302 
303 #define TX_SUPPORTED_DS_DEVICE_COUNT REP_SUPPORTED_DS_DEVICE_COUNT
304 #define TX_SUPPORTED_EDID_SEGMENTS REP_SUPPORTED_EDID_SEGMENTS
305 
306 
307 
308 /*========================================
309  * CEC macros
310  *=======================================*/
311 #define CEC_RX_BUFFER1 0
312 #define CEC_RX_BUFFER2 1
313 #define CEC_RX_BUFFER3 2
314 #define CEC_TRIPLE_NUMBER 3
315 
316 
317 /*========================================
318  * Enums and structures
319  *=======================================*/
320 typedef enum {
327 } ATV_ERR;
328 
329 
330 enum {
338 };
339 
340 typedef struct {
348  UCHAR RxFrameOrder[CEC_TRIPLE_NUMBER];
350 
351 /*========================================
352  * Auxiliary 8-bit I2C field access macros
353  *=======================================*/
354 #define ATV_I2CIsField8 (BOOL)ATV_I2CReadField8
355 #define ATV_I2CGetField8(d,r,m,b,p) *p=ATV_I2CReadField8(d,r,m,b)
356 #define ATV_I2CGetField32(d,r,Mm,Lm,b,s,p) *p=ATV_I2CReadField32(d,r,Mm,Lm,b,s)
357 #define ATV_I2CGetField32LE(d,r,Mm,Lm,b,s,p) *p=ATV_I2CReadField32LE(d,r,Mm,Lm,b,s)
358 #define ATV_I2CGetMultiField(d,r,s,p) HAL_I2CReadBlock(d,r,p,(UINT16)s)
359 
360 struct cec_status {
361  uint8_t tx_header;
362  uint8_t tx_tail;
363  uint8_t tx_cnt;
365 };
366 
370 };
371 
376 };
377 
378 void HAL_DelayMs (UINT16 Counter);
379 UCHAR HAL_I2CReadByte (UCHAR Dev, UCHAR Reg, UCHAR *Data);
380 UCHAR HAL_I2CWriteByte (UCHAR Dev, UCHAR Reg, UCHAR Data);
381 UINT16 HAL_I2CReadBlock (UCHAR Dev, UCHAR Reg, UCHAR *Data,
382  UINT16 NumberBytes);
383 UINT16 HAL_I2CWriteBlock (UCHAR Dev, UCHAR Reg, UCHAR *Data,
384  UINT16 NumberBytes);
386 void WaitMilliSec(unsigned int msec);
387 void DBG_Printf(const char *data, ...);
388 
389 
390 UCHAR ATV_I2CReadField8 (UCHAR DevAddr, UCHAR RegAddr, UCHAR Mask,
391  UCHAR BitPos);
392 void ATV_I2CWriteField8 (UCHAR DevAddr, UCHAR RegAddr, UCHAR Mask,
393  UCHAR BitPos, UCHAR FieldVal);
394 UINT32 ATV_I2CReadField32 (UCHAR DevAddr, UCHAR RegAddr, UCHAR MsbMask,
395  UCHAR LsbMask, UCHAR LsbPos, UCHAR FldSpan);
396 UINT32 ATV_I2CReadField32LE (UCHAR DevAddr, UCHAR RegAddr, UCHAR MsbMask,
397  UCHAR LsbMask, UCHAR LsbPos, UCHAR FldSpan);
398 void ATV_I2CWriteField32 (UCHAR DevAddr, UCHAR RegAddr, UCHAR MsbMask,
399  UCHAR LsbMask, UCHAR LsbPos, UCHAR FldSpan,
400  UINT32 Val);
401 void ATV_I2CWriteField32LE (UCHAR DevAddr, UCHAR RegAddr, UCHAR MsbMask,
402  UCHAR LsbMask, UCHAR LsbPos, UCHAR FldSpan,
403  UINT32 Val);
404 void ATV_I2CWriteFields (UCHAR *Table, UCHAR EndVal);
405 void ATV_I2CWriteTable (UCHAR *Table, UCHAR EndVal);
406 UINT16 ATV_LookupValue8 (UCHAR *Table, UCHAR Value, UCHAR EndVal, UINT16 Step);
407 void ATV_PrintTime (char *Prefix, UCHAR Gran, char *Postfix);
408 
409 UINT32 ATV_GetElapsedMs (UINT32 StartCount, UINT32 *CurrMsCount);
410 UINT32 ATV_GetMsCountNZ (void);
411 
412 ATV_ERR CEC_Reset (void);
413 ATV_ERR CEC_Enable (BOOL Enable);
414 ATV_ERR CEC_SetLogicalAddr (UCHAR LogAddr, UCHAR DevId, BOOL Enable);
415 ATV_ERR CEC_SendMessage (UCHAR *MsgPtr, UCHAR MsgLen);
418 ATV_ERR CEC_AllocateLogAddr (UCHAR *LogAddrList);
419 void CEC_Isr (CEC_INTERRUPTS *CecInts);
421 uint32_t HAL_GetCurrentMsCount();
422 void uart_int_handler(void *instance);
423 bool HAL_TxIntPending();
424 
425 #endif
Last250usCount
STATIC UINT32 Last250usCount
Definition: wrapper.c:92
INT16
short int INT16
Definition: wrapper.h:45
NUM_OF_VICS
#define NUM_OF_VICS
Definition: wrapper.h:162
HAL_TxIntPending
bool HAL_TxIntPending()
Definition: wrapper.c:1444
CEC_SendMessage
ATV_ERR CEC_SendMessage(UCHAR *MsgPtr, UCHAR MsgLen)
Definition: wrapper.c:917
no_os_alloc.h
ATV_GetMsCountNZ
UINT32 ATV_GetMsCountNZ(void)
Definition: wrapper.c:155
CEC_INTERRUPTS
Definition: wrapper.h:340
ATV_I2CWriteField32LE
void ATV_I2CWriteField32LE(UCHAR DevAddr, UCHAR RegAddr, UCHAR MsbMask, UCHAR LsbMask, UCHAR LsbPos, UCHAR FldSpan, UINT32 Val)
Definition: wrapper.c:452
ADV7511_CEC_TX_FRAME_LENGTH_SHIFT
#define ADV7511_CEC_TX_FRAME_LENGTH_SHIFT
Definition: wrapper.h:83
ATV_I2CWriteFields
void ATV_I2CWriteFields(UCHAR *Table, UCHAR EndVal)
Definition: wrapper.c:406
no_os_i2c_write
int32_t no_os_i2c_write(struct no_os_i2c_desc *desc, uint8_t *data, uint8_t bytes_number, uint8_t stop_bit)
I2C Write data to slave device.
Definition: no_os_i2c.c:159
CEC_ResendLastMessage
ATV_ERR CEC_ResendLastMessage(void)
Definition: wrapper.c:1046
CEC_TX_BUF_LEN
#define CEC_TX_BUF_LEN
Definition: wrapper.h:165
u16
unsigned short u16
Definition: wrapper.h:154
uart_int_handler
void uart_int_handler(void *instance)
Definition: wrapper.c:1428
ADV7511_CEC_RX_BUFFER_NUMBER_SHIFT
#define ADV7511_CEC_RX_BUFFER_NUMBER_SHIFT
Definition: wrapper.h:112
ADV7511_CEC_SOFT_RESET
#define ADV7511_CEC_SOFT_RESET
Definition: wrapper.h:149
ADV7511_CEC_RX_BUFFER_NUMBER_MASK
#define ADV7511_CEC_RX_BUFFER_NUMBER_MASK
Definition: wrapper.h:111
UINT32
unsigned long UINT32
Definition: wrapper.h:44
CecTxState
STATIC uint8_t CecTxState
Definition: wrapper.c:97
CEC_INTERRUPTS::RxReady2
BOOL RxReady2
Definition: wrapper.h:346
ADV7511_CEC_TX_FRAME_LENGTH_MASK
#define ADV7511_CEC_TX_FRAME_LENGTH_MASK
Definition: wrapper.h:82
ADV7511_CEC_LOGICADDR2
#define ADV7511_CEC_LOGICADDR2
Definition: wrapper.h:140
WaitMilliSec
void WaitMilliSec(unsigned int msec)
Definition: wrapper.c:701
HAL_GetMBSwitchState
BOOL HAL_GetMBSwitchState()
Definition: wrapper.c:1384
HAL_GetCurrentMsCount
uint32_t HAL_GetCurrentMsCount()
Definition: wrapper.c:1400
CONSTANT
#define CONSTANT
Definition: wrapper.h:37
HAL_SetRxChipSelect
UCHAR HAL_SetRxChipSelect(UCHAR DevIdx)
Definition: wrapper.c:693
ADV7511_CEC_TX_TRANS_ENABLE_MASK
#define ADV7511_CEC_TX_TRANS_ENABLE_MASK
Definition: wrapper.h:86
ADV7511_CEC_RX_ENABLE_MASK
#define ADV7511_CEC_RX_ENABLE_MASK
Definition: wrapper.h:104
ATV_I2CReadField32
UINT32 ATV_I2CReadField32(UCHAR DevAddr, UCHAR RegAddr, UCHAR MsbMask, UCHAR LsbMask, UCHAR LsbPos, UCHAR FldSpan)
Definition: wrapper.c:248
HAL_I2CWriteBlock
UINT16 HAL_I2CWriteBlock(UCHAR Dev, UCHAR Reg, UCHAR *Data, UINT16 NumberBytes)
Definition: wrapper.c:620
ADV7511_CEC_RX_BUFF1_HDR
#define ADV7511_CEC_RX_BUFF1_HDR
Definition: wrapper.h:101
ADV7511_CEC_LOGICADDR_MASK_MASK
#define ADV7511_CEC_LOGICADDR_MASK_MASK
Definition: wrapper.h:128
CEC_INTERRUPTS::TxReady
BOOL TxReady
Definition: wrapper.h:341
HAL_I2CReadBlock
UINT16 HAL_I2CReadBlock(UCHAR Dev, UCHAR Reg, UCHAR *Data, UINT16 NumberBytes)
Definition: wrapper.c:593
ADV7511_CEC_LOGICADDR0
#define ADV7511_CEC_LOGICADDR0
Definition: wrapper.h:134
EXTERNAL
#define EXTERNAL
Definition: wrapper.h:38
WaitMilliSec
void WaitMilliSec(unsigned int msec)
Definition: wrapper.c:701
ATV_GetElapsedMs
UINT32 ATV_GetElapsedMs(UINT32 StartCount, UINT32 *CurrMsCount)
Definition: wrapper.c:132
ADV7511_CEC_TX_NACK_CNT_SHIFT
#define ADV7511_CEC_TX_NACK_CNT_SHIFT
Definition: wrapper.h:99
CEC_Enable
ATV_ERR CEC_Enable(BOOL Enable)
Definition: wrapper.c:788
CEC_INTERRUPTS::RxFrameOrder
UCHAR RxFrameOrder[CEC_TRIPLE_NUMBER]
Definition: wrapper.h:348
wrapper.h
ADV7511_CEC_LOGICADDR_MASK
#define ADV7511_CEC_LOGICADDR_MASK
Definition: wrapper.h:127
ADV7511_CEC_SOFT_RESET_SHIFT
#define ADV7511_CEC_SOFT_RESET_SHIFT
Definition: wrapper.h:151
ATV_I2CWriteField32
void ATV_I2CWriteField32(UCHAR DevAddr, UCHAR RegAddr, UCHAR MsbMask, UCHAR LsbMask, UCHAR LsbPos, UCHAR FldSpan, UINT32 Val)
Definition: wrapper.c:356
ADV7511_CEC_RX_BUFFER2_RDY_SHIFT
#define ADV7511_CEC_RX_BUFFER2_RDY_SHIFT
Definition: wrapper.h:119
CHAR
char CHAR
Definition: wrapper.h:47
CEC_OP_LOG_ADDR_ALLOC
@ CEC_OP_LOG_ADDR_ALLOC
Definition: wrapper.h:374
ADV7511_CEC_POWER_MODE_SHIFT
#define ADV7511_CEC_POWER_MODE_SHIFT
Definition: wrapper.h:146
UCHAR
unsigned char UCHAR
Definition: wrapper.h:42
CEC_INTERRUPTS::ArbLost
BOOL ArbLost
Definition: wrapper.h:343
CEC_Enable
ATV_ERR CEC_Enable(BOOL Enable)
Definition: wrapper.c:788
cec_status::tx_buf
uint8_t tx_buf[CEC_TX_BUF_LEN]
Definition: wrapper.h:364
DBG_MSG
#define DBG_MSG
Definition: wrapper.h:186
uart_int_handler
void uart_int_handler(void *instance)
Definition: wrapper.c:1428
u8
unsigned char u8
Definition: wrapper.h:156
no_os_timer.h
Timer control module header.
ATVERR_TRUE
@ ATVERR_TRUE
Definition: wrapper.h:323
CEC_SendMessageOut
ATV_ERR CEC_SendMessageOut(void)
Definition: wrapper.c:997
no_os_calloc
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
HAL_I2CWriteBlock
UINT16 HAL_I2CWriteBlock(UCHAR Dev, UCHAR Reg, UCHAR *Data, UINT16 NumberBytes)
Definition: wrapper.c:620
UINT16
unsigned short UINT16
Definition: wrapper.h:43
ATV_I2CWriteFields
void ATV_I2CWriteFields(UCHAR *Table, UCHAR EndVal)
Definition: wrapper.c:406
ADV7511_CEC_TX_FRAME_LENGTH
#define ADV7511_CEC_TX_FRAME_LENGTH
Definition: wrapper.h:81
ATV_I2CReadField8
UCHAR ATV_I2CReadField8(UCHAR DevAddr, UCHAR RegAddr, UCHAR Mask, UCHAR BitPos)
Definition: wrapper.c:179
ADV7511_CEC_RX_BUFFER3_RDY
#define ADV7511_CEC_RX_BUFFER3_RDY
Definition: wrapper.h:120
ADV7511_CEC_RX_BUFFER1_RDY
#define ADV7511_CEC_RX_BUFFER1_RDY
Definition: wrapper.h:114
STATIC
#define STATIC
Definition: adis.h:40
no_os_i2c_desc::slave_address
uint8_t slave_address
Definition: no_os_i2c.h:109
ATV_I2CReadField32LE
UINT32 ATV_I2CReadField32LE(UCHAR DevAddr, UCHAR RegAddr, UCHAR MsbMask, UCHAR LsbMask, UCHAR LsbPos, UCHAR FldSpan)
Definition: wrapper.c:304
CEC_SetLogicalAddr
ATV_ERR CEC_SetLogicalAddr(UCHAR LogAddr, UCHAR DevId, BOOL Enable)
Definition: wrapper.c:867
CEC_Isr
void CEC_Isr(CEC_INTERRUPTS *CecInts)
Definition: wrapper.c:1220
ATV_ERR
ATV_ERR
Definition: wrapper.h:320
ATV_LookupValue8
UINT16 ATV_LookupValue8(UCHAR *Table, UCHAR Value, UCHAR EndVal, UINT16 Step)
Definition: wrapper.c:523
ADV7511_CEC_RX_BUFFER_NUMBER
#define ADV7511_CEC_RX_BUFFER_NUMBER
Definition: wrapper.h:110
ADV7511_CEC_LOGICADDR0_MASK
#define ADV7511_CEC_LOGICADDR0_MASK
Definition: wrapper.h:135
u32
unsigned long u32
Definition: wrapper.h:155
ADV7511_CEC_RX_BUFFER3_RDY_MASK
#define ADV7511_CEC_RX_BUFFER3_RDY_MASK
Definition: wrapper.h:121
ADV7511_CEC_LOGICADDR2_MASK
#define ADV7511_CEC_LOGICADDR2_MASK
Definition: wrapper.h:141
CEC_EVENT_RX_MSG
@ CEC_EVENT_RX_MSG
Definition: wrapper.h:331
cec_tx_state_machine
cec_tx_state_machine
Definition: wrapper.h:367
ADV7511_CEC_TX_RETRY_COUNT
#define ADV7511_CEC_TX_RETRY_COUNT
Definition: wrapper.h:92
ADV7511_CEC_SOFT_RESET_MASK
#define ADV7511_CEC_SOFT_RESET_MASK
Definition: wrapper.h:150
CEC_TX_STATE_DONE
@ CEC_TX_STATE_DONE
Definition: wrapper.h:368
ATV_LookupValue8
UINT16 ATV_LookupValue8(UCHAR *Table, UCHAR Value, UCHAR EndVal, UINT16 Step)
Definition: wrapper.c:523
TRUE
#define TRUE
Definition: wrapper.h:56
CEC_Reset
ATV_ERR CEC_Reset(void)
Definition: wrapper.c:731
CEC_AllocateLogAddr
ATV_ERR CEC_AllocateLogAddr(UCHAR *LogAddrList)
Definition: wrapper.c:1342
ATV_I2CWriteField8
void ATV_I2CWriteField8(UCHAR DevAddr, UCHAR RegAddr, UCHAR Mask, UCHAR BitPos, UCHAR FieldVal)
Definition: wrapper.c:209
ADV7511_CEC_LOGICADDR_MASK_ADDR2
#define ADV7511_CEC_LOGICADDR_MASK_ADDR2
Definition: wrapper.h:132
CecRxMessage
STATIC uint8_t CecRxMessage[CEC_MAX_MSG_SIZE+4]
Definition: wrapper.c:99
VicInfo
CONSTANT UINT16 VicInfo[NUM_OF_VICS *4]
Definition: wrapper.c:14
CEC_AllocateLogAddr
ATV_ERR CEC_AllocateLogAddr(UCHAR *LogAddrList)
Definition: wrapper.c:1342
ATV_I2CReadField8
UCHAR ATV_I2CReadField8(UCHAR DevAddr, UCHAR RegAddr, UCHAR Mask, UCHAR BitPos)
Definition: wrapper.c:179
HAL_I2CReadBlock
UINT16 HAL_I2CReadBlock(UCHAR Dev, UCHAR Reg, UCHAR *Data, UINT16 NofBytes)
Definition: wrapper.c:593
ADV7511_CEC_TX_TRANS_ENABLE
#define ADV7511_CEC_TX_TRANS_ENABLE
Definition: wrapper.h:85
ADV7511_CEC_RX_BUFFER3_RDY_SHIFT
#define ADV7511_CEC_RX_BUFFER3_RDY_SHIFT
Definition: wrapper.h:122
HAL_I2CReadByte
UCHAR HAL_I2CReadByte(UCHAR Dev, UCHAR Reg, UCHAR *Data)
Definition: wrapper.c:654
HAL_I2CReadByte
UCHAR HAL_I2CReadByte(UCHAR Dev, UCHAR Reg, UCHAR *Data)
Definition: wrapper.c:654
MsCnt
STATIC UINT32 MsCnt
Definition: wrapper.c:91
CEC_Reset
ATV_ERR CEC_Reset(void)
Definition: wrapper.c:731
ADV7511_CEC_RX_BUFFER2_RDY
#define ADV7511_CEC_RX_BUFFER2_RDY
Definition: wrapper.h:117
OperBuf
STATIC uint8_t OperBuf[32]
Definition: wrapper.c:101
HAL_DelayMs
void HAL_DelayMs(UINT16 Counter)
Definition: wrapper.c:585
ATV_GetElapsedMs
UINT32 ATV_GetElapsedMs(UINT32 StartCount, UINT32 *CurrMsCount)
Definition: wrapper.c:132
ATV_I2CWriteField32LE
void ATV_I2CWriteField32LE(UCHAR DevAddr, UCHAR RegAddr, UCHAR MsbMask, UCHAR LsbMask, UCHAR LsbPos, UCHAR FldSpan, UINT32 Val)
Definition: wrapper.c:452
cec_status
Definition: wrapper.h:360
ADV7511_CEC_RX_ENABLE
#define ADV7511_CEC_RX_ENABLE
Definition: wrapper.h:103
ADV7511_CEC_LOGICADDR_MASK_SHIFT
#define ADV7511_CEC_LOGICADDR_MASK_SHIFT
Definition: wrapper.h:129
no_os_i2c_desc
Structure holding I2C address descriptor.
Definition: no_os_i2c.h:101
CEC_RX_BUFFER2
#define CEC_RX_BUFFER2
Definition: wrapper.h:312
ATV_I2CReadField32LE
UINT32 ATV_I2CReadField32LE(UCHAR DevAddr, UCHAR RegAddr, UCHAR MsbMask, UCHAR LsbMask, UCHAR LsbPos, UCHAR FldSpan)
Definition: wrapper.c:304
CEC_SendMessageOut
ATV_ERR CEC_SendMessageOut(void)
Definition: wrapper.c:997
HAL_GetCurrentMsCount
uint32_t HAL_GetCurrentMsCount()
Definition: wrapper.c:1400
ADV7511_CEC_LOGICADDR1_SHIFT
#define ADV7511_CEC_LOGICADDR1_SHIFT
Definition: wrapper.h:139
ATV_PrintTime
void ATV_PrintTime(char *Prefix, UCHAR Gran, char *Postfix)
Definition: wrapper.c:552
no_os_i2c_read
int32_t no_os_i2c_read(struct no_os_i2c_desc *desc, uint8_t *data, uint8_t bytes_number, uint8_t stop_bit)
I2C Read data from slave device.
Definition: no_os_i2c.c:190
timer_counter_intr
volatile uint32_t timer_counter_intr
Definition: wrapper.c:90
ADV7511_CEC_TX_TRANS_ENABLE_SHIFT
#define ADV7511_CEC_TX_TRANS_ENABLE_SHIFT
Definition: wrapper.h:87
DBG_Printf
void DBG_Printf(const char *data,...)
ADV7511_CEC_RX_BUFFER2_RDY_MASK
#define ADV7511_CEC_RX_BUFFER2_RDY_MASK
Definition: wrapper.h:118
no_os_i2c.h
Header file of I2C Interface.
i2c_handler
struct no_os_i2c_desc * i2c_handler
Definition: wrapper.c:89
CEC_SetLogicalAddr
ATV_ERR CEC_SetLogicalAddr(UCHAR LogAddr, UCHAR DevId, BOOL Enable)
Definition: wrapper.c:867
ATVERR_FALSE
@ ATVERR_FALSE
Definition: wrapper.h:322
ADV7511_CEC_RX_BUFF3_HDR
#define ADV7511_CEC_RX_BUFF3_HDR
Definition: wrapper.h:108
ADV7511_CEC_POWER_MODE_MASK
#define ADV7511_CEC_POWER_MODE_MASK
Definition: wrapper.h:145
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
INT32
long int INT32
Definition: wrapper.h:46
ATVERR_INV_PARM
@ ATVERR_INV_PARM
Definition: wrapper.h:324
CEC_SendMessage
ATV_ERR CEC_SendMessage(UCHAR *MsgPtr, UCHAR MsgLen)
Definition: wrapper.c:917
CEC_INTERRUPTS::RxReady
BOOL RxReady
Definition: wrapper.h:342
CEC_EVENT_TX_TIMEOUT
@ CEC_EVENT_TX_TIMEOUT
Definition: wrapper.h:333
CEC_TX_STATE_BUSY
@ CEC_TX_STATE_BUSY
Definition: wrapper.h:369
CEC_RX_BUFFER1
#define CEC_RX_BUFFER1
Definition: wrapper.h:311
ATVERR_FAILED
@ ATVERR_FAILED
Definition: wrapper.h:326
ADV7511_CEC_LOGICADDR_MASK_ADDR1
#define ADV7511_CEC_LOGICADDR_MASK_ADDR1
Definition: wrapper.h:131
CecCurrOper
STATIC uint8_t CecCurrOper
Definition: wrapper.c:98
ATV_GetMsCountNZ
UINT32 ATV_GetMsCountNZ(void)
Definition: wrapper.c:155
CEC_EVENT_TX_DONE
@ CEC_EVENT_TX_DONE
Definition: wrapper.h:332
NULL
#define NULL
Definition: wrapper.h:64
ATV_I2CWriteField32
void ATV_I2CWriteField32(UCHAR DevAddr, UCHAR RegAddr, UCHAR MsbMask, UCHAR LsbMask, UCHAR LsbPos, UCHAR FldSpan, UINT32 Val)
Definition: wrapper.c:356
ADV7511_CEC_POWER_MODE
#define ADV7511_CEC_POWER_MODE
Definition: wrapper.h:144
ATV_I2CWriteField8
void ATV_I2CWriteField8(UCHAR DevAddr, UCHAR RegAddr, UCHAR Mask, UCHAR BitPos, UCHAR FieldVal)
Definition: wrapper.c:209
ATV_PrintTime
void ATV_PrintTime(char *Prefix, UCHAR Gran, char *Postfix)
Definition: wrapper.c:552
ATV_I2CReadField32
UINT32 ATV_I2CReadField32(UCHAR DevAddr, UCHAR RegAddr, UCHAR MsbMask, UCHAR LsbMask, UCHAR LsbPos, UCHAR FldSpan)
Definition: wrapper.c:248
BOOL
#define BOOL
Definition: wrapper.h:52
ADV7511_CEC_LOGICADDR1
#define ADV7511_CEC_LOGICADDR1
Definition: wrapper.h:137
CEC_TRIPLE_NUMBER
#define CEC_TRIPLE_NUMBER
Definition: wrapper.h:314
ADV7511_CEC_RX_BUFFER1_RDY_SHIFT
#define ADV7511_CEC_RX_BUFFER1_RDY_SHIFT
Definition: wrapper.h:116
cec_status::tx_header
uint8_t tx_header
Definition: wrapper.h:361
ADV7511_CEC_TX_FRAME_HEADER
#define ADV7511_CEC_TX_FRAME_HEADER
Definition: wrapper.h:79
ADV7511_CEC_LOGICADDR0_SHIFT
#define ADV7511_CEC_LOGICADDR0_SHIFT
Definition: wrapper.h:136
CEC_RX_BUFFER3
#define CEC_RX_BUFFER3
Definition: wrapper.h:313
ADV7511_CEC_LOGICADDR1_MASK
#define ADV7511_CEC_LOGICADDR1_MASK
Definition: wrapper.h:138
CEC_INTERRUPTS::Timeout
BOOL Timeout
Definition: wrapper.h:344
CecRetryCount
STATIC uint8_t CecRetryCount
Definition: wrapper.c:100
ADV7511_CEC_RX_BUFFER1_RDY_MASK
#define ADV7511_CEC_RX_BUFFER1_RDY_MASK
Definition: wrapper.h:115
SrcLogAddr
STATIC uint8_t SrcLogAddr
Definition: wrapper.c:103
CEC_ResendLastMessage
ATV_ERR CEC_ResendLastMessage(void)
Definition: wrapper.c:1046
HAL_I2CWriteByte
UCHAR HAL_I2CWriteByte(UCHAR Dev, UCHAR Reg, UCHAR Data)
Definition: wrapper.c:675
CEC_EVENT_TX_ARB_LOST
@ CEC_EVENT_TX_ARB_LOST
Definition: wrapper.h:334
HAL_GetMBSwitchState
BOOL HAL_GetMBSwitchState()
Definition: wrapper.c:1384
cec_operations
cec_operations
Definition: wrapper.h:372
true
@ true
Definition: ad5446.h:57
ADV7511_CEC_RX_BUFF2_HDR
#define ADV7511_CEC_RX_BUFF2_HDR
Definition: wrapper.h:107
HAL_SetRxChipSelect
UCHAR HAL_SetRxChipSelect(UCHAR DevIdx)
Definition: wrapper.c:693
ADV7511_CEC_RX_ENABLE_SHIFT
#define ADV7511_CEC_RX_ENABLE_SHIFT
Definition: wrapper.h:105
VicInfo
EXTERNAL CONSTANT UINT16 VicInfo[]
Definition: wrapper.h:167
ATV_I2CWriteTable
void ATV_I2CWriteTable(UCHAR *Table, UCHAR EndVal)
Definition: wrapper.c:502
CEC_INTERRUPTS::RxReady1
BOOL RxReady1
Definition: wrapper.h:345
L
#define L(x)
Definition: ad9144.h:1258
ADV7511_CEC_TX_RETRY_COUNT_MASK
#define ADV7511_CEC_TX_RETRY_COUNT_MASK
Definition: wrapper.h:93
FALSE
#define FALSE
Definition: wrapper.h:60
CEC_OP_GET_LOG_ADDR_LIST
@ CEC_OP_GET_LOG_ADDR_LIST
Definition: wrapper.h:375
ATVERR_NOT_AVAILABLE
@ ATVERR_NOT_AVAILABLE
Definition: wrapper.h:325
ADV7511_CEC_TX_NACK_CNT_MASK
#define ADV7511_CEC_TX_NACK_CNT_MASK
Definition: wrapper.h:98
CEC_EVENT_LOG_ADDR_LIST
@ CEC_EVENT_LOG_ADDR_LIST
Definition: wrapper.h:336
ADV7511_CEC_TX_NACK_CNT
#define ADV7511_CEC_TX_NACK_CNT
Definition: wrapper.h:97
ADV7511_CEC_I2C_ADDR
#define ADV7511_CEC_I2C_ADDR
Definition: wrapper.h:77
cec_status::tx_tail
uint8_t tx_tail
Definition: wrapper.h:362
HAL_TxIntPending
bool HAL_TxIntPending()
Definition: wrapper.c:1444
CEC_EVENT_RX_MSG_RESPOND
@ CEC_EVENT_RX_MSG_RESPOND
Definition: wrapper.h:337
HAL_I2CWriteByte
UCHAR HAL_I2CWriteByte(UCHAR Dev, UCHAR Reg, UCHAR Data)
Definition: wrapper.c:675
CEC_MAX_MSG_SIZE
#define CEC_MAX_MSG_SIZE
Definition: wrapper.h:164
CEC_OP_NONE
@ CEC_OP_NONE
Definition: wrapper.h:373
ADV7511_CEC_LOGICADDR_MASK_ADDR0
#define ADV7511_CEC_LOGICADDR_MASK_ADDR0
Definition: wrapper.h:130
CEC_Isr
void CEC_Isr(CEC_INTERRUPTS *CecInts)
Definition: wrapper.c:1220
HAL_DelayMs
void HAL_DelayMs(UINT16 Counter)
Definition: wrapper.c:585
ATV_I2CWriteTable
void ATV_I2CWriteTable(UCHAR *Table, UCHAR EndVal)
Definition: wrapper.c:502
Cec_Notification
UINT16 Cec_Notification(UCHAR Event, UINT16 Len, void *Buff)
CEC_RETRY_COUNT
#define CEC_RETRY_COUNT
Definition: wrapper.h:163
ADV7511_CEC_LOGICADDR2_SHIFT
#define ADV7511_CEC_LOGICADDR2_SHIFT
Definition: wrapper.h:142
CEC_EVENT_LOG_ADDR_ALLOC
@ CEC_EVENT_LOG_ADDR_ALLOC
Definition: wrapper.h:335
cec_status::tx_cnt
uint8_t tx_cnt
Definition: wrapper.h:363
BufIdx
STATIC uint8_t BufIdx
Definition: wrapper.c:102
ATVERR_OK
@ ATVERR_OK
Definition: wrapper.h:321
ADV7511_CEC_TX_RETRY_COUNT_SHIFT
#define ADV7511_CEC_TX_RETRY_COUNT_SHIFT
Definition: wrapper.h:94
CEC_INTERRUPTS::RxReady3
BOOL RxReady3
Definition: wrapper.h:347