Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
STITCH
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pascal Engeler
STITCH
Commits
6521c527
Commit
6521c527
authored
7 months ago
by
Pascal Engeler
Browse files
Options
Downloads
Patches
Plain Diff
Added beeper
parent
71ccd6a6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
stitch_project/stitch/Beeper.vhd
+62
-0
62 additions, 0 deletions
stitch_project/stitch/Beeper.vhd
with
62 additions
and
0 deletions
stitch_project/stitch/Beeper.vhd
0 → 100644
+
62
−
0
View file @
6521c527
library
IEEE
;
use
IEEE
.
STD_LOGIC_1164
.
ALL
;
use
IEEE
.
STD_LOGIC_UNSIGNED
.
ALL
;
use
IEEE
.
NUMERIC_STD
.
ALL
;
entity
Beeper
is
Port
(
CLK100
:
in
STD_LOGIC
;
Beep
:
in
STD_LOGIC
;
Speakerout
:
out
STD_LOGIC
;
Beeping
:
out
STD_LOGIC
);
end
Beeper
;
architecture
Behavioral
of
Beeper
is
signal
enabled
:
STD_LOGIC
:
=
'0'
;
signal
slowCounter
:
STD_LOGIC_VECTOR
(
23
downto
0
)
:
=
(
others
=>
'0'
);
signal
fastCounter
:
STD_LOGIC_VECTOR
(
13
downto
0
)
:
=
(
others
=>
'0'
);
signal
audio
:
STD_LOGIC
:
=
'0'
;
begin
Speakerout
<=
audio
;
Beeping
<=
enabled
;
updateBeeper
:
process
(
CLK100
)
begin
if
rising_edge
(
CLK100
)
then
if
((
Beep
=
'1'
)
and
(
enabled
=
'0'
))
then
enabled
<=
'1'
;
slowCounter
<=
(
others
=>
'0'
);
fastCounter
<=
(
others
=>
'0'
);
audio
<=
'0'
;
else
if
enabled
=
'1'
then
if
fastCounter
=
15000
then
fastCounter
<=
(
others
=>
'0'
);
audio
<=
NOT
audio
;
else
fastCounter
<=
fastCounter
+
1
;
audio
<=
audio
;
end
if
;
if
slowCounter
=
15000000
then
slowCounter
<=
(
others
=>
'0'
);
enabled
<=
'0'
;
else
slowCounter
<=
slowCounter
+
1
;
enabled
<=
'1'
;
end
if
;
else
slowCounter
<=
(
others
=>
'0'
);
fastCounter
<=
(
others
=>
'0'
);
enabled
<=
'0'
;
audio
<=
'0'
;
end
if
;
end
if
;
end
if
;
end
process
;
end
Behavioral
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment