关于RTX编程接口
RTX为Win32环境提供了一个最重要的实时编程接口,并与Win32编程接口兼容。
RTX应用程序在Win32和RTSS两个环境中都可以使用实时扩展,程序也可以在实时环境中使用Win32支持的API。RTX应用程序编程接口由以下三个接口集组成:
-
实时API(RTAPI)
-
Win32支持的API
-
C运行时库支持的API
-
C++库支持的API
实时API(RTAPI)概述
RTAPI分为两种:
-
纯粹实时接口 - 全新的,由实时扩展提供。这些RTAPI函数没有对应的Win32函数,并且都以Rt开头。
-
基于Win32的实时接口 - 由Win32函数扩展而来,并且和Win32平台的函数有点类似。但是以Rt开头,并且在功能上与Win32函数也不完全相同,例如, RtCreateMutex,它与Win32平台的 CreateMutex函数在功能上就不完全相同。
Win32支持的API概述
跟Win32函数功能完全一样,并被RTSS环境所支持。函数名没有以Rt开头,因为在两个环境中的功能和调用接口完全一样。一个例子是ResumeThread。
Windows驱动IPC API(RTKAPI)概述
Windows驱动进程间通讯API(RTKAPI)函数用来从Windows内核设备驱动访问RTX IPC机制。这些RTKAPI调用类似于它们的RTAPI对应的函数调用。例如,RtkOpenSemaphore 类似于 RtOpenSemaphore。
使用RTKAPI的方式与使用RTAPI的方式相同,但是是在Windows内核环境。所有的RTKAPI接口函数在最前面以Rtk开头。
RTKAPI还包括一个include文件(RtkApi.h) 和一个连接库 (rtx_rtk.lib)。
注意:RTK函数只能在一个Windows设备驱动的PASSIVE_LEVEL层来调用。
RtkCloseHandle |
RtkCreateEvent |
RtkCreateMutex |
RtkCreateSemaphore |
RtkWaitForSingleObject |
RtkCreateSharedMemory |
RtkOpenEvent |
RtkOpenMutex |
RtkOpenSemaphore | |
RtkOpenSharedMemory |
RtkPulseEvent |
RtkReleaseMutex |
RtkReleaseSemaphore | |
RtkResetEvent |
RtkRtssAttach |
RtkRtssDetach |
RtkSetEvent |
C++标准模板库概述
RTSS环境支持一个MS标准C++库调用的扩展集。详情见:Alphabetical List。
accumulate adjacent_difference adjacent_find advance back_insert_iterator back_inserter basic_string binary_negate binary_search bind1st binder2nd bsappend cerr clog copy copy_backward count count_if cout divides equal equal_range equal_to filebuf fill fill_n find find_end find_first_of find_if findfrstof for_each front_insert_iterator front_inserter fstream | generate generate_n greater greater_equal ifstream includes inner_product inplace_merge insert insert_iterator istream_iterator istringstream iter_swap less less_equal lexicographical_compare logical_and logical_not logical_or lower_bound make_heap max max_element merge min min_element minus mismatch modulus multiplies negate next_permutation not_equal_to nth_element ofstream | ostream ostream_iterator ostringstream pair partial_sort partial_sort_copy partial_sum partition plus pointer_to_binary_function pointer_to_unary_function prev_permutation priority_queue ptr_fun push_heap random_shuffle remove remove_copy remove_copy_if remove_if replace replace_copy replace_copy_if replace_if reverse reverse_copy rotate rotate_copy search search_n set_difference set_intersection set_symmetric_difference set_union setbase | setfill setprecision setw size sort sort_heap stable_partition stable_sort streq strgrteq strgrtthan stringbuf stringstream strlesseq strlessthan strneq strplus swap swap_ranges transform unique unique_copy upper_bound wcerr wclog wistringstream wostream wostringstream wstringstream |