Browse Source

projects/rgb_panel: Improve the documentation about pixel format / channels

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Sylvain Munaut 6 years ago
parent
commit
a5dfdf438f
2 changed files with 52 additions and 17 deletions
  1. 25 3
      projects/rgb_panel/README.md
  2. 27 14
      projects/rgb_panel/data/top-icebreaker.pcf

+ 25 - 3
projects/rgb_panel/README.md

@@ -13,6 +13,28 @@ This example has 3 modes of operations explained below. Each
 mode is selected by uncommenting the appropriate `define` at the
 top of the `top.v` file.
 
+Pixel format
+------------
+
+The color mapping from the `BITDEPTH` wide word sent to the core and the
+data sent to the panels in the various channels is fully configurable by
+modifying the `hub75_colormap` module.
+
+The default however is to have the following pixel format for each bit depth:
+ * `BITDEPTH == 8` : `RGB332`
+ * `BITDEPTH == 16` : `RGB565`
+ * `BITDEPTH == 24` : `RGB888`
+(meaning with Red channel in the MSB of the word and sent as litte-endian).
+
+Then the channel mapping is to have :
+ * Channel 0 (`hub75_data[3*n+0]`) = Blue
+ * Channel 1 (`hub75_data[3*n+1]`) = Green
+ * Channel 2 (`hub75_data[3*n+2]`) = Red
+
+Check the file `data/top-icebreaker.pcf` to check that this data channel
+mapping matches your panels since several pinout have been seen in the
+wild.
+
 
 Pattern mode
 ------------
@@ -34,9 +56,9 @@ animation.
 
 To load your own animation in flash, checkout the `ADDR_BASE` and `N_FRAMES`
 parameters that tell the module where to look in flash for the image data.
-It needs to be raw frames, pixel format is either in `RGB332` or `RGB565`
-or `RGB888` depending on the `BITDEPTH` you selected. (Default is 16 bits and
-`RGB565`).
+
+Data needs to be raw frame in RGB565 format, independent of the `BITDEPTH`
+parameter. It will internally convert those to the appropriate bitdepth.
 
 
 Video streaming mode

+ 27 - 14
projects/rgb_panel/data/top-icebreaker.pcf

@@ -1,18 +1,31 @@
 # RGB panel pmod
-set_io -nowarn hub75_addr[4] 28	# B10
-set_io -nowarn hub75_addr[3] 31	# B4
-set_io -nowarn hub75_addr[2] 34	# B3
-set_io -nowarn hub75_addr[1] 38	# B2
-set_io -nowarn hub75_addr[0] 43	# B1
-set_io -nowarn hub75_data[5] 46	# A9
-set_io -nowarn hub75_data[4] 48	# A8
-set_io -nowarn hub75_data[3] 3	# A7
-set_io -nowarn hub75_data[2] 47	# A3
-set_io -nowarn hub75_data[1] 2	# A2
-set_io -nowarn hub75_data[0] 4	# A1
-set_io -nowarn hub75_clk 32	# B9
-set_io -nowarn hub75_le	36	# B8
-set_io -nowarn hub75_blank 42	# B7
+ # Data for panels with Red on pin 1/5 and Blue on pin 3/7
+set_io -nowarn hub75_data[5] 3  # A7 - Red   1
+set_io -nowarn hub75_data[4] 48 # A8 - Green 1
+set_io -nowarn hub75_data[3] 46 # A9 - Blue  1
+set_io -nowarn hub75_data[2] 4  # A1 - Red   0
+set_io -nowarn hub75_data[1] 2  # A2 - Green 0
+set_io -nowarn hub75_data[0] 47 # A3 - Blue  0
+
+ # Data for panels with Red on pin 3/7 and Blue on pin 1/5
+#set_io -nowarn hub75_data[5] 46 # A9 - Red   1
+#set_io -nowarn hub75_data[4] 48 # A8 - Green 1
+#set_io -nowarn hub75_data[3] 3  # A7 - Blue  1
+#set_io -nowarn hub75_data[2] 47 # A3 - Red   0
+#set_io -nowarn hub75_data[1] 2  # A2 - Green 0
+#set_io -nowarn hub75_data[0] 4  # A1 - Blue  0
+
+ # Row address
+set_io -nowarn hub75_addr[4] 28 # B10
+set_io -nowarn hub75_addr[3] 31 # B4
+set_io -nowarn hub75_addr[2] 34 # B3
+set_io -nowarn hub75_addr[1] 38 # B2
+set_io -nowarn hub75_addr[0] 43 # B1
+
+ # Control
+set_io -nowarn hub75_clk 32     # B9
+set_io -nowarn hub75_le 36      # B8
+set_io -nowarn hub75_blank 42   # B7
 
 # SPI Flash
 set_io -nowarn flash_mosi 14