st-pincfg.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #ifndef _ST_PINCFG_H_
  2. #define _ST_PINCFG_H_
  3. /* Alternate functions */
  4. #define ALT1 1
  5. #define ALT2 2
  6. #define ALT3 3
  7. #define ALT4 4
  8. #define ALT5 5
  9. #define ALT6 6
  10. #define ALT7 7
  11. /* Output enable */
  12. #define OE (1 << 27)
  13. /* Pull Up */
  14. #define PU (1 << 26)
  15. /* Open Drain */
  16. #define OD (1 << 26)
  17. #define RT (1 << 23)
  18. #define INVERTCLK (1 << 22)
  19. #define CLKNOTDATA (1 << 21)
  20. #define DOUBLE_EDGE (1 << 20)
  21. #define CLK_A (0 << 18)
  22. #define CLK_B (1 << 18)
  23. #define CLK_C (2 << 18)
  24. #define CLK_D (3 << 18)
  25. /* User-frendly defines for Pin Direction */
  26. /* oe = 0, pu = 0, od = 0 */
  27. #define IN (0)
  28. /* oe = 0, pu = 1, od = 0 */
  29. #define IN_PU (PU)
  30. /* oe = 1, pu = 0, od = 0 */
  31. #define OUT (OE)
  32. /* oe = 1, pu = 0, od = 1 */
  33. #define BIDIR (OE | OD)
  34. /* oe = 1, pu = 1, od = 1 */
  35. #define BIDIR_PU (OE | PU | OD)
  36. /* RETIME_TYPE */
  37. /*
  38. * B Mode
  39. * Bypass retime with optional delay parameter
  40. */
  41. #define BYPASS (0)
  42. /*
  43. * R0, R1, R0D, R1D modes
  44. * single-edge data non inverted clock, retime data with clk
  45. */
  46. #define SE_NICLK_IO (RT)
  47. /*
  48. * RIV0, RIV1, RIV0D, RIV1D modes
  49. * single-edge data inverted clock, retime data with clk
  50. */
  51. #define SE_ICLK_IO (RT | INVERTCLK)
  52. /*
  53. * R0E, R1E, R0ED, R1ED modes
  54. * double-edge data, retime data with clk
  55. */
  56. #define DE_IO (RT | DOUBLE_EDGE)
  57. /*
  58. * CIV0, CIV1 modes with inverted clock
  59. * Retiming the clk pins will park clock & reduce the noise within the core.
  60. */
  61. #define ICLK (RT | CLKNOTDATA | INVERTCLK)
  62. /*
  63. * CLK0, CLK1 modes with non-inverted clock
  64. * Retiming the clk pins will park clock & reduce the noise within the core.
  65. */
  66. #define NICLK (RT | CLKNOTDATA)
  67. #endif /* _ST_PINCFG_H_ */