boards.vh 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * boards.vh
  3. *
  4. * vim: ts=4 sw=4 syntax=verilog
  5. *
  6. * Copyright (C) 2019 Sylvain Munaut <tnt@246tNt.com>
  7. * All rights reserved.
  8. *
  9. * BSD 3-clause, see LICENSE.bsd
  10. *
  11. * Redistribution and use in source and binary forms, with or without
  12. * modification, are permitted provided that the following conditions are met:
  13. * * Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions and the following disclaimer.
  15. * * Redistributions in binary form must reproduce the above copyright
  16. * notice, this list of conditions and the following disclaimer in the
  17. * documentation and/or other materials provided with the distribution.
  18. * * Neither the name of the <organization> nor the
  19. * names of its contributors may be used to endorse or promote products
  20. * derived from this software without specific prior written permission.
  21. *
  22. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  23. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  24. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  25. * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  26. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  27. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  28. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  29. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. */
  33. `ifdef BOARD_BITSY_V0
  34. // 1bitsquared iCEbreaker bitsy prototypes (v0.x)
  35. `define HAS_USB
  36. `define HAS_LEDS
  37. `define HAS_RGB
  38. `define RGB_DIM 3
  39. `define RGB_MAP 12'h201 // 41=Blue, 40=Red, 39=Green
  40. `elsif BOARD_BITSY_V1
  41. // 1bitsquared iCEbreaker bitsy prod (v1.x)
  42. `define HAS_USB
  43. `define HAS_LEDS
  44. `define HAS_RGB
  45. `define RGB_DIM 3
  46. `define RGB_MAP 12'h210 // 41=Blue, 40=Green, 39=Red
  47. `elsif BOARD_ICEBREAKER
  48. // 1bitsquare iCEbreaker
  49. `define HAS_USB
  50. `define HAS_LEDS
  51. `define HAS_RGB
  52. `define RGB_DIM 3
  53. `define RGB_MAP 12'h012 // 41=Red, 40=Green, 39=Blue
  54. // `define RGB_MAP 12'h120 // 41=Green, 40=Blue, 39=Red (Hacked v1.0b)
  55. `elsif BOARD_ICEPICK
  56. // iCEpick
  57. `define HAS_RGB
  58. `define HAS_USB
  59. `define RGB_MAP 12'h012 // 41=Red, 40=Green, 39=Blue
  60. // `define RGB_MAP 12'h210 // 41=Blue, 40=Green, 39=Red (Alt RGB LED)
  61. `elsif BOARD_ICE1USB
  62. // icE1usb
  63. `define HAS_USB
  64. `define HAS_RGB
  65. `define RGB_MAP 12'h012 // 41=Red, 40=Green, 39=Blue
  66. `elsif BOARD_E1TRACER
  67. // osmocom E1 tracer
  68. `define HAS_USB
  69. `define HAS_RGB
  70. `define RGB_MAP 12'h012 // 41=Red, 40=Green, 39=Blue
  71. `endif
  72. // Defaults
  73. `ifndef RGB_CURRENT_MODE
  74. `define RGB_CURRENT_MODE "0b1"
  75. `endif
  76. `ifndef RGB0_CURRENT
  77. `define RGB0_CURRENT "0b000001"
  78. `endif
  79. `ifndef RGB1_CURRENT
  80. `define RGB1_CURRENT "0b000001"
  81. `endif
  82. `ifndef RGB2_CURRENT
  83. `define RGB2_CURRENT "0b000001"
  84. `endif
  85. `ifndef RGB_MAP
  86. // [11:8] - Color of RGB2 / pin 41
  87. // [ 7:0] - Color of RGB1 / pin 40
  88. // [ 3:0] - Color of RGB0 / pin 39
  89. // 0=Red 1=Green 2=Blue
  90. `define RGB_MAP 12'h210 // 41=Blue, 40=Green, 39=Red
  91. `endif