Defines
board_tiny230.h File Reference
Board Definitions

Minimalistic Board with ATtiny84 / AT86RF230 by DL8DTL. More...

Go to the source code of this file.

## Defines
#define | DDR_KEY DDRA
#define | DDR_SPI (DDRA)
#define | DDR_TRX_RESET DDRB
#define | DDR_TRX_SLPTR DDRB
#define | DEFAULT_SPI_RATE (SPI_RATE_1_2)
#define | DI_TRX_IRQ() {GIMSK &= (~(TRX_IRQ));}
#define | EI_TRX_IRQ() {GIMSK |= (TRX_IRQ);}
#define | HIF_TYPE HIF_NONE
#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 DDRA
#define | LED_MASK (0x03)
#define | LED_NUMBER (2)
#define | LED_PORT PORTA
#define | LED_SHIFT (0)
#define | LEDS_INVERSE (0)
#define | MASK_KEY (0x04)
#define | MASK_TRX_RESET (_BV(PB0))
#define | MASK_TRX_SLPTR (_BV(PB1))
#define | PIN_KEY PINA
#define | PORT_KEY PORTA
#define | PORT_SPI (PORTA)
#define | PORT_TRX_RESET PORTB
#define | PORT_TRX_SLPTR PORTB
#define | PULLUP_KEYS (1)
#define | RADIO_TYPE (RADIO_AT86RF230B)
#define | SHIFT_KEY (2)
#define | SLEEP_ON_KEY()
#define | SLEEP_ON_KEY_INIT()
#define | SLEEP_ON_KEY_vect PCINT0_vect
#define | SPI_DATA_REG USIDR
#define | SPI_MISO _BV(PA6)
#define | SPI_MOSI _BV(PA5)
#define | SPI_SCK _BV(PA4)
#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(PA7)
#define | SPI_TYPE SPI_TYPE_USI
#define | SPI_WAITFOR()
#define | TIMER_INIT()
#define | TIMER_IRQ_vect TIM1_OVF_vect
#define | TIMER_POOL_SIZE (1)
#define | TIMER_TICK (HWTIMER_TICK * HWTIMER_TICK_NB)
#define | TRX_IRQ _BV(INT0)
#define | TRX_IRQ_INIT()
#define | TRX_IRQ_vect INT0_vect
#define | TRX_TSTAMP_REG TCNT1

## Detailed Description

Minimalistic Board with ATtiny84 / AT86RF230 by DL8DTL.

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

         AVR       RF230
         ---       -----
         PA5  -->  MOSI
         PA6  <--  MISO
         PA4  -->  SCK
         PA7  -->  SS
         PB0  -->  RSTN
         PB1  -->  SLPTR
         PB2  <--  IRQ (INT0)
                   MCLK (NC)
         PB7  -->  (reset)

         PA2   <--  KEY
         PA0:1 -->  LED
         PA3   <-- Thermo Sensor

         lfuse: 0x62 (8MHz in Osc., no clock divider)
         lfuse: 0xe2 (8MHz in Osc., w/ clock divider)
         hfuse: 0xDF for ISP Mode, 0x9F for debug wire
         efuse: 0xFF

Tiny230 Radio Controller Board

Build Options

- tiny230 : Radio Controller Board by Joerg Wunsch

## Define Documentation

#define DDR_KEY DDRA

DDR register for keys

#define DDR_SPI (DDRA)

DDR register for SPI port

#define DDR_TRX_RESET DDRB

DDR register for RESET pin

#define DDR_TRX_SLPTR DDRB

PORT register for SLP_TR pin

#define DEFAULT_SPI_RATE (SPI_RATE_1_2)

ID String for this hardware

#define DI_TRX_IRQ | ( |  | ) | {GIMSK &= (~(TRX_IRQ));}

disable TRX interrupt

#define EI_TRX_IRQ | ( |  | ) | {GIMSK |= (TRX_IRQ);}

enable TRX interrupt

#define HIF_TYPE HIF_NONE

Type of the host interface.

#define HWTIMER_REG (TCNT1)

name of the register where the clock ticks can be read

#define HWTIMER_TICK ((1.0*HWTMR_PRESCALE)/F_CPU)

hardware timer clock period in us (usually: prescaler / F_CPU)

#define HWTIMER_TICK_NB (0xffffUL)

number of hardware timer ticks, when IRQ routine is called

#define INVERSE_KEYS (1)

= 1, if low level at port means KEY pressed

#define LED_DDR DDRA

DDR register for LEDs

#define LED_MASK (0x03)

MASK value for LEDs (msb aligned)

#define LED_NUMBER (2)

number of LEDs for this board

#define LED_PORT PORTA

PORT register for LEDs

#define LED_SHIFT (0)

SHIFT value for LEDs

#define LEDS_INVERSE (0)

= 1, if low level at port means LED on

#define MASK_KEY (0x04)

MASK value for keys (msb aligned)

#define MASK_TRX_RESET (_BV(PB0))

PIN mask for RESET pin

#define MASK_TRX_SLPTR (_BV(PB1))

PIN mask for SLP_TR pin

#define PIN_KEY PINA

PIN register for keys

#define PORT_KEY PORTA

PORT register for keys

#define PORT_SPI (PORTA)

PORT register for SPI port

#define PORT_TRX_RESET PORTB

PORT register for RESET pin

#define PORT_TRX_SLPTR PORTB

DDR register for SLP_TR pin

#define RADIO_TYPE (RADIO_AT86RF230B)

used radiio (see const.h)

#define SHIFT_KEY (2)

SHIFT value for keys

#define SLEEP_ON_KEY | ( |  | ) |

Value:

    do{\
                GIMSK |= _BV(PCIE0);\
                set_sleep_mode(SLEEP_MODE_PWR_DOWN);\
                sleep_mode();\
                GIMSK &= ~_BV(PCIE0);\
            } while(0)

#define SLEEP_ON_KEY_INIT | ( |  | ) |

Value:

    do{\
                PCMSK0 |= _BV(PCINT2);\
            }while(0)

#define SPI_DATA_REG USIDR

abstraction for SPI data register

#define SPI_MISO _BV(PA6)

PIN mask for MISO pin

#define SPI_MOSI _BV(PA5)

PIN mask for MOSI pin

#define SPI_SCK _BV(PA4)

PIN mask for SCK pin

#define SPI_SELN_HIGH | ( |  | ) | PORT_SPI |= SPI_SS; SREG = sreg

set SS line to high level

#define SPI_SELN_LOW | ( |  | ) | uint8_t sreg = SREG; cli(); PORT_SPI &=~SPI_SS

set SS line to low level

#define SPI_SS _BV(PA7)

PIN mask for SS pin

#define SPI_WAITFOR | ( |  | ) |

Value:

    do \
        { \
            USISR = _BV(USIOIF); \
            do \
            { \
                USICR = _BV(USIWM0)|_BV(USICS1)|_BV(USICLK)|_BV(USITC); \
            } while ((USISR & _BV(USIOIF)) == 0); \
        } while(0)

wait until SPI transfer is ready

#define TIMER_INIT | ( |  | ) |

Value:

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

#define TIMER_IRQ_vect TIM1_OVF_vect

symbolic name of the timer interrupt routine that is called

#define TIMER_POOL_SIZE (1)

number of software timers running at a time

#define TIMER_TICK (HWTIMER_TICK * HWTIMER_TICK_NB)

period in us, when the timer interrupt routine is called

#define TRX_IRQ _BV(INT0)

interrupt mask for GICR

#define TRX_IRQ_INIT | ( |  | ) |

Value:

    do{\
                                MCUCR = _BV(ISC00) | _BV(ISC01);\
                                GIMSK  |= _BV(INT0);\
                              } while(0)

configuration of interrupt handling

#define TRX_IRQ_vect INT0_vect

interrupt vector name

#define TRX_TSTAMP_REG TCNT1

timestamp register for RX_START event