Struct IntcConfig

Source
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

Source

pub fn new_empty() -> IntcConfig

Constructs an empty PRU interrupt controller configuration.

Source

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 to Channel::C1,
    • Sysevt::S18 to Channel::C0,
    • Sysevt::S19 to Channel::C2,
    • Sysevt::S20 to Channel::C3,
    • Sysevt::S21 to Channel::C0,
    • Sysevt::S22 to Channel::C1,
  • it maps:

    • Channel::C0 to Host::Pru0,
    • Channel::C1 to Host::Pru1,
    • Channel::C2 to Host::Evtout0,
    • Channel::C3 to Host::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
Source

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.

Source

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.

Source

pub fn auto_enable_sysevts(&mut self)

Automatically enables system events that are already assigned to a channel.

Source

pub fn auto_enable_hosts(&mut self)

Automatically enables host interrupts that are already mapped to a channel.

Source

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.

Source

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

Source§

fn clone(&self) -> IntcConfig

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.