⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kapi.h

📁 ecos为实时嵌入式操作系统
💻 H
📖 第 1 页 / 共 2 页
字号:
    cyg_handle_t        *handle,        /* Returned clock handle             */    cyg_clock           *clock          /* put clock here                    */    );void cyg_clock_delete(cyg_handle_t clock);/* convert a clock handle to a counter handle so we can use the              *//* counter API on it.                                                        */void cyg_clock_to_counter(    cyg_handle_t        clock,    cyg_handle_t        *counter);void cyg_clock_set_resolution(    cyg_handle_t        clock,    cyg_resolution_t    resolution      /* New resolution                    */);cyg_resolution_t cyg_clock_get_resolution(cyg_handle_t clock);/* handle of real time clock                                                 */cyg_handle_t cyg_real_time_clock(void);/* returns value of real time clock's counter.   This is the same as:   (cyg_clock_to_counter(cyg_real_time_clock(), &h),    cyg_counter_current_value(h))                                            */cyg_tick_count_t cyg_current_time(void);/* Alarm handler function                                                    */typedef void cyg_alarm_t(cyg_handle_t alarm, cyg_addrword_t data);void cyg_alarm_create(    cyg_handle_t        counter,        /* Attached to this counter          */    cyg_alarm_t         *alarmfn,       /* Call-back function                */    cyg_addrword_t      data,           /* Call-back data                    */    cyg_handle_t        *handle,        /* Returned alarm object             */    cyg_alarm           *alarm          /* put alarm here                    */    );/* Disable alarm, detach from counter and invalidate handles                 */void cyg_alarm_delete( cyg_handle_t alarm);void cyg_alarm_initialize(    cyg_handle_t        alarm,    cyg_tick_count_t    trigger,        /* Absolute trigger time             */    cyg_tick_count_t    interval        /* Relative retrigger interval       */);void cyg_alarm_enable( cyg_handle_t alarm );void cyg_alarm_disable( cyg_handle_t alarm );/*---------------------------------------------------------------------------*//* Mail boxes                                                                */void cyg_mbox_create(    cyg_handle_t        *handle,    cyg_mbox            *mbox);void cyg_mbox_delete(cyg_handle_t mbox);void *cyg_mbox_get(cyg_handle_t mbox);#ifdef CYGFUN_KERNEL_THREADS_TIMERvoid *cyg_mbox_timed_get(    cyg_handle_t mbox,    cyg_tick_count_t abstime    );#endifvoid *cyg_mbox_tryget(cyg_handle_t mbox);void *cyg_mbox_peek_item(cyg_handle_t mbox);#ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAITcyg_bool_t cyg_mbox_put(cyg_handle_t mbox, void *item);#ifdef CYGFUN_KERNEL_THREADS_TIMERcyg_bool_t cyg_mbox_timed_put(    cyg_handle_t mbox,    void *item,    cyg_tick_count_t abstime    );#endif#endifcyg_bool_t cyg_mbox_tryput(cyg_handle_t mbox, void *item);cyg_count32 cyg_mbox_peek(cyg_handle_t mbox);cyg_bool_t cyg_mbox_waiting_to_get(cyg_handle_t mbox);cyg_bool_t cyg_mbox_waiting_to_put(cyg_handle_t mbox);/*-----------------------------------------------------------------------*//* Memory pools                                                          *//* There are two sorts of memory pools.  A variable size memory pool   is for allocating blocks of any size.  A fixed size memory pool, has   the block size specified when the pool is created, and only provides   blocks of that size.  *//* Create a variable size memory pool */void cyg_mempool_var_create(    void            *base,              /* base of memory to use for pool */    cyg_int32       size,               /* size of memory in bytes        */    cyg_handle_t    *handle,            /* returned handle of memory pool */    cyg_mempool_var *var                /* space to put pool structure in */    );/* Delete variable size memory pool */void cyg_mempool_var_delete(cyg_handle_t varpool);/* Allocates a block of length size.  This waits if the memory is not   currently available.  */void *cyg_mempool_var_alloc(cyg_handle_t varpool, cyg_int32 size);/* Allocates a block of length size.  This waits until abstime,   if the memory is not already available.  NULL is returned if   no memory is available. */void *cyg_mempool_var_timed_alloc(    cyg_handle_t     varpool,    cyg_int32        size,    cyg_tick_count_t abstime);/* Allocates a block of length size.  NULL is returned if no memory is   available. */void *cyg_mempool_var_try_alloc(    cyg_handle_t varpool,    cyg_int32    size);/* Frees memory back into variable size pool. */void cyg_mempool_var_free(cyg_handle_t varpool, void *p);/* Returns true if there are any threads waiting for memory in the   given memory pool. */cyg_bool_t cyg_mempool_var_waiting(cyg_handle_t varpool);typedef struct {    cyg_int32 totalmem;    cyg_int32 freemem;    void      *base;    cyg_int32 size;    cyg_int32 blocksize;    cyg_int32 maxfree;                  // The largest free block} cyg_mempool_info;/* Puts information about a variable memory pool into the structure   provided. */void cyg_mempool_var_get_info(cyg_handle_t varpool, cyg_mempool_info *info);/* Create a fixed size memory pool */void cyg_mempool_fix_create(    void            *base,              // base of memory to use for pool    cyg_int32       size,               // size of memory in byte    cyg_int32       blocksize,          // size of allocation in bytes    cyg_handle_t    *handle,            // handle of memory pool    cyg_mempool_fix *fix                // space to put pool structure in    );/* Delete fixed size memory pool */void cyg_mempool_fix_delete(cyg_handle_t fixpool);/* Allocates a block.  This waits if the memory is not   currently available.  */void *cyg_mempool_fix_alloc(cyg_handle_t fixpool);/* Allocates a block.  This waits until abstime, if the memory   is not already available.  NULL is returned if no memory is   available. */void *cyg_mempool_fix_timed_alloc(    cyg_handle_t     fixpool,    cyg_tick_count_t abstime);/* Allocates a block.  NULL is returned if no memory is available. */void *cyg_mempool_fix_try_alloc(cyg_handle_t fixpool);/* Frees memory back into fixed size pool. */void cyg_mempool_fix_free(cyg_handle_t fixpool, void *p);/* Returns true if there are any threads waiting for memory in the   given memory pool. */cyg_bool_t cyg_mempool_fix_waiting(cyg_handle_t fixpool);/* Puts information about a variable memory pool into the structure   provided. */void cyg_mempool_fix_get_info(cyg_handle_t fixpool, cyg_mempool_info *info);/*---------------------------------------------------------------------------*//* Semaphores                                                                */void      cyg_semaphore_init(    cyg_sem_t           *sem,            /* Semaphore to init                */    cyg_count32         val              /* Initial semaphore value          */);void cyg_semaphore_destroy( cyg_sem_t *sem );void cyg_semaphore_wait( cyg_sem_t *sem );#ifdef CYGFUN_KERNEL_THREADS_TIMERcyg_bool_t cyg_semaphore_timed_wait(    cyg_sem_t          *sem,    cyg_tick_count_t   abstime    );#endifcyg_bool_t cyg_semaphore_trywait( cyg_sem_t *sem );void cyg_semaphore_post( cyg_sem_t *sem );void cyg_semaphore_peek( cyg_sem_t *sem, cyg_count32 *val );/*---------------------------------------------------------------------------*//* Flags                                                                     */typedef cyg_uint32 cyg_flag_value_t;typedef cyg_uint8  cyg_flag_mode_t;#define CYG_FLAG_WAITMODE_AND ((cyg_flag_mode_t)0) /* all bits must be set */#define CYG_FLAG_WAITMODE_OR  ((cyg_flag_mode_t)2) /* any bit must be set  */#define CYG_FLAG_WAITMODE_CLR ((cyg_flag_mode_t)1) /* clear when satisfied */void cyg_flag_init(    cyg_flag_t        *flag             /* Flag to init                      */);void cyg_flag_destroy( cyg_flag_t *flag );/* bitwise-or in the bits in value; awaken any waiting tasks whose   condition is now satisfied */void cyg_flag_setbits( cyg_flag_t *flag, cyg_flag_value_t value);/* bitwise-and with the the bits in value; this clears the bits which   are not set in value.  No waiting task can be awoken. */void cyg_flag_maskbits( cyg_flag_t *flag, cyg_flag_value_t value);/* wait for the flag value to match the pattern, according to the mode.   If mode includes CLR, set the flag value to zero when   our pattern is matched.  The return value is that which matched   the request, or zero for an error/timeout return.   Value must not itself be zero. */cyg_flag_value_t cyg_flag_wait( cyg_flag_t        *flag,                                cyg_flag_value_t   pattern,                                 cyg_flag_mode_t    mode );#ifdef CYGFUN_KERNEL_THREADS_TIMERcyg_flag_value_t cyg_flag_timed_wait( cyg_flag_t        *flag,                                      cyg_flag_value_t   pattern,                                       cyg_flag_mode_t    mode,                                      cyg_tick_count_t   abstime );#endifcyg_flag_value_t cyg_flag_poll( cyg_flag_t         *flag,                                cyg_flag_value_t    pattern,                                 cyg_flag_mode_t     mode );cyg_flag_value_t cyg_flag_peek( cyg_flag_t *flag );cyg_bool_t cyg_flag_waiting( cyg_flag_t *flag );/*---------------------------------------------------------------------------*//* Mutex                                                                     */void cyg_mutex_init(    cyg_mutex_t        *mutex          /* Mutex to init                      */);void cyg_mutex_destroy( cyg_mutex_t *mutex );cyg_bool_t cyg_mutex_lock( cyg_mutex_t *mutex );cyg_bool_t cyg_mutex_trylock( cyg_mutex_t *mutex );void cyg_mutex_unlock( cyg_mutex_t *mutex );void cyg_mutex_release( cyg_mutex_t *mutex );/*---------------------------------------------------------------------------*//* Condition Variables                                                       */void cyg_cond_init(    cyg_cond_t          *cond,          /* condition variable to init        */    cyg_mutex_t         *mutex          /* associated mutex                  */);void cyg_cond_destroy( cyg_cond_t *cond );void cyg_cond_wait( cyg_cond_t *cond );void cyg_cond_signal( cyg_cond_t *cond );void cyg_cond_broadcast( cyg_cond_t *cond );#ifdef CYGMFN_KERNEL_SYNCH_CONDVAR_TIMED_WAITcyg_bool_t cyg_cond_timed_wait(    cyg_cond_t        *cond,    cyg_tick_count_t  abstime    );#endif#ifdef __cplusplus}#endif#include <cyg/kernel/kapidata.h>/*---------------------------------------------------------------------------*//* EOF kapi.h                                                                */#endif /* CYGFUN_KERNEL_API_C   */#endif /* CYGONCE_KERNEL_KAPI_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -