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