fyf_tuner.h
上传用户:sunhongbo
上传日期:2022-01-25
资源大小:3010k
文件大小:6k
源码类别:

数据库系统

开发平台:

C/C++

  1. /******************************************************************************/
  2. /*    Copyright (c) 2008 Embedded Internet Solutions, Inc                     */
  3. /*    All rights reserved. You are not allowed to copy or distribute          */
  4. /*    the code without permission.                                            */
  5. /*    This is the demo implenment of the Porting APIs needed by            */
  6. /*    MiddleWare.                                                             */
  7. /*    Maybe you should modify it accorrding to Platform.                      */
  8. /*                                                                            */
  9. /*    $author szhy 2008/09/23                                              */
  10. /******************************************************************************/ 
  11. #ifndef __FYF_TUNER_H__
  12. #define __FYF_TUNER_H__
  13. typedef enum
  14. {
  15. FYF_TUNER_STATUS_SUCCESS,
  16. FYF_TUNER_STATUS_FAIL
  17. }FYF_TUNER_STATUS;
  18. #define FYF_TUNER_LOCKED FYF_TUNER_STATUS_SUCCESS
  19. #define FYF_TUNER_LOST FYF_TUNER_STATUS_FAIL
  20. typedef void (*FYF_TUNER_NOTIFY_FUNC)(BU32 id, FYF_TUNER_STATUS status); 
  21. typedef enum
  22. {
  23. FYF_TUNER_GET_QUALITY=1,
  24. FYF_TUNER_GET_STRENGTH,
  25. FYF_TUNER_GET_BER,
  26. FYF_TUNER_GET_LEVEL,
  27. FYF_TUNER_GET_SNR,
  28. FYF_TUNER_TIME_OUT /* 锁tuner延时 */
  29. }FYF_TUNER_IOCTL_e;
  30. typedef struct
  31. {
  32. BS32 (*FYF_CPI_tuner_set_notify)(FYF_TUNER_NOTIFY_FUNC func);
  33. BS32 (*FYF_CPI_tuner_lock_delivery)(BS32 tunerid, BS32 frequency, BS32 symbol_rate, BS32 modulation, BS32 request_id);
  34. BS32 (*FYF_CPI_tuner_get_signal_quality)(BS32 tunerid);
  35. BS32 (*FYF_CPI_tuner_get_signal_strength)(BS32 tunerid);
  36. BS32 (*FYF_CPI_tuner_get_signal_ber)(BS32 tunerid);
  37. BS32 (*FYF_CPI_tuner_get_status)(BS32 tunerid);
  38. BS32 (*FYF_CPI_tuner_ioctl)(BS32 tunerid, FYF_TUNER_IOCTL_e op, void *arg); 
  39. }FYF_TUNER_PORTING;
  40. typedef enum
  41. {
  42. FYF_TUNER_MOD_QAM16 = 0,
  43. FYF_TUNER_MOD_QAM32 = 1,
  44. FYF_TUNER_MOD_QAM64 = 2,
  45. FYF_TUNER_MOD_QAM128= 3,
  46. FYF_TUNER_MOD_QAM256= 4
  47. }FYF_TUNER_MOD_e;
  48. /******************************************************************************/
  49. /*Description: register tuner                                                 */
  50. /*Input      : porting       */
  51. /*Output     : no                                                             */
  52. /*Return     : no                                                             */
  53. /******************************************************************************/
  54. void FYF_API_tuner_register(FYF_TUNER_PORTING *porting);
  55. /******************************************************************************/
  56. /*Description: set notify func                                                */
  57. /*Input      : func       */
  58. /*Output     : no                                                             */
  59. /*Return     : 0 success, -1 failure                                          */
  60. /******************************************************************************/
  61. BS32 FYF_API_tuner_set_notify(FYF_TUNER_NOTIFY_FUNC func);
  62. /******************************************************************************/
  63. /*Description: tuner lock delivery                                            */
  64. /*Input      : tunerid,frequency,symbol_rate,modulation,request_id         */
  65. /*Output     : no                                                             */
  66. /*Return     : 0 success, -1 failure                                          */
  67. /******************************************************************************/
  68. BS32 FYF_API_tuner_lock_delivery(BS32 tunerid, BS32 frequency, BS32 symbol_rate, BS32 modulation, BS32 request_id);
  69. /******************************************************************************/
  70. /*Description: get signal quality                                             */
  71. /*Input      : tunerid          */
  72. /*Output     : no                                                             */
  73. /*Return     : >0 success, -1 failure                                         */
  74. /******************************************************************************/
  75. BS32 FYF_API_tuner_get_signal_quality(BS32 tunerid);
  76. /******************************************************************************/
  77. /*Description: get signal strength                                            */
  78. /*Input      : tunerid          */
  79. /*Output     : no                                                             */
  80. /*Return     : >0 success, -1 failure                                         */
  81. /******************************************************************************/
  82. BS32 FYF_API_tuner_get_signal_strength(BS32 tunerid);
  83. /******************************************************************************/
  84. /*Description: get signal ber                                                 */
  85. /*Input      : tunerid          */
  86. /*Output     : no                                                             */
  87. /*Return     : >0 success, -1 failure                                         */
  88. /******************************************************************************/
  89. BS32 FYF_API_tuner_get_signal_ber(BS32 tunerid);
  90. /******************************************************************************/
  91. /*Description: get status                                                     */
  92. /*Input      : tunerid          */
  93. /*Output     : no                                                             */
  94. /*Return     : FYF_TUNER_LOST:no locked,FYF_TUNER_LOCKED:locked            */
  95. /*    FYF_ERR: failure                                               */
  96. /******************************************************************************/
  97. BS32 FYF_API_tuner_get_status(BS32 tunerid);
  98. /******************************************************************************/
  99. /*Description: ioctl                                                          */
  100. /*Input      : tunerid,op                 */
  101. /*Output     : arg                                                            */
  102. /*Return     : FYF_OK:success;FYF_ERR:fail   */
  103. /******************************************************************************/
  104. BS32 FYF_API_tuner_ioctl(BS32 tunerid, FYF_TUNER_IOCTL_e op, void *arg);
  105. #endif