Loading...
Searching...
No Matches
L4::Poll_timeout_kipclock Class Reference

A polling timeout based on the L4Re clock. More...

`#include <poll_timeout_kipclock>`

Collaboration diagram for L4::Poll_timeout_kipclock:

## Public Member Functions

| Poll_timeout_kipclock (unsigned poll_time_us)
| Initialise relative timeout in microseconds.
void | set (unsigned poll_time_us)
| (Re-)Set relative timeout in microseconds
bool | test (bool expression=true)
| Test whether timeout has expired.
bool | timed_out () const
| Query whether timeout has expired.

## Detailed Description

A polling timeout based on the L4Re clock.

This class allows to conveniently add a timeout to a polling loop.

The original

while (device.read(State) & Busy)
;

is converted to

Poll_timeout_kipclock timeout(10000);
while (timeout.test(device.read(State) & Busy))
;
if (timeout.timed_out())
printf("ERROR: Device does not respond.\n");
L4::Poll_timeout_kipclock::Poll_timeout_kipclock
Poll_timeout_kipclock(unsigned poll_time_us)
Initialise relative timeout in microseconds.
Definition poll_timeout_kipclock:42

Definition at line 35 of file poll_timeout_kipclock.

## Constructor & Destructor Documentation

## Poll_timeout_kipclock()

L4::Poll_timeout_kipclock::Poll_timeout_kipclock | ( | unsigned | poll_time_us | ) |

inline

Initialise relative timeout in microseconds.

Parameters

  poll_time_us | Polling timeout in microseconds.

Definition at line 42 of file poll_timeout_kipclock.

References set().

Here is the call graph for this function:

## Member Function Documentation

## set()

void L4::Poll_timeout_kipclock::set | ( | unsigned | poll_time_us | ) |

inline

(Re-)Set relative timeout in microseconds

Parameters

  poll_time_us | Polling timeout in microseconds.

Definition at line 51 of file poll_timeout_kipclock.

References l4_kip_clock(), and l4re_kip().

Referenced by Poll_timeout_kipclock().

Here is the call graph for this function:
Here is the caller graph for this function:

## test()

bool L4::Poll_timeout_kipclock::test | ( | bool | expression = true | ) |

inline

Test whether timeout has expired.

Parameters

  expression | Optional expression.

Return values

  false | The timeout has expired or the given expression returned false.
  true | The timeout has not expired and the optionally given expression returns true.

Definition at line 65 of file poll_timeout_kipclock.

References l4_kip_clock(), and l4re_kip().

Here is the call graph for this function:

## timed_out()

bool L4::Poll_timeout_kipclock::timed_out | ( |  | ) | const

inline

Query whether timeout has expired.

Returns
  Expiry state of timeout

Definition at line 77 of file poll_timeout_kipclock.

The documentation for this class was generated from the following file:

- l4/re/util/poll_timeout_kipclock