lol

Dependencies:   MMA8451Q

Fork of Application by Mateusz Kowalik

Committer:
danix
Date:
Sun Jan 21 22:28:30 2018 +0000
Revision:
12:3a30cdffa27c
Parent:
10:41552d038a69
Working acelerometer and mouse

Who changed what in which revision?

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