12c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/*
22c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent * Copyright (C) 2004-2010 NXP Software
32c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent * Copyright (C) 2010 The Android Open Source Project
42c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent *
52c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent * Licensed under the Apache License, Version 2.0 (the "License");
62c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent * you may not use this file except in compliance with the License.
72c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent * You may obtain a copy of the License at
82c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent *
92c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent *      http://www.apache.org/licenses/LICENSE-2.0
102c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent *
112c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent * Unless required by applicable law or agreed to in writing, software
122c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent * distributed under the License is distributed on an "AS IS" BASIS,
132c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
142c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent * See the License for the specific language governing permissions and
152c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent * limitations under the License.
162c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent */
172c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
182c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/****************************************************************************************/
192c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/*                                                                                      */
202c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/*  Header file defining the standard LifeVibes types for use in the application layer  */
212c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/*  interface of all LifeVibes modules                                                  */
222c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/*                                                                                      */
232c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/****************************************************************************************/
242c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
252c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#ifndef LVM_TYPES_H
262c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_TYPES_H
272c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
282c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#ifdef __cplusplus
292c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurentextern "C" {
302c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#endif /* __cplusplus */
312c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
32b302bd5d288be2d3363b80053ca2392560b00b25Ashok Bhat#include <stdint.h>
332c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
342c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/****************************************************************************************/
352c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/*                                                                                      */
362c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/*  definitions                                                                         */
372c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/*                                                                                      */
382c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/****************************************************************************************/
392c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
402c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_NULL                0                   /* NULL pointer */
412c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
422c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_TRUE                1                   /* Booleans */
432c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_FALSE               0
442c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
452c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_MAXINT_8            127                 /* Maximum positive integer size */
462c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_MAXINT_16           32767
472c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_MAXINT_32           2147483647
482c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_MAXENUM             2147483647
492c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
502c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_MODULEID_MASK       0xFF00              /* Mask to extract the calling module ID from callbackId */
512c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_EVENTID_MASK        0x00FF              /* Mask to extract the callback event from callbackId */
522c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
532c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/* Memory table*/
542c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_MEMREGION_PERSISTENT_SLOW_DATA      0   /* Offset to the instance memory region */
552c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_MEMREGION_PERSISTENT_FAST_DATA      1   /* Offset to the persistent data memory region */
562c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_MEMREGION_PERSISTENT_FAST_COEF      2   /* Offset to the persistent coefficient memory region */
572c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_MEMREGION_TEMPORARY_FAST            3   /* Offset to temporary memory region */
582c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
592c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_NR_MEMORY_REGIONS                   4   /* Number of memory regions */
602c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
612c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/* Memory partition type */
622c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_MEM_PARTITION0      0                   /* 1st memory partition */
632c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_MEM_PARTITION1      1                   /* 2nd memory partition */
642c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_MEM_PARTITION2      2                   /* 3rd memory partition */
652c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_MEM_PARTITION3      3                   /* 4th memory partition */
662c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
672c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/* Use type */
682c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_MEM_PERSISTENT      0                   /* Persistent memory type */
692c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_MEM_SCRATCH         4                   /* Scratch  memory type */
702c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
712c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/* Access type */
722c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_MEM_INTERNAL        0                   /* Internal (fast) access memory */
732c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_MEM_EXTERNAL        8                   /* External (slow) access memory */
742c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
752c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/* Platform specific */
762c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_PERSISTENT          LVM_MEM_PARTITION0+LVM_MEM_PERSISTENT+LVM_MEM_INTERNAL
772c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_PERSISTENT_DATA     LVM_MEM_PARTITION1+LVM_MEM_PERSISTENT+LVM_MEM_INTERNAL
782c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_PERSISTENT_COEF     LVM_MEM_PARTITION2+LVM_MEM_PERSISTENT+LVM_MEM_INTERNAL
792c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#define LVM_SCRATCH             LVM_MEM_PARTITION3+LVM_MEM_SCRATCH+LVM_MEM_INTERNAL
802c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
812c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/****************************************************************************************/
822c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/*                                                                                      */
832c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/*  Basic types                                                                         */
842c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/*                                                                                      */
852c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/****************************************************************************************/
862c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
872c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurenttypedef     char                LVM_CHAR;           /* ASCII character */
882c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
89b302bd5d288be2d3363b80053ca2392560b00b25Ashok Bhattypedef     int8_t              LVM_INT8;           /* Signed 8-bit word */
90b302bd5d288be2d3363b80053ca2392560b00b25Ashok Bhattypedef     uint8_t             LVM_UINT8;          /* Unsigned 8-bit word */
912c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
92b302bd5d288be2d3363b80053ca2392560b00b25Ashok Bhattypedef     int16_t             LVM_INT16;          /* Signed 16-bit word */
93b302bd5d288be2d3363b80053ca2392560b00b25Ashok Bhattypedef     uint16_t            LVM_UINT16;         /* Unsigned 16-bit word */
942c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
95b302bd5d288be2d3363b80053ca2392560b00b25Ashok Bhattypedef     int32_t             LVM_INT32;          /* Signed 32-bit word */
96b302bd5d288be2d3363b80053ca2392560b00b25Ashok Bhattypedef     uint32_t            LVM_UINT32;         /* Unsigned 32-bit word */
972c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
982c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
992c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/****************************************************************************************/
1002c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/*                                                                                      */
1012c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/*  Standard Enumerated types                                                           */
1022c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/*                                                                                      */
1032c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/****************************************************************************************/
1042c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
1052c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/* Operating mode */
1062c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurenttypedef enum
1072c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent{
1082c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_MODE_OFF    = 0,
1092c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_MODE_ON     = 1,
1102c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_MODE_DUMMY  = LVM_MAXENUM
1112c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent} LVM_Mode_en;
1122c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
1132c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
1142c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/* Format */
1152c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurenttypedef enum
1162c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent{
1172c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_STEREO          = 0,
1182c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_MONOINSTEREO    = 1,
1192c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_MONO            = 2,
1202c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_SOURCE_DUMMY    = LVM_MAXENUM
1212c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent} LVM_Format_en;
1222c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
1232c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
1242c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/* LVM sampling rates */
1252c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurenttypedef enum
1262c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent{
1272c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_FS_8000  = 0,
1282c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_FS_11025 = 1,
1292c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_FS_12000 = 2,
1302c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_FS_16000 = 3,
1312c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_FS_22050 = 4,
1322c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_FS_24000 = 5,
1332c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_FS_32000 = 6,
1342c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_FS_44100 = 7,
1352c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_FS_48000 = 8,
1362c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_FS_INVALID = LVM_MAXENUM-1,
1372c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_FS_DUMMY = LVM_MAXENUM
1382c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent} LVM_Fs_en;
1392c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
1402c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
1412c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/* Memory Types */
1422c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurenttypedef enum
1432c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent{
1442c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_PERSISTENT_SLOW_DATA    = LVM_MEMREGION_PERSISTENT_SLOW_DATA,
1452c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_PERSISTENT_FAST_DATA    = LVM_MEMREGION_PERSISTENT_FAST_DATA,
1462c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_PERSISTENT_FAST_COEF    = LVM_MEMREGION_PERSISTENT_FAST_COEF,
1472c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_TEMPORARY_FAST          = LVM_MEMREGION_TEMPORARY_FAST,
1482c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_MEMORYTYPE_DUMMY        = LVM_MAXENUM
1492c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent} LVM_MemoryTypes_en;
1502c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
1512c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
1522c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/* Memory region definition */
1532c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurenttypedef struct
1542c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent{
1552c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_UINT32                  Size;                   /* Region size in bytes */
1562c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_MemoryTypes_en          Type;                   /* Region type */
1572c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    void                        *pBaseAddress;          /* Pointer to the region base address */
1582c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent} LVM_MemoryRegion_st;
1592c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
1602c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
1612c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/* Memory table containing the region definitions */
1622c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurenttypedef struct
1632c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent{
1642c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent    LVM_MemoryRegion_st         Region[LVM_NR_MEMORY_REGIONS];  /* One definition for each region */
1652c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent} LVM_MemoryTable_st;
1662c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
1672c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
1682c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/****************************************************************************************/
1692c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/*                                                                                      */
1702c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/*  Standard Function Prototypes                                                        */
1712c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/*                                                                                      */
1722c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/****************************************************************************************/
1732c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurenttypedef LVM_INT32 (*LVM_Callback)(void          *pCallbackData,     /* Pointer to the callback data structure */
1742c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent                                  void          *pGeneralPurpose,   /* General purpose pointer (e.g. to a data structure needed in the callback) */
1752c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent                                  LVM_INT16     GeneralPurpose );   /* General purpose variable (e.g. to be used as callback ID) */
1762c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
1772c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
1782c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/****************************************************************************************/
1792c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/*                                                                                      */
1802c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/*  End of file                                                                         */
1812c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/*                                                                                      */
1822c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent/****************************************************************************************/
1832c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
1842c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#ifdef __cplusplus
1852c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent}
1862c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#endif /* __cplusplus */
1872c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent
1882c8e5cab3faa6d360e222b7a6c40a80083d021acEric Laurent#endif  /* LVM_TYPES_H */
189