Defines

# board_stkm8.h File Reference

AT86RF230 adapter board wired to STK500 with Atmega8(L)/Atmega88(L). More...

Go to the source code of this file.

## Defines
#define | BOARD_NAME "stkm8"
#define | BOARD_TYPE (BOARD_STKM8)
#define | DDR_KEY DDRD
#define | DDR_SPI (DDRB)
#define | DDR_TRX_RESET DDRD
#define | DDR_TRX_SLPTR DDRD
#define | DEFAULT_SPI_RATE (SPI_RATE_1_2)
#define | DI_TRX_IRQ() {TIMSK &= ~_BV(TICIE1);}
#define | EI_TRX_IRQ() {TIMSK |= _BV(TICIE1);}
#define | HIF_TYPE HIF_UART_0
#define | HWTIMER_REG (TCNT1)
#define | HWTIMER_TICK ((1.0*HWTMR_PRESCALE)/F_CPU)
#define | HWTIMER_TICK_NB (0xFFFFUL)
#define | HWTMR_PRESCALE (1)
#define | INVERSE_KEYS (1)
#define | LED_DDR DDRC
#define | LED_MASK (0x03)
#define | LED_NUMBER (2)
#define | LED_PORT PORTC
#define | LED_SHIFT (0)
#define | LEDS_INVERSE (1)
#define | MASK_KEY (0x0c)
#define | MASK_TRX_RESET (_BV(PD6))
#define | MASK_TRX_SLPTR (_BV(PD7))
#define | PIN_KEY PIND
#define | PORT_KEY PORTD
#define | PORT_SPI (PORTB)
#define | PORT_TRX_RESET PORTD
#define | PORT_TRX_SLPTR PORTD
#define | PULLUP_KEYS (1)
#define | RADIO_TYPE (RADIO_AT86RF230B)
#define | SHIFT_KEY (2)
#define | SPI_DATA_REG SPDR
#define | SPI_MISO _BV(PB4)
#define | SPI_MOSI _BV(PB3)
#define | SPI_SCK _BV(PB5)
#define | SPI_SELN_HIGH() PORT_SPI |= SPI_SS; SREG = sreg
#define | SPI_SELN_LOW() uint8_t sreg = SREG; cli(); PORT_SPI &=~SPI_SS
#define | SPI_SS _BV(PB2)
#define | SPI_WAITFOR() do { while((SPSR & _BV(SPIF)) == 0);} while(0)
#define | TIMER_INIT()
#define | TIMER_IRQ_vect TIMER1_OVF_vect
#define | TIMER_POOL_SIZE (4)
#define | TIMER_TICK (HWTIMER_TICK_NB * HWTIMER_TICK)
#define | TRX_IRQ_INIT()
#define | TRX_IRQ_vect TIMER1_CAPT_vect
#define | TRX_RESET_HIGH() PORT_TRX_RESET |= MASK_TRX_RESET
#define | TRX_RESET_INIT() DDR_TRX_RESET |= MASK_TRX_RESET
#define | TRX_RESET_LOW() PORT_TRX_RESET &= ~MASK_TRX_RESET
#define | TRX_SLPTR_HIGH() PORT_TRX_SLPTR |= MASK_TRX_SLPTR
#define | TRX_SLPTR_INIT() DDR_TRX_SLPTR |= MASK_TRX_SLPTR
#define | TRX_SLPTR_LOW() PORT_TRX_SLPTR &= ~MASK_TRX_SLPTR
#define | TRX_TSTAMP_REG TCNT1

## Detailed Description

AT86RF230 adapter board wired to STK500 with Atmega8(L)/Atmega88(L).

The wiring of the radio and the ATmega is shown below:

         AVR         RF230
         ---         -----
         PB0    <--  INT
         PB1    -->  TXCW
         PB2    -->  /SEL
         PB3    -->  MOSI
         PB4    <--  MISO
         PB5    -->  SCK
         PB6 intentionally unused for XTAL1
         PB7 intentionally unused for XTAL2

         PC0:6

        (T1) PD5   <--  CLKM
             PD6   --> /RST
             PD7   --> SLPTR

        USART:
            PD0 RXD
            PD1 TXD

        LED:  PC0:1
        KEY:  PD2:3

        Fuses:
         LF: 0xe1
         HF: 0xd9

Build Options

- stkm8 : AT86RF230 adapter board wired to STK500 with Atmega8(L)/Atmega88(L).

## Define Documentation

#define DI_TRX_IRQ | ( |  | ) | {TIMSK &= ~_BV(TICIE1);}

disable TRX interrupt

#define EI_TRX_IRQ | ( |  | ) | {TIMSK |= _BV(TICIE1);}

enable TRX interrupt

#define HWTMR_PRESCALE (1)

Mode: normal Prescaler: 1 Overflow: 0xFFFFUL

#define TIMER_INIT | ( |  | ) |

Value:

    do{ \
            TCCR1B |= (_BV(CS10)); \
            TIMSK |= _BV(TOIE1); \
        }while(0)

#define TRX_IRQ_INIT | ( |  | ) |

Value:

    do{\
                                /* TCCR1B |= (_BV(ICNC1) | _BV(ICES1) | _BV(CS12) | _BV(CS10)); */\
                                TCCR1B |= (_BV(ICNC1) | _BV(ICES1));\
                                TIFR = _BV(ICF1);\
                              } while(0)

init interrupt handling

- rising edge triggers ICP1 (ICES1),
- timer capture is enabled (ICF1)

#define TRX_IRQ_vect TIMER1_CAPT_vect

interrupt vector name

#define TRX_TSTAMP_REG TCNT1

timestamp register for RX_START event