summaryrefslogtreecommitdiff
path: root/bsp/efm32/drv_emu.h
blob: da4074f0217dac237ae68c34997cae0e86801647 (plain)
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
/*
 * Copyright (c) 2006-2022, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date         Author      Notes
 * 2011-02-21   onelife     Initial creation for EFM32
 * 2011-07-14   onelife     Add multiple channels support for scan mode
 */

#ifndef __DRV_EMU_H__
#define __DRV_EMU_H__

/* Includes ------------------------------------------------------------------*/
/* Exported defines ----------------------------------------------------------*/
#define EMU_TASK_STACK_SIZE         (256)
#define EMU_TASK_EM2_TOKEN_NUMBER   (255)
#define EMU_TASK_EM3_TOKEN_NUMBER   (255)
#define EMU_TASK_EM4_TOKEN_NUMBER   (255)
#define EMU_RX_MESSAGE_SIZE         (4)
#define EMU_RX_MESSAGE_QUEUE_SIZE   (1)

/* Exported types ------------------------------------------------------------*/
struct efm32_emu_task
{
    struct rt_thread        thread;
    struct rt_semaphore     em2;
    struct rt_semaphore     em3;
    struct rt_semaphore     em4;
    rt_uint8_t              stack[EMU_TASK_STACK_SIZE];
};

/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void emu_all_disable(void);
void emu_em2_disable(void);
void emu_em2_enable(void);
void emu_em3_disable(void);
void emu_em3_enable(void);
void emu_em4_disable(void);
void emu_em4_enable(void);
void efm32_emu_init(void);

#endif /*__DRV_EMU_H__ */