📄 devapi-api.html
字号:
><DD><P>Thread</P></DD><DT>Description:</DT><DD><P>Initialize the mutex pointed to by the <TTCLASS="LITERAL">mutex</TT> argument. </P></DD></DL></DIV></DIV><DIVCLASS="SECTION"><H2CLASS="SECTION"><ANAME="AEN11650">cyg_drv_mutex_destroy</H2><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Function:</DT><DD><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">void cyg_drv_mutex_destroy( cyg_drv_mutex *mutex )</PRE></TD></TR></TABLE></DD><DT>Arguments:</DT><DD><P><TTCLASS="PARAMETER"><I>mutex</I></TT> - pointer to mutex to destroy</P></DD><DT>Result:</DT><DD><P>None </P></DD><DT>Level:</DT><DD><P>Thread</P></DD><DT>Description:</DT><DD><P>Destroy the mutex pointed to by the <TTCLASS="PARAMETER"><I>mutex</I></TT> argument. The mutex should be unlocked and there should be no threads waiting to lock it when this call in made.</P></DD></DL></DIV></DIV><DIVCLASS="SECTION"><H2CLASS="SECTION"><ANAME="AEN11675">cyg_drv_mutex_lock</H2><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Function:</DT><DD><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">cyg_bool cyg_drv_mutex_lock( cyg_drv_mutex *mutex )</PRE></TD></TR></TABLE></DD><DT>Arguments:</DT><DD><P><TTCLASS="PARAMETER"><I>mutex</I></TT> - pointer to mutex to lock</P></DD><DT>Result:</DT><DD><P><TTCLASS="LITERAL">TRUE</TT> it the thread has claimed the lock, <TTCLASS="LITERAL">FALSE</TT> otherwise.</P></DD><DT>Level:</DT><DD><P>Thread</P></DD><DT>Description:</DT><DD><P>Attempt to lock the mutex pointed to by the <TTCLASS="PARAMETER"><I>mutex</I></TT> argument. If the mutex is already locked by another thread then this thread will wait until that thread is finished. If the result from this function is <TTCLASS="LITERAL">FALSE</TT> then the thread was broken out of its wait by some other thread. In this case the mutex will not have been locked. </P></DD></DL></DIV></DIV><DIVCLASS="SECTION"><H2CLASS="SECTION"><ANAME="AEN11703">cyg_drv_mutex_trylock</H2><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Function:</DT><DD><P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">cyg_bool cyg_drv_mutex_trylock( cyg_drv_mutex *mutex )</PRE></TD></TR></TABLE></P></DD><DT>Arguments:</DT><DD><P><TTCLASS="PARAMETER"><I>mutex</I></TT> - pointer to mutex to lock</P></DD><DT>Result:</DT><DD><P><TTCLASS="LITERAL">TRUE</TT> if the mutex has been locked, <TTCLASS="LITERAL">FALSE</TT> otherwise. </P></DD><DT>Level:</DT><DD><P>Thread</P></DD><DT>Description:</DT><DD><P>Attempt to lock the mutex pointed to by the <TTCLASS="PARAMETER"><I>mutex</I></TT> argument without waiting. If the mutex is already locked by some other thread then this function returns <TTCLASS="LITERAL">FALSE</TT>. If the function can lock the mutex without waiting, then <TTCLASS="LITERAL">TRUE</TT> is returned. </P></DD></DL></DIV></DIV><DIVCLASS="SECTION"><H2CLASS="SECTION"><ANAME="AEN11733">cyg_drv_mutex_unlock</H2><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Function:</DT><DD><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">void cyg_drv_mutex_unlock( cyg_drv_mutex *mutex )</PRE></TD></TR></TABLE></DD><DT>Arguments:</DT><DD><P><TTCLASS="PARAMETER"><I>mutex</I></TT> - pointer to mutex to unlock</P></DD><DT>Result:</DT><DD><P>None </P></DD><DT>Level:</DT><DD><P>Thread</P></DD><DT>Description:</DT><DD><P>Unlock the mutex pointed to by the <TTCLASS="PARAMETER"><I>mutex</I></TT> argument. If there are any threads waiting to claim the lock, one of them is woken up to try and claim it. </P></DD></DL></DIV></DIV><DIVCLASS="SECTION"><H2CLASS="SECTION"><ANAME="AEN11758">cyg_drv_mutex_release</H2><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Function:</DT><DD><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">void cyg_drv_mutex_release( cyg_drv_mutex *mutex )</PRE></TD></TR></TABLE></DD><DT>Arguments:</DT><DD><P><TTCLASS="LITERAL">mutex</TT> - pointer to mutex to release</P></DD><DT>Result:</DT><DD><P>None </P></DD><DT>Level:</DT><DD><P>Thread</P></DD><DT>Description:</DT><DD><P>Release all threads waiting on the mutex pointed to by the <TTCLASS="PARAMETER"><I>mutex</I></TT> argument. These threads will return from <TTCLASS="FUNCTION">cyg_drv_mutex_lock()</TT> with a <TTCLASS="LITERAL">FALSE</TT> result and will not have claimed the mutex. This function has no effect on any thread that may have the mutex claimed. </P></DD></DL></DIV></DIV><DIVCLASS="SECTION"><H2CLASS="SECTION"><ANAME="AEN11785">cyg_drv_cond_init</H2><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Function:</DT><DD><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING"> void cyg_drv_cond_init( cyg_drv_cond *cond, cyg_drv_mutex *mutex ) </PRE></TD></TR></TABLE></DD><DT>Arguments:</DT><DD><P><TTCLASS="PARAMETER"><I>cond</I></TT> - condition variable to initialize</P><P><TTCLASS="PARAMETER"><I>mutex</I></TT> - mutex to associate with this condition variable</P></DD><DT>Result:</DT><DD><P>None</P></DD><DT>Level:</DT><DD><P>Thread </P></DD><DT>Description:</DT><DD><P>Initialize the condition variable pointed to by the <TTCLASS="PARAMETER"><I>cond</I></TT> argument. The <TTCLASS="PARAMETER"><I>mutex</I></TT> argument must point to a mutex with which this condition variable is associated. A thread may only wait on this condition variable when it has already locked the associated mutex. Waiting will cause the mutex to be unlocked, and when the thread is reawakened, it will automatically claim the mutex before continuing. </P></DD></DL></DIV></DIV><DIVCLASS="SECTION"><H2CLASS="SECTION"><ANAME="AEN11813">cyg_drv_cond_destroy</H2><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Function:</DT><DD><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING"> void cyg_drv_cond_destroy( cyg_drv_cond *cond )</PRE></TD></TR></TABLE></DD><DT>Arguments:</DT><DD><P><TTCLASS="PARAMETER"><I>cond</I></TT> - condition variable to destroy</P></DD><DT>Result:</DT><DD><P>None </P></DD><DT>Level:</DT><DD><P>Thread</P></DD><DT>Description:</DT><DD><P>Destroy the condition variable pointed to by the <TTCLASS="PARAMETER"><I>cond</I></TT> argument. </P></DD></DL></DIV></DIV><DIVCLASS="SECTION"><H2CLASS="SECTION"><ANAME="AEN11838">cyg_drv_cond_wait</H2><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Function:</DT><DD><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">void cyg_drv_cond_wait( cyg_drv_cond *cond )</PRE></TD></TR></TABLE></DD><DT>Arguments:</DT><DD><P><TTCLASS="PARAMETER"><I>cond</I></TT> - condition variable to wait on</P></DD><DT>Result:</DT><DD><P>None </P></DD><DT>Level:</DT><DD><P>Thread</P></DD><DT>Description:</DT><DD><P>Wait for a signal on the condition variable pointed to by the <TTCLASS="PARAMETER"><I>cond</I></TT> argument. The thread must have locked the associated mutex, supplied in <TTCLASS="FUNCTION">cyg_drv_cond_init()</TT>, before waiting on this condition variable. While the thread waits, the mutex will be unlocked, and will be re-locked before this function returns. It is possible for threads waiting on a condition variable to occasionally wake up spuriously. For this reason it is necessary to use this function in a loop that re-tests the condition each time it returns. Note that this function performs an implicit scheduler unlock/relock sequence, so that it may be used within an explicit <TTCLASS="LITERAL">cyg_drv_dsr_lock()...cyg_drv_dsr_unlock()</TT> structure.</P></DD></DL></DIV></DIV><DIVCLASS="SECTION"><H2CLASS="SECTION"><ANAME="AEN11865">cyg_drv_cond_signal</H2><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Function:</DT><DD><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">void cyg_drv_cond_signal( cyg_drv_cond *cond )</PRE></TD></TR></TABLE></DD><DT>Arguments:</DT><DD><P><TTCLASS="PARAMETER"><I>cond</I></TT> - condition variable to signal</P></DD><DT>Result:</DT><DD><P>None </P></DD><DT>Level:</DT><DD><P>DSR</P></DD><DT>Description:</DT><DD><P>Signal the condition variable pointed to by the <TTCLASS="PARAMETER"><I>cond</I></TT> argument. If there are any threads waiting on this variable at least one of them will be awakened. Note that in some configurations there may not be any difference between this function and <TTCLASS="FUNCTION">cyg_drv_cond_broadcast()</TT>. </P></DD></DL></DIV></DIV><DIVCLASS="SECTION"><H2CLASS="SECTION"><ANAME="AEN11891">cyg_drv_cond_broadcast</H2><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Function:</DT><DD><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">void cyg_drv_cond_broadcast( cyg_drv_cond *cond )</PRE></TD></TR></TABLE></DD><DT>Arguments:</DT><DD><P><TTCLASS="PARAMETER"><I>cond</I></TT> - condition variable to broadcast to</P></DD><DT>Result:</DT><DD><P>None </P></DD><DT>Level:</DT><DD><P>DSR</P></DD><DT>Description:</DT><DD><P>Signal the condition variable pointed to by the <TTCLASS="PARAMETER"><I>cond</I></TT> argument. If there are any threads waiting on this variable they will all be awakened. </P></DD></DL></DIV></DIV><DIVCLASS="SECTION"><H2CLASS="SECTION"><ANAME="AEN11916">cyg_drv_interrupt_create</H2><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Function:</DT><DD><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">void cyg_drv_interrupt_create( cyg_vector_t vector, cyg_priority_t priority, cyg_addrword_t data, cyg_ISR_t *isr, cyg_DSR_t *dsr, cyg_handle_t *handle, cyg_interrupt *intr )</PRE></TD></TR></TABLE></DD><DT>Arguments:</DT><DD><P><TTCLASS="PARAMETER"><I>vector</I></TT> - vector to attach to</P><P><TTCLASS="PARAMETER"><I>priority</I></TT> - queuing priority</P><P><TTCLASS="PARAMETER"><I>data</I></TT> - data pointer</P><P><TTCLASS="PARAMETER"><I>isr</I></TT> - interrupt service routine</P><P><TTCLASS="PARAMETER"><I>dsr</I></TT> - deferred service routine</P><P><TTCLASS="PARAMETER"><I>handle</I></TT> - returned handle</P><P><TTCLASS="PARAMETER"><I>intr</I></TT> - put interrupt object here</P></DD><DT>Result:</DT><DD><P>None</P></DD><DT>Level:</DT><DD><P>Thread</P></DD><DT>Description:</DT><DD><P>Create an interrupt object and returns a handle to it. The object contains information about which interrupt vector to use and the ISR and DSR that will be called after the interrupt object is attached to the vector. The interrupt object will be allocated in the memory passed in the <TTCLASS="PARAMETER"><I>intr</I></TT> parameter. The interrupt object is not immediately attached; it must be attached with the <TTCLASS="FUNCTION">cyg_interrupt_attach()</TT> call. </P></DD></DL></DIV></DIV><DIVCLASS="SECTION"><H2CLASS="SECTION"><ANAME="AEN11954">cyg_drv_interrupt_delete</H2><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Function:</DT><DD><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING"> void cyg_drv_interrupt_delete( cyg_handle_t interrupt )</PRE></TD></TR></TABLE></DD><DT>Arguments:</DT><DD><P><TTCLASS="PARAMETER"><I>interrupt</I></TT> - interrupt to delete</P></DD><DT>Result:</DT><DD><P>None </P></DD><DT>Level:</DT><DD><P>Thread</P></DD><DT>Description:</DT><DD><P>Detach the interrupt from the vector and free the memory passed in the <TTCLASS="PARAMETER"><I>intr</I></TT> argument to <TTCLASS="FUNCTION">cyg_drv_interrupt_create()</TT> for reuse. </P></DD></DL></DIV></DIV><DIVCLASS="SECTION"><H2CLASS="SECTION"><ANAME="AEN11980">cyg_drv_interrupt_attach</H2><P></P><DIVCLASS="VARIABLELIST"><DL><DT>Function:</DT><DD><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">void cyg_drv_interrupt_attach( cyg_handle_t interrupt )</PRE></TD></TR></TABLE></DD><DT>Arguments:</DT><DD><P><TTCLASS="PARAMETER"><I>interrupt</I></TT
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -