Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00083
00084
00085
00086
00087 #if defined(zgbl230)
00088 # define BOARD_TYPE BOARD_ZGBL230
00089 # define BOARD_NAME "zgbl230"
00090 # define RADIO_TYPE (RADIO_AT86RF230B)
00091 #elif defined(zgbl231)
00092 # define BOARD_TYPE BOARD_ZGBL231
00093 # define BOARD_NAME "zgbl231"
00094 # define RADIO_TYPE (RADIO_AT86RF231)
00095 #elif defined(zgbl212)
00096 # define BOARD_TYPE BOARD_ZGBL212
00097 # define BOARD_NAME "zgbl212"
00098 # define RADIO_TYPE (RADIO_AT86RF212)
00099 #elif defined(zgbh230)
00100 # define BOARD_TYPE BOARD_ZGBH230
00101 # define BOARD_NAME "zgbh230"
00102 # define RADIO_TYPE (RADIO_AT86RF230B)
00103 # define ZGBL_EVM_HOST (1)
00104 #elif defined(zgbh231)
00105 # define BOARD_TYPE BOARD_ZGBH231
00106 # define BOARD_NAME "zgbh231"
00107 # define RADIO_TYPE (RADIO_AT86RF231)
00108 # define ZGBL_EVM_HOST (1)
00109 #elif defined(zgbh212)
00110 # define BOARD_TYPE BOARD_ZGBH212
00111 # define BOARD_NAME "zgbh212"
00112 # define RADIO_TYPE (RADIO_AT86RF212)
00113 # define ZGBL_EVM_HOST (1)
00114 #endif
00115
00116 #ifndef BOARD_ZGBL_H
00117 #define BOARD_ZGBL_H
00118
00119
00120
00121
00122
00123 #include "base_rdk2xx.h"
00124
00125 static inline void xmem_init(void)
00126 {
00127 XMCRA |= _BV(SRE);
00128 XMCRB |= _BV(XMBK);
00129 }
00130
00131
00132
00133 #ifndef ZGBL_EVM_HOST
00134 # define NO_KEYS (1)
00135 #else
00136
00137 # define KEY_IO_AD (0x4000)
00138 # define PIN_KEY (*(volatile uint8_t*)(KEY_IO_AD))
00139 # define xDDR_KEY DDRE
00140 # define MASK_KEY (0x1)
00141 # define SHIFT_KEY (0)
00142 # define INVERSE_KEYS (0)
00143 # define PULLUP_KEYS (0)
00144 # define KEY_INIT xmem_init
00145 #endif
00146
00147 #ifndef ZGBL_EVM_HOST
00148 # define NO_LEDS (1)
00149 #else
00150
00151
00152
00153
00154
00155
00156
00157
00158 #define MASK_LED0 (_BV(6))
00159 #define PORT_LED0 PORTB
00160 #define DDR_LED0 DDRB
00161 #define MASK_LED1 (_BV(7))
00162 #define PORT_LED1 PORTD
00163 #define DDR_LED1 DDRD
00164
00165 #define LED_INIT() \
00166 do { \
00167 DDR_LED0 |= MASK_LED0; \
00168 DDR_LED1 |= MASK_LED1; \
00169 PORT_LED0 &= ~MASK_LED0; \
00170 PORT_LED1 |= MASK_LED1;\
00171 } while (0)
00172
00173 #define LED_SET(x) \
00174 switch (x) { \
00175 case 0: PORT_LED0 &= ~MASK_LED0; break; \
00176 case 1: PORT_LED1 &= ~MASK_LED1; break; \
00177 }
00178
00179 #define LED_CLR(x) \
00180 switch (x) { \
00181 case 0: PORT_LED0 |= MASK_LED0; break; \
00182 case 1: PORT_LED1 |= MASK_LED1; break; \
00183 }
00184
00185 #define LED_SET_VALUE(x) \
00186 do { \
00187 if (x & 1) PORT_LED0 &= ~MASK_LED0; else PORT_LED0 |= MASK_LED0; \
00188 if (x & 2) PORT_LED1 &= ~MASK_LED1; else PORT_LED1 |= MASK_LED1; \
00189 } while (0)
00190
00191 #define LED_GET_VALUE() ( \
00192 ((PORT_LED0 & MASK_LED0)? 0: 1) | \
00193 ((PORT_LED1 & MASK_LED1)? 0: 2) \
00194 )
00195
00196 #define LED_VAL(msk,val) do{}while(0)
00198 #define LED_TOGGLE(ln) \
00199 switch (ln) { \
00200 case 0: PORT_LED0 ^= MASK_LED0; break; \
00201 case 1: PORT_LED1 ^= MASK_LED1; break; \
00202 }
00203
00204 #define LED_NUMBER (2)
00205
00206 #endif
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220 #define SLEEP_ON_KEY_INIT() do{}while(0)
00221 #define SLEEP_ON_KEY() do{}while(0)
00222
00223
00224 #define HIF_TYPE (HIF_UART_1)
00225
00226
00227 #define HWTMR_PRESCALE (1)
00228 #define HWTIMER_TICK ((1.0*HWTMR_PRESCALE)/F_CPU)
00229 #define HWTIMER_TICK_NB (0xFFFFUL)
00230 #define HWTIMER_REG (TCNT1)
00231 #define TIMER_TICK (HWTIMER_TICK_NB * HWTIMER_TICK)
00232 #define TIMER_POOL_SIZE (4)
00233 #define TIMER_INIT() \
00234 do{ \
00235 TCCR1B |= (_BV(CS10)); \
00236 TIMSK1 |= _BV(TOIE1); \
00237 }while(0)
00238 #define TIMER_IRQ_vect TIMER1_OVF_vect
00239
00240 #endif