pub struct IntcConfig { /* private fields */ }
Expand description
PRU interrupt controller configuration.
A call to the new_populated
method automatically initializes the data with the same defaults
as the PRUSS_INTC_INITDATA macro of the C prussdrv library. Alternatively, a blank-state
initialization data structure can be created with new_empty
and then populated with the
dedicated methods.
Implementations§
Source§impl IntcConfig
impl IntcConfig
Sourcepub fn new_empty() -> IntcConfig
pub fn new_empty() -> IntcConfig
Constructs an empty PRU interrupt controller configuration.
Sourcepub fn new_populated() -> IntcConfig
pub fn new_populated() -> IntcConfig
Constructs a PRU interrupt controller configuration with a default mapping.
The mapping reflects the one defined in the PRUSS_INTC_INITDATA
C macro of the C
prussdrv library, namely:
-
it maps:
Sysevt::S17
toChannel::C1
,Sysevt::S18
toChannel::C0
,Sysevt::S19
toChannel::C2
,Sysevt::S20
toChannel::C3
,Sysevt::S21
toChannel::C0
,Sysevt::S22
toChannel::C1
,
-
it maps:
Channel::C0
toHost::Pru0
,Channel::C1
toHost::Pru1
,Channel::C2
toHost::Evtout0
,Channel::C3
toHost::Evtout1
,
-
it enables:
Sysevt::S17
,Sysevt::S18
,Sysevt::S19
,Sysevt::S20
,Sysevt::S21
,Sysevt::S22
,
-
it enables:
Host::Pru0
,Host::Pru1
,Host::Evtout0
,Host::Evtout1
Sourcepub fn enable_sysevts(&mut self, sysevts: &[Sysevt])
pub fn enable_sysevts(&mut self, sysevts: &[Sysevt])
Enables the specified system events.
§Panics
This will panic if a system event is enabled several times.
Sourcepub fn enable_hosts(&mut self, hosts: &[Host])
pub fn enable_hosts(&mut self, hosts: &[Host])
Enables the specified host interrupts.
§Panics
This will panic if a host interrupt is enabled several times.
Sourcepub fn auto_enable_sysevts(&mut self)
pub fn auto_enable_sysevts(&mut self)
Automatically enables system events that are already assigned to a channel.
Sourcepub fn auto_enable_hosts(&mut self)
pub fn auto_enable_hosts(&mut self)
Automatically enables host interrupts that are already mapped to a channel.
Sourcepub fn map_sysevts_to_channels(&mut self, scmap: &[(Sysevt, Channel)])
pub fn map_sysevts_to_channels(&mut self, scmap: &[(Sysevt, Channel)])
Assigns system events to channels.
A channel can be targeted by several events but an event can be mapped to only one channel.
§Panics
This will panic if a system event is mapped to several channels simultaneously.
Sourcepub fn map_channels_to_hosts(&mut self, chmap: &[(Channel, Host)])
pub fn map_channels_to_hosts(&mut self, chmap: &[(Channel, Host)])
Assigns channel numbers to host interrupts.
A host interrupt can be targeted by several channels but a channel can be mapped to only one host.
§Panics
This will panic if a channel is mapped to several hosts.
Trait Implementations§
Source§impl Clone for IntcConfig
impl Clone for IntcConfig
Source§fn clone(&self) -> IntcConfig
fn clone(&self) -> IntcConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more