2011-07-08 15:13:20 +08:00
|
|
|
/***************************************************************************//**
|
|
|
|
* @file rtconfig.h
|
2011-02-17 11:33:15 +08:00
|
|
|
* @brief RT-Thread config file
|
|
|
|
* COPYRIGHT (C) 2009, RT-Thread Development Team
|
|
|
|
* @author
|
2011-07-08 15:13:20 +08:00
|
|
|
* @version 0.4 beta
|
|
|
|
*******************************************************************************
|
2011-02-17 11:33:15 +08:00
|
|
|
* @section License
|
2011-07-08 15:13:20 +08:00
|
|
|
* 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
|
|
|
|
******************************************************************************/
|
2011-02-17 11:33:15 +08:00
|
|
|
#ifndef __RTTHREAD_CFG_H__
|
|
|
|
#define __RTTHREAD_CFG_H__
|
|
|
|
|
2011-07-08 15:13:20 +08:00
|
|
|
/* Includes ------------------------------------------------------------------*/
|
|
|
|
/* Exported types ------------------------------------------------------------*/
|
|
|
|
/* Exported constants --------------------------------------------------------*/
|
|
|
|
/* Exported macro ------------------------------------------------------------*/
|
2011-02-17 11:33:15 +08:00
|
|
|
/* RT_NAME_MAX*/
|
2011-07-08 15:13:20 +08:00
|
|
|
#define RT_NAME_MAX (8)
|
2011-02-17 11:33:15 +08:00
|
|
|
|
|
|
|
/* RT_ALIGN_SIZE*/
|
2011-07-08 15:13:20 +08:00
|
|
|
#define RT_ALIGN_SIZE (4)
|
2011-02-17 11:33:15 +08:00
|
|
|
|
|
|
|
/* PRIORITY_MAX */
|
2011-07-08 15:13:20 +08:00
|
|
|
#define RT_THREAD_PRIORITY_MAX (32)
|
2011-02-17 11:33:15 +08:00
|
|
|
|
|
|
|
/* Tick per Second */
|
2011-07-08 15:13:20 +08:00
|
|
|
#define RT_TICK_PER_SECOND (100)
|
2011-02-17 11:33:15 +08:00
|
|
|
|
|
|
|
/* SECTION: RT_DEBUG */
|
|
|
|
#define RT_DEBUG
|
2011-07-11 14:16:26 +08:00
|
|
|
//#define RT_DEBUG_MEM (1)
|
2011-07-08 15:13:20 +08:00
|
|
|
//#define RT_DEBUG_SCHEDULER (1)
|
2011-07-29 10:47:37 +08:00
|
|
|
//#define RT_DEBUG_IPC (1)
|
2011-02-17 11:33:15 +08:00
|
|
|
//#define THREAD_DEBUG
|
|
|
|
//#define IRQ_DEBUG
|
2011-03-29 17:41:22 +08:00
|
|
|
#define RT_USING_OVERFLOW_CHECK
|
2011-07-08 15:13:20 +08:00
|
|
|
//#define DFS_DEBUG
|
|
|
|
#define RT_LWIP_DEBUG
|
2011-03-29 17:41:22 +08:00
|
|
|
|
2011-02-17 11:33:15 +08:00
|
|
|
//#define RT_IRQHDL_DEBUG
|
2011-07-08 15:13:20 +08:00
|
|
|
//#define RT_USART_DEBUG
|
2011-06-20 09:56:28 +08:00
|
|
|
//#define RT_IIC_DEBUG
|
|
|
|
//#define RT_MISC_DEBUG
|
2011-02-28 12:47:50 +08:00
|
|
|
//#define RT_ADC_DEBUG
|
2011-03-29 17:41:22 +08:00
|
|
|
//#define RT_ACMP_DEBUG
|
|
|
|
//#define RT_TIMER_DEBUG
|
2011-06-20 09:56:28 +08:00
|
|
|
//#define RT_RTC_DEBUG
|
|
|
|
|
2011-07-29 10:47:37 +08:00
|
|
|
#define EFM32_DEBUG
|
|
|
|
#define RT_ACCEL_DEBUG
|
2011-06-20 09:56:28 +08:00
|
|
|
#define EFM32_SFLASH_DEBUG
|
|
|
|
//#define EFM32_SDCARD_DEBUG
|
2011-07-29 10:47:37 +08:00
|
|
|
//#define EFM32_ETHERNET_DEBUG
|
2011-07-08 15:13:20 +08:00
|
|
|
|
2011-02-17 11:33:15 +08:00
|
|
|
|
|
|
|
/* Using Hook */
|
2011-03-29 17:41:22 +08:00
|
|
|
//#define RT_USING_HOOK
|
2011-02-17 11:33:15 +08:00
|
|
|
|
|
|
|
/* Using Software Timer */
|
|
|
|
/* #define RT_USING_TIMER_SOFT */
|
2011-07-08 15:13:20 +08:00
|
|
|
#define RT_TIMER_THREAD_PRIO (4)
|
|
|
|
#define RT_TIMER_THREAD_STACK_SIZE (512)
|
|
|
|
#define RT_TIMER_TICK_PER_SECOND (10)
|
2011-02-17 11:33:15 +08:00
|
|
|
|
|
|
|
/* SECTION: IPC */
|
|
|
|
/* Using Semaphore*/
|
2011-07-08 15:13:20 +08:00
|
|
|
#define RT_USING_SEMAPHORE /* Using by DFS and lwIP */
|
2011-02-17 11:33:15 +08:00
|
|
|
/* Using Mutex */
|
2011-07-08 15:13:20 +08:00
|
|
|
//#define RT_USING_MUTEX /* Using by DFS */
|
2011-02-17 11:33:15 +08:00
|
|
|
/* Using Event */
|
2011-03-29 17:41:22 +08:00
|
|
|
//#define RT_USING_EVENT
|
2011-02-17 11:33:15 +08:00
|
|
|
/* Using MailBox */
|
2011-07-08 15:13:20 +08:00
|
|
|
#define RT_USING_MAILBOX /* Using by lwIP */
|
2011-02-17 11:33:15 +08:00
|
|
|
/* Using Message Queue */
|
2011-03-29 17:41:22 +08:00
|
|
|
//#define RT_USING_MESSAGEQUEUE
|
2011-02-17 11:33:15 +08:00
|
|
|
/* SECTION: Memory Management */
|
|
|
|
/* Using Memory Pool Management*/
|
2011-03-29 17:41:22 +08:00
|
|
|
//#define RT_USING_MEMPOOL
|
2011-02-17 11:33:15 +08:00
|
|
|
|
|
|
|
/* Using Dynamic Heap Management */
|
|
|
|
#define RT_USING_HEAP
|
|
|
|
|
|
|
|
/* Using Small MM */
|
|
|
|
#define RT_USING_SMALL_MEM
|
|
|
|
|
|
|
|
/* SECTION: Device System */
|
|
|
|
/* Using Device System */
|
|
|
|
#define RT_USING_DEVICE
|
|
|
|
|
|
|
|
/* USART Device for Console */
|
|
|
|
#if defined(EFM32_G290_DK)
|
2011-07-08 15:13:20 +08:00
|
|
|
#define RT_USING_USART1 (0x0UL)
|
|
|
|
#define RT_USART1_NAME "debug"
|
|
|
|
//#define RT_USART1_USING_DMA (0x0UL)
|
2011-02-17 11:33:15 +08:00
|
|
|
#elif defined(EFM32_G890_STK)
|
2011-07-08 15:13:20 +08:00
|
|
|
#define RT_USING_USART1 (0x1UL)
|
|
|
|
#define RT_USART1_NAME "debug"
|
2011-07-29 10:47:37 +08:00
|
|
|
//#define RT_USART1_USING_DMA (0x0UL)
|
2011-02-17 11:33:15 +08:00
|
|
|
#endif
|
|
|
|
|
2011-05-12 15:19:37 +08:00
|
|
|
/* SECTION: SPI options */
|
|
|
|
#if defined(EFM32_G290_DK)
|
2011-07-08 15:13:20 +08:00
|
|
|
#define RT_USING_USART0 (0x2UL)
|
|
|
|
#define RT_USART0_SYNC_MODE (0x1UL) /* Master */
|
|
|
|
#define RT_USART0_NAME "spi0"
|
|
|
|
#define RT_USART0_USING_DMA (0x1UL)
|
|
|
|
|
|
|
|
#define RT_USING_USART2 (0x1UL)
|
|
|
|
#define RT_USART2_SYNC_MODE (0x1UL) /* Master */
|
|
|
|
#define RT_USART2_NAME "spi2"
|
|
|
|
#define RT_USART2_USING_DMA (0x2UL)
|
2011-05-12 15:19:37 +08:00
|
|
|
#elif defined(EFM32_G890_STK)
|
2011-07-08 15:13:20 +08:00
|
|
|
//#define RT_USING_USART0 (0x0UL)
|
|
|
|
//#define RT_USART0_SYNC_MODE (0x1UL) /* Master */
|
|
|
|
//#define RT_USART0_NAME "spi0"
|
|
|
|
//#define RT_USART0_USING_DMA (0x1UL)
|
2011-05-12 15:19:37 +08:00
|
|
|
#endif
|
|
|
|
|
2011-06-20 09:56:28 +08:00
|
|
|
/* SECTION: IIC options */
|
2011-07-08 15:13:20 +08:00
|
|
|
//#define RT_USING_IIC0 0x1UL
|
|
|
|
#define RT_IIC0_NAME "iic0"
|
2011-02-28 12:47:50 +08:00
|
|
|
|
2011-06-20 09:56:28 +08:00
|
|
|
/* SECTION: ACMP options */
|
|
|
|
//#define RT_USING_ACMP0
|
2011-07-08 15:13:20 +08:00
|
|
|
#define RT_ACMP0_NAME "acmp0"
|
2011-02-28 12:47:50 +08:00
|
|
|
|
|
|
|
/* SECTION: ADC options */
|
2011-07-08 15:13:20 +08:00
|
|
|
#define RT_USING_ADC0
|
2011-07-29 10:47:37 +08:00
|
|
|
#define RT_ADC0_NAME "adc0"
|
|
|
|
#if defined(RT_USING_ADC0)
|
|
|
|
#define RT_USING_MISC
|
|
|
|
#endif
|
2011-02-28 12:47:50 +08:00
|
|
|
|
2011-06-20 09:56:28 +08:00
|
|
|
/* SECTION: TIMER options */
|
2011-07-08 15:13:20 +08:00
|
|
|
//#define RT_USING_TIMER2 (0x00) /* Continuous mode */
|
|
|
|
#define RT_TIMER2_NAME "tmr2"
|
2011-06-20 09:56:28 +08:00
|
|
|
|
|
|
|
/* SECTION: RTC options */
|
|
|
|
#if (defined(EFM32_G290_DK) || defined(EFM32_G890_STK))
|
|
|
|
//#define RT_USING_RTC
|
2011-07-08 15:13:20 +08:00
|
|
|
#define RT_RTC_NAME "rtc"
|
2011-06-20 09:56:28 +08:00
|
|
|
#endif
|
|
|
|
|
2011-02-17 11:33:15 +08:00
|
|
|
/* SECTION: Serial options */
|
|
|
|
#if defined(EFM32_G290_DK)
|
2011-07-08 15:13:20 +08:00
|
|
|
#define RT_CONSOLE_DEVICE (0x1UL)
|
2011-02-17 11:33:15 +08:00
|
|
|
#elif defined(EFM32_G890_STK)
|
2011-07-08 15:13:20 +08:00
|
|
|
#define RT_CONSOLE_DEVICE (0x1UL)
|
2011-02-17 11:33:15 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* SECTION: Console options */
|
2011-03-29 17:41:22 +08:00
|
|
|
#define RT_USING_CONSOLE
|
2011-02-17 11:33:15 +08:00
|
|
|
/* the buffer size of console*/
|
2011-07-08 15:13:20 +08:00
|
|
|
#define RT_CONSOLEBUF_SIZE (128)
|
2011-02-17 11:33:15 +08:00
|
|
|
|
|
|
|
/* SECTION: finsh, a C-Express shell */
|
|
|
|
#define RT_USING_FINSH
|
|
|
|
/* Using symbol table */
|
|
|
|
#define FINSH_USING_SYMTAB
|
|
|
|
#define FINSH_USING_DESCRIPTION
|
|
|
|
|
2011-07-29 10:47:37 +08:00
|
|
|
/* SECTION: Peripheral devices */
|
2011-06-20 09:56:28 +08:00
|
|
|
#if defined(EFM32_G290_DK)
|
2011-07-29 10:47:37 +08:00
|
|
|
//#define EFM32_USING_ACCEL /* Three axis accelerometer */
|
|
|
|
//#define EFM32_USING_SFLASH /* SPI Flash */
|
|
|
|
//#define EFM32_USING_SPISD /* MicroSD card */
|
|
|
|
#define EFM32_USING_ETHERNET /* Ethernet controller */
|
|
|
|
#endif
|
|
|
|
#if defined(EFM32_USING_ACCEL)
|
|
|
|
#define ACCEL_USING_DEVICE_NAME RT_ADC0_NAME
|
|
|
|
#define ACCEL_USING_DMA (0x3UL)
|
2011-06-20 09:56:28 +08:00
|
|
|
#endif
|
|
|
|
#if defined(EFM32_USING_SFLASH)
|
|
|
|
#define SFLASH_USING_DEVICE_NAME RT_USART0_NAME
|
|
|
|
#endif
|
|
|
|
#if defined(EFM32_USING_SPISD)
|
|
|
|
#define SPISD_USING_DEVICE_NAME RT_USART0_NAME
|
|
|
|
#define SPISD_DEVICE_NAME "spiSd"
|
|
|
|
#endif
|
2011-07-08 15:13:20 +08:00
|
|
|
#if defined(EFM32_USING_ETHERNET)
|
|
|
|
#define ETH_USING_DEVICE_NAME RT_USART2_NAME
|
|
|
|
#define ETH_DEVICE_NAME "spiEth"
|
2011-07-29 10:47:37 +08:00
|
|
|
#define ETH_ADDR_DEFAULT {0x00, 0x01, 0x02, 0x03, 0x04, 0x05}
|
2011-07-08 15:13:20 +08:00
|
|
|
#endif
|
2011-06-20 09:56:28 +08:00
|
|
|
|
|
|
|
/* SECTION: device filesystem */
|
2011-07-08 15:13:20 +08:00
|
|
|
#if defined(EFM32_USING_SPISD)
|
|
|
|
//#define RT_USING_DFS
|
|
|
|
//#define RT_USING_DFS_ELMFAT
|
2011-06-20 09:56:28 +08:00
|
|
|
#define DFS_ELMFAT_INTERFACE_EFM
|
|
|
|
/* the max number of mounted filesystem */
|
|
|
|
#define DFS_FILESYSTEMS_MAX (2)
|
|
|
|
/* the max number of opened files */
|
|
|
|
#define DFS_FD_MAX (4)
|
|
|
|
/* the max number of cached sector */
|
|
|
|
#define DFS_CACHE_MAX_NUM (4)
|
2011-07-29 10:47:37 +08:00
|
|
|
#endif /* defined(EFM32_USING_SPISD) */
|
2011-07-08 15:13:20 +08:00
|
|
|
|
|
|
|
/* SECTION: lwip, a lighwight TCP/IP protocol stack */
|
|
|
|
#if defined(EFM32_USING_ETHERNET)
|
2011-07-29 10:47:37 +08:00
|
|
|
#define EFM32_USING_ETH_HTTPD
|
|
|
|
//#define EFM32_USING_ETH_UTILS
|
|
|
|
//#define hostName "onelife.dyndns.org"
|
|
|
|
//#define userPwdB64 "dXNlcjpwYXNzd2Q="
|
|
|
|
|
2011-07-08 15:13:20 +08:00
|
|
|
#define RT_USING_LWIP
|
2011-07-08 16:24:33 +08:00
|
|
|
//#define RT_USING_NETUTILS
|
2011-07-08 15:13:20 +08:00
|
|
|
/* LwIP uses RT-Thread Memory Management */
|
|
|
|
#define RT_LWIP_USING_RT_MEM
|
|
|
|
/* Enable ICMP protocol*/
|
|
|
|
#define RT_LWIP_ICMP
|
2011-07-29 10:47:37 +08:00
|
|
|
/* Enable ICMP protocol*/
|
|
|
|
//#define RT_LWIP_IGMP
|
2011-07-08 15:13:20 +08:00
|
|
|
/* Enable UDP protocol*/
|
|
|
|
#define RT_LWIP_UDP
|
|
|
|
/* Enable TCP protocol*/
|
|
|
|
#define RT_LWIP_TCP
|
2011-07-29 10:47:37 +08:00
|
|
|
/* Enable DHCP */
|
|
|
|
//#define RT_LWIP_DHCP
|
2011-07-08 15:13:20 +08:00
|
|
|
/* Enable DNS */
|
|
|
|
//#define RT_LWIP_DNS
|
|
|
|
|
|
|
|
/* the number of simulatenously active TCP connections*/
|
|
|
|
#define RT_LWIP_TCP_PCB_NUM (2)
|
|
|
|
|
|
|
|
/* ip address of target*/
|
|
|
|
#define RT_LWIP_IPADDR0 (192)
|
|
|
|
#define RT_LWIP_IPADDR1 (168)
|
|
|
|
#define RT_LWIP_IPADDR2 (1)
|
|
|
|
#define RT_LWIP_IPADDR3 (118)
|
|
|
|
|
|
|
|
/* gateway address of target*/
|
|
|
|
#define RT_LWIP_GWADDR0 (192)
|
|
|
|
#define RT_LWIP_GWADDR1 (168)
|
|
|
|
#define RT_LWIP_GWADDR2 (1)
|
|
|
|
#define RT_LWIP_GWADDR3 (1)
|
|
|
|
|
|
|
|
/* mask address of target*/
|
|
|
|
#define RT_LWIP_MSKADDR0 (255)
|
|
|
|
#define RT_LWIP_MSKADDR1 (255)
|
|
|
|
#define RT_LWIP_MSKADDR2 (255)
|
|
|
|
#define RT_LWIP_MSKADDR3 (0)
|
|
|
|
|
|
|
|
/* tcp thread options */
|
|
|
|
#define RT_LWIP_TCPTHREAD_PRIORITY (12)
|
|
|
|
#define RT_LWIP_TCPTHREAD_MBOX_SIZE (4)
|
2011-07-29 10:47:37 +08:00
|
|
|
#define RT_LWIP_TCPTHREAD_STACKSIZE (1024)
|
2011-07-08 15:13:20 +08:00
|
|
|
|
|
|
|
/* ethernet if thread options */
|
|
|
|
#define RT_LWIP_ETHTHREAD_PRIORITY (15)
|
|
|
|
#define RT_LWIP_ETHTHREAD_MBOX_SIZE (4)
|
|
|
|
#define RT_LWIP_ETHTHREAD_STACKSIZE (512)
|
2011-07-29 10:47:37 +08:00
|
|
|
#endif /* defined(EFM32_USING_ETHERNET) */
|
2011-06-20 09:56:28 +08:00
|
|
|
|
2011-07-08 15:13:20 +08:00
|
|
|
/* Exported functions ------------------------------------------------------- */
|
2011-02-17 11:33:15 +08:00
|
|
|
|
2011-05-12 15:19:37 +08:00
|
|
|
#endif /* __RTTHREAD_CFG_H__ */
|