Go to the documentation of this file.
15 #include "xil_printf.h"
23 #define TX_DEVICE 7511
24 #define TX_USER_CONFIG 1
25 #define TX_USER_INIT 0
26 #define TX_CALLBACK_FUNCTION TRANSMITTER_Notification
29 #define IGNORE_INT_LINES 1
37 #define CONSTANT const
38 #define EXTERNAL extern
39 #define PACKED __attribute__((packed))
40 #define PACKED_STR struct PACKED
64 #define NULL ((void *)0)
67 #define ADV7511_MAIN_I2C_ADDR 0x39
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)
74 #define ADV7511_MAIN_CEC_PWRDWN 0xe2
75 #define ADV7511_MAIN_CEC_PWRDWN_SET(x) (((x) << 1) & 0x01)
77 #define ADV7511_CEC_I2C_ADDR 0x3c
79 #define ADV7511_CEC_TX_FRAME_HEADER 0x00
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
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
89 #define ADV7511_CEC_TX_TRANSMISSION_EN 0x11
90 #define ADV7511_CEC_TX_TRANSMISSION_EN_SET(x) (((x) << 0) & 0x1)
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)
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
101 #define ADV7511_CEC_RX_BUFF1_HDR 0x15
103 #define ADV7511_CEC_RX_ENABLE 0x26
104 #define ADV7511_CEC_RX_ENABLE_MASK 0x40
105 #define ADV7511_CEC_RX_ENABLE_SHIFT 0x06
107 #define ADV7511_CEC_RX_BUFF2_HDR 0x27
108 #define ADV7511_CEC_RX_BUFF3_HDR 0x38
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
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
124 #define ADV7511_CEC_LOGICADDR_DEV01_REG 0x4c
125 #define ADV7511_CEC_LOGICADDR_DEV2_REG 0x4d
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
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
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)
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)
154 typedef unsigned short u16;
155 typedef unsigned long u32;
156 typedef unsigned char u8;
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
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
183 #define CEC_TRIPLE_NUMBER 3
186 #define DBG_MSG xil_printf
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
208 #define RX_I2C_IO_MAP_ADDR 0x40
209 #define RX2_I2C_IO_MAP_ADDR 0xB4
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
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
225 #define RX_I2C_INFOFRAME_MAP_ADDR 0x76
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
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
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
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
259 #if ( (TX_DEVICE == 7511) && (MULTI_RX_NUM))
260 #define TX_I2C_MAIN_MAP_ADDR 0x7A
261 #define TX2_I2C_MAIN_MAP_ADDR 0x72
263 #define TX_I2C_MAIN_MAP_ADDR 0x72
264 #define TX2_I2C_MAIN_MAP_ADDR 0x7A
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
272 #define TX_I2C_EDID_MAP_ADDR 0x7E
274 #if ( RX_NUM_OF_DEVICES > 1 )
275 #define TX2_I2C_PKT_MEM_MAP_ADDR 0x7C
277 #define TX2_I2C_PKT_MEM_MAP_ADDR 0x76
279 #define TX2_I2C_CEC_MAP_ADDR 0x82
280 #define TX2_I2C_EDID_MAP_ADDR 0x86
282 #define TX_INCLUDE_CEC 1
283 #define TX_EDID_RETRY_COUNT 8
285 #define TX_NUM_OF_DEVICES 1
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
295 #define REP_SUPPORTED_DS_DEVICE_COUNT 12
299 #define REP_SUPPORTED_EDID_SEGMENTS 2
303 #define TX_SUPPORTED_DS_DEVICE_COUNT REP_SUPPORTED_DS_DEVICE_COUNT
304 #define TX_SUPPORTED_EDID_SEGMENTS REP_SUPPORTED_EDID_SEGMENTS
311 #define CEC_RX_BUFFER1 0
312 #define CEC_RX_BUFFER2 1
313 #define CEC_RX_BUFFER3 2
314 #define CEC_TRIPLE_NUMBER 3
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)
STATIC UINT32 Last250usCount
Definition: wrapper.c:92
short int INT16
Definition: wrapper.h:45
#define NUM_OF_VICS
Definition: wrapper.h:162
bool HAL_TxIntPending()
Definition: wrapper.c:1444
ATV_ERR CEC_SendMessage(UCHAR *MsgPtr, UCHAR MsgLen)
Definition: wrapper.c:917
UINT32 ATV_GetMsCountNZ(void)
Definition: wrapper.c:155
Definition: wrapper.h:340
void ATV_I2CWriteField32LE(UCHAR DevAddr, UCHAR RegAddr, UCHAR MsbMask, UCHAR LsbMask, UCHAR LsbPos, UCHAR FldSpan, UINT32 Val)
Definition: wrapper.c:452
#define ADV7511_CEC_TX_FRAME_LENGTH_SHIFT
Definition: wrapper.h:83
void ATV_I2CWriteFields(UCHAR *Table, UCHAR EndVal)
Definition: wrapper.c:406
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
ATV_ERR CEC_ResendLastMessage(void)
Definition: wrapper.c:1046
#define CEC_TX_BUF_LEN
Definition: wrapper.h:165
unsigned short u16
Definition: wrapper.h:154
void uart_int_handler(void *instance)
Definition: wrapper.c:1428
#define ADV7511_CEC_RX_BUFFER_NUMBER_SHIFT
Definition: wrapper.h:112
#define ADV7511_CEC_SOFT_RESET
Definition: wrapper.h:149
#define ADV7511_CEC_RX_BUFFER_NUMBER_MASK
Definition: wrapper.h:111
unsigned long UINT32
Definition: wrapper.h:44
STATIC uint8_t CecTxState
Definition: wrapper.c:97
BOOL RxReady2
Definition: wrapper.h:346
#define ADV7511_CEC_TX_FRAME_LENGTH_MASK
Definition: wrapper.h:82
#define ADV7511_CEC_LOGICADDR2
Definition: wrapper.h:140
void WaitMilliSec(unsigned int msec)
Definition: wrapper.c:701
BOOL HAL_GetMBSwitchState()
Definition: wrapper.c:1384
uint32_t HAL_GetCurrentMsCount()
Definition: wrapper.c:1400
#define CONSTANT
Definition: wrapper.h:37
UCHAR HAL_SetRxChipSelect(UCHAR DevIdx)
Definition: wrapper.c:693
#define ADV7511_CEC_TX_TRANS_ENABLE_MASK
Definition: wrapper.h:86
#define ADV7511_CEC_RX_ENABLE_MASK
Definition: wrapper.h:104
UINT32 ATV_I2CReadField32(UCHAR DevAddr, UCHAR RegAddr, UCHAR MsbMask, UCHAR LsbMask, UCHAR LsbPos, UCHAR FldSpan)
Definition: wrapper.c:248
UINT16 HAL_I2CWriteBlock(UCHAR Dev, UCHAR Reg, UCHAR *Data, UINT16 NumberBytes)
Definition: wrapper.c:620
#define ADV7511_CEC_RX_BUFF1_HDR
Definition: wrapper.h:101
#define ADV7511_CEC_LOGICADDR_MASK_MASK
Definition: wrapper.h:128
BOOL TxReady
Definition: wrapper.h:341
UINT16 HAL_I2CReadBlock(UCHAR Dev, UCHAR Reg, UCHAR *Data, UINT16 NumberBytes)
Definition: wrapper.c:593
#define ADV7511_CEC_LOGICADDR0
Definition: wrapper.h:134
#define EXTERNAL
Definition: wrapper.h:38
void WaitMilliSec(unsigned int msec)
Definition: wrapper.c:701
UINT32 ATV_GetElapsedMs(UINT32 StartCount, UINT32 *CurrMsCount)
Definition: wrapper.c:132
#define ADV7511_CEC_TX_NACK_CNT_SHIFT
Definition: wrapper.h:99
ATV_ERR CEC_Enable(BOOL Enable)
Definition: wrapper.c:788
UCHAR RxFrameOrder[CEC_TRIPLE_NUMBER]
Definition: wrapper.h:348
#define ADV7511_CEC_LOGICADDR_MASK
Definition: wrapper.h:127
#define ADV7511_CEC_SOFT_RESET_SHIFT
Definition: wrapper.h:151
void ATV_I2CWriteField32(UCHAR DevAddr, UCHAR RegAddr, UCHAR MsbMask, UCHAR LsbMask, UCHAR LsbPos, UCHAR FldSpan, UINT32 Val)
Definition: wrapper.c:356
#define ADV7511_CEC_RX_BUFFER2_RDY_SHIFT
Definition: wrapper.h:119
char CHAR
Definition: wrapper.h:47
@ CEC_OP_LOG_ADDR_ALLOC
Definition: wrapper.h:374
#define ADV7511_CEC_POWER_MODE_SHIFT
Definition: wrapper.h:146
unsigned char UCHAR
Definition: wrapper.h:42
BOOL ArbLost
Definition: wrapper.h:343
ATV_ERR CEC_Enable(BOOL Enable)
Definition: wrapper.c:788
uint8_t tx_buf[CEC_TX_BUF_LEN]
Definition: wrapper.h:364
#define DBG_MSG
Definition: wrapper.h:186
void uart_int_handler(void *instance)
Definition: wrapper.c:1428
unsigned char u8
Definition: wrapper.h:156
Timer control module header.
@ ATVERR_TRUE
Definition: wrapper.h:323
ATV_ERR CEC_SendMessageOut(void)
Definition: wrapper.c:997
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
UINT16 HAL_I2CWriteBlock(UCHAR Dev, UCHAR Reg, UCHAR *Data, UINT16 NumberBytes)
Definition: wrapper.c:620
unsigned short UINT16
Definition: wrapper.h:43
void ATV_I2CWriteFields(UCHAR *Table, UCHAR EndVal)
Definition: wrapper.c:406
#define ADV7511_CEC_TX_FRAME_LENGTH
Definition: wrapper.h:81
UCHAR ATV_I2CReadField8(UCHAR DevAddr, UCHAR RegAddr, UCHAR Mask, UCHAR BitPos)
Definition: wrapper.c:179
#define ADV7511_CEC_RX_BUFFER3_RDY
Definition: wrapper.h:120
#define ADV7511_CEC_RX_BUFFER1_RDY
Definition: wrapper.h:114
#define STATIC
Definition: adis.h:40
uint8_t slave_address
Definition: no_os_i2c.h:109
UINT32 ATV_I2CReadField32LE(UCHAR DevAddr, UCHAR RegAddr, UCHAR MsbMask, UCHAR LsbMask, UCHAR LsbPos, UCHAR FldSpan)
Definition: wrapper.c:304
ATV_ERR CEC_SetLogicalAddr(UCHAR LogAddr, UCHAR DevId, BOOL Enable)
Definition: wrapper.c:867
void CEC_Isr(CEC_INTERRUPTS *CecInts)
Definition: wrapper.c:1220
ATV_ERR
Definition: wrapper.h:320
UINT16 ATV_LookupValue8(UCHAR *Table, UCHAR Value, UCHAR EndVal, UINT16 Step)
Definition: wrapper.c:523
#define ADV7511_CEC_RX_BUFFER_NUMBER
Definition: wrapper.h:110
#define ADV7511_CEC_LOGICADDR0_MASK
Definition: wrapper.h:135
unsigned long u32
Definition: wrapper.h:155
#define ADV7511_CEC_RX_BUFFER3_RDY_MASK
Definition: wrapper.h:121
#define ADV7511_CEC_LOGICADDR2_MASK
Definition: wrapper.h:141
@ CEC_EVENT_RX_MSG
Definition: wrapper.h:331
cec_tx_state_machine
Definition: wrapper.h:367
#define ADV7511_CEC_TX_RETRY_COUNT
Definition: wrapper.h:92
#define ADV7511_CEC_SOFT_RESET_MASK
Definition: wrapper.h:150
@ CEC_TX_STATE_DONE
Definition: wrapper.h:368
UINT16 ATV_LookupValue8(UCHAR *Table, UCHAR Value, UCHAR EndVal, UINT16 Step)
Definition: wrapper.c:523
#define TRUE
Definition: wrapper.h:56
ATV_ERR CEC_Reset(void)
Definition: wrapper.c:731
ATV_ERR CEC_AllocateLogAddr(UCHAR *LogAddrList)
Definition: wrapper.c:1342
void ATV_I2CWriteField8(UCHAR DevAddr, UCHAR RegAddr, UCHAR Mask, UCHAR BitPos, UCHAR FieldVal)
Definition: wrapper.c:209
#define ADV7511_CEC_LOGICADDR_MASK_ADDR2
Definition: wrapper.h:132
STATIC uint8_t CecRxMessage[CEC_MAX_MSG_SIZE+4]
Definition: wrapper.c:99
CONSTANT UINT16 VicInfo[NUM_OF_VICS *4]
Definition: wrapper.c:14
ATV_ERR CEC_AllocateLogAddr(UCHAR *LogAddrList)
Definition: wrapper.c:1342
UCHAR ATV_I2CReadField8(UCHAR DevAddr, UCHAR RegAddr, UCHAR Mask, UCHAR BitPos)
Definition: wrapper.c:179
UINT16 HAL_I2CReadBlock(UCHAR Dev, UCHAR Reg, UCHAR *Data, UINT16 NofBytes)
Definition: wrapper.c:593
#define ADV7511_CEC_TX_TRANS_ENABLE
Definition: wrapper.h:85
#define ADV7511_CEC_RX_BUFFER3_RDY_SHIFT
Definition: wrapper.h:122
UCHAR HAL_I2CReadByte(UCHAR Dev, UCHAR Reg, UCHAR *Data)
Definition: wrapper.c:654
UCHAR HAL_I2CReadByte(UCHAR Dev, UCHAR Reg, UCHAR *Data)
Definition: wrapper.c:654
STATIC UINT32 MsCnt
Definition: wrapper.c:91
ATV_ERR CEC_Reset(void)
Definition: wrapper.c:731
#define ADV7511_CEC_RX_BUFFER2_RDY
Definition: wrapper.h:117
STATIC uint8_t OperBuf[32]
Definition: wrapper.c:101
void HAL_DelayMs(UINT16 Counter)
Definition: wrapper.c:585
UINT32 ATV_GetElapsedMs(UINT32 StartCount, UINT32 *CurrMsCount)
Definition: wrapper.c:132
void ATV_I2CWriteField32LE(UCHAR DevAddr, UCHAR RegAddr, UCHAR MsbMask, UCHAR LsbMask, UCHAR LsbPos, UCHAR FldSpan, UINT32 Val)
Definition: wrapper.c:452
Definition: wrapper.h:360
#define ADV7511_CEC_RX_ENABLE
Definition: wrapper.h:103
#define ADV7511_CEC_LOGICADDR_MASK_SHIFT
Definition: wrapper.h:129
Structure holding I2C address descriptor.
Definition: no_os_i2c.h:101
#define CEC_RX_BUFFER2
Definition: wrapper.h:312
UINT32 ATV_I2CReadField32LE(UCHAR DevAddr, UCHAR RegAddr, UCHAR MsbMask, UCHAR LsbMask, UCHAR LsbPos, UCHAR FldSpan)
Definition: wrapper.c:304
ATV_ERR CEC_SendMessageOut(void)
Definition: wrapper.c:997
uint32_t HAL_GetCurrentMsCount()
Definition: wrapper.c:1400
#define ADV7511_CEC_LOGICADDR1_SHIFT
Definition: wrapper.h:139
void ATV_PrintTime(char *Prefix, UCHAR Gran, char *Postfix)
Definition: wrapper.c:552
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
volatile uint32_t timer_counter_intr
Definition: wrapper.c:90
#define ADV7511_CEC_TX_TRANS_ENABLE_SHIFT
Definition: wrapper.h:87
void DBG_Printf(const char *data,...)
#define ADV7511_CEC_RX_BUFFER2_RDY_MASK
Definition: wrapper.h:118
Header file of I2C Interface.
struct no_os_i2c_desc * i2c_handler
Definition: wrapper.c:89
ATV_ERR CEC_SetLogicalAddr(UCHAR LogAddr, UCHAR DevId, BOOL Enable)
Definition: wrapper.c:867
@ ATVERR_FALSE
Definition: wrapper.h:322
#define ADV7511_CEC_RX_BUFF3_HDR
Definition: wrapper.h:108
#define ADV7511_CEC_POWER_MODE_MASK
Definition: wrapper.h:145
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
long int INT32
Definition: wrapper.h:46
@ ATVERR_INV_PARM
Definition: wrapper.h:324
ATV_ERR CEC_SendMessage(UCHAR *MsgPtr, UCHAR MsgLen)
Definition: wrapper.c:917
BOOL RxReady
Definition: wrapper.h:342
@ CEC_EVENT_TX_TIMEOUT
Definition: wrapper.h:333
@ CEC_TX_STATE_BUSY
Definition: wrapper.h:369
#define CEC_RX_BUFFER1
Definition: wrapper.h:311
@ ATVERR_FAILED
Definition: wrapper.h:326
#define ADV7511_CEC_LOGICADDR_MASK_ADDR1
Definition: wrapper.h:131
STATIC uint8_t CecCurrOper
Definition: wrapper.c:98
UINT32 ATV_GetMsCountNZ(void)
Definition: wrapper.c:155
@ CEC_EVENT_TX_DONE
Definition: wrapper.h:332
#define NULL
Definition: wrapper.h:64
void ATV_I2CWriteField32(UCHAR DevAddr, UCHAR RegAddr, UCHAR MsbMask, UCHAR LsbMask, UCHAR LsbPos, UCHAR FldSpan, UINT32 Val)
Definition: wrapper.c:356
#define ADV7511_CEC_POWER_MODE
Definition: wrapper.h:144
void ATV_I2CWriteField8(UCHAR DevAddr, UCHAR RegAddr, UCHAR Mask, UCHAR BitPos, UCHAR FieldVal)
Definition: wrapper.c:209
void ATV_PrintTime(char *Prefix, UCHAR Gran, char *Postfix)
Definition: wrapper.c:552
UINT32 ATV_I2CReadField32(UCHAR DevAddr, UCHAR RegAddr, UCHAR MsbMask, UCHAR LsbMask, UCHAR LsbPos, UCHAR FldSpan)
Definition: wrapper.c:248
#define BOOL
Definition: wrapper.h:52
#define ADV7511_CEC_LOGICADDR1
Definition: wrapper.h:137
#define CEC_TRIPLE_NUMBER
Definition: wrapper.h:314
#define ADV7511_CEC_RX_BUFFER1_RDY_SHIFT
Definition: wrapper.h:116
uint8_t tx_header
Definition: wrapper.h:361
#define ADV7511_CEC_TX_FRAME_HEADER
Definition: wrapper.h:79
#define ADV7511_CEC_LOGICADDR0_SHIFT
Definition: wrapper.h:136
#define CEC_RX_BUFFER3
Definition: wrapper.h:313
#define ADV7511_CEC_LOGICADDR1_MASK
Definition: wrapper.h:138
BOOL Timeout
Definition: wrapper.h:344
STATIC uint8_t CecRetryCount
Definition: wrapper.c:100
#define ADV7511_CEC_RX_BUFFER1_RDY_MASK
Definition: wrapper.h:115
STATIC uint8_t SrcLogAddr
Definition: wrapper.c:103
ATV_ERR CEC_ResendLastMessage(void)
Definition: wrapper.c:1046
UCHAR HAL_I2CWriteByte(UCHAR Dev, UCHAR Reg, UCHAR Data)
Definition: wrapper.c:675
@ CEC_EVENT_TX_ARB_LOST
Definition: wrapper.h:334
BOOL HAL_GetMBSwitchState()
Definition: wrapper.c:1384
cec_operations
Definition: wrapper.h:372
@ true
Definition: ad5446.h:57
#define ADV7511_CEC_RX_BUFF2_HDR
Definition: wrapper.h:107
UCHAR HAL_SetRxChipSelect(UCHAR DevIdx)
Definition: wrapper.c:693
#define ADV7511_CEC_RX_ENABLE_SHIFT
Definition: wrapper.h:105
EXTERNAL CONSTANT UINT16 VicInfo[]
Definition: wrapper.h:167
void ATV_I2CWriteTable(UCHAR *Table, UCHAR EndVal)
Definition: wrapper.c:502
BOOL RxReady1
Definition: wrapper.h:345
#define L(x)
Definition: ad9144.h:1258
#define ADV7511_CEC_TX_RETRY_COUNT_MASK
Definition: wrapper.h:93
#define FALSE
Definition: wrapper.h:60
@ CEC_OP_GET_LOG_ADDR_LIST
Definition: wrapper.h:375
@ ATVERR_NOT_AVAILABLE
Definition: wrapper.h:325
#define ADV7511_CEC_TX_NACK_CNT_MASK
Definition: wrapper.h:98
@ CEC_EVENT_LOG_ADDR_LIST
Definition: wrapper.h:336
#define ADV7511_CEC_TX_NACK_CNT
Definition: wrapper.h:97
#define ADV7511_CEC_I2C_ADDR
Definition: wrapper.h:77
uint8_t tx_tail
Definition: wrapper.h:362
bool HAL_TxIntPending()
Definition: wrapper.c:1444
@ CEC_EVENT_RX_MSG_RESPOND
Definition: wrapper.h:337
UCHAR HAL_I2CWriteByte(UCHAR Dev, UCHAR Reg, UCHAR Data)
Definition: wrapper.c:675
#define CEC_MAX_MSG_SIZE
Definition: wrapper.h:164
@ CEC_OP_NONE
Definition: wrapper.h:373
#define ADV7511_CEC_LOGICADDR_MASK_ADDR0
Definition: wrapper.h:130
void CEC_Isr(CEC_INTERRUPTS *CecInts)
Definition: wrapper.c:1220
void HAL_DelayMs(UINT16 Counter)
Definition: wrapper.c:585
void ATV_I2CWriteTable(UCHAR *Table, UCHAR EndVal)
Definition: wrapper.c:502
UINT16 Cec_Notification(UCHAR Event, UINT16 Len, void *Buff)
#define CEC_RETRY_COUNT
Definition: wrapper.h:163
#define ADV7511_CEC_LOGICADDR2_SHIFT
Definition: wrapper.h:142
@ CEC_EVENT_LOG_ADDR_ALLOC
Definition: wrapper.h:335
uint8_t tx_cnt
Definition: wrapper.h:363
STATIC uint8_t BufIdx
Definition: wrapper.c:102
@ ATVERR_OK
Definition: wrapper.h:321
#define ADV7511_CEC_TX_RETRY_COUNT_SHIFT
Definition: wrapper.h:94
BOOL RxReady3
Definition: wrapper.h:347