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 &= ~(1<<ACC_IRQ_bp); }while(0)
#define | ACC_IRQ_ASOUT() do{ ACC_IRQ_DDR |= (1<<ACC_IRQ_bp); }while(0)
#define | ACC_IRQ_bp (2)
#define | ACC_IRQ_DDR DDRD
#define | ACC_IRQ_HI() do{ ACC_IRQ_PORT |= (1<<ACC_IRQ_bp); }while(0)
#define | ACC_IRQ_LO() do{ ACC_IRQ_PORT &= ~(1<<ACC_IRQ_bp); }while(0)
#define | ACC_IRQ_PIN PIND
#define | ACC_IRQ_PORT PORTD
#define | ACC_IRQ_STATE() ( (ACC_IRQ_PIN & (1<<ACC_IRQ_bp)) != 0)
#define | ACC_IRQ_vect INT0_vect
#define | BOARD_MUSE231_H (1)
#define | BOARD_NAME "Multisensor 231"
#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_TRX_IRQ() { PCMSK2 &= ~(1<<PCINT21); }
#define | EI_TRX_IRQ() { PCMSK2 |= (1<<PCINT21); }
#define | HIF_TYPE HIF_NONE
#define | HWTIMER_REG (TCNT1)
#define | HWTIMER_TICK ((1.0*HWTMR_PRESCALE)/F_CPU)
#define | HWTIMER_TICK_NB (1000UL)
#define | HWTMR_PRESCALE (8)
#define | LED_ANODE_bp (3)
#define | LED_CATHODE_bp (4)
#define | LED_DDR DDRD
#define | LED_INIT()
#define | LED_MASK (0x08)
#define | LED_NUMBER (1)
#define | LED_PIN PIND
#define | LED_PORT PORTD
#define | LED_SHIFT (3)
#define | LEDS_INVERSE (0)
#define | MASK_TRX_RESET ((1<<1))
#define | MASK_TRX_SLPTR ((1<<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 (1<<PB4)
#define | SPI_MOSI (1<<PB3)
#define | SPI_SCK (1<<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 (1<<PB0)
#define | SPI_TYPE SPI_TYPE_SPI
#define | SPI_WAITFOR() do { while((SPSR & (1<<SPIF)) == 0);} while(0)
#define | TIMER_INIT()
#define | TIMER_IRQ_vect TIMER1_COMPA_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 |= (1<<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

## Define Documentation

#define ACC_IRQ_vect INT0_vect

interrupt vector name

#define BOARD_NAME "Multisensor 231"

current board name

#define BOARD_TYPE (BOARD_MUSE231)

Build Options

#define DDR_SPI (DDRB)

DDR register for SPI port

#define DDR_TRX_RESET DDRC

DDR register for RESET pin

#define DDR_TRX_SLPTR DDRC

PORT register for SLP_TR pin

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

disable TRX interrupt

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

enable TRX interrupt

#define HIF_TYPE HIF_NONE

Type of the host interface.

#define LED_ANODE_bp (3)

LED anode bit position

#define LED_CATHODE_bp (4)

LED cathode bit position

#define LED_DDR DDRD

DDR register for LEDs

#define LED_INIT | ( |  | ) |

Value:

    do{ LED_PORT &= ~((1<<LED_CATHODE_bp) | (1<<LED_ANODE_bp)); \
                LED_DDR |= ((1<<LED_CATHODE_bp) | (1<<LED_ANODE_bp)); }while(0)

#define LED_MASK (0x08)

MASK value for LEDs (msb aligned)

#define LED_NUMBER (1)

number of LEDs for this board

#define LED_PIN PIND

PIN register for LEDs

#define LED_PORT PORTD

PORT register for LEDs

#define LED_SHIFT (3)

SHIFT value for LEDs

#define LEDS_INVERSE (0)

= 1, if low level at port means LED on

#define MASK_TRX_RESET ((1<<1))

PIN mask for RESET pin

#define MASK_TRX_SLPTR ((1<<0))

PIN mask for SLP_TR pin

#define NO_KEYS (1)

if defined, no KEYS are connected

#define PORT_SPI (PORTB)

PORT register for SPI port

#define PORT_TRX_RESET PORTC

PORT register for RESET pin

#define PORT_TRX_SLPTR PORTC

DDR register for SLP_TR pin

#define RADIO_TYPE (RADIO_AT86RF231)

used radio (see const.h)

#define SPI_DATA_REG SPDR

abstraction for SPI data register

#define SPI_MISO (1<<PB4)

PIN mask for MISO pin

#define SPI_MOSI (1<<PB3)

PIN mask for MOSI pin

#define SPI_SCK (1<<PB5)

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 (1<<PB0)

PIN mask for SS pin

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

wait until SPI transfer is ready

#define TIMER_INIT | ( |  | ) |

Value:

    do{ \
            TCCR1B = 0; \
            OCR1A = HWTIMER_TICK_NB; \
            TCCR1B |= ((1<<WGM12) | (1<<CS11)); \
            TIMSK1 |= (1<<OCIE1A); \
        }while(0)

#define TRX_IRQ 0x00

interrupt mask for GICR

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

configuration of interrupt handling any edge triggers PCINT1

#define TRX_IRQ_vect PCINT2_vect

interrupt vector name