OpenCores
URL https://opencores.org/ocsvn/neorv32/neorv32/trunk

Subversion Repositories neorv32

[/] [neorv32/] [trunk/] [rtl/] [core/] [neorv32_neoled.vhd] - Blame information for rev 65

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 52 zero_gravi
-- #################################################################################################
2
-- # << NEORV32 - Smart LED (WS2811/WS2812) Interface (NEOLED) >>                                  #
3
-- # ********************************************************************************************* #
4 62 zero_gravi
-- # Hardware interface for direct control of "smart LEDs" using an asynchronous serial data       #
5 52 zero_gravi
-- # line. Compatible with the WS2811 and WS2812 LEDs.                                             #
6
-- #                                                                                               #
7 62 zero_gravi
-- # NeoPixel-compatible, RGB (24-bit) and RGBW (32-bit) modes supported (in "parallel")           #
8
-- # (TM) "NeoPixel" is a trademark of Adafruit Industries.                                        #
9 52 zero_gravi
-- #                                                                                               #
10 62 zero_gravi
-- # The interface uses a programmable carrier frequency (800 KHz for the WS2812 LEDs)             #
11 52 zero_gravi
-- # configurable via the control register's clock prescaler bits (ctrl_clksel*_c) and the period  #
12
-- # length configuration bits (ctrl_t_tot_*_c). "high-times" for sending a ZERO or a ONE bit are  #
13
-- # configured using the ctrl_t_0h_*_c and ctrl_t_1h_*_c bits, respectively. 32-bit transfers     #
14
-- # (for RGBW modules) and 24-bit transfers (for RGB modules) are supported via ctrl_mode__c.     #
15
-- #                                                                                               #
16 65 zero_gravi
-- # The device features a TX buffer (FIFO) with <FIFO_DEPTH> entries with configurable interrupt. #
17 52 zero_gravi
-- # ********************************************************************************************* #
18
-- # BSD 3-Clause License                                                                          #
19
-- #                                                                                               #
20
-- # Copyright (c) 2021, Stephan Nolting. All rights reserved.                                     #
21
-- #                                                                                               #
22
-- # Redistribution and use in source and binary forms, with or without modification, are          #
23
-- # permitted provided that the following conditions are met:                                     #
24
-- #                                                                                               #
25
-- # 1. Redistributions of source code must retain the above copyright notice, this list of        #
26
-- #    conditions and the following disclaimer.                                                   #
27
-- #                                                                                               #
28
-- # 2. Redistributions in binary form must reproduce the above copyright notice, this list of     #
29
-- #    conditions and the following disclaimer in the documentation and/or other materials        #
30
-- #    provided with the distribution.                                                            #
31
-- #                                                                                               #
32
-- # 3. Neither the name of the copyright holder nor the names of its contributors may be used to  #
33
-- #    endorse or promote products derived from this software without specific prior written      #
34
-- #    permission.                                                                                #
35
-- #                                                                                               #
36
-- # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS   #
37
-- # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF               #
38
-- # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE    #
39
-- # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,     #
40
-- # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE #
41
-- # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED    #
42
-- # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING     #
43
-- # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED  #
44
-- # OF THE POSSIBILITY OF SUCH DAMAGE.                                                            #
45
-- # ********************************************************************************************* #
46
-- # The NEORV32 Processor - https://github.com/stnolting/neorv32              (c) Stephan Nolting #
47
-- #################################################################################################
48
 
49
library ieee;
50
use ieee.std_logic_1164.all;
51
use ieee.numeric_std.all;
52
 
53
library neorv32;
54
use neorv32.neorv32_package.all;
55
 
56
entity neorv32_neoled is
57 62 zero_gravi
  generic (
58
    FIFO_DEPTH : natural -- TX FIFO depth (1..32k, power of two)
59
  );
60 52 zero_gravi
  port (
61
    -- host access --
62
    clk_i       : in  std_ulogic; -- global clock line
63
    addr_i      : in  std_ulogic_vector(31 downto 0); -- address
64
    rden_i      : in  std_ulogic; -- read enable
65
    wren_i      : in  std_ulogic; -- write enable
66
    data_i      : in  std_ulogic_vector(31 downto 0); -- data in
67
    data_o      : out std_ulogic_vector(31 downto 0); -- data out
68
    ack_o       : out std_ulogic; -- transfer acknowledge
69
    -- clock generator --
70
    clkgen_en_o : out std_ulogic; -- enable clock generator
71
    clkgen_i    : in  std_ulogic_vector(07 downto 0);
72
    -- interrupt --
73
    irq_o       : out std_ulogic; -- interrupt request
74
    -- NEOLED output --
75
    neoled_o    : out std_ulogic -- serial async data line
76
  );
77
end neorv32_neoled;
78
 
79
architecture neorv32_neoled_rtl of neorv32_neoled is
80
 
81
  -- IO space: module base address --
82
  constant hi_abb_c : natural := index_size_f(io_size_c)-1; -- high address boundary bit
83
  constant lo_abb_c : natural := index_size_f(neoled_size_c); -- low address boundary bit
84
 
85
  -- access control --
86
  signal acc_en : std_ulogic; -- module access enable
87
  signal addr   : std_ulogic_vector(31 downto 0); -- access address
88
  signal wren   : std_ulogic; -- word write enable
89
  signal rden   : std_ulogic; -- read enable
90
 
91
  -- Control register bits --
92 65 zero_gravi
  constant ctrl_enable_c   : natural :=  0; -- r/w: module enable
93
  constant ctrl_mode_c     : natural :=  1; -- r/w: 0 = 24-bit RGB mode, 1 = 32-bit RGBW mode
94
  constant ctrl_strobe_c   : natural :=  2; -- r/w: 0 = send normal data, 1 = send LED strobe command (RESET) on data write
95 62 zero_gravi
  --
96 65 zero_gravi
  constant ctrl_clksel0_c  : natural :=  3; -- r/w: prescaler select bit 0
97
  constant ctrl_clksel1_c  : natural :=  4; -- r/w: prescaler select bit 1
98
  constant ctrl_clksel2_c  : natural :=  5; -- r/w: prescaler select bit 2
99 52 zero_gravi
  --
100 65 zero_gravi
  constant ctrl_bufs_0_c   : natural :=  6; -- r/-: log2(FIFO_DEPTH) bit 0
101
  constant ctrl_bufs_1_c   : natural :=  7; -- r/-: log2(FIFO_DEPTH) bit 1
102
  constant ctrl_bufs_2_c   : natural :=  8; -- r/-: log2(FIFO_DEPTH) bit 2
103
  constant ctrl_bufs_3_c   : natural :=  9; -- r/-: log2(FIFO_DEPTH) bit 3
104 52 zero_gravi
  --
105 65 zero_gravi
  constant ctrl_t_tot_0_c  : natural := 10; -- r/w: pulse-clock ticks per total period bit 0
106
  constant ctrl_t_tot_1_c  : natural := 11; -- r/w: pulse-clock ticks per total period bit 1
107
  constant ctrl_t_tot_2_c  : natural := 12; -- r/w: pulse-clock ticks per total period bit 2
108
  constant ctrl_t_tot_3_c  : natural := 13; -- r/w: pulse-clock ticks per total period bit 3
109
  constant ctrl_t_tot_4_c  : natural := 14; -- r/w: pulse-clock ticks per total period bit 4
110 52 zero_gravi
  --
111 65 zero_gravi
  constant ctrl_t_0h_0_c   : natural := 15; -- r/w: pulse-clock ticks per ZERO high-time bit 0
112
  constant ctrl_t_0h_1_c   : natural := 16; -- r/w: pulse-clock ticks per ZERO high-time bit 1
113
  constant ctrl_t_0h_2_c   : natural := 17; -- r/w: pulse-clock ticks per ZERO high-time bit 2
114
  constant ctrl_t_0h_3_c   : natural := 18; -- r/w: pulse-clock ticks per ZERO high-time bit 3
115
  constant ctrl_t_0h_4_c   : natural := 19; -- r/w: pulse-clock ticks per ZERO high-time bit 4
116 52 zero_gravi
  --
117 65 zero_gravi
  constant ctrl_t_1h_0_c   : natural := 20; -- r/w: pulse-clock ticks per ONE high-time bit 0
118
  constant ctrl_t_1h_1_c   : natural := 21; -- r/w: pulse-clock ticks per ONE high-time bit 1
119
  constant ctrl_t_1h_2_c   : natural := 22; -- r/w: pulse-clock ticks per ONE high-time bit 2
120
  constant ctrl_t_1h_3_c   : natural := 23; -- r/w: pulse-clock ticks per ONE high-time bit 3
121
  constant ctrl_t_1h_4_c   : natural := 24; -- r/w: pulse-clock ticks per ONE high-time bit 4
122 52 zero_gravi
  --
123 65 zero_gravi
  constant ctrl_irq_conf_c : natural := 27; -- r/w: interrupt config: 1=IRQ when buffer is empty, 0=IRQ when buffer is half-empty
124
  constant ctrl_tx_empty_c : natural := 28; -- r/-: TX FIFO is empty
125
  constant ctrl_tx_half_c  : natural := 29; -- r/-: TX FIFO is at least half-full
126
  constant ctrl_tx_full_c  : natural := 30; -- r/-: TX FIFO is full
127
  constant ctrl_tx_busy_c  : natural := 31; -- r/-: serial TX engine busy when set
128 52 zero_gravi
 
129
  -- control register --
130
  type ctrl_t is record
131
    enable   : std_ulogic;
132
    mode     : std_ulogic;
133 62 zero_gravi
    strobe   : std_ulogic;
134 52 zero_gravi
    clk_prsc : std_ulogic_vector(2 downto 0);
135 65 zero_gravi
    irq_conf : std_ulogic;
136 52 zero_gravi
    -- pulse config --
137
    t_total  : std_ulogic_vector(4 downto 0);
138
    t0_high  : std_ulogic_vector(4 downto 0);
139
    t1_high  : std_ulogic_vector(4 downto 0);
140
  end record;
141
  signal ctrl : ctrl_t;
142
 
143
  -- transmission buffer --
144
  type tx_buffer_t is record
145 65 zero_gravi
    we    : std_ulogic; -- write enable
146
    re    : std_ulogic; -- read enable
147
    clear : std_ulogic; -- sync reset, high-active
148
    wdata : std_ulogic_vector(31+2 downto 0); -- write data (excluding mode)
149
    rdata : std_ulogic_vector(31+2 downto 0); -- read data (including mode)
150
    avail : std_ulogic; -- data available?
151
    free  : std_ulogic; -- free entry available?
152
    half  : std_ulogic; -- half full
153 52 zero_gravi
  end record;
154
  signal tx_buffer : tx_buffer_t;
155
 
156
  -- serial transmission engine --
157 62 zero_gravi
  type serial_state_t is (S_IDLE, S_INIT, S_GETBIT, S_PULSE, S_STROBE);
158 52 zero_gravi
  type serial_t is record
159
    -- state control --
160 62 zero_gravi
    state      : serial_state_t;
161
    mode       : std_ulogic;
162
    busy       : std_ulogic;
163
    bit_cnt    : std_ulogic_vector(5 downto 0);
164 52 zero_gravi
    -- shift register --
165 62 zero_gravi
    sreg       : std_ulogic_vector(31 downto 0);
166
    next_bit   : std_ulogic; -- next bit to send
167 52 zero_gravi
    -- pulse generator --
168 62 zero_gravi
    pulse_clk  : std_ulogic; -- pulse cycle "clock"
169
    pulse_cnt  : std_ulogic_vector(4 downto 0);
170
    t_high     : std_ulogic_vector(4 downto 0);
171
    strobe_cnt : std_ulogic_vector(6 downto 0);
172
    tx_out     : std_ulogic;
173 52 zero_gravi
  end record;
174
  signal serial : serial_t;
175
 
176
begin
177
 
178
  -- Sanity Checks --------------------------------------------------------------------------
179
  -- -------------------------------------------------------------------------------------------
180 62 zero_gravi
  assert not ((is_power_of_two_f(FIFO_DEPTH) = false) or (FIFO_DEPTH < 1) or (FIFO_DEPTH > 32768)) report
181
  "NEORV32 PROCESSOR CONFIG ERROR! Invalid <NEOLED.FIFO_DEPTH> buffer size configuration (1..32k)!" severity error;
182 52 zero_gravi
 
183
 
184
  -- Access Control -------------------------------------------------------------------------
185
  -- -------------------------------------------------------------------------------------------
186
  acc_en <= '1' when (addr_i(hi_abb_c downto lo_abb_c) = neoled_base_c(hi_abb_c downto lo_abb_c)) else '0';
187
  addr   <= neoled_base_c(31 downto lo_abb_c) & addr_i(lo_abb_c-1 downto 2) & "00"; -- word aligned
188
  wren   <= acc_en and wren_i;
189
  rden   <= acc_en and rden_i;
190
 
191
 
192
  -- Read/Write Access ----------------------------------------------------------------------
193
  -- -------------------------------------------------------------------------------------------
194
  rw_access: process(clk_i)
195
  begin
196
    if rising_edge(clk_i) then
197
      -- access acknowledge --
198
      ack_o <= wren or rden;
199
 
200 62 zero_gravi
      -- write access: control register --
201
      if (wren = '1') and (addr = neoled_ctrl_addr_c) then
202
        ctrl.enable   <= data_i(ctrl_enable_c);
203
        ctrl.mode     <= data_i(ctrl_mode_c);
204
        ctrl.strobe   <= data_i(ctrl_strobe_c);
205
        ctrl.clk_prsc <= data_i(ctrl_clksel2_c downto ctrl_clksel0_c);
206 65 zero_gravi
        ctrl.irq_conf <= data_i(ctrl_irq_conf_c);
207 62 zero_gravi
        ctrl.t_total  <= data_i(ctrl_t_tot_4_c downto ctrl_t_tot_0_c);
208
        ctrl.t0_high  <= data_i(ctrl_t_0h_4_c  downto ctrl_t_0h_0_c);
209
        ctrl.t1_high  <= data_i(ctrl_t_1h_4_c  downto ctrl_t_1h_0_c);
210 52 zero_gravi
      end if;
211
 
212
      -- read access: control register --
213
      data_o <= (others => '0');
214 62 zero_gravi
      if (rden = '1') then -- and (addr = neoled_ctrl_addr_c) then
215 52 zero_gravi
        data_o(ctrl_enable_c)                        <= ctrl.enable;
216
        data_o(ctrl_mode_c)                          <= ctrl.mode;
217 62 zero_gravi
        data_o(ctrl_strobe_c)                        <= ctrl.strobe;
218 52 zero_gravi
        data_o(ctrl_clksel2_c downto ctrl_clksel0_c) <= ctrl.clk_prsc;
219 65 zero_gravi
        data_o(ctrl_irq_conf_c)                      <= ctrl.irq_conf or bool_to_ulogic_f(boolean(FIFO_DEPTH = 1)); -- tie to one if FIFO_DEPTH is 1
220 62 zero_gravi
        data_o(ctrl_bufs_3_c  downto ctrl_bufs_0_c)  <= std_ulogic_vector(to_unsigned(index_size_f(FIFO_DEPTH), 4));
221 52 zero_gravi
        data_o(ctrl_t_tot_4_c downto ctrl_t_tot_0_c) <= ctrl.t_total;
222
        data_o(ctrl_t_0h_4_c  downto ctrl_t_0h_0_c)  <= ctrl.t0_high;
223
        data_o(ctrl_t_1h_4_c  downto ctrl_t_1h_0_c)  <= ctrl.t1_high;
224 62 zero_gravi
        --
225
        data_o(ctrl_tx_empty_c)                      <= not tx_buffer.avail;
226
        data_o(ctrl_tx_half_c)                       <= tx_buffer.half;
227
        data_o(ctrl_tx_full_c)                       <= not tx_buffer.free;
228
        data_o(ctrl_tx_busy_c)                       <= serial.busy;
229 52 zero_gravi
      end if;
230
    end if;
231
  end process rw_access;
232
 
233
  -- enable external clock generator --
234
  clkgen_en_o <= ctrl.enable;
235
 
236 62 zero_gravi
  -- FIFO write access --
237
  tx_buffer.we    <= '1' when (wren = '1') and (addr = neoled_data_addr_c) else '0';
238
  tx_buffer.wdata <= ctrl.strobe & ctrl.mode & data_i;
239
  tx_buffer.clear <= not ctrl.enable;
240 52 zero_gravi
 
241 62 zero_gravi
 
242
  -- IRQ Generator --------------------------------------------------------------------------
243
  -- -------------------------------------------------------------------------------------------
244
  irq_generator: process(clk_i)
245
  begin
246
    if rising_edge(clk_i) then
247 65 zero_gravi
      if (ctrl.enable = '0') then
248
        irq_o <= '0'; -- no interrupt if unit is disabled
249
      else
250
        if (FIFO_DEPTH = 1) then
251
          irq_o <= tx_buffer.free; -- fire IRQ if FIFO is empty
252
        else
253
          if (ctrl.irq_conf = '0') then -- fire IRQ if FIFO is less than half-full
254
            irq_o <= not tx_buffer.half;
255
          else -- fire IRQ if FIFO is empty
256
            irq_o <= tx_buffer.free;
257
          end if;
258
        end if;
259
      end if;
260 62 zero_gravi
    end if;
261
  end process irq_generator;
262
 
263
 
264 52 zero_gravi
  -- TX Buffer (FIFO) -----------------------------------------------------------------------
265
  -- -------------------------------------------------------------------------------------------
266 61 zero_gravi
  tx_data_fifo: neorv32_fifo
267
  generic map (
268 62 zero_gravi
    FIFO_DEPTH => FIFO_DEPTH, -- number of fifo entries; has to be a power of two; min 1
269
    FIFO_WIDTH => 32+2,       -- size of data elements in fifo
270
    FIFO_RSYNC => true,       -- sync read
271
    FIFO_SAFE  => true        -- safe access
272 61 zero_gravi
  )
273
  port map (
274
    -- control --
275
    clk_i   => clk_i,           -- clock, rising edge
276
    rstn_i  => '1',             -- async reset, low-active
277 62 zero_gravi
    clear_i => tx_buffer.clear, -- sync reset, high-active
278 65 zero_gravi
    level_o => open,            -- fill level
279
    half_o  => tx_buffer.half,  -- FIFO is at least half full
280 61 zero_gravi
    -- write port --
281 62 zero_gravi
    wdata_i => tx_buffer.wdata, -- write data
282 61 zero_gravi
    we_i    => tx_buffer.we,    -- write enable
283
    free_o  => tx_buffer.free,  -- at least one entry is free when set
284
    -- read port --
285
    re_i    => tx_buffer.re,    -- read enable
286
    rdata_o => tx_buffer.rdata, -- read data
287
    avail_o => tx_buffer.avail  -- data available when set
288
  );
289 52 zero_gravi
 
290 65 zero_gravi
  -- try to get new TX data --
291
  tx_buffer.re <= '1' when (serial.state = S_IDLE) else '0';
292 52 zero_gravi
 
293
 
294
  -- Serial TX Engine -----------------------------------------------------------------------
295
  -- -------------------------------------------------------------------------------------------
296
  serial_engine: process(clk_i)
297
  begin
298
    if rising_edge(clk_i) then
299 62 zero_gravi
      -- clock generator --
300 52 zero_gravi
      serial.pulse_clk <= clkgen_i(to_integer(unsigned(ctrl.clk_prsc)));
301
 
302 62 zero_gravi
      -- FSM --
303 52 zero_gravi
      if (ctrl.enable = '0') then -- disabled
304 62 zero_gravi
        serial.state <= S_IDLE;
305 52 zero_gravi
      else
306
        case serial.state is
307
 
308
          when S_IDLE => -- waiting for new TX data
309
          -- ------------------------------------------------------------
310 62 zero_gravi
            serial.tx_out     <= '0';
311
            serial.pulse_cnt  <= (others => '0');
312
            serial.strobe_cnt <= (others => '0');
313 52 zero_gravi
            if (tx_buffer.avail = '1') then
314
              serial.state <= S_INIT;
315
            end if;
316
 
317
          when S_INIT => -- initialize TX shift engine
318
          -- ------------------------------------------------------------
319 62 zero_gravi
            if (tx_buffer.rdata(33) = '0') then -- send data
320
              if (tx_buffer.rdata(32) = '0') then -- mode = "RGB" 
321
                serial.mode    <= '0';
322
                serial.bit_cnt <= "011000"; -- total number of bits to send: 3x8=24
323
              else -- mode = "RGBW"
324
                serial.mode    <= '1';
325
                serial.bit_cnt <= "100000"; -- total number of bits to send: 4x8=32
326
              end if;
327
              serial.sreg  <= tx_buffer.rdata(31 downto 00);
328
              serial.state <= S_GETBIT;
329
            else -- send RESET command
330
              serial.state <= S_STROBE;
331 52 zero_gravi
            end if;
332
 
333
          when S_GETBIT => -- get next TX bit
334
          -- ------------------------------------------------------------
335
            serial.sreg      <= serial.sreg(serial.sreg'left-1 downto 0) & '0'; -- shift left by one position (MSB-first)
336
            serial.bit_cnt   <= std_ulogic_vector(unsigned(serial.bit_cnt) - 1);
337
            serial.pulse_cnt <= (others => '0');
338 65 zero_gravi
            if (serial.next_bit = '0') then -- send zero-bit
339
              serial.t_high <= ctrl.t0_high;
340
            else -- send one-bit
341
              serial.t_high <= ctrl.t1_high;
342
            end if;
343 52 zero_gravi
            if (serial.bit_cnt = "000000") then -- all done?
344 65 zero_gravi
              serial.tx_out <= '0';
345
              serial.state  <= S_IDLE;
346
            else -- send current data MSB
347
              serial.tx_out <= '1';
348 52 zero_gravi
              serial.state  <= S_PULSE; -- transmit single pulse
349
            end if;
350
 
351
          when S_PULSE => -- send pulse with specific duty cycle
352
          -- ------------------------------------------------------------
353
            -- total pulse length = ctrl.t_total
354
            -- pulse high time    = serial.t_high
355
            if (serial.pulse_clk = '1') then
356
              serial.pulse_cnt <= std_ulogic_vector(unsigned(serial.pulse_cnt) + 1);
357
              -- T_high reached? --
358
              if (serial.pulse_cnt = serial.t_high) then
359 62 zero_gravi
                serial.tx_out <= '0';
360 52 zero_gravi
              end if;
361
              -- T_total reached? --
362
              if (serial.pulse_cnt = ctrl.t_total) then
363
                serial.state <= S_GETBIT; -- get next bit to send
364
              end if;
365
            end if;
366
 
367 62 zero_gravi
          when S_STROBE => -- strobe LED data ("RESET" command)
368
          -- ------------------------------------------------------------
369
            -- wait for 127 * ctrl.t_total to _ensure_ RESET
370
            if (serial.pulse_clk = '1') then
371
              -- T_total reached? --
372
              if (serial.pulse_cnt = ctrl.t_total) then
373
                serial.pulse_cnt  <= (others => '0');
374
                serial.strobe_cnt <= std_ulogic_vector(unsigned(serial.strobe_cnt) + 1);
375
              else
376
                serial.pulse_cnt <= std_ulogic_vector(unsigned(serial.pulse_cnt) + 1);
377
              end if;
378
            end if;
379
            -- number of LOW periods reached for RESET? --
380
            if (and_reduce_f(serial.strobe_cnt) = '1') then
381
              serial.state <= S_IDLE;
382
            end if;
383
 
384 52 zero_gravi
          when others => -- undefined
385
          -- ------------------------------------------------------------
386
            serial.state <= S_IDLE;
387
 
388
        end case;
389
      end if;
390 62 zero_gravi
      -- serial data tx_out --
391
      neoled_o <= serial.tx_out and ctrl.enable;
392 52 zero_gravi
    end if;
393
  end process serial_engine;
394
 
395
  -- SREG's TX data: bit 23 for RGB mode (24-bit), bit 31 for RGBW mode (32-bit) --
396
  serial.next_bit <= serial.sreg(23) when (serial.mode = '0') else serial.sreg(31);
397
 
398
  -- TX engine status --
399 65 zero_gravi
  serial.busy <= '0' when (serial.state = S_IDLE) else '1';
400 52 zero_gravi
 
401
 
402
end neorv32_neoled_rtl;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.