Type Alias E310xClint

Source
pub type E310xClint<'a> = Clint<'a, Freq32KHz>;

Aliased Type§

struct E310xClint<'a> { /* private fields */ }

Implementations

Source§

impl<'a, F> Clint<'a, F>
where F: Frequency,

Source

pub fn new(base: &'a StaticRef<ClintRegisters>) -> Clint<'a, F>

Source

pub fn handle_interrupt(&self)

Source

pub fn disable_machine_timer(&self)

Trait Implementations

Source§

impl<'a, F> Alarm<'a> for Clint<'a, F>
where F: Frequency,

Source§

fn set_alarm_client(&self, client: &'a dyn AlarmClient)

Specify the callback for when the counter reaches the alarm value. If there was a previously installed callback this call replaces it.
Source§

fn set_alarm( &self, reference: <Clint<'a, F> as Time>::Ticks, dt: <Clint<'a, F> as Time>::Ticks, )

Specify when the callback should be called and enable it. The callback will be enqueued when Time::now() == reference + dt. The callback itself may not run exactly at this time, due to delays. However, it it assured to execute after reference + dt: it can be delayed but will never fire early. The method takes reference and dt rather than a single value denoting the counter value so it can distinguish between alarms which have very recently already passed and those in the far far future (see #1651).
Source§

fn get_alarm(&self) -> <Clint<'a, F> as Time>::Ticks

Return the current alarm value. This is undefined at boot and otherwise returns now + dt from the last call to set_alarm.
Source§

fn disarm(&self) -> Result<(), ErrorCode>

Disable the alarm and stop it from firing in the future. Valid Result<(), ErrorCode> codes are: Read more
Source§

fn is_armed(&self) -> bool

Returns whether the alarm is currently armed. Note that this does not reliably indicate whether there will be a future callback: it is possible that the alarm has triggered (and disarmed) and a callback is pending and has not been called yet. In this case it possible for is_armed to return false yet to receive a callback.
Source§

fn minimum_dt(&self) -> <Clint<'a, F> as Time>::Ticks

Return the minimum dt value that is supported. Any dt smaller than this will automatically be increased to this minimum value.
Source§

impl<F> SchedulerTimer for Clint<'_, F>
where F: Frequency,

SchedulerTimer Implementation for RISC-V mtimer. Notably, this implementation should only be used by a chip if that chip has multiple hardware timer peripherals such that a different hardware timer can be used to provide alarms to capsules and userspace. This implementation will not work alongside other uses of the machine timer.

Source§

fn start(&self, us: NonZero<u32>)

Start a timer for a process timeslice. The us argument is the length of the timeslice in microseconds. Read more
Source§

fn get_remaining_us(&self) -> Option<NonZero<u32>>

Return the number of microseconds remaining in the process’s timeslice if the timeslice is still active. Read more
Source§

fn reset(&self)

Reset the SchedulerTimer. Read more
Source§

fn arm(&self)

Arm the SchedulerTimer timer and ensure an interrupt will be generated. Read more
Source§

fn disarm(&self)

Disarm the SchedulerTimer timer indicating an interrupt is no longer required. Read more
Source§

impl<F> Time for Clint<'_, F>
where F: Frequency,

Source§

type Frequency = F

The number of ticks per second
Source§

type Ticks = Ticks64

The width of a time value
Source§

fn now(&self) -> Ticks64

Returns a timestamp. Depending on the implementation of Time, this could represent either a static timestamp or a sample of a counter; if an implementation relies on it being constant or changing it should use Timestamp or Counter.