s921_core.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #ifndef _S921_CORE_H
  2. #define _S921_CORE_H
  3. //#define u8 unsigned int
  4. //#define u32 unsigned int
  5. //#define EINVAL -1
  6. #define E_OK 0
  7. struct s921_isdb_t {
  8. void *priv_dev;
  9. int (*i2c_write)(void *dev, u8 reg, u8 val);
  10. int (*i2c_read)(void *dev, u8 reg);
  11. };
  12. #define ISDB_T_CMD_INIT 0
  13. #define ISDB_T_CMD_SET_PARAM 1
  14. #define ISDB_T_CMD_TUNE 2
  15. #define ISDB_T_CMD_GET_STATUS 3
  16. struct s921_isdb_t_tune_params {
  17. u32 frequency;
  18. };
  19. struct s921_isdb_t_status {
  20. };
  21. struct s921_isdb_t_transmission_mode_params {
  22. u8 mode;
  23. u8 layer_a_mode;
  24. #define ISDB_T_LA_MODE_1 0
  25. #define ISDB_T_LA_MODE_2 1
  26. #define ISDB_T_LA_MODE_3 2
  27. u8 layer_a_carrier_modulation;
  28. #define ISDB_T_LA_CM_DQPSK 0
  29. #define ISDB_T_LA_CM_QPSK 1
  30. #define ISDB_T_LA_CM_16QAM 2
  31. #define ISDB_T_LA_CM_64QAM 3
  32. #define ISDB_T_LA_CM_NOLAYER 4
  33. u8 layer_a_code_rate;
  34. #define ISDB_T_LA_CR_1_2 0
  35. #define ISDB_T_LA_CR_2_3 1
  36. #define ISDB_T_LA_CR_3_4 2
  37. #define ISDB_T_LA_CR_5_6 4
  38. #define ISDB_T_LA_CR_7_8 8
  39. #define ISDB_T_LA_CR_NOLAYER 16
  40. u8 layer_a_time_interleave;
  41. #define ISDB_T_LA_TI_0 0
  42. #define ISDB_T_LA_TI_1 1
  43. #define ISDB_T_LA_TI_2 2
  44. #define ISDB_T_LA_TI_4 4
  45. #define ISDB_T_LA_TI_8 8
  46. #define ISDB_T_LA_TI_16 16
  47. #define ISDB_T_LA_TI_32 32
  48. u8 layer_a_nseg;
  49. u8 layer_b_mode;
  50. #define ISDB_T_LB_MODE_1 0
  51. #define ISDB_T_LB_MODE_2 1
  52. #define ISDB_T_LB_MODE_3 2
  53. u8 layer_b_carrier_modulation;
  54. #define ISDB_T_LB_CM_DQPSK 0
  55. #define ISDB_T_LB_CM_QPSK 1
  56. #define ISDB_T_LB_CM_16QAM 2
  57. #define ISDB_T_LB_CM_64QAM 3
  58. #define ISDB_T_LB_CM_NOLAYER 4
  59. u8 layer_b_code_rate;
  60. #define ISDB_T_LB_CR_1_2 0
  61. #define ISDB_T_LB_CR_2_3 1
  62. #define ISDB_T_LB_CR_3_4 2
  63. #define ISDB_T_LB_CR_5_6 4
  64. #define ISDB_T_LB_CR_7_8 8
  65. #define ISDB_T_LB_CR_NOLAYER 16
  66. u8 layer_b_time_interleave;
  67. #define ISDB_T_LB_TI_0 0
  68. #define ISDB_T_LB_TI_1 1
  69. #define ISDB_T_LB_TI_2 2
  70. #define ISDB_T_LB_TI_4 4
  71. #define ISDB_T_LB_TI_8 8
  72. #define ISDB_T_LB_TI_16 16
  73. #define ISDB_T_LB_TI_32 32
  74. u8 layer_b_nseg;
  75. u8 layer_c_mode;
  76. #define ISDB_T_LC_MODE_1 0
  77. #define ISDB_T_LC_MODE_2 1
  78. #define ISDB_T_LC_MODE_3 2
  79. u8 layer_c_carrier_modulation;
  80. #define ISDB_T_LC_CM_DQPSK 0
  81. #define ISDB_T_LC_CM_QPSK 1
  82. #define ISDB_T_LC_CM_16QAM 2
  83. #define ISDB_T_LC_CM_64QAM 3
  84. #define ISDB_T_LC_CM_NOLAYER 4
  85. u8 layer_c_code_rate;
  86. #define ISDB_T_LC_CR_1_2 0
  87. #define ISDB_T_LC_CR_2_3 1
  88. #define ISDB_T_LC_CR_3_4 2
  89. #define ISDB_T_LC_CR_5_6 4
  90. #define ISDB_T_LC_CR_7_8 8
  91. #define ISDB_T_LC_CR_NOLAYER 16
  92. u8 layer_c_time_interleave;
  93. #define ISDB_T_LC_TI_0 0
  94. #define ISDB_T_LC_TI_1 1
  95. #define ISDB_T_LC_TI_2 2
  96. #define ISDB_T_LC_TI_4 4
  97. #define ISDB_T_LC_TI_8 8
  98. #define ISDB_T_LC_TI_16 16
  99. #define ISDB_T_LC_TI_32 32
  100. u8 layer_c_nseg;
  101. };
  102. int s921_isdb_cmd(struct s921_isdb_t *dev, u32 cmd, void *data);
  103. #endif