ads1115 only

Fork of mbed by mbed official

Committer:
kaoshen
Date:
Tue Jan 17 23:27:32 2017 +0000
Revision:
135:fce8a9387ed1
Parent:
124:2241e3a39974
333 ADS1115 ADC1

Who changed what in which revision?

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