Commit d39363a6 authored by Ille, Ondrej, Ing.'s avatar Ille, Ondrej, Ing.

Added "CAN_wait_tx_rx" starts procedure.

parent 1bc1df89
......@@ -1235,6 +1235,24 @@ package CANtestLib is
);
----------------------------------------------------------------------------
-- Waits until transmission or reception is started by a Node.
--
-- Arguments:
-- bits Number of Bit times to wait for
-- exit_trans Exit when unit turns transceiver.
-- exit_rec Exit when unit turns receiver.
-- ID Index of CTU CAN FD Core instance
-- mem_bus Avalon memory bus to execute the access on.
----------------------------------------------------------------------------
procedure CAN_wait_tx_rx_start(
constant exit_trans : in boolean;
constant exit_rec : in boolean;
constant ID : in natural range 0 to 15;
signal mem_bus : inout Avalon_mem_type
);
----------------------------------------------------------------------------
-- Calculate length of CAN Frame in bits (stuff bits not included).
--
......@@ -3128,6 +3146,28 @@ package body CANtestLib is
end procedure;
procedure CAN_wait_tx_rx_start(
constant exit_trans : in boolean;
constant exit_rec : in boolean;
constant ID : in natural range 0 to 15;
signal mem_bus : inout Avalon_mem_type
)is
variable r_data : std_logic_vector(31 downto 0);
begin
-- Wait until unit starts to transmitt or recieve
while (true) loop
CAN_read(r_data, MODE_ADR, ID, mem_bus);
if (exit_trans and r_data(RS_IND) = '1') then
exit;
end if;
if (exit_rec and r_data(TS_IND) = '1') then
exit;
end if;
end loop;
end procedure;
procedure CAN_calc_frame_length(
constant frame : in SW_CAN_frame_type;
variable bit_length : inout natural
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment