The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
AnnaBridge
Date:
Wed Feb 20 20:53:29 2019 +0000
Revision:
172:65be27845400
Parent:
171:3a7713b1edbc
mbed library release version 165

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AnnaBridge 171:3a7713b1edbc 1 /* mbed Microcontroller Library
AnnaBridge 171:3a7713b1edbc 2 * Copyright (c) 2006-2013 ARM Limited
AnnaBridge 171:3a7713b1edbc 3 *
AnnaBridge 171:3a7713b1edbc 4 * Licensed under the Apache License, Version 2.0 (the "License");
AnnaBridge 171:3a7713b1edbc 5 * you may not use this file except in compliance with the License.
AnnaBridge 171:3a7713b1edbc 6 * You may obtain a copy of the License at
AnnaBridge 171:3a7713b1edbc 7 *
AnnaBridge 171:3a7713b1edbc 8 * http://www.apache.org/licenses/LICENSE-2.0
AnnaBridge 171:3a7713b1edbc 9 *
AnnaBridge 171:3a7713b1edbc 10 * Unless required by applicable law or agreed to in writing, software
AnnaBridge 171:3a7713b1edbc 11 * distributed under the License is distributed on an "AS IS" BASIS,
AnnaBridge 171:3a7713b1edbc 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
AnnaBridge 171:3a7713b1edbc 13 * See the License for the specific language governing permissions and
AnnaBridge 171:3a7713b1edbc 14 * limitations under the License.
AnnaBridge 171:3a7713b1edbc 15 */
AnnaBridge 171:3a7713b1edbc 16 #ifndef MBED_OBJECTS_H
AnnaBridge 171:3a7713b1edbc 17 #define MBED_OBJECTS_H
AnnaBridge 171:3a7713b1edbc 18
AnnaBridge 171:3a7713b1edbc 19 #include "cmsis.h"
AnnaBridge 171:3a7713b1edbc 20 #include "PortNames.h"
AnnaBridge 171:3a7713b1edbc 21 #include "PeripheralNames.h"
AnnaBridge 171:3a7713b1edbc 22 #include "PinNames.h"
AnnaBridge 171:3a7713b1edbc 23
AnnaBridge 171:3a7713b1edbc 24 #ifdef __cplusplus
AnnaBridge 171:3a7713b1edbc 25 extern "C" {
AnnaBridge 171:3a7713b1edbc 26 #endif
AnnaBridge 171:3a7713b1edbc 27
AnnaBridge 171:3a7713b1edbc 28 #if defined(TARGET_KL46Z)
AnnaBridge 171:3a7713b1edbc 29 #define UARTLP_Type UART0_Type
AnnaBridge 171:3a7713b1edbc 30 #elif defined(TARGET_KL43Z)
AnnaBridge 171:3a7713b1edbc 31 #define UARTLP_Type LPUART_Type
AnnaBridge 171:3a7713b1edbc 32 #elif defined(TARGET_KL26Z)
AnnaBridge 171:3a7713b1edbc 33 #define UARTLP_Type UART0_Type
AnnaBridge 171:3a7713b1edbc 34 #endif
AnnaBridge 171:3a7713b1edbc 35
AnnaBridge 171:3a7713b1edbc 36 struct gpio_irq_s {
AnnaBridge 171:3a7713b1edbc 37 uint32_t port;
AnnaBridge 171:3a7713b1edbc 38 uint32_t pin;
AnnaBridge 171:3a7713b1edbc 39 uint32_t ch;
AnnaBridge 171:3a7713b1edbc 40 };
AnnaBridge 171:3a7713b1edbc 41
AnnaBridge 171:3a7713b1edbc 42 struct port_s {
AnnaBridge 171:3a7713b1edbc 43 __IO uint32_t *reg_dir;
AnnaBridge 171:3a7713b1edbc 44 __IO uint32_t *reg_out;
AnnaBridge 171:3a7713b1edbc 45 __I uint32_t *reg_in;
AnnaBridge 171:3a7713b1edbc 46 PortName port;
AnnaBridge 171:3a7713b1edbc 47 uint32_t mask;
AnnaBridge 171:3a7713b1edbc 48 };
AnnaBridge 171:3a7713b1edbc 49
AnnaBridge 171:3a7713b1edbc 50 struct pwmout_s {
AnnaBridge 171:3a7713b1edbc 51 __IO uint32_t *MOD;
AnnaBridge 171:3a7713b1edbc 52 __IO uint32_t *CNT;
AnnaBridge 171:3a7713b1edbc 53 __IO uint32_t *CnV;
AnnaBridge 171:3a7713b1edbc 54 };
AnnaBridge 171:3a7713b1edbc 55
AnnaBridge 171:3a7713b1edbc 56 struct serial_s {
AnnaBridge 171:3a7713b1edbc 57 UARTLP_Type *uart;
AnnaBridge 171:3a7713b1edbc 58 int index;
AnnaBridge 171:3a7713b1edbc 59 };
AnnaBridge 171:3a7713b1edbc 60
AnnaBridge 171:3a7713b1edbc 61 struct analogin_s {
AnnaBridge 171:3a7713b1edbc 62 ADCName adc;
AnnaBridge 171:3a7713b1edbc 63 };
AnnaBridge 171:3a7713b1edbc 64
AnnaBridge 171:3a7713b1edbc 65 struct dac_s {
AnnaBridge 171:3a7713b1edbc 66 DACName dac;
AnnaBridge 171:3a7713b1edbc 67 };
AnnaBridge 171:3a7713b1edbc 68
AnnaBridge 171:3a7713b1edbc 69 struct i2c_s {
AnnaBridge 171:3a7713b1edbc 70 I2C_Type *i2c;
AnnaBridge 171:3a7713b1edbc 71 };
AnnaBridge 171:3a7713b1edbc 72
AnnaBridge 171:3a7713b1edbc 73 struct spi_s {
AnnaBridge 171:3a7713b1edbc 74 SPI_Type *spi;
AnnaBridge 171:3a7713b1edbc 75 };
AnnaBridge 171:3a7713b1edbc 76
AnnaBridge 171:3a7713b1edbc 77 #include "gpio_object.h"
AnnaBridge 171:3a7713b1edbc 78
AnnaBridge 171:3a7713b1edbc 79 #ifdef __cplusplus
AnnaBridge 171:3a7713b1edbc 80 }
AnnaBridge 171:3a7713b1edbc 81 #endif
AnnaBridge 171:3a7713b1edbc 82
AnnaBridge 171:3a7713b1edbc 83 #endif