ISF  2.2 rev 5
Intelligent Sensing Framework for Kinetis with Processor Expert
isf_sm_types.h
Go to the documentation of this file.
1 /**
2  * @file isf_sm_types.h
3  * @brief The \b isf_sm_types.h contains the collection of type definitions used in the Sensor Manager Interface as well as related defines and data structures
4  * required.
5  *
6  * @copyright Copyright (c) 2015, Freescale Semiconductor, Inc.
7  */
8 
9 #ifndef ISF_SM_TYPES_H_
10 #define ISF_SM_TYPES_H_
11 
12 #include "isf.h"
13 #include "isf_sensor_types.h"
14 #include "isf_dsa_adapter.h"
15 
16 
17 /*!
18  * @brief This status code indicates that the API operation was successful.
19  */
20 //#define ISF_SUCCESS (0)
21 
22 /*!
23  * @brief This is the maximum number of subscribers allowed per sensor.
24  *
25  * \b Note: This define must not be changed by the user.
26  */
27 #define SM_MAX_SUBSCRIBERS_PER_SENSOR (3)
28 
29 /*!
30  * @brief This is the maximum allowed depth of the sample FIFO.
31  *
32  * \b Note: This define must not be changed by the user.
33  */
34 #define SM_MAX_FIFO_DEPTH (20)
35 
36 //! Sensor Manager API return type
38 
39 //! Sensor Manager subscription token type
41 
42 /*
43 typedef enum sm_dsa_return_status
44 {
45  SM_DSA_RET_SETTINGS_CHANGED = 0x0010 // !< Value returned to the user when alternate sensor settings have been suggested.
46 
47 } sm_dsa_ret_t;
48 */
49 
50 /*!
51  * @brief This is returned by the Sensor Manager when an invalid
52  * token ID is passed into any of the API calls.
53  */
54 #define SM_API_ERR_TOKEN_ID (sm_result_t)(-1L)
55 
56 /*!
57  * @brief This is returned by the Sensor Manager when the passed
58  * parameter, sensor ID, does not match an existing sensor.
59  */
60 #define SM_API_ERR_SENSOR_ID (sm_result_t)(-2L)
61 
62 /*!
63  * @brief This is returned by the Sensor Manager when the sensor data flow is already enabled.
64  */
65 #define SM_API_ERR_ALREADY_BEGUN (sm_result_t)(-3L)
66 
67 /*!
68  * @brief This is returned by the Sensor Manager when the sensor
69  * data is unavailable because the data stream has not been
70  * started.
71  */
72 #define SM_API_ERR_NOT_YET_BEGUN (sm_result_t)(-4L)
73 
74 /*!
75  * @brief This is returned by the Sensor Manager when the
76  * maximum number of subscribers as defined in
77  * ::SM_MAX_SUBSCRIBERS_PER_SENSOR for this particular sensor
78  * has been exceeded.
79  */
80 #define SM_API_ERR_SUBSCRIBER_COUNT (sm_result_t)(-5L)
81 
82 /*!
83  * @brief This is returned by the Sensor Manager when an out-of-
84  * memory error status is returned during the execution of the
85  * API.
86  */
87 #define SM_API_ERR_NO_MEMORY (sm_result_t)(-6L)
88 
89 /*!
90  * @brief This is returned by the Sensor Manager when the
91  * requested FIFO depth is larger than the FIFO limit specified
92  * in ::SM_MAX_FIFO_DEPTH.
93  */
94 #define SM_API_ERR_FIFO_OVER_LIMIT (sm_result_t)(-7L)
95 
96 /*!
97  * @brief This is returned by the Sensor Manager when the
98  * requested sample tap rate is invalid.
99  */
100 #define SM_API_ERR_SAMPLE_TAP_RATE (sm_result_t)(-8L)
101 
102 /*!
103  * @brief This is returned by the Sensor Manager when the
104  * requested sensor settings are invalid.
105  */
106 #define SM_API_ERR_SETTINGS_TO_USE (sm_result_t)(-9L)
107 
108 /*!
109  * @brief This is the status code returned by the Sensor Manager
110  * when the sensor cannot be configured based on user
111  * requested sensor settings. Additionally, the Sensor Manager
112  * provides a suggestion for the next best alternate rate and other
113  * possible settings.
114  */
115 #define SM_API_ALTERNATE_OFFERED (sm_result_t)(-10L)
116 
117 /*!
118  * @brief This is returned by the Sensor Manager when the sample buffer lock call fails.
119  */
120 #define SM_API_ERR_BUFFERLOCK_TIMEOUT (sm_result_t)(-11L)
121 
122 /*!
123  * @brief This is returned by the Sensor Manager when the MQX semaphore create call fails.
124  */
125 #define SM_API_ERR_LOCK_CREATION_FAILED (sm_result_t)(-12L)
126 
127 /*!
128  * @brief This is returned by the Sensor Manager when the
129  * requested sensor is not available.
130  */
131 #define SM_API_ERR_SENSOR_NOT_AVAIL (sm_result_t)(-21L)
132 
133 
134 /*!
135  * @brief This is returned by the Sensor Manager when the sensor
136  * is already initialized.
137  */
138 #define SM_API_ERR_SENSOR_ALREADY_INITIALIZED (sm_result_t)(-22L)
139 
140 /*!
141  * @brief This is returned by the Sensor Manager when the sensor initialization was not successful.
142  */
143 #define SM_API_ERR_SENSOR_INIT_FAILED (sm_result_t)(-23L)
144 
145 /*!
146  * @brief This is returned by the Sensor Manager when it receives an invalid handle
147  */
148 #define SM_API_ERR_INVALID_HANDLE (sm_result_t)(-24L)
149 
150 /*!
151  * @brief This is returned by the Sensor Manager when it receives an invalid pointer
152  */
153 #define SM_API_ERR_INVALID_PTR (sm_result_t)(-25L)
154 
155 /*!
156  * @brief This is returned by the Sensor Manager when no more sensor taps are available
157  */
158 #define SM_API_ERR_MAX_TAPS_PER_SENSOR (sm_result_t)(-26L)
159 
160 /*!
161  * @brief This is returned by the Sensor Manager when no more sensor taps are available
162  */
163 #define SM_API_ERR_DATATYPE_NOT_SUPPORTED (sm_result_t)(-27L)
164 
165 /*! Defines for subscriber setting options. */
167 {
169 /*!< Use the current sensor settings. */
171 /*!< Use the user-provided sensor settings if possible. */
173 /*!< Use the given settings, if possible. If not, use the best
174  * possible settings.
175  */
177 
178 
179 /*! Sensor configuration settings used when subscribing to sensor data. */
180 typedef struct
181 {
182  isf_SensorDataTypes_t resultType; //!< The desired data type of the subscription
183  isf_dsa_result_types_t resultFormat; //!< The format of the data to be returned- 0=RAW, 1=FIXED, 2=FLOAT
184  uint32 nSamplePeriod; //!< Sample period in microseconds
185  uint8 nSettingsToUse; //!< 1 = current; 2=given; 3=best possible
186  uint8 nFifoDepth; //!< 1 = no FIFO, or another value < ::SM_MAX_FIFO_DEPTH
188 
189 
190 #endif /* ISF_SM_TYPES_H_ */
unsigned char uint8
Definition: isf_types.h:76
uint32 sm_token_t
Sensor Manager subscription token type.
Definition: isf_sm_types.h:40
SubscriptionSettingChoices
Definition: isf_sm_types.h:166
The isf_sensor_types.h contains the enumerated list of sensor types used by ISF.
enum isf_dsa_result_enums isf_dsa_result_types_t
isf_SensorDataTypes_t
Main ISF header file. Contains code common to all ISF components.
signed long int int32
Definition: isf_types.h:74
enum SubscriptionSettingChoices SubscriptionSettingsChoices_t
int32 sm_result_t
Sensor Manager API return type.
Definition: isf_sm_types.h:37
unsigned long int uint32
Definition: isf_types.h:78