Simple mbed library with macros

Dependents:   SimpleTimer SimpleUART SimpleTimer Stoppuhr1

Committer:
Alkorin
Date:
Sat Nov 13 14:47:51 2010 +0000
Revision:
6:9e1310782abf
Parent:
4:afddc4848b6c
Child:
8:f8b47457fdcf
Fixed a bug in SERIAL_SETBAUD

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Alkorin 4:afddc4848b6c 1 #ifndef __LEDS_H__
Alkorin 4:afddc4848b6c 2 #define __LEDS_H__
Alkorin 4:afddc4848b6c 3
Alkorin 4:afddc4848b6c 4 #include "mbed_globals.h"
Alkorin 4:afddc4848b6c 5
Alkorin 4:afddc4848b6c 6 /** Bits **/
Alkorin 4:afddc4848b6c 7 #define LED1 (1 << 18)
Alkorin 4:afddc4848b6c 8 #define LED2 (1 << 20)
Alkorin 4:afddc4848b6c 9 #define LED3 (1 << 21)
Alkorin 4:afddc4848b6c 10 #define LED4 (1 << 23)
Alkorin 4:afddc4848b6c 11 #define LEDS_MASK (LED1 | LED2 | LED3 | LED4)
Alkorin 4:afddc4848b6c 12
Alkorin 4:afddc4848b6c 13 /** Macros **/
Alkorin 4:afddc4848b6c 14 #define LEDS_INIT() LPC_GPIO1->FIODIR |= LEDS_MASK;
Alkorin 4:afddc4848b6c 15
Alkorin 6:9e1310782abf 16 #define LEDS_SET(value) { \
Alkorin 6:9e1310782abf 17 LPC_GPIO1->FIOMASK = ~LEDS_MASK; \
Alkorin 6:9e1310782abf 18 LPC_GPIO1->FIOPIN = (value); \
Alkorin 6:9e1310782abf 19 }
Alkorin 4:afddc4848b6c 20
Alkorin 0:aa3c3d1a5918 21 #endif