MDK-ARM Keil, MDK-ARM Datasheet - Page 33
![KIT REALVIEW MCU DEVELOPMENT](/photos/9/32/93274/mdk-arm_sml.jpg)
MDK-ARM
Manufacturer Part Number
MDK-ARM
Description
KIT REALVIEW MCU DEVELOPMENT
Manufacturer
Keil
Type
Compiler and IDEr
Specifications of MDK-ARM
For Use With/related Products
ARM MCUs
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
- Current page: 33 of 156
- Download datasheet (3Mb)
Getting Started: Building Applications with RL-ARM
33
To use a semaphore in RTX you must first declare a semaphore container:
OS_SEM <semaphore>;
Then within a task, the semaphore container can be initialized with a number of
tokens.
void os_sem_init (OS_ID semaphore, unsigned short token_count);
It is important to understand that semaphore tokens may also be created and
destroyed as tasks run. So for example, you can initialize a semaphore with zero
tokens and then use one task to create tokens into the semaphore while another
task removes them. This allows you to design tasks as producer and consumer
tasks.
Once the semaphore is initialized, tokens may be acquired and sent to the
semaphore in a similar fashion as event flags. The os_sem_wait() call is used to
block a task until a semaphore token is available, like the os_evnt_wait_or() call.
A timeout period may also be specified with
being an infinite wait.
0xFFFF
OS_RESULT os_sem_wait (OS_ID semaphore, unsigned short timeout)
When a token is available in the semaphore a waiting task will acquire the token,
decrementing the semaphore token count by one. Once the token has been
acquired, the waiting task will move to the READY state and then into the RUN
state when the scheduler allocates it run time on the CPU.
When the task has finished using the semaphore resource, it can send a token to
the semaphore container.
OS_RESULT os_sem_send (OS_ID semaphore)
Like events, interrupt service routines can send semaphore tokens to a semaphore
container. This allows interrupt routines to control the execution of tasks
dependant on semaphore access.
void isr_sem_send (OS_ID semaphore)
Exercise: Semaphores
This first semaphore exercise demonstrates the basic configuration and use of a
semaphore.
Related parts for MDK-ARM
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
![MDK-ARM-B](/photos/28/43/284363/mdk-arm-basic_tmb.jpg)
Part Number:
Description:
KIT REALVIEW MCU DEVELOPMENT
Manufacturer:
Keil
Datasheet:
![MDK-ARM-B-SM](/photos/15/87/158780/keil_software_tmb.jpg)
Part Number:
Description:
Development Software SUPPORT EXTENSION FOR MDK-ARM-B
Manufacturer:
Keil Software
![MDK-ARM-SM](/photos/15/87/158780/keil_software_tmb.jpg)
Part Number:
Description:
Development Software SUPPORT EXTENSION FOR MDK-ARM
Manufacturer:
Keil Software
![MDK-ARM-BASIC](/photos/28/43/284363/mdk-arm-basic_tmb.jpg)
Part Number:
Description:
KIT REALVIEW MCU DEVELOPMENT
Manufacturer:
Keil
Datasheet:
![MDK-ARM-UF](/photos/15/87/158780/keil_software_tmb.jpg)
Part Number:
Description:
Development Software MCU DEV KIT FOR ARM UPG TO FLOATING LIC
Manufacturer:
Keil Tools
![MDK-ARM-F](/photos/15/87/158780/keil_software_tmb.jpg)
Part Number:
Description:
Development Software MCU DEV KIT FOR ARM W/ FLOATING LICENSE
Manufacturer:
Keil Software
![MDK-ARM3.1](/photos/26/86/268691/landingpagekeilrealviewarmkit_tmb.jpg)
Part Number:
Description:
Development Software MCU DEV KIT FOR ARM uVISION & C++ & RTX
Manufacturer:
Keil Tools
![MDK-ARM-SMB](/images/no-image3.png)
Part Number:
Description:
Development Software SUPP LICENSE RENEWAL 90+ DAYS NO TECH SUP
Manufacturer:
Keil Software
![KEIL-PK51-INTL](/images/manufacturer_photos/0/6/609/silicon_laboratories_inc_tmb.jpg)
Part Number:
Description:
KEIL C-COMPILER INTERNATIONAL
Manufacturer:
Silicon Laboratories Inc
![OM10045](/photos/9/21/92162/om10045_tmb.jpg)
Part Number:
Description:
BOARD EVAL FOR LPC213X ARM MCU
Manufacturer:
NXP Semiconductors
Datasheet:
![TWR-K60N512-KEIL](/images/manufacturer_photos/0/2/262/freescale_semiconductor_tmb.jpg)
Part Number:
Description:
K60N512 Keil Tower Kit
Manufacturer:
Freescale Semiconductor
Datasheet: