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:
<>
Date:
Tue Mar 14 16:20:51 2017 +0000
Revision:
138:093f2bd7b9eb
Parent:
104:b9ad9a133dc7
Release 138 of the mbed library

Ports for Upcoming Targets


Fixes and Changes

3716: fix for issue #3715: correction in startup files for ARM and IAR, alignment of system_stm32f429xx.c files https://github.com/ARMmbed/mbed-os/pull/3716
3741: STM32 remove warning in hal_tick_32b.c file https://github.com/ARMmbed/mbed-os/pull/3741
3780: STM32L4 : Fix GPIO G port compatibility https://github.com/ARMmbed/mbed-os/pull/3780
3831: NCS36510: SPISLAVE enabled (Conflict resolved) https://github.com/ARMmbed/mbed-os/pull/3831
3836: Allow to redefine nRF's PSTORAGE_NUM_OF_PAGES outside of the mbed-os https://github.com/ARMmbed/mbed-os/pull/3836
3840: STM32: gpio SPEED - always set High Speed by default https://github.com/ARMmbed/mbed-os/pull/3840
3844: STM32 GPIO: Typo correction. Update comment (GPIO_IP_WITHOUT_BRR) https://github.com/ARMmbed/mbed-os/pull/3844
3850: STM32: change spi error to debug warning https://github.com/ARMmbed/mbed-os/pull/3850
3860: Define GPIO_IP_WITHOUT_BRR for xDot platform https://github.com/ARMmbed/mbed-os/pull/3860
3880: DISCO_F469NI: allow the use of CAN2 instance when CAN1 is not activated https://github.com/ARMmbed/mbed-os/pull/3880
3795: Fix pwm period calc https://github.com/ARMmbed/mbed-os/pull/3795
3828: STM32 CAN API: correct format and type https://github.com/ARMmbed/mbed-os/pull/3828
3842: TARGET_NRF: corrected spi_init() to properly handle re-initialization https://github.com/ARMmbed/mbed-os/pull/3842
3843: STM32L476xG: set APB2 clock to 80MHz (instead of 40MHz) https://github.com/ARMmbed/mbed-os/pull/3843
3879: NUCLEO_F446ZE: Add missing AnalogIn pins on PF_3, PF_5 and PF_10. https://github.com/ARMmbed/mbed-os/pull/3879
3902: Fix heap and stack size for NUCLEO_F746ZG https://github.com/ARMmbed/mbed-os/pull/3902
3829: can_write(): return error code when no tx mailboxes are available https://github.com/ARMmbed/mbed-os/pull/3829

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 104:b9ad9a133dc7 1 /* mbed Microcontroller Library
Kojto 104:b9ad9a133dc7 2 * Copyright (c) 2013 Nordic Semiconductor
Kojto 104:b9ad9a133dc7 3 *
Kojto 104:b9ad9a133dc7 4 * Licensed under the Apache License, Version 2.0 (the "License");
Kojto 104:b9ad9a133dc7 5 * you may not use this file except in compliance with the License.
Kojto 104:b9ad9a133dc7 6 * You may obtain a copy of the License at
Kojto 104:b9ad9a133dc7 7 *
Kojto 104:b9ad9a133dc7 8 * http://www.apache.org/licenses/LICENSE-2.0
Kojto 104:b9ad9a133dc7 9 *
Kojto 104:b9ad9a133dc7 10 * Unless required by applicable law or agreed to in writing, software
Kojto 104:b9ad9a133dc7 11 * distributed under the License is distributed on an "AS IS" BASIS,
Kojto 104:b9ad9a133dc7 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Kojto 104:b9ad9a133dc7 13 * See the License for the specific language governing permissions and
Kojto 104:b9ad9a133dc7 14 * limitations under the License.
Kojto 104:b9ad9a133dc7 15 */
Kojto 104:b9ad9a133dc7 16 #ifndef MBED_OBJECTS_H
Kojto 104:b9ad9a133dc7 17 #define MBED_OBJECTS_H
Kojto 104:b9ad9a133dc7 18
Kojto 104:b9ad9a133dc7 19 #include "cmsis.h"
Kojto 104:b9ad9a133dc7 20 #include "PortNames.h"
Kojto 104:b9ad9a133dc7 21 #include "PeripheralNames.h"
Kojto 104:b9ad9a133dc7 22 #include "PinNames.h"
Kojto 104:b9ad9a133dc7 23
Kojto 104:b9ad9a133dc7 24 #ifdef __cplusplus
Kojto 104:b9ad9a133dc7 25 extern "C" {
Kojto 104:b9ad9a133dc7 26 #endif
Kojto 104:b9ad9a133dc7 27
Kojto 104:b9ad9a133dc7 28 #define I2C_SPI_PERIPHERAL_FOR_I2C 1
Kojto 104:b9ad9a133dc7 29 #define I2C_SPI_PERIPHERAL_FOR_SPI 2
Kojto 104:b9ad9a133dc7 30
Kojto 104:b9ad9a133dc7 31 typedef struct {
Kojto 104:b9ad9a133dc7 32 uint8_t usage; // I2C: 1, SPI: 2
Kojto 104:b9ad9a133dc7 33 uint8_t sda_mosi;
Kojto 104:b9ad9a133dc7 34 uint8_t scl_miso;
Kojto 104:b9ad9a133dc7 35 uint8_t sclk;
Kojto 104:b9ad9a133dc7 36 } i2c_spi_peripheral_t;
Kojto 104:b9ad9a133dc7 37
Kojto 104:b9ad9a133dc7 38 struct serial_s {
Kojto 104:b9ad9a133dc7 39 NRF_UART_Type *uart;
Kojto 104:b9ad9a133dc7 40 int index;
Kojto 104:b9ad9a133dc7 41 };
Kojto 104:b9ad9a133dc7 42
Kojto 104:b9ad9a133dc7 43 struct spi_s {
Kojto 104:b9ad9a133dc7 44 NRF_SPI_Type *spi;
Kojto 104:b9ad9a133dc7 45 NRF_SPIS_Type *spis;
Kojto 104:b9ad9a133dc7 46 uint8_t peripheral;
Kojto 104:b9ad9a133dc7 47 };
Kojto 104:b9ad9a133dc7 48
Kojto 104:b9ad9a133dc7 49 struct port_s {
Kojto 104:b9ad9a133dc7 50 __IO uint32_t *reg_cnf;
Kojto 104:b9ad9a133dc7 51 __IO uint32_t *reg_out;
Kojto 104:b9ad9a133dc7 52 __I uint32_t *reg_in;
Kojto 104:b9ad9a133dc7 53 PortName port;
Kojto 104:b9ad9a133dc7 54 uint32_t mask;
Kojto 104:b9ad9a133dc7 55 };
Kojto 104:b9ad9a133dc7 56
Kojto 104:b9ad9a133dc7 57 struct pwmout_s {
Kojto 104:b9ad9a133dc7 58 PWMName pwm;
Kojto 104:b9ad9a133dc7 59 PinName pin;
Kojto 104:b9ad9a133dc7 60 };
Kojto 104:b9ad9a133dc7 61
Kojto 104:b9ad9a133dc7 62 struct i2c_s {
Kojto 104:b9ad9a133dc7 63 NRF_TWI_Type *i2c;
Kojto 104:b9ad9a133dc7 64 PinName sda;
Kojto 104:b9ad9a133dc7 65 PinName scl;
Kojto 104:b9ad9a133dc7 66 int freq;
Kojto 104:b9ad9a133dc7 67 uint8_t address_set;
Kojto 104:b9ad9a133dc7 68 uint8_t peripheral;
Kojto 104:b9ad9a133dc7 69 };
Kojto 104:b9ad9a133dc7 70
Kojto 104:b9ad9a133dc7 71 struct analogin_s {
Kojto 104:b9ad9a133dc7 72 ADCName adc;
Kojto 104:b9ad9a133dc7 73 uint8_t adc_pin;
Kojto 104:b9ad9a133dc7 74 };
Kojto 104:b9ad9a133dc7 75
Kojto 104:b9ad9a133dc7 76 struct gpio_irq_s {
Kojto 104:b9ad9a133dc7 77 uint32_t ch;
Kojto 104:b9ad9a133dc7 78 };
Kojto 104:b9ad9a133dc7 79
Kojto 104:b9ad9a133dc7 80 #include "gpio_object.h"
Kojto 104:b9ad9a133dc7 81
Kojto 104:b9ad9a133dc7 82 #ifdef __cplusplus
Kojto 104:b9ad9a133dc7 83 }
Kojto 104:b9ad9a133dc7 84 #endif
Kojto 104:b9ad9a133dc7 85
Kojto 104:b9ad9a133dc7 86 #endif