Line 1... |
Line 1... |
-- Copyright (c)2013, 2020 Jeremy Seth Henry
|
-- Copyright (c)2020 Jeremy Seth Henry
|
-- All rights reserved.
|
-- All rights reserved.
|
--
|
--
|
-- Redistribution and use in source and binary forms, with or without
|
-- Redistribution and use in source and binary forms, with or without
|
-- modification, are permitted provided that the following conditions are met:
|
-- modification, are permitted provided that the following conditions are met:
|
-- * Redistributions of source code must retain the above copyright
|
-- * Redistributions of source code must retain the above copyright
|
Line 22... |
Line 22... |
-- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
-- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
--
|
--
|
-- VHDL Units : o8_btn_int
|
-- VHDL Units : o8_btn_int
|
-- Description: Detects and reports when a user pushbutton is pressed with an
|
-- Description: Detects and reports when a user pushbutton is pressed with an
|
-- interrupt.
|
-- interrupt.
|
|
--
|
|
-- Register Map:
|
|
-- Offset Bitfield Description Read/Write
|
|
-- 0x00 AAAAAAAA Current Button State (RW)
|
|
--
|
|
-- Revision History
|
|
-- Author Date Change
|
|
------------------ -------- ---------------------------------------------------
|
|
-- Seth Henry 01/22/20 Re-write of original with separate debouncer
|
|
|
library ieee;
|
library ieee;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_unsigned.all;
|
use ieee.std_logic_unsigned.all;
|
use ieee.std_logic_arith.all;
|
use ieee.std_logic_arith.all;
|
Line 57... |
Line 66... |
|
|
architecture behave of o8_btn_int is
|
architecture behave of o8_btn_int is
|
|
|
constant User_Addr : std_logic_vector(15 downto 0) := Address;
|
constant User_Addr : std_logic_vector(15 downto 0) := Address;
|
alias Comp_Addr is Bus_Address(15 downto 0);
|
alias Comp_Addr is Bus_Address(15 downto 0);
|
signal Addr_Match : std_logic;
|
signal Addr_Match : std_logic := '0';
|
signal Rd_En : std_logic;
|
signal Rd_En : std_logic := '0';
|
|
|
constant MSEC_DELAY : std_logic_vector(9 downto 0) :=
|
constant MSEC_DELAY : std_logic_vector(9 downto 0) :=
|
conv_std_logic_vector(1000,10);
|
conv_std_logic_vector(1000,10);
|
|
|
signal mSec_Timer : std_logic_vector(9 downto 0);
|
signal mSec_Timer : std_logic_vector(9 downto 0) := (others => '0');
|
signal mSec_Tick : std_logic;
|
signal mSec_Tick : std_logic := '0';
|
|
|
signal Button_Pressed : DATA_TYPE := x"00";
|
signal Button_Pressed : DATA_TYPE := x"00";
|
signal Button_CoS : DATA_TYPE := x"00";
|
signal Button_CoS : DATA_TYPE := x"00";
|
|
|
begin
|
begin
|