dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pios_queue.h
Go to the documentation of this file.
1 
12 /*
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful, but
19  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  * for more details.
22  *
23  * You should have received a copy of the GNU General Public License along
24  * with this program; if not, see <http://www.gnu.org/licenses/>
25  */
26 
27 #ifndef PIOS_QUEUE_H_
28 #define PIOS_QUEUE_H_
29 
30 #define PIOS_QUEUE_TIMEOUT_MAX 0xffffffff
31 
32 #include <stddef.h>
33 #include <stdbool.h>
34 #include <stdint.h>
35 
36 /*
37  * The following functions implement the concept of a queue usable
38  * with PIOS_INCLUDE_CHIBIOS.
39  *
40  * for details see
41  * http://www.freertos.org/a00018.html
42  * http://chibios.sourceforge.net/html/group__mailboxes.html
43  *
44  */
45 
46 struct pios_queue *PIOS_Queue_Create(size_t queue_length, size_t item_size);
47 void PIOS_Queue_Delete(struct pios_queue *queuep);
48 bool PIOS_Queue_Send(struct pios_queue *queuep, const void *itemp, uint32_t timeout_ms);
49 bool PIOS_Queue_Send_FromISR(struct pios_queue *queuep, const void *itemp, bool *wokenp);
50 bool PIOS_Queue_Receive(struct pios_queue *queuep, void *itemp, uint32_t timeout_ms);
51 size_t PIOS_Queue_GetItemSize(struct pios_queue *queuep);
52 
53 #endif /* PIOS_QUEUE_H_ */
54 
struct pios_queue * PIOS_Queue_Create(size_t queue_length, size_t item_size)
Definition: pios_queue.c:47
bool PIOS_Queue_Send_FromISR(struct pios_queue *queuep, const void *itemp, bool *wokenp)
Definition: pios_queue.c:163
bool PIOS_Queue_Send(struct pios_queue *queuep, const void *itemp, uint32_t timeout_ms)
Definition: pios_queue.c:141
bool PIOS_Queue_Receive(struct pios_queue *queuep, void *itemp, uint32_t timeout_ms)
Definition: pios_queue.c:213
void PIOS_Queue_Delete(struct pios_queue *queuep)
Definition: pios_queue.c:89
uint16_t item_size
Definition: pios_queue.c:41
size_t PIOS_Queue_GetItemSize(struct pios_queue *queuep)
Definition: pios_queue.c:235