mbed official / mbed

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Committer:
<>
Date:
Tue Nov 08 17:28:34 2016 +0000
Revision:
129:0ab6a29f35bf
Parent:
116:c0f6e94411f5
Release 129 of the mbed library

Ports for Upcoming Targets

3011: Add u-blox Sara-N target. https://github.com/ARMmbed/mbed-os/pull/3011
3099: MAX32625 https://github.com/ARMmbed/mbed-os/pull/3099
3151: Add support for FRDM-K82F https://github.com/ARMmbed/mbed-os/pull/3151
3177: New mcu k22512 fixing pr 3136 https://github.com/ARMmbed/mbed-os/pull/3177

Fixes and Changes

3008: NUCLEO_F072RB: Fix wrong timer channel number on pwm PB_5 pin https://github.com/ARMmbed/mbed-os/pull/3008
3013: STM32xx - Change how the ADC internal pins are checked before pinmap_ https://github.com/ARMmbed/mbed-os/pull/3013
3041: [nRF5] - added implementation of API of serial port flow control configuration. https://github.com/ARMmbed/mbed-os/pull/3041
3084: [nrf5] fix in Digital I/O : a gpioe pin was uninitialized badly https://github.com/ARMmbed/mbed-os/pull/3084
3009: TRNG enabled. TRNG APIs implemented. REV A/B/C/D flags removed. Warnings removed https://github.com/ARMmbed/mbed-os/pull/3009
3074: Target stm init gcc alignement https://github.com/ARMmbed/mbed-os/pull/3074
2988: Update of can_api.c fixing #2987 https://github.com/ARMmbed/mbed-os/pull/2988
3173: [Exporters] Add a device_name to microbit entry in targets.json https://github.com/ARMmbed/mbed-os/pull/3173
2969: [nRF52] - switch irq priorities of driver handlers to the lowest level https://github.com/ARMmbed/mbed-os/pull/2969
3184: #3183 Compiler warning in trng_api.c with K64F https://github.com/ARMmbed/mbed-os/pull/3184
3104: [NuMaker] Support CAN and fix PWM CLK error https://github.com/ARMmbed/mbed-os/pull/3104
3186: MultiTech mDot - add back SPI3 pins https://github.com/ARMmbed/mbed-os/pull/3186
3075: nsapi - Add standardized return types for size and errors https://github.com/ARMmbed/mbed-os/pull/3075
3221: u-blox odin w2 drivers update https://github.com/ARMmbed/mbed-os/pull/3221

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 102:da0ca467f8b5 1 /* mbed Microcontroller Library
Kojto 102:da0ca467f8b5 2 * Copyright (c) 2006-2015 ARM Limited
Kojto 102:da0ca467f8b5 3 *
Kojto 102:da0ca467f8b5 4 * Licensed under the Apache License, Version 2.0 (the "License");
Kojto 102:da0ca467f8b5 5 * you may not use this file except in compliance with the License.
Kojto 102:da0ca467f8b5 6 * You may obtain a copy of the License at
Kojto 102:da0ca467f8b5 7 *
Kojto 102:da0ca467f8b5 8 * http://www.apache.org/licenses/LICENSE-2.0
Kojto 102:da0ca467f8b5 9 *
Kojto 102:da0ca467f8b5 10 * Unless required by applicable law or agreed to in writing, software
Kojto 102:da0ca467f8b5 11 * distributed under the License is distributed on an "AS IS" BASIS,
Kojto 102:da0ca467f8b5 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Kojto 102:da0ca467f8b5 13 * See the License for the specific language governing permissions and
Kojto 102:da0ca467f8b5 14 * limitations under the License.
Kojto 102:da0ca467f8b5 15 */
Kojto 102:da0ca467f8b5 16 #ifndef MBED_GPIO_OBJECT_H
Kojto 102:da0ca467f8b5 17 #define MBED_GPIO_OBJECT_H
Kojto 102:da0ca467f8b5 18
Kojto 102:da0ca467f8b5 19 #include "cmsis.h"
Kojto 102:da0ca467f8b5 20 #include "PortNames.h"
Kojto 102:da0ca467f8b5 21 #include "PeripheralNames.h"
Kojto 102:da0ca467f8b5 22 #include "PinNames.h"
Kojto 102:da0ca467f8b5 23
Kojto 102:da0ca467f8b5 24 #ifdef __cplusplus
Kojto 102:da0ca467f8b5 25 extern "C" {
Kojto 102:da0ca467f8b5 26 #endif
Kojto 116:c0f6e94411f5 27
Kojto 102:da0ca467f8b5 28 typedef struct {
Kojto 102:da0ca467f8b5 29 PinName pin;
Kojto 102:da0ca467f8b5 30 uint32_t mask;
Kojto 116:c0f6e94411f5 31 uint32_t pin_number;
Kojto 116:c0f6e94411f5 32
Kojto 102:da0ca467f8b5 33 __IO uint32_t *reg_dir;
Kojto 116:c0f6e94411f5 34 __IO uint32_t *reg_dirclr;
Kojto 102:da0ca467f8b5 35 __IO uint32_t *reg_data;
Kojto 102:da0ca467f8b5 36 __I uint32_t *reg_in;
Kojto 102:da0ca467f8b5 37 } gpio_t;
Kojto 102:da0ca467f8b5 38
Kojto 102:da0ca467f8b5 39 static inline void gpio_write(gpio_t *obj, int value) {
Kojto 116:c0f6e94411f5 40 if (value){
Kojto 116:c0f6e94411f5 41 *obj->reg_data |= (obj->mask);
Kojto 116:c0f6e94411f5 42 } else {
Kojto 116:c0f6e94411f5 43 *obj->reg_data &= ~(obj->mask);
Kojto 116:c0f6e94411f5 44 }
Kojto 102:da0ca467f8b5 45 }
Kojto 102:da0ca467f8b5 46
Kojto 102:da0ca467f8b5 47 static inline int gpio_read(gpio_t *obj) {
Kojto 102:da0ca467f8b5 48 return ((*obj->reg_in & obj->mask) ? 1 : 0);
Kojto 102:da0ca467f8b5 49 }
Kojto 102:da0ca467f8b5 50
Kojto 102:da0ca467f8b5 51 #ifdef __cplusplus
Kojto 102:da0ca467f8b5 52 }
Kojto 102:da0ca467f8b5 53 #endif
Kojto 102:da0ca467f8b5 54
Kojto 102:da0ca467f8b5 55 #endif