Microcontroller Wireless Solutions


pal_config.h
Go to the documentation of this file.
00001 
00014 /*
00015  * Copyright (c) 2009, Atmel Corporation All rights reserved.
00016  *
00017  * Licensed under Atmel's Limited License Agreement --> EULA.txt
00018  */
00019 
00196 /* Prevent double inclusion */
00197 #ifndef PAL_CONFIG_H
00198 #define PAL_CONFIG_H
00199 
00200 /* === Includes =============================================================*/
00201 
00202 #include "pal_boardtypes.h"
00203 
00204 #if (BOARD_TYPE == RCB_6_3_PLAIN)
00205 
00211 /*
00212  * This header file is required since a function with
00213  * return type retval_t is declared
00214  */
00215 #include "return_val.h"
00216 
00217 /* === Types ================================================================*/
00218 
00220 typedef enum led_id_tag
00221 {
00222     LED_0,
00223     LED_1,
00224     LED_2
00225 } SHORTENUM led_id_t;
00226 
00228 #define NO_OF_LEDS                      (3)
00229 
00230 
00232 typedef enum button_id_tag
00233 {
00234     BUTTON_0
00235 } SHORTENUM button_id_t;
00236 
00238 #define NO_OF_BUTTONS                   (1)
00239 
00240 /* === Externals ============================================================*/
00241 
00242 
00243 /* === Macros ===============================================================*/
00244 
00253 #ifndef F_CPU
00254 #define F_CPU                           (16000000UL)
00255 #endif
00256 
00260 #define ANTENNA_DIVERSITY               (0)
00261 
00268 #define PAL_WAIT_65_NS()                // empty
00269 
00270 
00271 /*
00272  * PORT where LEDs are connected
00273  */
00274 #define LED_PORT                        (PORTE) 
00275 #define LED_PORT_DIR                    (DDRE)  
00277 /*
00278  * PINs where LEDs are connected
00279  */
00280 #define LED_PIN_0                       (PE2)   
00281 #define LED_PIN_1                       (PE3)   
00282 #define LED_PIN_2                       (PE4)   
00284 /*
00285  * PORT where button is connected
00286  */
00287 #define BUTTON_PORT                     (PORTE) 
00288 #define BUTTON_PORT_DIR                 (DDRE)  
00289 #define BUTTON_INPUT_PINS               (PINE)  
00291 /*
00292  * PINs where buttons are connected
00293  */
00294 #define BUTTON_PIN_0                    (PE5)   
00296 /*
00297  * UART0 and UART1 non-generic (board specific) initialization part.
00298  */
00299 
00300 #define UART_0_INIT_NON_GENERIC()
00301 
00302 #define UART_1_INIT_NON_GENERIC()
00303 
00304 
00309 #ifndef EXTERN_EEPROM_AVAILABLE
00310 #define EXTERN_EEPROM_AVAILABLE            (1)
00311 #endif
00312 
00316 #define EE_IEEE_ADDR                    (0)
00317 
00321 #define EE_XTAL_TRIM_ADDR               (21)
00322 
00323 
00324 #if (EXTERN_EEPROM_AVAILABLE == 1) || defined(DOXYGEN)
00325 
00326 #define EXT_EE_CS_PORT                  (PORTG)
00327 
00328 #define EXT_EE_CS_DDR                   (DDRG)
00329 
00331 #define EXT_EE_CS_PIN                   (0x20) /* PG5 */
00332 #endif  /* #if (EXTERN_EEPROM_AVAILABLE == 1) || defined(DOXYGEN) */
00333 
00334 
00335 /*
00336 * Pwr_mode fun handles the sleeps modes
00337 */
00338 #define pal_pwr_mode(x)       pal_sleep_mode(x)
00339 
00340 
00344 #define ALERT_INIT()                    do {    \
00345         LED_PORT = 0;                           \
00346         LED_PORT_DIR = 0xFF;                    \
00347 } while (0)
00348 
00356 #define ALERT_INDICATE()                do {    \
00357         LED_PORT ^= 0xFF;                       \
00358 } while (0)
00359 
00360 
00361 /* === Prototypes ===========================================================*/
00362 #ifdef __cplusplus
00363 extern "C" {
00364 #endif
00365 
00366 
00367 #ifdef __cplusplus
00368 } /* extern "C" */
00369 #endif
00370 
00373 /* MCU pins used for debugging  */
00374 #ifndef DOXYGEN
00375 #define TST_PIN_0_HIGH()
00376 #define TST_PIN_0_LOW()
00377 #define TST_PIN_1_HIGH()
00378 #define TST_PIN_1_LOW()
00379 #define TST_PIN_2_HIGH()
00380 #define TST_PIN_2_LOW()
00381 #define TST_PIN_3_HIGH()
00382 #define TST_PIN_3_LOW()
00383 #define TST_PIN_4_HIGH()
00384 #define TST_PIN_4_LOW()
00385 #define TST_PIN_5_HIGH()
00386 #define TST_PIN_5_LOW()
00387 #define TST_PIN_6_HIGH()
00388 #define TST_PIN_6_LOW()
00389 #define TST_PIN_7_HIGH()
00390 #define TST_PIN_7_LOW()
00391 #define TST_PIN_8_HIGH()
00392 #define TST_PIN_8_LOW()
00393 #endif  /* #ifndef (DOXYGEN) */
00394 
00395 #endif /* RCB_6_3_PLAIN */
00396 
00397 #endif  /* PAL_CONFIG_H */
00398 /* EOF */