Defines

# board_muse231.h File Reference

Definition of Multi Sensor by IBDT. More...

Go to the source code of this file.

## Defines
#define | ACC_IRQ_ASIN() do{ ACC_IRQ_DDR &= ~_BV(ACC_IRQ_bp); }while(0)
#define | ACC_IRQ_ASOUT() do{ ACC_IRQ_DDR |= _BV(ACC_IRQ_bp); }while(0)
#define | ACC_IRQ_bp (2)
#define | ACC_IRQ_DDR DDRD
#define | ACC_IRQ_HI() do{ ACC_IRQ_PORT |= _BV(ACC_IRQ_bp); }while(0)
#define | ACC_IRQ_INIT() do{ EICRA |= _BV(ISC00) | _BV(ISC01); }while(0)
#define | ACC_IRQ_LO() do{ ACC_IRQ_PORT &= ~_BV(ACC_IRQ_bp); }while(0)
#define | ACC_IRQ_PIN PIND
#define | ACC_IRQ_PORT PORTD
#define | ACC_IRQ_STATE() ( (ACC_IRQ_PIN & _BV(ACC_IRQ_bp)) != 0)
#define | ACC_IRQ_vect INT0_vect
#define | BOARD_ACC_MMA7455_I2CADDR (0x3A)
#define | BOARD_HAS_ACC_MMA7455_I2C (1)
#define | BOARD_MUSE231_H (1)
#define | BOARD_NAME "Multisensor 231"
#define | BOARD_SHT21_I2CADDR (0x80)
#define | BOARD_TYPE (BOARD_MUSE231)
#define | DDR_SPI (DDRB)
#define | DDR_TRX_RESET DDRC
#define | DDR_TRX_SLPTR DDRC
#define | DEFAULT_SPI_RATE (SPI_RATE_1_2)
#define | DI_ACC_IRQ() do{ EIMSK &= ~_BV(INT0); }while(0)
#define | DI_TRX_IRQ() { PCMSK2 &= ~_BV(PCINT21); }
#define | EI_ACC_IRQ()
#define | EI_TRX_IRQ() { PCMSK2 |= _BV(PCINT21); }
#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 | LED_ANODE_bp (3)
#define | LED_CATHODE_bp (4)
#define | LED_DDR DDRD
#define | LED_MASK (0x18)
#define | LED_NUMBER (1)
#define | LED_PIN PIND
#define | LED_PORT PORTD
#define | LED_SHIFT (3)
#define | LEDS_INVERSE (1)
#define | MASK_TRX_RESET (_BV(1))
#define | MASK_TRX_SLPTR (_BV(0))
#define | NO_KEYS (1)
#define | PORT_SPI (PORTB)
#define | PORT_TRX_RESET PORTC
#define | PORT_TRX_SLPTR PORTC
#define | RADIO_TYPE (RADIO_AT86RF231)
#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(PB0)
#define | SPI_TYPE SPI_TYPE_SPI
#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 0x00
#define | TRX_IRQ_bp (5)
#define | TRX_IRQ_DDR (DDRD)
#define | TRX_IRQ_INIT() do{ PCICR |= _BV(PCIE2); } while(0)
#define | TRX_IRQ_PIN (PIND)
#define | TRX_IRQ_PORT (PORTD)
#define | TRX_IRQ_vect PCINT2_vect

## Detailed Description

Definition of Multi Sensor by IBDT.

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

         Transceiver
         AVR         AT86RF231
         ---        ----------
         PC0    -->   SLPTR   must be patched manually from ADC7 (neighboured pin)
         PD5    <--   IRQ (INT2)
         PC1    -->   RSTN
         PB0    -->   /SEL
         PB3    -->   MOSI
         PB4    <--   MISO
         PB5    -->   SCK
                <--   DIG2    used to patch SLPTR

         Accelerometer (I2C)
         AVR        MMA7455L
         ---        --------
         PC4    -->   SDA
         PC5    -->   SCL
         PD2    -->   INT1/DRDY
         PD3    -->   INT2

         Humidity Sensor SHT-21
         AVR        SHT-21
         ---        ------
         PC4    -->   SDA
         PC5    -->   SCL

         Light Sensor / LED
         AVR        LED
         ---        ---
         PD3    -->  Anode
         PD4    -->  Cathode

       Fuses/Locks:
         LF: 0xd2 - 8MHz internal RC Osc.
         HF: 0xDF
         EF: 0x01

    Bootloader:
        Start at byte=...., address=....., size = 4096 instructions/ 8192 bytes

image latex

Definition in file board_muse231.h.

## Define Documentation

#define ACC_IRQ_INIT | ( |  | ) | do{ EICRA |= _BV(ISC00) | _BV(ISC01); }while(0)

any edge triggers PCINT1

Definition at line 152 of file board_muse231.h.

#define ACC_IRQ_vect INT0_vect

interrupt vector name

Definition at line 140 of file board_muse231.h.

#define BOARD_HAS_ACC_MMA7455_I2C (1)

Freescale® accelerometer in I2C mode

Definition at line 241 of file board_muse231.h.

#define BOARD_NAME "Multisensor 231"

current board name

Definition at line 91 of file board_muse231.h.

#define BOARD_TYPE (BOARD_MUSE231)

Build Options board type (see const.h)

Definition at line 90 of file board_muse231.h.

#define DDR_SPI (DDRB)

DDR register for SPI port

Definition at line 161 of file board_muse231.h.

#define DDR_TRX_RESET DDRC

DDR register for RESET pin

Definition at line 106 of file board_muse231.h.

#define DDR_TRX_SLPTR DDRC

PORT register for SLEEP_TR pin

Definition at line 113 of file board_muse231.h.

#define DI_ACC_IRQ | ( |  | ) | do{ EIMSK &= ~_BV(INT0); }while(0)

disable ACC interrupt

Definition at line 157 of file board_muse231.h.

#define DI_TRX_IRQ | ( |  | ) | { PCMSK2 &= ~_BV(PCINT21); }

disable TRX interrupt

Definition at line 147 of file board_muse231.h.

#define EI_ACC_IRQ | ( |  | ) |

Value:

    do{ EIFR |= _BV(INTF0); \
                               EIMSK |= _BV(INT0);}while(0)

enable ACC interrupt

Definition at line 154 of file board_muse231.h.

#define EI_TRX_IRQ | ( |  | ) | { PCMSK2 |= _BV(PCINT21); }

enable TRX interrupt

Definition at line 149 of file board_muse231.h.

#define HIF_TYPE HIF_NONE

Type of the host interface.

Definition at line 223 of file board_muse231.h.

#define LED_ANODE_bp (3)

LED anode bit position

Definition at line 215 of file board_muse231.h.

#define LED_CATHODE_bp (4)

LED cathode bit position

Definition at line 216 of file board_muse231.h.

#define LED_DDR DDRD

DDR register for LEDs

Definition at line 206 of file board_muse231.h.

#define LED_MASK (0x18)

MASK value for LEDs (msb aligned)

Definition at line 207 of file board_muse231.h.

#define LED_NUMBER (1)

number of LEDs for this board

Definition at line 211 of file board_muse231.h.

#define LED_PIN PIND

PIN register for LEDs

Definition at line 214 of file board_muse231.h.

#define LED_PORT PORTD

PORT register for LEDs

Definition at line 205 of file board_muse231.h.

#define LED_SHIFT (3)

SHIFT value for LEDs

Definition at line 208 of file board_muse231.h.

#define LEDS_INVERSE (1)

= 1, if low level at port means LED on

Definition at line 209 of file board_muse231.h.

#define MASK_TRX_RESET (_BV(1))

PIN mask for RESET pin

Definition at line 108 of file board_muse231.h.

#define MASK_TRX_SLPTR (_BV(0))

PIN mask for SLEEP_TR pin

Definition at line 114 of file board_muse231.h.

#define NO_KEYS (1)

if defined, no KEYS are connected

Definition at line 219 of file board_muse231.h.

#define PORT_SPI (PORTB)

PORT register for SPI port

Definition at line 162 of file board_muse231.h.

#define PORT_TRX_RESET PORTC

PORT register for RESET pin

Definition at line 107 of file board_muse231.h.

#define PORT_TRX_SLPTR PORTC

DDR register for SLEEP_TR pin

Definition at line 112 of file board_muse231.h.

#define RADIO_TYPE (RADIO_AT86RF231)

used radio (see const.h)

Definition at line 92 of file board_muse231.h.

#define SPI_DATA_REG SPDR

abstraction for SPI data register

Definition at line 170 of file board_muse231.h.

#define SPI_MISO _BV(PB4)

PIN mask for MISO pin

Definition at line 165 of file board_muse231.h.

#define SPI_MOSI _BV(PB3)

PIN mask for MOSI pin

Definition at line 164 of file board_muse231.h.

#define SPI_SCK _BV(PB5)

PIN mask for SCK pin

Definition at line 166 of file board_muse231.h.

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

set SS line to high level

Definition at line 199 of file board_muse231.h.

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

set SS line to low level

Definition at line 197 of file board_muse231.h.

#define SPI_SS _BV(PB0)

PIN mask for SS pin

Definition at line 167 of file board_muse231.h.

#define SPI_WAITFOR | ( |  | ) | do { while((SPSR & _BV(SPIF)) == 0);} while(0)

wait until SPI transfer is ready

Definition at line 201 of file board_muse231.h.

#define TIMER_INIT | ( |  | ) |

Value:

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

Definition at line 232 of file board_muse231.h.

#define TRX_IRQ 0x00

interrupt mask for GICR

Definition at line 138 of file board_muse231.h.

#define TRX_IRQ_INIT | ( |  | ) | do{ PCICR |= _BV(PCIE2); } while(0)

configuration of interrupt handling any edge triggers PCINT1

Definition at line 145 of file board_muse231.h.

#define TRX_IRQ_vect PCINT2_vect

interrupt vector name

Definition at line 139 of file board_muse231.h.