mirror of
https://github.com/supleed2/EIE4-FYP.git
synced 2024-12-22 14:15:50 +00:00
Add interrupt output to can
wrapper
This commit is contained in:
parent
4c8687014e
commit
be6ab940ff
1
make.py
1
make.py
|
@ -233,6 +233,7 @@ class BaseSoC(SoCCore):
|
||||||
platform = platform,
|
platform = platform,
|
||||||
pads = platform.request("can")
|
pads = platform.request("can")
|
||||||
)
|
)
|
||||||
|
self.irq.add("can", use_loc_if_exists=True)
|
||||||
|
|
||||||
# DAC Control / Audio Blocks ---------------------------------------------------------------
|
# DAC Control / Audio Blocks ---------------------------------------------------------------
|
||||||
from testWave import TestWave
|
from testWave import TestWave
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
from migen import *
|
from migen import *
|
||||||
|
|
||||||
from litex.soc.interconnect.csr import *
|
from litex.soc.interconnect.csr import *
|
||||||
|
from litex.soc.interconnect.csr_eventmanager import EventManager, EventSourcePulse
|
||||||
from litex.soc.integration.doc import ModuleDoc
|
from litex.soc.integration.doc import ModuleDoc
|
||||||
|
|
||||||
# CAN Receiver Module ------------------------------------------------------------------------------
|
# CAN Receiver Module ------------------------------------------------------------------------------
|
||||||
|
@ -27,11 +28,18 @@ class CanReceiver(Module, AutoCSR, ModuleDoc):
|
||||||
self.rcv_data5 = CSRStatus(size = 8, description = "Received message data byte 5")
|
self.rcv_data5 = CSRStatus(size = 8, description = "Received message data byte 5")
|
||||||
self.rcv_data6 = CSRStatus(size = 8, description = "Received message data byte 6")
|
self.rcv_data6 = CSRStatus(size = 8, description = "Received message data byte 6")
|
||||||
self.rcv_data7 = CSRStatus(size = 8, description = "Received message data byte 7")
|
self.rcv_data7 = CSRStatus(size = 8, description = "Received message data byte 7")
|
||||||
|
self.rcv_pulse = Signal()
|
||||||
|
|
||||||
# Pin Connections
|
# Pin Connections
|
||||||
self.can_rx = Signal()
|
self.can_rx = Signal()
|
||||||
self.can_tx = Signal()
|
self.can_tx = Signal()
|
||||||
|
|
||||||
|
# Interrupts
|
||||||
|
self.submodules.ev = EventManager()
|
||||||
|
self.ev.frame = EventSourcePulse(description = "CAN frame received, sets pending bit")
|
||||||
|
self.ev.finalize()
|
||||||
|
self.comb += self.ev.frame.trigger.eq(self.rcv_pulse)
|
||||||
|
|
||||||
# # #
|
# # #
|
||||||
|
|
||||||
self.specials += Instance("can",
|
self.specials += Instance("can",
|
||||||
|
@ -50,6 +58,7 @@ class CanReceiver(Module, AutoCSR, ModuleDoc):
|
||||||
o_o_data5 = self.rcv_data5.status,
|
o_o_data5 = self.rcv_data5.status,
|
||||||
o_o_data6 = self.rcv_data6.status,
|
o_o_data6 = self.rcv_data6.status,
|
||||||
o_o_data7 = self.rcv_data7.status,
|
o_o_data7 = self.rcv_data7.status,
|
||||||
|
o_o_pulse = self.rcv_pulse,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.comb += self.can_rx.eq(self.pads.rx)
|
self.comb += self.can_rx.eq(self.pads.rx)
|
||||||
|
|
Loading…
Reference in a new issue