NHS31xx SW API
accel.h
1 /*
2  * Copyright 2018-2020 NXP
3  * This software is owned or controlled by NXP and may only be used strictly
4  * in accordance with the applicable license terms. By expressly accepting
5  * such terms or by downloading, installing, activating and/or otherwise using
6  * the software, you are agreeing that you have read, and that you agree to
7  * comply with and are bound by, such license terms. If you do not agree to
8  * be bound by the applicable license terms, then you may not retain, install,
9  * activate or otherwise use the software.
10  */
11 
12 #ifndef __ACCEL_H_
13 #define __ACCEL_H_
14 
15 #include <stdbool.h>
16 #include <stdint.h>
17 #include "accel/accel_dft.h"
18 #include "accel/accel_params.h"
19 
170 typedef enum ACCEL_MODE {
180 
181  ACCEL_MODE_ALL = 0x0F,
182 } ACCEL_MODE_T;
183 
187 typedef enum ACCEL_STATE {
194 
202 
210 } ACCEL_STATE_T;
211 
215 #define ACCEL_WORKSPACE_SIZE 22
216 
217 /* ------------------------------------------------------------------------- */
218 
220 #define ACCEL_SHOCK_DEFAULT_AMPLITUDE 12000 /* milli-g */
221 
223 #define ACCEL_SHOCK_DEFAULT_WAITTIME 100 /* ms */
224 
226 #define ACCEL_SHOCK_DEFAULT_RINGING_AMPLITUDE 4000 /* milli-g */
227 
229 #define ACCEL_SHOCK_DEFAULT_RINGING_COUNT 2
230 
232 #define ACCEL_SHOCK_DEFAULT_RINGING_DURATION 900 /* ms */
233 
235 #define ACCEL_SHAKE_DEFAULT_AMPLITUDE 2500 /* milli-g */
236 
238 #define ACCEL_SHAKE_DEFAULT_COUNT 4
239 
241 #define ACCEL_SHAKE_DEFAULT_DURATION 1500 /* ms */
242 
244 #define ACCEL_VIBRATION_DEFAULT_AMPLITUDE 1500 /* milli-g */
245 
247 #define ACCEL_VIBRATION_DEFAULT_FREQUENCY 20 /* Hz */
248 
250 #define ACCEL_VIBRATION_DEFAULT_DURATION 4 /* s */
251 
253 #define ACCEL_TILT_DEFAULT_WAITTIME 1000 /* ms */
254 
255 /* ------------------------------------------------------------------------- */
256 
264 WEAK void Accel_Cb(ACCEL_MODE_T mode, ACCEL_STATE_T state);
265 
278 void Accel_Init(void * pWorkspace);
279 
286 void Accel_DeInit(void);
287 
300 void Accel_SetParams(const ACCEL_SHOCK_PARAMS_T * pShock, const ACCEL_SHAKE_PARAMS_T * pShake,
301  const ACCEL_VIBRATION_PARAMS_T * pVibration, const ACCEL_TILT_PARAMS_T * pTilt);
302 
312  ACCEL_VIBRATION_PARAMS_T * pVibration, ACCEL_TILT_PARAMS_T * pTilt);
313 
328 int Accel_Start(int mode);
329 
341 int Accel_Stop(int mode);
342 
352 bool Accel_Check(void);
353 
354 #endif
int Accel_Start(int mode)
bool Accel_Check(void)
Definition: accel.h:175
ACCEL_MODE_T
Definition: accel.h:170
void Accel_GetParams(ACCEL_SHOCK_PARAMS_T *pShock, ACCEL_SHAKE_PARAMS_T *pShake, ACCEL_VIBRATION_PARAMS_T *pVibration, ACCEL_TILT_PARAMS_T *pTilt)
Definition: accel.h:209
Definition: accel.h:179
Definition: accel.h:173
WEAK void Accel_Cb(ACCEL_MODE_T mode, ACCEL_STATE_T state)
Definition: accel_params.h:121
Definition: accel_params.h:26
Definition: accel_params.h:65
Definition: accel_params.h:90
ACCEL_STATE_T
Definition: accel.h:187
Definition: accel.h:176
Definition: accel.h:181
void Accel_DeInit(void)
void Accel_Init(void *pWorkspace)
Definition: accel.h:171
Definition: accel.h:193
int Accel_Stop(int mode)
#define WEAK
Definition: startup.h:76
void Accel_SetParams(const ACCEL_SHOCK_PARAMS_T *pShock, const ACCEL_SHAKE_PARAMS_T *pShake, const ACCEL_VIBRATION_PARAMS_T *pVibration, const ACCEL_TILT_PARAMS_T *pTilt)
Definition: accel.h:201
Definition: accel.h:174