RTXI 3.0.0 The Real-Time eXperiment Interface Reference Manual |
Data Structures | |
class | xbuffFifo |
class | Fifo |
class | evlFifo |
class | posixFifo |
class | xenomaiFifo |
struct | Task |
Functions | |
int | getFifo (std::unique_ptr< Fifo > &fifo, size_t fifo_size) |
int | initiate (RT::OS::Task *task) |
void | shutdown (RT::OS::Task *task) |
void | deleteTask (Task *task) |
int | setPeriod (Task *task, int64_t period) |
int64_t | getPeriod () |
void | sleepTimestep (Task *task) |
bool | isRealtime () |
int64_t | getTime () |
double | getCpuUsage () |
int | createTask (Task *task, void(*func)(void *), void *arg) |
void | renameOSThread (std::thread &thread, const std::string &name) |
Variables | |
const int64_t | SECONDS_TO_NANOSECONDS |
const int64_t | DEFAULT_PERIOD = 1000000 |
const uint64_t | DEFAULT_FIFO_SIZE = 255 |
const size_t | PROCESSOR_COUNT = std::thread::hardware_concurrency() |
int RT::OS::createTask | ( | Task * | task, |
void(*)(void *) | func, | ||
void * | arg | ||
) |
Creates a real-time task. This task will be associated with a system object to manage it.
task | Object holding metadata for real-time task |
entry | Callable function that will run the real-time loop |
arg | Reference to RT::System object that will manage this real-time loop |
Definition at line 86 of file rtos_evl.cpp.
void RT::OS::deleteTask | ( | Task * | task | ) |
terminates task in real-time loop
task | Task object holding metadata for real-time task |
Definition at line 117 of file rtos_evl.cpp.
double RT::OS::getCpuUsage | ( | ) |
Returns the percentage of Cpu being used by the Real-Time Thread. Should not be run from the real-time thread directly as this can cause high latency.
Definition at line 232 of file rt_os-xenomai.cpp.
int RT::OS::getFifo | ( | std::unique_ptr< Fifo > & | fifo, |
size_t | fifo_size | ||
) |
int64_t RT::OS::getPeriod | ( | ) |
Get the period for the real-time task
This function can only be called from a real-time context and will not function from other threads that are not real-time. It is meant to provide the real-time period to Thread/Device classes that require this value for their calculations in the real-time loop. Available inside execute().
Definition at line 150 of file rtos_evl.cpp.
int64_t RT::OS::getTime | ( | void | ) |
Returns the current CPU time in nanoseconds. In general this is really only useful for determining the time between two events.
Definition at line 186 of file rt_os-xenomai.cpp.
int RT::OS::initiate | ( | RT::OS::Task * | task | ) |
Initializes the real-time resources. This is done by locking memory Pages and storing real-time identification variables
task | The real-time structure identifying the task |
Definition at line 39 of file rtos_evl.cpp.
bool RT::OS::isRealtime | ( | void | ) |
CHecks whether the calling thread is in real time. Important for functions that should not have access to real-time services else risk blocking the whole computer system.
Definition at line 179 of file rt_os-xenomai.cpp.
void RT::OS::renameOSThread | ( | std::thread & | thread, |
const std::string & | name | ||
) |
Renames a thread. This is useful for debugging and developer sanity
thread | Standard thread object |
name | String holding the name to assign to thread |
Definition at line 175 of file rtos_evl.cpp.
int RT::OS::setPeriod | ( | Task * | task, |
int64_t | period | ||
) |
Set the period for the real-time task
task | Object holding metadata for real-time task |
period | The new period to set the real-time loop to |
Definition at line 144 of file rtos_evl.cpp.
void RT::OS::shutdown | ( | RT::OS::Task * | task | ) |
Releases real-time resources from the operating system. Called when rtxi is closing.
task | the real-time structure identifying the task |
Definition at line 72 of file rtos_evl.cpp.
void RT::OS::sleepTimestep | ( | Task * | task | ) |
Uses real-time core to sleep until the next periodic wakeup. It uses the timestep given in task to determine next waekup.
task | Object holding the timestep data for the task |
Definition at line 159 of file rtos_evl.cpp.
const size_t RT::OS::PROCESSOR_COUNT = std::thread::hardware_concurrency() |