mbed libraries for KL25Z

Dependents:   FRDM_RGBLED

Committer:
emilmont
Date:
Tue Oct 23 09:20:18 2012 +0000
Revision:
7:73c5efe92a6c
Child:
8:c14af7958ef5
Make the C++ library completely TARGET independent.; Implement "gpio_irq_api" and "port_api" to KL25Z.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
emilmont 7:73c5efe92a6c 1 /* mbed Microcontroller Library - portmap
emilmont 7:73c5efe92a6c 2 * Copyright (c) 2010-2011 ARM Limited. All rights reserved.
emilmont 7:73c5efe92a6c 3 */
emilmont 7:73c5efe92a6c 4 #ifndef MBED_PORTMAP_H
emilmont 7:73c5efe92a6c 5 #define MBED_PORTMAP_H
emilmont 7:73c5efe92a6c 6
emilmont 7:73c5efe92a6c 7 #include "device.h"
emilmont 7:73c5efe92a6c 8
emilmont 7:73c5efe92a6c 9 #if DEVICE_PORTIN || DEVICE_PORTOUT
emilmont 7:73c5efe92a6c 10
emilmont 7:73c5efe92a6c 11 #include "PinNames.h"
emilmont 7:73c5efe92a6c 12 #include "PortNames.h"
emilmont 7:73c5efe92a6c 13
emilmont 7:73c5efe92a6c 14 #ifdef __cplusplus
emilmont 7:73c5efe92a6c 15 extern "C" {
emilmont 7:73c5efe92a6c 16 #endif
emilmont 7:73c5efe92a6c 17
emilmont 7:73c5efe92a6c 18 typedef struct {
emilmont 7:73c5efe92a6c 19 __IO uint32_t *reg_dir;
emilmont 7:73c5efe92a6c 20 #if defined(TARGET_LPC11U24)
emilmont 7:73c5efe92a6c 21 __IO uint32_t *reg_mpin;
emilmont 7:73c5efe92a6c 22 #elif defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_KL25Z)
emilmont 7:73c5efe92a6c 23 __IO uint32_t *reg_out;
emilmont 7:73c5efe92a6c 24 __I uint32_t *reg_in;
emilmont 7:73c5efe92a6c 25 #endif
emilmont 7:73c5efe92a6c 26 PortName port;
emilmont 7:73c5efe92a6c 27 uint32_t mask;
emilmont 7:73c5efe92a6c 28 } port_object;
emilmont 7:73c5efe92a6c 29
emilmont 7:73c5efe92a6c 30 PinName port_pin(PortName port, int pin_n);
emilmont 7:73c5efe92a6c 31
emilmont 7:73c5efe92a6c 32 void port_init (port_object *obj, PortName port, int mask, PinDirection dir);
emilmont 7:73c5efe92a6c 33 void port_mode (port_object *obj, PinMode mode);
emilmont 7:73c5efe92a6c 34 void port_dir (port_object *obj, PinDirection dir);
emilmont 7:73c5efe92a6c 35 void port_write(port_object *obj, int value);
emilmont 7:73c5efe92a6c 36 int port_read (port_object *obj);
emilmont 7:73c5efe92a6c 37
emilmont 7:73c5efe92a6c 38 #ifdef __cplusplus
emilmont 7:73c5efe92a6c 39 }
emilmont 7:73c5efe92a6c 40 #endif
emilmont 7:73c5efe92a6c 41 #endif
emilmont 7:73c5efe92a6c 42
emilmont 7:73c5efe92a6c 43 #endif