1 /*---------------------------------------------------------------------------*
2   Project:  TwlSDK - libraries - mic
3   File:     micex.h
4 
5   Copyright 2007-2008 Nintendo. All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law. They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Date:: 2008-09-18#$
14   $Rev: 8573 $
15   $Author: okubata_ryoma $
16  *---------------------------------------------------------------------------*/
17 #ifndef TWL_LIBRARIES_SPI_ARM9_MICEX_H_
18 #define TWL_LIBRARIES_SPI_ARM9_MICEX_H_
19 #ifdef  __cplusplus
20 extern  "C" {
21 #endif
22 /*---------------------------------------------------------------------------*/
23 
24 #include    <nitro/spi/ARM9/mic.h>
25 
26 /*---------------------------------------------------------------------------*
27     Structure Definitions
28  *---------------------------------------------------------------------------*/
29 /* Lock definition for exclusive processing of asynchronous functions */
30 typedef enum MICLock
31 {
32     MIC_LOCK_OFF = 0,                  // Unlock status
33     MIC_LOCK_ON,                       // Lock status
34     MIC_LOCK_MAX
35 }
36 MICLock;
37 
38 /* Work structure */
39 typedef struct MICWork
40 {
41     MICLock lock;                      // Exclusive lock
42     MICCallback callback;              // For saving an asynchronous callback function
43     void   *callbackArg;               // For saving arguments to the callback function
44     MICResult commonResult;            // For saving asynchronous function processing results
45     MICCallback full;                  // For saving the sampling completion callback
46     void   *fullArg;                   // For saving arguments to the completion callback function
47     void   *dst_buf;                   // For saving a storage area for individual sampling results
48 
49 }
50 MICWork;
51 
52 /*---------------------------------------------------------------------------*
53     Function definitions
54  *---------------------------------------------------------------------------*/
55 MICWork*    MICi_GetSysWork(void);
56 
57 MICResult   MICEXi_StartLimitedSampling(const MICAutoParam* param);
58 MICResult   MICEXi_StartLimitedSamplingAsync(const MICAutoParam* param, MICCallback callback, void* arg);
59 MICResult   MICEXi_StopLimitedSampling(void);
60 MICResult   MICEXi_StopLimitedSamplingAsync(MICCallback callback, void* arg);
61 MICResult   MICEXi_AdjustLimitedSampling(u32 rate);
62 MICResult   MICEXi_AdjustLimitedSamplingAsync(u32 rate, MICCallback callback, void* arg);
63 
64 
65 /*---------------------------------------------------------------------------*/
66 #ifdef __cplusplus
67 }   /* extern "C" */
68 #endif
69 #endif  /* TWL_LIBRARIES_SPI_ARM9_MICEX_H_ */
70