Revision 42470f0a

View differences:

inc/todo.txt
1
todo
inc/urt_confcheck.h
1
/*
2
µRtWare is a lightweight publish/subscribe middleware for real-time
3
applications. It was developed as part of the software habitat for the
4
Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well.
5

  
6
Copyright (C) 2018..2018  Thomas Schöpping et al.
7

  
8
This program is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
12

  
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17

  
18
You should have received a copy of the GNU General Public License
19
along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
*/
21

  
22
#ifndef _URTWARE_CONFCHECK_H_
23
#define _URTWARE_CONFCHECK_H_
24

  
25
#include <urtwareconf.h>
26

  
27
#if !defined(URT_CFG_DELAY_WIDTH)
28
  #error "URT_CFG_DELAY_WIDTH not defined in urtwareconf.h"
29
#else
30
  #if !(URT_CFG_DELAY_WIDTH == 32 || URT_CFG_DELAY_WIDTH == 64)
31
    #error "URT_CFG_DELAY_WIDTH set to illegal value in urtwareconf.h"
32
  #endif
33
#endif
34

  
35
#if !defined(URT_CFG_TOPICID_WIDTH)
36
  #error "URT_CFG_TOPICID_WIDTH not defined in urtwareconf.h"
37
#else
38
  #if !(URT_CFG_TOPICID_WIDTH == 8 || URT_CFG_TOPICID_WIDTH == 16 || URT_CFG_TOPICID_WIDTH == 32 || URT_CFG_TOPICID_WIDTH == 64)
39
    #error "URT_CFG_TOPICID_WIDTH set to illegal value in urtwareconf.h"
40
  #endif
41
#endif
42

  
43
#if !defined(URT_CFG_NODESTAGE_WIDTH)
44
  #error "URT_CFG_NODESTAGE_WIDTH not defined in urtwareconf.h"
45
#else
46
  #if !(URT_CFG_NODESTAGE_WIDTH == 8 || URT_CFG_NODESTAGE_WIDTH == 16 || URT_CFG_NODESTAGE_WIDTH == 32 || URT_CFG_NODESTAGE_WIDTH == 64)
47
    #error "URT_CFG_NODESTAGE_WIDTH set to illegal value in urtwareconf.h"
48
  #endif
49
#endif
50

  
51
#if !defined(URT_CFG_DEBUG)
52
  #error "URT_CFG_DEBUG not defined in urtwareconf.h"
53
#endif
54

  
55
#endif /* _URTWARE_CONFCHECK_H_ */
urt_types.h
1
/*
2
µRtWare is a lightweight publish/subscribe middleware for real-time
3
applications. It was developed as part of the software habitat for the
4
Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well.
5

  
6
Copyright (C) 2018..2018  Thomas Schöpping et al.
7

  
8
This program is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
12

  
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17

  
18
You should have received a copy of the GNU General Public License
19
along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
*/
21

  
22
#ifndef _URT_TYPES_H_
23
#define _URT_TYPES_H_
24

  
25
#include <urtwareconf.h>
26
#include <stdint.h>
27

  
28
/*============================================================================*/
29
/* PRIMTIVES                                                                  */
30
/*============================================================================*/
31

  
32
/**
33
 * @brief   Type for representing temporal delays in microseconds.
34
 */
35
#if (URT_CFG_DELAY_WIDTH == 32) || defined (__DOXYGEN__)
36
typedef uint32_t urt_delay_t;
37
#elif (URT_CFG_DELAY_WIDTH == 64)
38
typedef uint64_t urt_delay_t;
39
#else
40
#error "URT_CFG_DELAY_WIDTH set to invalid value"
41
#endif
42

  
43
/**
44
 * @brief   Type representing topic IDs.
45
 */
46
#if (URT_CFG_TOPICID_WIDTH == 8) || defined(__DOXYGEN__)
47
typedef uint8_t urt_topicid_t;
48
#elif (URT_CFG_TOPICID_WIDTH == 16)
49
typedef uint16_t urt_topicid_t;
50
#elif (URT_CFG_TOPICID_WIDTH == 32)
51
typedef uint32_t urt_topicid_t;
52
#elif (URT_CFG_TOPICID_WIDTH == 64)
53
typedef uint64_t urt_topicid_t;
54
#else
55
#error "URT_CFG_TOPICID_WIDTH set to invalid value"
56
#endif
57

  
58
/**
59
 * @brief   Type representing node execution stages.
60
 */
61
#if (URT_CFG_NODESTAGE_WIDTH == 8) || defined(__DOXYGEN__)
62
typedef uint8_t urt_nodestage_t;
63
#elif (URT_CFG_NODESTAGE_WIDTH == 16)
64
typedef uint16_t urt_nodestage_t;
65
#elif (URT_CFG_NODESTAGE_WIDTH == 32)
66
typedef uint32_t urt_nodestage_t;
67
#elif (URT_CFG_NODESTAGE_WIDTH == 64)
68
typedef uint64_t urt_nodestage_t;
69
#else
70
#error "URT_CFG_NODESTAGE_WIDTH set to invalid value"
71
#endif
72

  
73
/**
74
 * @brief   µRtWare error codes.
75
 */
76
typedef enum {
77
  URT_STATUS_OK       = 0,  /**< No error occurred. */
78
  URT_STATUS_WARNING  = 1,  /**< A warning occurred. */
79
  URT_STATUS_ERROR    = -1, /**< An error occurred. */
80
} urt_status_t;
81

  
82
/*============================================================================*/
83
/* URT-OSAL                                                                   */
84
/*============================================================================*/
85

  
86
/**
87
 * @brief   µRtWare OSAL timer callback function type.
88
 */
89
typedef void (*urt_osTimerCallback)(void* parameter);
90

  
91
/**
92
 * @brief   Condition variable status.
93
 */
94
typedef enum {
95
  URT_CONDVAR_STATUS_SIGNAL     = 0,  /**< The condition variable has been signaled individually. */
96
  URT_CONDVAR_STATUS_BROADCAST  = 1,  /**< The condition variable has been signaled via broadcast. */
97
  URT_CONDVAR_STATUS_TIMEOUT    = 2,  /**< The condition variable timed out. */
98
} urt_condvarStatus_t;
99

  
100
/**
101
 * @brief   µRtWare OSAL thread function type.
102
 */
103
typedef void (*urt_osThreadFunction_t)(void* arg);
104

  
105
/**
106
 * @brief   Thread execution state.
107
 */
108
typedef enum {
109
  URT_THREAD_STATE_RUNNING    = 0,  /**< Thread is currently running. */
110
  URT_THREAD_STATE_READY      = 1,  /**< Thread is ready and wating to be scheduled. */
111
  URT_THREAD_STATE_SLEEPING   = 2,  /**< Thread is currently sleeping. */
112
  URT_THREAD_STATE_SUSPENDED  = 3,  /**< Thread is suspended. */
113
  URT_THREAD_STATE_WAITING    = 4,  /**< Thread is waiting for event. */
114
  URT_THREAD_STATE_TERMINATED = 5,  /**< Thread has been terminated. */
115
} urt_osThreadState_t;
116

  
117
/**
118
 * @brief   Thread terminate request flags.
119
 */
120
typedef enum {
121
  URT_THREAD_TERMINATE_REQEUST  = 15, /**< Request thread to terminate. */
122
  URT_THREAD_TERMINATE_KILL     = 9,  /**< Kill thread immediately. */
123
} urt_osThreadTerminateSignal_t;
124

  
125
/**
126
 * @brief   Specifier for waiting for events.
127
 */
128
typedef enum {
129
  URT_EVENT_WAIT_ONE  = 0,  /**< Wait for exactly one event to occur. */
130
  URT_EVENT_WAIT_ANY  = 1,  /**< Wait for any combination of events to occur. */
131
  URT_EVENT_WAIT_ALL  = 2,  /**< Wait for all specified events to have occurred. */
132
} urt_osEventWaitType_t;
133

  
134
#endif /* _URT_TYPES_H_ */
urtware.h
1
/*
2
µRtWare is a lightweight publish/subscribe middleware for real-time
3
applications. It was developed as part of the software habitat for the
4
Autonomous Mini Robot [1] (AMiRo) but can be used for other purposes as well.
5

  
6
Copyright (C) 2018..2018  Thomas Schöpping et al.
7

  
8
This program is free software: you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation, either version 3 of the License, or
11
(at your option) any later version.
12

  
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
GNU General Public License for more details.
17

  
18
You should have received a copy of the GNU General Public License
19
along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
*/
21

  
22
#ifndef _URTWARE_H_
23
#define _URTWARE_H_
24

  
25
/**
26
 * @brief   µRtWare identification macro.
27
 */
28
#define _uRtWare_
29

  
30
/**
31
 * @name    µRtWare version and release information.
32
 * @{
33
 */
34

  
35
/**
36
 * @brief   Release type of this version.
37
 * @note    Possible values are "pre-alpha", "alpha", "beta", "release candidate", and "release".
38
 */
39
#define URTWARE_RELEASE_TYPE      "pre-alpha"
40

  
41
/**
42
 * @brief   The µRtWare major version.
43
 * @note    Changes of the major version imply incompatibilities.
44
 */
45
#define URTWARE_VERSION_MAJOR     0
46

  
47
/**
48
 * @brief   The µRtWare minor version.
49
 * @note    A higher minor version implies new functionalities, but all old interfaces are still available.
50
 */
51
#define URTWARE_VERSION_MINOR     1
52

  
53
/**
54
 * @brief   The µRtWare patch level.
55
 */
56
#define URTWARE_VERSION_PATCH     0
57

  
58
/**
59
 * @brief   The µRtWare operating system abstraction layer interface required major version.
60
 * @note    Any other major version is assumed to be incompatible.
61
 */
62
#define URT_OSAL_REQUIRED_MAJOR   0
63

  
64
/**
65
 * @brief   The µRtWare operating system abstraction layer interface required minor version.
66
 * @note    Higher minor version values are assumed to be compatible, too.
67
 */
68
#define URT_OSAL_REQUIRED_MINOR   1
69

  
70
/** @} */
71

  
72
#include <urtwareconf.h>
73
#if !defined(_URTWARE_CFG_)
74
#error "invalid µRtWare configuration file"
75
#endif
76
#if (URTWARE_CFG_VERSION_MAJOR != URTWARE_VERSION_MAJOR) || (URTWARE_CFG_VERSION_MINOR < URTWARE_VERSION_MINOR)
77
#error "incompatible µRtWare configuration file"
78
#endif
79
#include <urt_confcheck.h>
80

  
81
#include <urt_osal.h>
82
#if !defined(URT_OSAL_VERSION_MAJOR) || !defined(URT_OSAL_VERSION_MINOR)
83
#error "invalid µRt-OSAL implementation"
84
#endif
85
#if (URT_OSAL_VERSION_MAJOR != URT_OSAL_REQUIRED_MAJOR) || (URT_OSAL_VERSION_MINOR < URT_OSAL_REQUIRED_MINOR)
86
#error "incompatible µRt-OSAL implementation"
87
#endif
88

  
89
#endif /* _URTWARE_H_ */

Also available in: Unified diff