summaryrefslogtreecommitdiff
path: root/bsp/efm32/drv_emu.h
blob: 3e491665ba69fab95495b0ed2c334c6be5217a3d (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
47
48
49
50
51
/***************************************************************************//**
 * @file 	drv_emu.h
 * @brief 	EMU driver of RT-Thread RTOS for EFM32
 *  COPYRIGHT (C) 2012, RT-Thread Development Team
 * @author 	onelife
 * @version 1.0
 *******************************************************************************
 * @section License
 * The license and distribution terms for this file may be found in the file
 * LICENSE in this distribution or at http://www.rt-thread.org/license/LICENSE
 *******************************************************************************
 * @section 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__ */