mbed-os
Fork of mbed-os by
targets/TARGET_NORDIC/TARGET_NRF5/objects.h@0:f269e3021894, 2016-10-23 (annotated)
- Committer:
- elessair
- Date:
- Sun Oct 23 15:10:02 2016 +0000
- Revision:
- 0:f269e3021894
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
elessair | 0:f269e3021894 | 1 | /* |
elessair | 0:f269e3021894 | 2 | * Copyright (c) 2013 Nordic Semiconductor ASA |
elessair | 0:f269e3021894 | 3 | * All rights reserved. |
elessair | 0:f269e3021894 | 4 | * |
elessair | 0:f269e3021894 | 5 | * Redistribution and use in source and binary forms, with or without modification, |
elessair | 0:f269e3021894 | 6 | * are permitted provided that the following conditions are met: |
elessair | 0:f269e3021894 | 7 | * |
elessair | 0:f269e3021894 | 8 | * 1. Redistributions of source code must retain the above copyright notice, this list |
elessair | 0:f269e3021894 | 9 | * of conditions and the following disclaimer. |
elessair | 0:f269e3021894 | 10 | * |
elessair | 0:f269e3021894 | 11 | * 2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA |
elessair | 0:f269e3021894 | 12 | * integrated circuit in a product or a software update for such product, must reproduce |
elessair | 0:f269e3021894 | 13 | * the above copyright notice, this list of conditions and the following disclaimer in |
elessair | 0:f269e3021894 | 14 | * the documentation and/or other materials provided with the distribution. |
elessair | 0:f269e3021894 | 15 | * |
elessair | 0:f269e3021894 | 16 | * 3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be |
elessair | 0:f269e3021894 | 17 | * used to endorse or promote products derived from this software without specific prior |
elessair | 0:f269e3021894 | 18 | * written permission. |
elessair | 0:f269e3021894 | 19 | * |
elessair | 0:f269e3021894 | 20 | * 4. This software, with or without modification, must only be used with a |
elessair | 0:f269e3021894 | 21 | * Nordic Semiconductor ASA integrated circuit. |
elessair | 0:f269e3021894 | 22 | * |
elessair | 0:f269e3021894 | 23 | * 5. Any software provided in binary or object form under this license must not be reverse |
elessair | 0:f269e3021894 | 24 | * engineered, decompiled, modified and/or disassembled. |
elessair | 0:f269e3021894 | 25 | * |
elessair | 0:f269e3021894 | 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
elessair | 0:f269e3021894 | 27 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
elessair | 0:f269e3021894 | 28 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
elessair | 0:f269e3021894 | 29 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
elessair | 0:f269e3021894 | 30 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
elessair | 0:f269e3021894 | 31 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
elessair | 0:f269e3021894 | 32 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
elessair | 0:f269e3021894 | 33 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
elessair | 0:f269e3021894 | 34 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
elessair | 0:f269e3021894 | 35 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
elessair | 0:f269e3021894 | 36 | * |
elessair | 0:f269e3021894 | 37 | */ |
elessair | 0:f269e3021894 | 38 | |
elessair | 0:f269e3021894 | 39 | #ifndef MBED_OBJECTS_H |
elessair | 0:f269e3021894 | 40 | #define MBED_OBJECTS_H |
elessair | 0:f269e3021894 | 41 | |
elessair | 0:f269e3021894 | 42 | #include "cmsis.h" |
elessair | 0:f269e3021894 | 43 | #include "PortNames.h" |
elessair | 0:f269e3021894 | 44 | #include "PeripheralNames.h" |
elessair | 0:f269e3021894 | 45 | #include "PinNames.h" |
elessair | 0:f269e3021894 | 46 | |
elessair | 0:f269e3021894 | 47 | #ifdef __cplusplus |
elessair | 0:f269e3021894 | 48 | extern "C" { |
elessair | 0:f269e3021894 | 49 | #endif |
elessair | 0:f269e3021894 | 50 | |
elessair | 0:f269e3021894 | 51 | struct serial_s { |
elessair | 0:f269e3021894 | 52 | uint32_t placeholder; // struct is unused by nRF5x API implementation |
elessair | 0:f269e3021894 | 53 | }; // but it must be not empty (required by strict compiler - IAR) |
elessair | 0:f269e3021894 | 54 | |
elessair | 0:f269e3021894 | 55 | struct spi_s { |
elessair | 0:f269e3021894 | 56 | uint8_t spi_idx; |
elessair | 0:f269e3021894 | 57 | }; |
elessair | 0:f269e3021894 | 58 | |
elessair | 0:f269e3021894 | 59 | struct port_s { |
elessair | 0:f269e3021894 | 60 | __IO uint32_t *reg_cnf; |
elessair | 0:f269e3021894 | 61 | __IO uint32_t *reg_out; |
elessair | 0:f269e3021894 | 62 | __I uint32_t *reg_in; |
elessair | 0:f269e3021894 | 63 | PortName port; |
elessair | 0:f269e3021894 | 64 | uint32_t mask; |
elessair | 0:f269e3021894 | 65 | }; |
elessair | 0:f269e3021894 | 66 | |
elessair | 0:f269e3021894 | 67 | struct pwmout_s { |
elessair | 0:f269e3021894 | 68 | PWMName pwm_name; |
elessair | 0:f269e3021894 | 69 | PinName pin; |
elessair | 0:f269e3021894 | 70 | uint8_t pwm_channel; |
elessair | 0:f269e3021894 | 71 | void * pwm_struct; |
elessair | 0:f269e3021894 | 72 | }; |
elessair | 0:f269e3021894 | 73 | |
elessair | 0:f269e3021894 | 74 | struct i2c_s { |
elessair | 0:f269e3021894 | 75 | uint8_t twi_idx; |
elessair | 0:f269e3021894 | 76 | }; |
elessair | 0:f269e3021894 | 77 | |
elessair | 0:f269e3021894 | 78 | struct analogin_s { |
elessair | 0:f269e3021894 | 79 | ADCName adc; |
elessair | 0:f269e3021894 | 80 | uint8_t adc_pin; |
elessair | 0:f269e3021894 | 81 | }; |
elessair | 0:f269e3021894 | 82 | |
elessair | 0:f269e3021894 | 83 | struct gpio_irq_s { |
elessair | 0:f269e3021894 | 84 | uint32_t ch; |
elessair | 0:f269e3021894 | 85 | }; |
elessair | 0:f269e3021894 | 86 | |
elessair | 0:f269e3021894 | 87 | |
elessair | 0:f269e3021894 | 88 | #include "gpio_object.h" |
elessair | 0:f269e3021894 | 89 | |
elessair | 0:f269e3021894 | 90 | #ifdef __cplusplus |
elessair | 0:f269e3021894 | 91 | } |
elessair | 0:f269e3021894 | 92 | #endif |
elessair | 0:f269e3021894 | 93 | |
elessair | 0:f269e3021894 | 94 | #endif |