本帖最后由 咕噜 于 2016-8-17 21:00 编辑
/************************************************************************************************/
最近一段时间在学习contiki系统,STM32在无线应用上前景更为广阔。
/************************************************************************************************/
平台配置-- platform-conf.h
- /*
- * \file
- * platform-conf.h
- * \author
- * Marcus Lunden <marcus@thingsquare.com>>
- * \desc
- * platform dependent configurations
- */
- #ifndef __PLATFORM_CONF_H__
- #define __PLATFORM_CONF_H__
- /*--------------------------------------------------------------------*/
- #include <inttypes.h>
- #include <string.h>
- /*--------------------------------------------------------------------*/
- //系统时钟
- #define F_CPU 168000000ul
- //LED
- #define LEDS_CONF_LED1 1 /* green */
- #define LEDS_CONF_LED2 2 /* orange */
- #define LEDS_CONF_LED3 4 /* red */
- #define LEDS_CONF_LED4 8 /* blue */
- #define LEDS_CONF_LED5 5 /* yellow */
- #define LEDS_CONF_RED (1<<LEDS_CONF_LED3)
- #define LEDS_CONF_GREEN (1<<LEDS_CONF_LED1)
- #define LEDS_CONF_BLUE (1<<LEDS_CONF_LED4)
- //#define FIXED_NET_ADDRESS 1
- //#define NET_ADDR_A 0x2001
- //#define NET_ADDR_B 0xdb8
- //#define NET_ADDR_C 0xbbbb
- //#define NET_ADDR_D 0xabcd
- #define UART1_CONF_TX_WITH_INTERRUPT 1 //0
- #define WITH_SERIAL_LINE_INPUT 1 //串口
- #define ENERGEST_CONF_ON 0 //能量估计,失效
- #define TELNETD_CONF_NUMLINES 6 //telnet服务
- //射频RADIO 驱动
- #define NETSTACK_CONF_RADIO spirit_radio_driver
- //射频RADIO 最大负载
- #define NETSTACK_RADIO_MAX_PAYLOAD_LEN 96 /* spirit1-config.h */
- /*---------------------------------------------------------------------*/
- /* define ticks/second for slow and fast clocks. Notice that these should be a
- power of two, eg 64,128,256,512 etc, for efficiency as POT's can be optimized
- well. */
- #define CLOCK_CONF_SECOND 2048
- // One tick: 85.33 us
- #define RTIMER_ARCH_SECOND 168000/*32768*/
- /*--------------------------------------------------------------------*/
- #define RTIMER_CLOCK_LT(a,b) ((signed short)((a)-(b)) < 0)
- typedef unsigned long clock_time_t;
- typedef unsigned long long rtimer_clock_t;
- #define CC_CONF_REGISTER_ARGS 0
- #define CC_CONF_FUNCTION_POINTER_ARGS 1
- #define CC_CONF_FASTCALL
- #define CC_CONF_VA_ARGS 1
- #define CC_CONF_INLINE inline
- #define CCIF
- #define CLIF
- typedef uint8_t u8_t;
- typedef uint16_t u16_t;
- typedef uint32_t u32_t;
- typedef int32_t s32_t;
- typedef unsigned short uip_stats_t;
- /*--------------------------------------------------------------------*/
- #endif /* __PLATFORM_CONF_H__ */
复制代码
|
contiki-conf配置