cs2000.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #ifndef CS2000_H_INCLUDED
  2. #define CS2000_H_INCLUDED
  3. #define CS2000_DEV_ID 0x01
  4. #define CS2000_DEV_CTRL 0x02
  5. #define CS2000_DEV_CFG_1 0x03
  6. #define CS2000_DEV_CFG_2 0x04
  7. #define CS2000_GLOBAL_CFG 0x05
  8. #define CS2000_RATIO_0 0x06 /* 32 bits, big endian */
  9. #define CS2000_RATIO_1 0x0a
  10. #define CS2000_RATIO_2 0x0e
  11. #define CS2000_RATIO_3 0x12
  12. #define CS2000_FUN_CFG_1 0x16
  13. #define CS2000_FUN_CFG_2 0x17
  14. #define CS2000_FUN_CFG_3 0x1e
  15. /* DEV_ID */
  16. #define CS2000_DEVICE_MASK 0xf8
  17. #define CS2000_REVISION_MASK 0x07
  18. /* DEV_CTRL */
  19. #define CS2000_UNLOCK 0x80
  20. #define CS2000_AUX_OUT_DIS 0x02
  21. #define CS2000_CLK_OUT_DIS 0x01
  22. /* DEV_CFG_1 */
  23. #define CS2000_R_MOD_SEL_MASK 0xe0
  24. #define CS2000_R_MOD_SEL_1 0x00
  25. #define CS2000_R_MOD_SEL_2 0x20
  26. #define CS2000_R_MOD_SEL_4 0x40
  27. #define CS2000_R_MOD_SEL_8 0x60
  28. #define CS2000_R_MOD_SEL_1_2 0x80
  29. #define CS2000_R_MOD_SEL_1_4 0xa0
  30. #define CS2000_R_MOD_SEL_1_8 0xc0
  31. #define CS2000_R_MOD_SEL_1_16 0xe0
  32. #define CS2000_R_SEL_MASK 0x18
  33. #define CS2000_R_SEL_SHIFT 3
  34. #define CS2000_AUX_OUT_SRC_MASK 0x06
  35. #define CS2000_AUX_OUT_SRC_REF_CLK 0x00
  36. #define CS2000_AUX_OUT_SRC_CLK_IN 0x02
  37. #define CS2000_AUX_OUT_SRC_CLK_OUT 0x04
  38. #define CS2000_AUX_OUT_SRC_PLL_LOCK 0x06
  39. #define CS2000_EN_DEV_CFG_1 0x01
  40. /* DEV_CFG_2 */
  41. #define CS2000_LOCK_CLK_MASK 0x06
  42. #define CS2000_LOCK_CLK_SHIFT 1
  43. #define CS2000_FRAC_N_SRC_MASK 0x01
  44. #define CS2000_FRAC_N_SRC_STATIC 0x00
  45. #define CS2000_FRAC_N_SRC_DYNAMIC 0x01
  46. /* GLOBAL_CFG */
  47. #define CS2000_FREEZE 0x08
  48. #define CS2000_EN_DEV_CFG_2 0x01
  49. /* FUN_CFG_1 */
  50. #define CS2000_CLK_SKIP_EN 0x80
  51. #define CS2000_AUX_LOCK_CFG_MASK 0x40
  52. #define CS2000_AUX_LOCK_CFG_PP_HIGH 0x00
  53. #define CS2000_AUX_LOCK_CFG_OD_LOW 0x40
  54. #define CS2000_REF_CLK_DIV_MASK 0x18
  55. #define CS2000_REF_CLK_DIV_4 0x00
  56. #define CS2000_REF_CLK_DIV_2 0x08
  57. #define CS2000_REF_CLK_DIV_1 0x10
  58. /* FUN_CFG_2 */
  59. #define CS2000_CLK_OUT_UNL 0x10
  60. #define CS2000_L_F_RATIO_CFG_MASK 0x08
  61. #define CS2000_L_F_RATIO_CFG_20_12 0x00
  62. #define CS2000_L_F_RATIO_CFG_12_20 0x08
  63. /* FUN_CFG_3 */
  64. #define CS2000_CLK_IN_BW_MASK 0x70
  65. #define CS2000_CLK_IN_BW_1 0x00
  66. #define CS2000_CLK_IN_BW_2 0x10
  67. #define CS2000_CLK_IN_BW_4 0x20
  68. #define CS2000_CLK_IN_BW_8 0x30
  69. #define CS2000_CLK_IN_BW_16 0x40
  70. #define CS2000_CLK_IN_BW_32 0x50
  71. #define CS2000_CLK_IN_BW_64 0x60
  72. #define CS2000_CLK_IN_BW_128 0x70
  73. #endif