takashi kadono
/
Nucleo446_SSD1331
Color Oled(SSD1331) connect to STMicroelectronics Nucleo-F466
mbed-os/events/mbed_shared_queues.h@3:f3764f852aa8, 2018-10-11 (annotated)
- Committer:
- kadonotakashi
- Date:
- Thu Oct 11 02:27:46 2018 +0000
- Revision:
- 3:f3764f852aa8
- Parent:
- 0:8fdf9a60065b
Nucreo 446 + SSD1331 test version;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kadonotakashi | 0:8fdf9a60065b | 1 | |
kadonotakashi | 0:8fdf9a60065b | 2 | /** \addtogroup events */ |
kadonotakashi | 0:8fdf9a60065b | 3 | /** @{*/ |
kadonotakashi | 0:8fdf9a60065b | 4 | /* events |
kadonotakashi | 0:8fdf9a60065b | 5 | * Copyright (c) 2017 ARM Limited |
kadonotakashi | 0:8fdf9a60065b | 6 | * |
kadonotakashi | 0:8fdf9a60065b | 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
kadonotakashi | 0:8fdf9a60065b | 8 | * you may not use this file except in compliance with the License. |
kadonotakashi | 0:8fdf9a60065b | 9 | * You may obtain a copy of the License at |
kadonotakashi | 0:8fdf9a60065b | 10 | * |
kadonotakashi | 0:8fdf9a60065b | 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
kadonotakashi | 0:8fdf9a60065b | 12 | * |
kadonotakashi | 0:8fdf9a60065b | 13 | * Unless required by applicable law or agreed to in writing, software |
kadonotakashi | 0:8fdf9a60065b | 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
kadonotakashi | 0:8fdf9a60065b | 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
kadonotakashi | 0:8fdf9a60065b | 16 | * See the License for the specific language governing permissions and |
kadonotakashi | 0:8fdf9a60065b | 17 | * limitations under the License. |
kadonotakashi | 0:8fdf9a60065b | 18 | */ |
kadonotakashi | 0:8fdf9a60065b | 19 | #ifndef MBED_SHARED_QUEUES_H |
kadonotakashi | 0:8fdf9a60065b | 20 | #define MBED_SHARED_QUEUES_H |
kadonotakashi | 0:8fdf9a60065b | 21 | |
kadonotakashi | 0:8fdf9a60065b | 22 | #include "events/EventQueue.h" |
kadonotakashi | 0:8fdf9a60065b | 23 | |
kadonotakashi | 0:8fdf9a60065b | 24 | namespace mbed { |
kadonotakashi | 0:8fdf9a60065b | 25 | |
kadonotakashi | 0:8fdf9a60065b | 26 | /** |
kadonotakashi | 0:8fdf9a60065b | 27 | * Return a pointer to an EventQueue, on which normal tasks can be queued. |
kadonotakashi | 0:8fdf9a60065b | 28 | * |
kadonotakashi | 0:8fdf9a60065b | 29 | * All calls to this return the same EventQueue - it and its dispatch thread |
kadonotakashi | 0:8fdf9a60065b | 30 | * are created on the first call to this function. The dispatch thread |
kadonotakashi | 0:8fdf9a60065b | 31 | * runs at default priority (currently osPriorityNormal). |
kadonotakashi | 0:8fdf9a60065b | 32 | * |
kadonotakashi | 0:8fdf9a60065b | 33 | * The EventQueue returned may be used to call() Events, or to chain() other |
kadonotakashi | 0:8fdf9a60065b | 34 | * EventQueues so that they are run in the same context. |
kadonotakashi | 0:8fdf9a60065b | 35 | * |
kadonotakashi | 0:8fdf9a60065b | 36 | * Events (or chained EventQueues) executing on the normal event queue should |
kadonotakashi | 0:8fdf9a60065b | 37 | * normally take less than 10ms to execute, to avoid starving other users. As |
kadonotakashi | 0:8fdf9a60065b | 38 | * such, users can expect that event latency will typically be 10ms or less, |
kadonotakashi | 0:8fdf9a60065b | 39 | * but could occasionally be significantly higher if many events are queued. |
kadonotakashi | 0:8fdf9a60065b | 40 | * |
kadonotakashi | 0:8fdf9a60065b | 41 | * If an RTOS is not present or the configuration option |
kadonotakashi | 0:8fdf9a60065b | 42 | * `events.shared-dispatch-from-application` is set to true, then this |
kadonotakashi | 0:8fdf9a60065b | 43 | * does not create a dedicated dispatch thread - instead the application is |
kadonotakashi | 0:8fdf9a60065b | 44 | * expected to run the EventQueue's dispatch, eg from main. This is necessary |
kadonotakashi | 0:8fdf9a60065b | 45 | * for the event loop to work without an RTOS, or an RTOS system can can save |
kadonotakashi | 0:8fdf9a60065b | 46 | * memory by reusing the main stack. |
kadonotakashi | 0:8fdf9a60065b | 47 | * |
kadonotakashi | 0:8fdf9a60065b | 48 | * @note |
kadonotakashi | 0:8fdf9a60065b | 49 | * mbed_event_queue is not itself IRQ safe. To use the mbed_event_queue in |
kadonotakashi | 0:8fdf9a60065b | 50 | * interrupt context, you must first call `mbed_event_queue()` in threaded |
kadonotakashi | 0:8fdf9a60065b | 51 | * context and store the pointer for later use. |
kadonotakashi | 0:8fdf9a60065b | 52 | * |
kadonotakashi | 0:8fdf9a60065b | 53 | * @return pointer to event queue |
kadonotakashi | 0:8fdf9a60065b | 54 | */ |
kadonotakashi | 0:8fdf9a60065b | 55 | events::EventQueue *mbed_event_queue(); |
kadonotakashi | 0:8fdf9a60065b | 56 | |
kadonotakashi | 0:8fdf9a60065b | 57 | #ifdef MBED_CONF_RTOS_PRESENT |
kadonotakashi | 0:8fdf9a60065b | 58 | /** |
kadonotakashi | 0:8fdf9a60065b | 59 | * Return a pointer to an EventQueue, on which small high-priority tasks can |
kadonotakashi | 0:8fdf9a60065b | 60 | * be queues, such as simple deferrals from interrupt. |
kadonotakashi | 0:8fdf9a60065b | 61 | * |
kadonotakashi | 0:8fdf9a60065b | 62 | * All calls to this return the same EventQueue - it and its thread are |
kadonotakashi | 0:8fdf9a60065b | 63 | * created on the first call to this function. The dispatch thread |
kadonotakashi | 0:8fdf9a60065b | 64 | * runs at a high priority (currently osPriorityHigh). |
kadonotakashi | 0:8fdf9a60065b | 65 | * |
kadonotakashi | 0:8fdf9a60065b | 66 | * The EventQueue returned may be used to call() Events, or to chain() other |
kadonotakashi | 0:8fdf9a60065b | 67 | * EventQueues so that they are run in the same context. |
kadonotakashi | 0:8fdf9a60065b | 68 | * |
kadonotakashi | 0:8fdf9a60065b | 69 | * Events (or chained EventQueues) executing on the high-priority event queue |
kadonotakashi | 0:8fdf9a60065b | 70 | * should normally take less than 100us to execute, to avoid starving other |
kadonotakashi | 0:8fdf9a60065b | 71 | * users. As such, users can expect that event latency will typically be 100us |
kadonotakashi | 0:8fdf9a60065b | 72 | * or less, but could occasionally be significantly higher if many events are |
kadonotakashi | 0:8fdf9a60065b | 73 | * queued. |
kadonotakashi | 0:8fdf9a60065b | 74 | * |
kadonotakashi | 0:8fdf9a60065b | 75 | * @note |
kadonotakashi | 0:8fdf9a60065b | 76 | * mbed_highprio_event_queue is not itself IRQ safe. To use the |
kadonotakashi | 0:8fdf9a60065b | 77 | * mbed_highprio_event_queue in interrupt context, you must first call |
kadonotakashi | 0:8fdf9a60065b | 78 | * `mbed_event_queue()` in threaded context and store the pointer for |
kadonotakashi | 0:8fdf9a60065b | 79 | * later use. |
kadonotakashi | 0:8fdf9a60065b | 80 | * |
kadonotakashi | 0:8fdf9a60065b | 81 | * @return pointer to high-priority event queue |
kadonotakashi | 0:8fdf9a60065b | 82 | */ |
kadonotakashi | 0:8fdf9a60065b | 83 | |
kadonotakashi | 0:8fdf9a60065b | 84 | events::EventQueue *mbed_highprio_event_queue(); |
kadonotakashi | 0:8fdf9a60065b | 85 | |
kadonotakashi | 0:8fdf9a60065b | 86 | #endif // MBED_CONF_RTOS_PRESENT |
kadonotakashi | 0:8fdf9a60065b | 87 | |
kadonotakashi | 0:8fdf9a60065b | 88 | }; |
kadonotakashi | 0:8fdf9a60065b | 89 | |
kadonotakashi | 0:8fdf9a60065b | 90 | #endif |
kadonotakashi | 0:8fdf9a60065b | 91 | |
kadonotakashi | 0:8fdf9a60065b | 92 | /** @}*/ |