piSmasher Configuration Libraries
piSmasher peripheral device configuration libraries
tda1997x.h
Go to the documentation of this file.
1 
46 #ifndef __TDA1997X_H
47 #define __TDA1997X_H
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
57 enum tda1997x_filters_ctrl_prefil {
58  FILTERS_CTRL_PREFILTER_OFF = 0x00,
59  FILTERS_CTRL_PREFILTER_2TAPS = 0x01,
60  FILTERS_CTRL_PREFILTER_7TAPS = 0X02,
61  FILTERS_CTRL_PREFILTER_27TAPS = 0x03
62 };
63 
64 enum tda1997x_of_ctrl_format {
65  OF_CTRL_FORMAT_444 = 0x00,
66  OF_CTRL_FORMAT_422_SMP = 0x01,
67  OF_CTRL_FORMAT_422_CCIR = 0x02
68 };
69 
74 enum tda1997x_audio_freq {
75  AUDIO_FREQ_HEADER = 0x00,
76  AUDIO_FREQ_32kHz = 0x01,
77  AUDIO_FREQ_44_1kHz = 0x02,
78  AUDIO_FREQ_48kHz = 0x03,
79  AUDIO_FREQ_88_2kHz = 0x04,
80  AUDIO_FREQ_96kHz = 0x05,
81  AUDIO_FREQ_176kHz = 0x06,
82  AUDIO_FREQ_192kHz = 0x07
83 };
84 
89  AUDIO_SEL_MODE_DST = 0x03
90 };
95 struct tda1997x_mtp_seed {
96  uint16_t lookup;
97  uint16_t seed;
98 };
99 
100 struct tda1997x_dev;
101 
105 struct tda1997x_irq_event {
106  uint8_t irq;
107  uint8_t en;
108  int (*handler) (struct tda1997x_dev *ref, uint8_t flags);
109 };
111 struct tda1997x_irq_source {
112  uint16_t clr_reg;
113  uint16_t mask_reg;
114  struct tda1997x_irq_event *events;
115 };
116 
124 };
125 
126 
130 struct tda1997x_vid_cfg {
131  enum tda1997x_vid_fmt fmt;
132  uint8_t vpconf;
133  uint8_t mute;
134 };
135 
139 struct tda1997x_cfg {
140  uint8_t id;
141  uint16_t i2c_addr;
142  uint16_t cec_addr;
143  int (*i2c_write) (uint16_t addr, uint8_t reg, uint8_t *data);
144  int (*i2c_read) (uint16_t addr, uint8_t reg, uint8_t *data);
145  uint8_t cur_page;
146 };
147 
151 struct tda1997x_dev {
152  int id;
153  struct tda1997x_cfg *cfg;
154  struct tda1997x_event *events;
155 };
156 
157 int tda1997x_init(struct tda1997x_dev *dev, struct tda1997x_cfg *cfg, uint8_t *edid_block, uint8_t *edid_ext);
158 int tda1997x_handle_irq(struct tda1997x_dev *dev);
159 int tda1997x_cfg_vid_out(struct tda1997x_dev *dev);
160 int tda1997x_cfg_vp(struct tda1997x_dev *dev, uint8_t *vp_conf);
161 int tda1997x_cfg_prefilter(struct tda1997x_dev *dev,
162  enum tda1997x_filters_ctrl_prefil bu,
163  enum tda1997x_filters_ctrl_prefil rv);
164 int tda1997x_cfg_audio_fmt(struct tda1997x_dev *dev);
166 int tda1997x_get_audio_flags(struct tda1997x_dev *dev, uint8_t *status);
167 int tda1997x_get_audio_freq(struct tda1997x_dev *dev, enum tda1997x_audio_freq *freq);
168 int tda1997x_cfg_edid(struct tda1997x_dev *dev, uint8_t *edid, uint8_t *edid_ext);
169 int tda1997x_get_timing(struct tda1997x_dev *dev, uint8_t *data);
174 #ifdef __cplusplus
175 }
176 #endif
177 
178 #endif /* __TDA1997X_H */
tda1997x_vid_fmt
TDA1997X video format.
Definition: tda1997x.h:119
int tda1997x_cfg_edid(struct tda1997x_dev *dev, uint8_t *edid, uint8_t *edid_ext)
Configure EDID.
Definition: tda1997x.c:2437
Definition: tda1997x.h:86
Definition: tda1997x.h:85
int tda1997x_get_audio_freq(struct tda1997x_dev *dev, enum tda1997x_audio_freq *freq)
Get Audio Frequency.
Definition: tda1997x.c:2346
int tda1997x_get_timing(struct tda1997x_dev *dev, uint8_t *data)
Get Timing Values Sets an data memory block to the video timing register values.
Definition: tda1997x.c:2638
int tda1997x_cfg_vp(struct tda1997x_dev *dev, uint8_t *vp_conf)
Configure Video Port.
Definition: tda1997x.c:2071
TDA1997X driver configuration.
Definition: tda1997x.h:138
Definition: tda1997x.h:94
int tda1997x_init(struct tda1997x_dev *dev, struct tda1997x_cfg *cfg, uint8_t *edid_block, uint8_t *edid_ext)
Initialize TDA1997x HDMI Receiver.
Definition: tda1997x.c:2662
TDA1997X interrupt event.
Definition: tda1997x.h:104
int tda1997x_cfg_prefilter(struct tda1997x_dev *dev, enum tda1997x_filters_ctrl_prefil bu, enum tda1997x_filters_ctrl_prefil rv)
Configure Prefilter.
Definition: tda1997x.c:2193
Definition: tda1997x.h:122
int tda1997x_cfg_audio_fmt(struct tda1997x_dev *dev)
Configure Audio Format.
Definition: tda1997x.c:2223
Definition: tda1997x.h:120
int tda1997x_cfg_vid_out(struct tda1997x_dev *dev)
Configure Video Output Format.
Definition: tda1997x.c:2116
Definition: tda1997x.h:121
TDA1997X video configuration.
Definition: tda1997x.h:129
tda1997x_audio_sel_mode
Definition: tda1997x.h:84
TDA1997X device structure.
Definition: tda1997x.h:150
Definition: tda1997x.h:87
int tda1997x_cfg_audio_mode(struct tda1997x_dev *dev, enum tda1997x_audio_sel_mode mode)
Configure Audio Selection.
Definition: tda1997x.c:2320
int tda1997x_handle_irq(struct tda1997x_dev *dev)
Handle TDA1997x Interrupt.
Definition: tda1997x.c:3346
Definition: tda1997x.h:88
int tda1997x_get_audio_flags(struct tda1997x_dev *dev, uint8_t *status)
Get Audio Status.
Definition: tda1997x.c:2333
Definition: tda1997x.h:110