Simple mbed library with macros

Dependents:   SimpleTimer SimpleUART SimpleTimer Stoppuhr1

Committer:
Alkorin
Date:
Tue Nov 09 12:40:55 2010 +0000
Revision:
4:afddc4848b6c
Parent:
2:e6b2d22fbf75
Child:
6:9e1310782abf
Added interrupt names and default handlers (from CMSIS)

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 4:afddc4848b6c 16 #define LEDS_SET(value) LPC_GPIO1->FIOMASK = ~LEDS_MASK; \
Alkorin 4:afddc4848b6c 17 LPC_GPIO1->FIOPIN = (value);
Alkorin 4:afddc4848b6c 18
Alkorin 0:aa3c3d1a5918 19 #endif