-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathapp_thread.h
More file actions
96 lines (80 loc) · 2.15 KB
/
Copy pathapp_thread.h
File metadata and controls
96 lines (80 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/***************************************************************************
*
* Copyright 2015-2019 BES.
* All rights reserved. All unpublished rights reserved.
*
* No part of this work may be used or reproduced in any form or by any
* means, or stored in a database or retrieval system, without prior written
* permission of BES.
*
* Use of this work is governed by a license granted by BES.
* This work contains confidential and proprietary information of
* BES. which is protected by copyright, trade secret,
* trademark and other intellectual property rights.
*
****************************************************************************/
#ifndef __APP_THREAD_H__
#define __APP_THREAD_H__
#include <stdbool.h>
#include <stdint.h>
#include "plat_types.h"
#ifdef __cplusplus
extern "C" {
#endif
#define APP_MAILBOX_MAX (20)
enum APP_MODUAL_ID_T {
APP_MODUAL_KEY = 0,
APP_MODUAL_AUDIO,
APP_MODUAL_BATTERY,
APP_MODUAL_BT,
APP_MODUAL_FM,
APP_MODUAL_SD,
APP_MODUAL_LINEIN,
APP_MODUAL_USBHOST,
APP_MODUAL_USBDEVICE,
APP_MODUAL_WATCHDOG,
APP_MODUAL_AUDIO_MANAGE,
APP_MODUAL_ANC,
APP_MODUAL_SMART_MIC,
#ifdef __PC_CMD_UART__
APP_MODUAL_CMD,
#endif
#ifdef TILE_DATAPATH
APP_MODUAL_TILE,
#endif
APP_MODUAL_MIC,
#ifdef VOICE_DETECTOR_EN
APP_MODUAL_VOICE_DETECTOR,
#endif
APP_MODUAL_CUSTOM_FUNCTION,
APP_MODUAL_OHTER,
APP_MODUAL_WNR,
APP_MODUAL_NUM
};
typedef struct {
uint32_t message_id;
uint32_t message_ptr;
uint32_t message_Param0;
uint32_t message_Param1;
uint32_t message_Param2;
} APP_MESSAGE_BODY;
typedef struct {
uint32_t src_thread;
uint32_t dest_thread;
uint32_t system_time;
uint32_t mod_id;
APP_MESSAGE_BODY msg_body;
} APP_MESSAGE_BLOCK;
typedef int (*APP_MOD_HANDLER_T)(APP_MESSAGE_BODY *);
int app_mailbox_put(APP_MESSAGE_BLOCK *msg_src);
int app_mailbox_free(APP_MESSAGE_BLOCK *msg_p);
int app_mailbox_get(APP_MESSAGE_BLOCK **msg_p);
int app_os_init(void);
int app_set_threadhandle(enum APP_MODUAL_ID_T mod_id,
APP_MOD_HANDLER_T handler);
void *app_os_tid_get(void);
bool app_is_module_registered(enum APP_MODUAL_ID_T mod_id);
#ifdef __cplusplus
}
#endif
#endif //__FMDEC_H__