- Main Page
- Related Pages
- Modules
- Files

- File List
- Globals

# hal_mdb1.h

Go to the documentation of this file.

    00001
    00010 #ifndef PERIPHERALS_H
    00011 #define PERIPHERALS_H
    00012
    00013 #define STATUS_LED_RED BIT6
    00014 #define STATUS_LED_GREEN BIT7
    00015 #define STATUS_LED_YELLOW (BIT6+BIT7)
    00016 #define ALL_LEDS_OFF 0x3F
    00017
    00018 #define HAL_SLEEP()     ( __bis_SR_register(LPM3_bits + GIE))
    00019 #define HAL_WAKEUP()    ( __bic_SR_register_on_exit(LPM3_bits))
    00020
    00021 #include "msp430x24x.h"
    00022
    00023 void halInit();
    00024 void halEnableInterrupts();
    00025 void delayMs(unsigned int ms);
    00026 void toggleLed(unsigned char whichLed);
    00027 signed int setLed(unsigned char led);
    00028 void clearLeds();
    00029 void halSpiInit();
    00030 void spiWrite(unsigned char *bytes, unsigned char numBytes);
    00031 void setZnpInterfaceToInputs(void);
    00032 unsigned int calibrateVlo();
    00033 signed int initTimer(unsigned char seconds, unsigned char wakeOnTimer);
    00034
    00035
    00036 //NOT REQUIRED FOR ZNP LIBRARY:
    00037 unsigned char getSwitches();
    00038 void testLEDs();
    00039 void setStatusLed(unsigned char color);
    00040 void setButtonLeds(unsigned char buttonId);
    00041 void clearButtonLeds();
    00042 int putcharPmd(int c);
    00043
    00044 //REQUIRED FOR ZNP LIBRARY:
    00045 #define RADIO_ON()                  (P1OUT |= BIT2)
    00046 #define RADIO_OFF()                 (P1OUT &= ~BIT2)
    00047
    00048 #define SPI_SS_SET()                (P5OUT &= ~BIT0)  //active low
    00049 #define SPI_SS_CLEAR()              (P5OUT |= BIT0)
    00050 #define SRDY_IS_HIGH()              (P1IN & BIT3)
    00051 #define SRDY_IS_LOW()               ((~P1IN) & BIT3)
    00052
    00053 //NOT REQUIRED FOR ZNP LIBRARY:
    00054 #define DEBUG_ON()                  (P6OUT |= BIT6)
    00055 #define DEBUG_OFF()                 (P6OUT &= BIT6)
    00056
    00057 #define TICKS_IN_ONE_MS_8MHZ        1980   //derived experimentally
    00058 #define TICKS_IN_ONE_MS             TICKS_IN_ONE_MS_8MHZ
    00059
    00060 #define NO_WAKEUP_AFTER_TIMER 0
    00061 #define WAKEUP_AFTER_TIMER 1
    00062
    00063 #define MASTER_BUTTON_0 0x00
    00064 #define MASTER_BUTTON_1 0x01
    00065 #define MASTER_BUTTON_2 0x02
    00066 #define MASTER_BUTTON_3 0x03
    00067 #define MASTER_BUTTON_4 0x04
    00068
    00069 #define BUTTON_LEDS_OFF 0xFF
    00070
    00071 #endif

All Files Functions Variables Defines