# board_tiny230.h File Reference

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

Definition in file board_tiny230.h.

Go to the source code of this file.

## Defines
#define | BOARD_NAME BOARD_NAME_TINY_230
#define | BOARD_NAME_TINY230 "tiny230"
#define | BOARD_TYPE (TINY_230)
#define | CPU_TYPE (CPU_T44)
#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 | MAX_FRAME_SIZE (127)
#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
#define | TUNED_OSCCAL (0xbf)
## Functions
static void | SPI_INIT (uint8_t spirate)
| inline function for SPI initialization

## Define Documentation

#define BOARD_NAME BOARD_NAME_TINY_230

current board name

Definition at line 77 of file board_tiny230.h.

#define BOARD_NAME_TINY230 "tiny230"

ID String for this hardware

Definition at line 72 of file board_tiny230.h.

#define BOARD_TYPE (TINY_230)

current board type (see const.h)

Definition at line 76 of file board_tiny230.h.

#define CPU_TYPE (CPU_T44)

used CPU (see const.h)

Definition at line 89 of file board_tiny230.h.

#define DDR_KEY DDRA

DDR register for keys

Definition at line 179 of file board_tiny230.h.

#define DDR_SPI (DDRA)

DDR register for SPI port

Definition at line 128 of file board_tiny230.h.

#define DDR_TRX_RESET DDRB

DDR register for RESET pin

Definition at line 96 of file board_tiny230.h.

#define DDR_TRX_SLPTR DDRB

PORT register for SLEEP_TR pin

Definition at line 103 of file board_tiny230.h.

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

high level INT0 disable TRX interrupt

Definition at line 119 of file board_tiny230.h.

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

enable TRX interrupt

Definition at line 121 of file board_tiny230.h.

#define HIF_TYPE HIF_NONE

Type of the host interface.

Definition at line 204 of file board_tiny230.h.

#define HWTIMER_REG (TCNT1)

name of the register where the clock ticks can be read

Definition at line 213 of file board_tiny230.h.

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

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

Definition at line 208 of file board_tiny230.h.

#define HWTIMER_TICK_NB (0xffffUL)

number of hardware timer ticks, when IRQ routine is called

Definition at line 211 of file board_tiny230.h.

#define INVERSE_KEYS (1)

= 1, if low level at port means KEY pressed

Definition at line 182 of file board_tiny230.h.

#define LED_DDR DDRA

DDR register for LEDs

Definition at line 167 of file board_tiny230.h.

#define LED_MASK (0x03)

MASK value for LEDs (msb aligned)

Definition at line 168 of file board_tiny230.h.

#define LED_NUMBER (2)

number of LEDs for this board

Definition at line 172 of file board_tiny230.h.

#define LED_PORT PORTA

PORT register for LEDs

Definition at line 166 of file board_tiny230.h.

#define LED_SHIFT (0)

SHIFT value for LEDs

Definition at line 169 of file board_tiny230.h.

#define LEDS_INVERSE (0)

= 1, if low level at port means LED on

Definition at line 170 of file board_tiny230.h.

#define MASK_KEY (0x04)

MASK value for keys (msb aligned)

Definition at line 180 of file board_tiny230.h.

#define MASK_TRX_RESET (_BV(PB0))

PIN mask for RESET pin

Definition at line 98 of file board_tiny230.h.

#define MASK_TRX_SLPTR (_BV(PB1))

PIN mask for SLEEP_TR pin

Definition at line 104 of file board_tiny230.h.

#define MAX_FRAME_SIZE (127)

maximum allowed frame size

Definition at line 81 of file board_tiny230.h.

#define PIN_KEY PINA

PIN register for keys

Definition at line 178 of file board_tiny230.h.

#define PORT_KEY PORTA

PORT register for keys

Definition at line 177 of file board_tiny230.h.

#define PORT_SPI (PORTA)

PORT register for SPI port

Definition at line 129 of file board_tiny230.h.

#define PORT_TRX_RESET PORTB

PORT register for RESET pin

Definition at line 97 of file board_tiny230.h.

#define PORT_TRX_SLPTR PORTB

DDR register for SLEEP_TR pin

Definition at line 102 of file board_tiny230.h.

#define RADIO_TYPE (RADIO_AT86RF230B)

used radiio (see const.h)

Definition at line 91 of file board_tiny230.h.

#define SHIFT_KEY (2)

SHIFT value for keys

Definition at line 181 of file board_tiny230.h.

#define SLEEP_ON_KEY | ( |  | ) |

Value:

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

Definition at line 191 of file board_tiny230.h.

#define SLEEP_ON_KEY_INIT | ( |  | ) |

Value:

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

Definition at line 186 of file board_tiny230.h.

#define SPI_DATA_REG USIDR

abstraction for SPI data register

Definition at line 136 of file board_tiny230.h.

#define SPI_MISO _BV(PA6)

PIN mask for MISO pin

Definition at line 132 of file board_tiny230.h.

#define SPI_MOSI _BV(PA5)

PIN mask for MOSI pin

Definition at line 131 of file board_tiny230.h.

#define SPI_SCK _BV(PA4)

PIN mask for SCK pin

Definition at line 133 of file board_tiny230.h.

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

set SS line to high level

Definition at line 153 of file board_tiny230.h.

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

set SS line to low level

Definition at line 151 of file board_tiny230.h.

#define SPI_SS _BV(PA7)

PIN mask for SS pin

Definition at line 134 of file board_tiny230.h.

#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

Definition at line 155 of file board_tiny230.h.

#define TIMER_INIT | ( |  | ) |

Value:

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

Definition at line 222 of file board_tiny230.h.

#define TIMER_IRQ_vect TIM1_OVF_vect

symbolic name of the timer interrupt routine that is called

Definition at line 229 of file board_tiny230.h.

#define TIMER_POOL_SIZE (1)

number of software timers running at a time

Definition at line 219 of file board_tiny230.h.

#define TIMER_TICK (HWTIMER_TICK * HWTIMER_TICK_NB)

period in us, when the timer interrupt routine is called

Definition at line 215 of file board_tiny230.h.

#define TRX_IRQ _BV(INT0)

interrupt mask for GICR

Definition at line 109 of file board_tiny230.h.

#define TRX_IRQ_INIT | ( |  | ) |

Value:

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

configuration of interrupt handling

Definition at line 113 of file board_tiny230.h.

#define TRX_IRQ_vect INT0_vect

interrupt vector name

Definition at line 110 of file board_tiny230.h.

#define TRX_TSTAMP_REG TCNT1

timestamp register for RX_START event

Definition at line 124 of file board_tiny230.h.

## Function Documentation

static void SPI_INIT | ( | uint8_t | spirate | ) | `[static]`

inline function for SPI initialization

Definition at line 142 of file board_tiny230.h.