# board_zgbta2.h

Go to the documentation of this file.

    00001 /* Copyright (c) 2011 Joerg Wunsch
    00002    All rights reserved.
    00003
    00004    Redistribution and use in source and binary forms, with or without
    00005    modification, are permitted provided that the following conditions
    00006    are met:
    00007
    00008    * Redistributions of source code must retain the above copyright
    00009      notice, this list of conditions and the following disclaimer.
    00010    * Redistributions in binary form must reproduce the above copyright
    00011      notice, this list of conditions and the following disclaimer in the
    00012      documentation and/or other materials provided with the distribution.
    00013    * Neither the name of the authors nor the names of its contributors
    00014      may be used to endorse or promote products derived from this software
    00015      without specific prior written permission.
    00016
    00017    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    00018    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    00019    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    00020    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
    00021    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    00022    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    00023    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    00024    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    00025    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    00026    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    00027    POSSIBILITY OF SUCH DAMAGE. */
    00028
    00029 /* $Id$ */
    00084 /*
    00085  * Courtesy Martin Vejnár:
    00086  *
    00087  * http://ratatanek.cz/blog/zigbit-atzb-24-a2-pinout
    00088  * http://ratatanek.cz/files/node/16/zigbit_mcu_pinout_mapping.svg
    00089  *
    00090  * This is the pin mapping of the Zigbit module:
    00091  *
    00092  * ZGBT  AVR   Atmel Zigbit    Remark
    00093  * pin#  port  datasheet name
    00094  * ===================================================
    00095  *   1   B1    SPI_CLK         shared with trx and ISP
    00096  *   2   B3    SPI_MISO        -"-, *not* ISP!
    00097  *   3   B2    SPI_MOSI        -"-, *not* ISP
    00098  *   4   B5    GPIO0
    00099  *   5   B6    GPIO1
    00100  *   6   B7    GPIO2
    00101  *   7   TOSC1 OSC32K          from 32.768 kHz oscillator
    00102  *   8   /RST  RESET
    00103  *   9   DGND  DGND
    00104  *  10   CLKM  CPU_CLK         CLKM from transceiver,
    00105  *  11   D0    I2C_CLK            [ can be fused as CPU
    00106  *  12   D1    I2C_DATA           [ clock input
    00107  *  13   D2    UART_TXD        UART1
    00108  *  14   D3    UART_RXD        -"-
    00109  *  15   D4    UART_RTS
    00110  *  16   D5    UART_CTS
    00111  *  17   D6    GPIO6
    00112  *  18   D7    GPIO7
    00113  *  19   G0    GPIO3
    00114  *  20   G1    GPIO4
    00115  *  21   G2    GPIO5
    00116  *  22   DGND  DGND
    00117  *  23   DGND  DGND
    00118  *  24   DVCC  DVCC
    00119  *  25   DVCC  DVCC
    00120  *  26   F5    JTAG_TMS
    00121  *  27   F7    JTAG_TDI
    00122  *  28   F6    JTAG_TDO
    00123  *  29   F4    JTAG_TCK
    00124  *  30   F3    ADC_INPUT3
    00125  *  31   F2    ADC_INPUT2
    00126  *  32   F1    ADC_INPUT1
    00127  *  33   F0    BAT             voltage divider?
    00128  *  34   AREF  V_AREF
    00129  *  35   AGND  AGND
    00130  *  36   G5    GPIO_1WR
    00131  *  37   E4    UART_DTR
    00132  *  38   E0    USART0_RXD      also ISP PDI
    00133  *  39   E1    USART0_TXD      also ISP PDO
    00134  *  40   E2    USART0_EXTCLK
    00135  *  41   E3    GPIO8
    00136  *  42   E7    IRQ_7
    00137  *  43   E6    IRQ_6
    00138  */
    00139
    00140 #if defined(zgbt1281a2uart0)
    00141 # define BOARD_TYPE BOARD_ZGBT1281A2UART0
    00142 # define BOARD_NAME "zgbt1281a2uart0"
    00143 # define RADIO_TYPE (RADIO_AT86RF230)
    00144 #endif
    00145 #if defined(zgbt1281a2uart1)
    00146 # define BOARD_TYPE BOARD_ZGBT1281A2UART1
    00147 # define BOARD_NAME "zgbt1281a2uart1"
    00148 # define RADIO_TYPE (RADIO_AT86RF230)
    00149 #endif
    00150 #if defined(zgbt1281a2nouart)
    00151 # define BOARD_TYPE BOARD_ZGBT1281A2NOUART
    00152 # define BOARD_NAME "zgbt1281a2nouart"
    00153 # define RADIO_TYPE (RADIO_AT86RF230)
    00154 #endif
    00155
    00156 #ifndef BOARD_ZGBTA2_H
    00157 #define BOARD_ZGBTA2_H
    00158
    00159 /*=== Compile time parameters ========================================*/
    00160
    00161 /*=== radio interface definition =====================================*/
    00162 #include "base_zdma1281.h"
    00163
    00164 /*=== LED access macros ==============================================*/
    00165 #define LED_NUMBER    (0)
    00166 #define NO_LEDS       (1)
    00167
    00168 /*=== KEY access macros ==============================================*/
    00169 #define NO_KEYS       (1)
    00170
    00171 /*=== Host Interface ================================================*/
    00176 #if defined(zgbt1281a2uart0)
    00177 #  define HIF_TYPE (HIF_UART_0)
    00178 #elif defined(zgbt1281a2uart1)
    00179 #  define HIF_TYPE (HIF_UART_1)
    00180 #elif defined(zgbt1281a2nouart)
    00181 #  define HIF_TYPE HIF_NONE
    00182 #else
    00183 #  error "Don't know which UART to use."
    00184 #endif
    00185
    00186 /*=== TIMER Interface ===============================================*/
    00194 #define HWTMR_PRESCALE  (1)
    00195 #define HWTIMER_TICK    ((1.0*HWTMR_PRESCALE)/F_CPU)
    00196 #define HWTIMER_TICK_NB (0xFFFFUL+1)
    00197 #define HWTIMER_REG     (TCNT1)
    00198 #define TIMER_TICK      (HWTIMER_TICK_NB * HWTIMER_TICK)
    00199 #define TIMER_POOL_SIZE (4)
    00200 #define TIMER_INIT() \
    00201     do{ \
    00202         TCCR1B |= (_BV(CS10));\
    00203         TIMSK1 |= _BV(TOIE1); \
    00204     }while(0)
    00205 #define TIMER_IRQ_vect  TIMER1_OVF_vect
    00206
    00207 #endif /* BOARD_ZGBTA2_H*/