Lines Matching refs:semaphore

557 cy_rslt_t cy_rtos_semaphore_init(cy_semaphore_t* semaphore, uint32_t maxcount, uint32_t initcount)  in cy_rtos_semaphore_init()  argument
559 if (semaphore == NULL) in cy_rtos_semaphore_init()
563 semaphore->maxcount = maxcount; in cy_rtos_semaphore_init()
564 return convert_error(tx_semaphore_create(&(semaphore->tx_semaphore), TX_NULL, initcount)); in cy_rtos_semaphore_init()
571 cy_rslt_t cy_rtos_semaphore_get(cy_semaphore_t* semaphore, cy_time_t timeout_ms) in cy_rtos_semaphore_get() argument
576 if ((semaphore == NULL) || (is_in_isr() && (timeout_ms != 0))) in cy_rtos_semaphore_get()
581 tx_semaphore_get(&(semaphore->tx_semaphore), convert_ms_to_ticks(timeout_ms)); in cy_rtos_semaphore_get()
596 cy_rslt_t cy_rtos_semaphore_set(cy_semaphore_t* semaphore) in cy_rtos_semaphore_set() argument
598 if (semaphore == NULL) in cy_rtos_semaphore_set()
602 return convert_error(tx_semaphore_ceiling_put(&(semaphore->tx_semaphore), semaphore->maxcount)); in cy_rtos_semaphore_set()
609 cy_rslt_t cy_rtos_semaphore_get_count(cy_semaphore_t* semaphore, size_t* count) in cy_rtos_semaphore_get_count() argument
611 if ((semaphore == NULL) || (count == NULL)) in cy_rtos_semaphore_get_count()
615 return convert_error(tx_semaphore_info_get(&(semaphore->tx_semaphore), TX_NULL, (ULONG*)count, in cy_rtos_semaphore_get_count()
623 cy_rslt_t cy_rtos_semaphore_deinit(cy_semaphore_t* semaphore) in cy_rtos_semaphore_deinit() argument
625 if (semaphore == NULL) in cy_rtos_semaphore_deinit()
629 return convert_error(tx_semaphore_delete(&(semaphore->tx_semaphore))); in cy_rtos_semaphore_deinit()