piSmasher Configuration Libraries
piSmasher peripheral device configuration libraries
tda998x.h File Reference

NXP TDA998x HDMI Transmitter FreeBSD. More...

#include <stdint.h>
#include <stdbool.h>

Go to the source code of this file.

Data Structures

struct  tda998x_mtx_coeff
 
struct  tda998x_pkt
 Metadata packet structure. More...
 
struct  tda998x_mpeg_pkt
 
struct  tda998x_spd_pkt
 
struct  tda998x_vidin_cfg
 Video Input Configuration. More...
 
struct  tda998x_vidout_cfg
 Video Output Configuration. More...
 
struct  tda998x_edid
 
struct  tda998x_aud_packet
 
struct  tda998x_aud_ch_status
 
struct  tda998x_aud_if_pkt
 
struct  tda998x_audin_cfg
 
struct  tda998x_cfg
 TDA998X driver configuration. More...
 
struct  tda998x_dev
 TDA998X device. More...
 

Macros

#define MTX_COEFF_LEN   (9)
 
#define EDID_BLOCK_SIZE   (128)
 

Enumerations

enum  tda998x_sink { SINK_DVI = 0, SINK_HDMI = 0x01, SINK_EDID = 0x02 }
 
enum  tda998x_vid_fmt {
  VFMT_INVALID = 0, VFMT_01_640x480p_60Hz = 1, VFMT_02_720x480p_60Hz = 2, VFMT_03_720x480p_60Hz = 3,
  VFMT_04_1280x720p_60Hz = 4, VFMT_05_1920x1080i_60Hz = 5, VFMT_06_720x480i_60Hz = 6, VFMT_07_720x480i_60Hz = 7,
  VFMT_08_720x240p_60Hz = 8, VFMT_09_720x240p_60Hz = 9, VFMT_10_720x480i_60Hz = 10, VFMT_11_720x480i_60Hz = 11,
  VFMT_12_720x240p_60Hz = 12, VFMT_13_720x240p_60Hz = 13, VFMT_14_1440x480p_60Hz = 14, VFMT_15_1440x480p_60Hz = 15,
  VFMT_16_1920x1080p_60Hz = 16, VFMT_17_720x576p_50Hz = 17, VFMT_18_720x576p_50Hz = 18, VFMT_19_1280x720p_50Hz = 19,
  VFMT_20_1920x1080i_50Hz = 20, VFMT_21_720x576i_50Hz = 21, VFMT_22_720x576i_50Hz = 22, VFMT_23_720x288p_50Hz = 23,
  VFMT_24_720x288p_50Hz = 24, VFMT_25_720x576i_50Hz = 25, VFMT_26_720x576i_50Hz = 26, VFMT_27_720x288p_50Hz = 27,
  VFMT_28_720x288p_50Hz = 28, VFMT_29_1440x576p_50Hz = 29, VFMT_30_1440x576p_50Hz = 30, VFMT_31_1920x1080p_50Hz = 31,
  VFMT_32_1920x1080p_24Hz = 32, VFMT_33_1920x1080p_25Hz = 33, VFMT_34_1920x1080p_30Hz = 34, VFMT_35_2880x480p_60Hz = 35,
  VFMT_36_2880x480p_60Hz = 36, VFMT_37_2880x576p_50Hz = 37, VFMT_38_2880x576p_50Hz = 38, VFMT_60_1280x720p_24Hz = 60,
  VFMT_61_1280x720p_25Hz = 61, VFMT_62_1280x720p_30Hz = 62, VFMT_PC_640x480p_60Hz = 128, VFMT_PC_800x600p_60Hz = 129,
  VFMT_PC_1152x960p_60Hz = 130, VFMT_PC_1024x768p_60Hz = 131, VFMT_PC_1280x768p_60Hz = 132, VFMT_PC_1280x1024p_60Hz = 133,
  VFMT_PC_1366x768p_60Hz = 134, VFMT_PC_1400x1050p_60Hz = 135, VFMT_PC_1600x1200p_60Hz = 136, VFMT_PC_1920x1200p_60Hz = 137
}
 EIA/CEA-861B video format type. More...
 
enum  tda998x_vidin_mode { VINMODE_CCIR656 = 0, VINMODE_RGB444 = 1, VINMODE_YUV444 = 2, VINMODE_YUV422 = 3 }
 
enum  tda998x_sync_src { SYNCSRC_EMBEDDED = 0, SYNCSRC_EXT_VREF = 1, SYNCSRC_EXT_VS = 2 }
 
enum  tda998x_pix_rate { PIXRATE_DOUBLE = 0, PIXRATE_SINGLE = 1, PIXRATE_SINGLE_REPEATED = 2 }
 
enum  tda998x_upsample { UPSAMPLE_BYPASS = 0, UPSAMPLE_COPY = 1, UPSAMPLE_INTERPOLATE = 2, UPSAMPLE_AUTO = 3 }
 
enum  tda998x_pix_tgl { PIXTOGL_NO_ACTION = 0, PIXTOGL_ENABLE = 1 }
 
enum  tda998x_scaler_mode { SCALER_MODE_OFF = 0, SCALER_MODE_ON = 1, SCALER_MODE_AUTO = 2 }
 
enum  tda998x_mtx_mode { MTX_MODE_OFF = 0, MTX_MODE_AUTO = 1 }
 
enum  tda998x_format_3d { FORMAT_3D_NONE = 0, FORMAT_3D_FRAME_PACKING = 1, FORMAT_3D_TOP_AND_BOTTOM = 2, FORMAT_3D_SIDE_BY_SIDEF = 3 }
 
enum  tda998x_vidout_mode { VOUTMODE_RGB444 = 0, VOUTMODE_YUV422 = 1, VOUTMODE_YUV444 = 2 }
 
enum  tda998x_dwidth { VOUT_DBITS_12 = 0, VOUT_DBITS_8 = 1, VOUT_DBITS_10 = 2 }
 
enum  tda998x_color_depth { COLORDEPTH_24 = 0, COLORDEPTH_30 = 1, COLORDEPTH_36 = 2, COLORDEPTH_48 = 3 }
 
enum  tda998x_vqr { VQR_DEFAULT = 0, VQR_RGB_FULL = 1, VQR_RGB_LIMITED = 2 }
 Video quantization range. More...
 
enum  tda998x_mpeg_frame { MPEG_FRAME_UNKNOWN = 0, MPEG_FRAME_I = 1, MPEG_FRAME_B = 2, MPEG_FRAME_P = 3 }
 
enum  tda998x_spd_dev {
  SPDINFO_UNKNOWN = 0, SPDINFO_DIGITAL_STB = 1, SPDINFO_DVD = 2, SPDINFO_DVHS = 3,
  SPDINFO_HDD_VIDEO = 4, SPDINFO_DVC = 5, SPDINFO_DSC = 6, SPDINFO_VIDEO_CD = 7,
  SPDINFO_GAME = 8, SPDINFO_PC = 9
}
 
enum  tda998x_edid_state { EDID_NOT_READ = 0, EDID_READ, EDID_ERR_BLOCK_0 }
 
enum  tda998x_aud_fmt {
  AFMT_SPDIF = 0, AFMT_I2S = 1, AFMT_OBA = 2, AFMT_DST = 3,
  AFMT_HBR = 4
}
 
enum  tda998x_cts_ref { CTSREF_ACLK = 0, CTSREF_MCLK = 1, CTSREF_FS64SPDIF = 2 }
 
enum  tda998x_ctsk {
  CTSK1 = 0, CTSK2 = 1, CTSK3 = 2, CTSK4 = 3,
  CTSK8 = 4, CTSK_USE_CTSX = 5
}
 
enum  tda998x_ctsm {
  CTSMTS = 0, CTSMTS2 = 1, CTSMTS4 = 2, CTSMTS8 = 3,
  CTSMTS_USE_CTSX = 4
}
 
enum  tda998x_aud_rate {
  AFS_32K = 0, AFS_44K = 1, AFS_48K = 2, AFS_88K = 3,
  AFS_96K = 4, AFS_176K = 5, AFS_192K = 6
}
 
enum  tda998x_aud_i2s_wlen { I2S_WLEN_16BITS = 16, I2S_WLEN_32BITS = 32, I2S_WLEN_OTHERS = 0 }
 Audio I2S word length. More...
 
enum  tda998x_aud_i2s_fmt {
  I2S_FMT_PHILIPS_L = 12, I2S_FMT_OTH_L = 14, I2S_FMT_OTH_R_16 = 11, I2S_FMT_OTH_R_20 = 7,
  I2S_FMT_OTH_R = 15
}
 Audio I2S format. More...
 
enum  tda998x_clkpol_dsd { CLKPOLDSD_ACLK = 0, CLKPOLDSD_NACLK = 0x04 }
 DSD clock polarities. More...
 
enum  tda998x_swap_dsd { SWAPDSD_OFF = 0, SWAPDSD_ON = 0x02 }
 DSD data swap values. More...
 
enum  tda998x_dst_rate { DST_RATE_SINGLE = 0, DST_RATE_DOUBLE = 1 }
 DSD data transfer rates. More...
 
enum  tda998x_state { TDA998X_STATE_ON, TDA998X_STATE_STANDBY, TDA998X_STATE_SUSPEND, TDA998X_STATE_OFF }
 TDA998X state. More...
 
enum  tda998x_hotplug_status { HOTPLUG_INACTIVE = 0, HOTPLUG_ACTIVE }
 
enum  tda998x_callback {
  CALLBACK_ENCRYPT, CALLBACK_HPD, CALLBACK_T0, CALLBACK_BCAPS,
  CALLBACK_BSTATUS, CALLBACK_SHA_1, CALLBACK_PJ, CALLBACK_R0,
  CALLBACK_SW_INT, CALLBACK_RX_SENSE, CALLBACK_EDID_BLK_READ, CALLBACK_PLL_LOCK,
  CALLBACK_VS_RPT
}
 

Functions

int tda998x_init (struct tda998x_dev *dev, struct tda998x_cfg *cfg)
 
int tda998x_edid_get_block (struct tda998x_dev *dev, uint8_t *block, int nblocks, int len)
 Get EDID Block Data. More...
 
int tda998x_read_edid (struct tda998x_dev *dev, uint8_t *data)
 
int tda998x_get_hotplug_status (struct tda998x_dev *dev, enum tda998x_hotplug_status *hotplug_status, bool client)
 
int tda998x_set_input_output (struct tda998x_dev *dev, struct tda998x_vidin_cfg *vidin_cfg, struct tda998x_vidout_cfg *vidout_cfg, struct tda998x_audin_cfg *audin_cfg, enum tda998x_sink sink)
 Set Input and Output. More...
 
int tda998x_handle_interrupt (struct tda998x_dev *dev)
 

Detailed Description

NXP TDA998x HDMI Transmitter FreeBSD.

Author
R. Bush bush@.nosp@m.krtk.nosp@m.l.com
Version
v1.0
Date
2017 November 10 Copyright (c) 2017, krtkl inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project.