1 ------------------------------------------------------------------------------- 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2016-05-13 5 -- Last update: 2016-06-28 6 ------------------------------------------------------------------------------- 7 -- Description: Uart Transmitter 8 ------------------------------------------------------------------------------- 9 -- This file is part of 'SLAC Firmware Standard Library'. 10 -- It is subject to the license terms in the LICENSE.txt file found in the 11 -- top-level directory of this distribution and at: 12 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. 13 -- No part of 'SLAC Firmware Standard Library', including this file, 14 -- may be copied, modified, propagated, or distributed except according to 15 -- the terms contained in the LICENSE.txt file. 16 ------------------------------------------------------------------------------- 19 use ieee.std_logic_1164.
all;
20 use ieee.std_logic_unsigned.
all;
25 --! @ingroup protocols_uart 41 type StateType is (WAIT_DATA_S, SYNC_EN_16_S, WAIT_16_S, TX_BIT_S);
63 begin -- architecture RTL 72 -- Wait for new data to send 81 -- Wait for next baud16x to synchronize 82 -- Then load the shift reg 83 -- Bit 0 is the start bit, bit 9 is the stop bit 92 -- Wait 16 baud_16x counts (the baud rate) 93 -- When shifted all bits, wait for next tx data 105 -- Shift to TX next bit, increment shift count 125 if (rising_edge(clk)) then 131 end architecture RTL;
in wrDataslv( 7 downto 0)
slv( 9 downto 0) shiftReg
(WAIT_DATA_S,SYNC_EN_16_S,WAIT_16_S,TX_BIT_S) StateType
slv( 3 downto 0) baud16xCount
slv( 3 downto 0) shiftCount
RegType :=(wrReady => '0',holdReg =>( others => '0'),txState => WAIT_DATA_S,baud16xCount =>( others => '0'),shiftReg =>( others => '1'),shiftCount =>( others => '0')) REG_INIT_C