# board_stkm8.h File Reference

## 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).

Definition in file board_stkm8.h.

Go to the source code of this file.

## Defines
#define | BOARD_NAME BOARD_NAME_STKM8
#define | BOARD_NAME_STKM8 "stkm8"
#define | BOARD_TYPE (STK500_MEGA8)
#define | CPU_TYPE (CPU_M8)
#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 | MAX_FRAME_SIZE (127)
#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
#define | TUNED_OSCCAL (0xbf)
## Functions
static void | SPI_INIT (uint8_t spirate)

## Define Documentation

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

disable TRX interrupt

Definition at line 128 of file board_stkm8.h.

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

enable TRX interrupt

Definition at line 131 of file board_stkm8.h.

#define HWTMR_PRESCALE (1)

Mode: normal Prescaler: 1 Overflow: 0xFFFFUL

Definition at line 194 of file board_stkm8.h.

#define TIMER_INIT | ( |  | ) |

Value:

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

Definition at line 200 of file board_stkm8.h.

#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)

Definition at line 121 of file board_stkm8.h.

#define TRX_IRQ_vect TIMER1_CAPT_vect

interrupt vector name

Definition at line 115 of file board_stkm8.h.

#define TRX_TSTAMP_REG TCNT1

timestamp register for RX_START event

Definition at line 134 of file board_stkm8.h.