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.
TARGET_NRF52_DK/TARGET_NORDIC/TARGET_NRF5/gpio_object.h@136:ef9c61f8c49f, 2017-02-14 (annotated)
- Committer:
- Kojto
- Date:
- Tue Feb 14 11:24:20 2017 +0000
- Revision:
- 136:ef9c61f8c49f
- Parent:
- 123:b0220dba8be7
Release 136 of the mbed library
Ports for Upcoming Targets
Fixes and Changes
3432: Target STM USBHOST support https://github.com/ARMmbed/mbed-os/pull/3432
3181: NUCLEO_F207ZG extending PeripheralPins.c: all available alternate functions can be used now https://github.com/ARMmbed/mbed-os/pull/3181
3626: NUCLEO_F412ZG : Add USB Device +Host https://github.com/ARMmbed/mbed-os/pull/3626
3628: Fix warnings https://github.com/ARMmbed/mbed-os/pull/3628
3629: STM32: L0 LL layer https://github.com/ARMmbed/mbed-os/pull/3629
3632: IDE Export support for platform VK_RZ_A1H https://github.com/ARMmbed/mbed-os/pull/3632
3642: Missing IRQ pin fix for platform VK_RZ_A1H https://github.com/ARMmbed/mbed-os/pull/3642
3664: Fix ncs36510 sleep definitions https://github.com/ARMmbed/mbed-os/pull/3664
3655: [STM32F4] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3655
3657: [STM32L4] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3657
3658: [STM32F3] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3658
3685: STM32: I2C: reset state machine https://github.com/ARMmbed/mbed-os/pull/3685
3692: uVisor: Standardize available legacy heap and stack https://github.com/ARMmbed/mbed-os/pull/3692
3621: Fix for #2884, LPC824: export to LPCXpresso, target running with wron https://github.com/ARMmbed/mbed-os/pull/3621
3649: [STM32F7] Modify folder structure https://github.com/ARMmbed/mbed-os/pull/3649
3695: Enforce device_name is valid in targets.json https://github.com/ARMmbed/mbed-os/pull/3695
3723: NCS36510: spi_format function bug fix https://github.com/ARMmbed/mbed-os/pull/3723
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 123:b0220dba8be7 | 1 | /* mbed Microcontroller Library |
Kojto | 123:b0220dba8be7 | 2 | * Copyright (c) 2006-2013 ARM Limited |
Kojto | 123:b0220dba8be7 | 3 | * |
Kojto | 123:b0220dba8be7 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
Kojto | 123:b0220dba8be7 | 5 | * you may not use this file except in compliance with the License. |
Kojto | 123:b0220dba8be7 | 6 | * You may obtain a copy of the License at |
Kojto | 123:b0220dba8be7 | 7 | * |
Kojto | 123:b0220dba8be7 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
Kojto | 123:b0220dba8be7 | 9 | * |
Kojto | 123:b0220dba8be7 | 10 | * Unless required by applicable law or agreed to in writing, software |
Kojto | 123:b0220dba8be7 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
Kojto | 123:b0220dba8be7 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
Kojto | 123:b0220dba8be7 | 13 | * See the License for the specific language governing permissions and |
Kojto | 123:b0220dba8be7 | 14 | * limitations under the License. |
Kojto | 123:b0220dba8be7 | 15 | */ |
Kojto | 123:b0220dba8be7 | 16 | #ifndef MBED_GPIO_OBJECT_H |
Kojto | 123:b0220dba8be7 | 17 | #define MBED_GPIO_OBJECT_H |
Kojto | 123:b0220dba8be7 | 18 | |
Kojto | 123:b0220dba8be7 | 19 | #include "mbed_assert.h" |
Kojto | 123:b0220dba8be7 | 20 | |
Kojto | 123:b0220dba8be7 | 21 | #include "nrf_gpio.h" |
Kojto | 123:b0220dba8be7 | 22 | |
Kojto | 123:b0220dba8be7 | 23 | #ifdef __cplusplus |
Kojto | 123:b0220dba8be7 | 24 | extern "C" { |
Kojto | 123:b0220dba8be7 | 25 | #endif |
Kojto | 123:b0220dba8be7 | 26 | |
Kojto | 123:b0220dba8be7 | 27 | typedef struct { |
Kojto | 123:b0220dba8be7 | 28 | PinName pin; |
Kojto | 123:b0220dba8be7 | 29 | } gpio_t; |
Kojto | 123:b0220dba8be7 | 30 | |
Kojto | 123:b0220dba8be7 | 31 | static inline void gpio_write(gpio_t *obj, int value) { |
Kojto | 123:b0220dba8be7 | 32 | MBED_ASSERT(obj->pin != (PinName)NC); |
Kojto | 123:b0220dba8be7 | 33 | if (value) { |
Kojto | 123:b0220dba8be7 | 34 | nrf_gpio_pin_set(obj->pin); |
Kojto | 123:b0220dba8be7 | 35 | } else { |
Kojto | 123:b0220dba8be7 | 36 | nrf_gpio_pin_clear(obj->pin); |
Kojto | 123:b0220dba8be7 | 37 | } |
Kojto | 123:b0220dba8be7 | 38 | } |
Kojto | 123:b0220dba8be7 | 39 | |
Kojto | 123:b0220dba8be7 | 40 | static inline int gpio_is_connected(const gpio_t *obj) { |
Kojto | 123:b0220dba8be7 | 41 | return obj->pin != (PinName)NC; |
Kojto | 123:b0220dba8be7 | 42 | } |
Kojto | 123:b0220dba8be7 | 43 | |
Kojto | 123:b0220dba8be7 | 44 | #ifdef __cplusplus |
Kojto | 123:b0220dba8be7 | 45 | } |
Kojto | 123:b0220dba8be7 | 46 | #endif |
Kojto | 123:b0220dba8be7 | 47 | |
Kojto | 123:b0220dba8be7 | 48 | #endif |