xypad theremin for LPC1768

Dependencies:   MODDMA mbed

Committer:
exopiped
Date:
Mon Mar 14 23:43:44 2016 +0000
Revision:
2:c5eeaf1c8e69
Parent:
0:8ee38453bad9
touch screen driver glitches removed; debug statements commented out

Who changed what in which revision?

UserRevisionLine numberNew contents of line
exopiped 0:8ee38453bad9 1 /* mbed Microcontroller Library
exopiped 0:8ee38453bad9 2 * Copyright (c) 2006-2013 ARM Limited
exopiped 0:8ee38453bad9 3 *
exopiped 0:8ee38453bad9 4 * Licensed under the Apache License, Version 2.0 (the "License");
exopiped 0:8ee38453bad9 5 * you may not use this file except in compliance with the License.
exopiped 0:8ee38453bad9 6 * You may obtain a copy of the License at
exopiped 0:8ee38453bad9 7 *
exopiped 0:8ee38453bad9 8 * http://www.apache.org/licenses/LICENSE-2.0
exopiped 0:8ee38453bad9 9 *
exopiped 0:8ee38453bad9 10 * Unless required by applicable law or agreed to in writing, software
exopiped 0:8ee38453bad9 11 * distributed under the License is distributed on an "AS IS" BASIS,
exopiped 0:8ee38453bad9 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
exopiped 0:8ee38453bad9 13 * See the License for the specific language governing permissions and
exopiped 0:8ee38453bad9 14 * limitations under the License.
exopiped 0:8ee38453bad9 15 */
exopiped 0:8ee38453bad9 16 #ifndef MBED_I2C_API_H
exopiped 0:8ee38453bad9 17 #define MBED_I2C_API_H
exopiped 0:8ee38453bad9 18
exopiped 0:8ee38453bad9 19 #include "device.h"
exopiped 0:8ee38453bad9 20
exopiped 0:8ee38453bad9 21 #if DEVICE_I2C
exopiped 0:8ee38453bad9 22
exopiped 0:8ee38453bad9 23 #ifdef __cplusplus
exopiped 0:8ee38453bad9 24 extern "C" {
exopiped 0:8ee38453bad9 25 #endif
exopiped 0:8ee38453bad9 26
exopiped 0:8ee38453bad9 27 typedef struct i2c_s i2c_t;
exopiped 0:8ee38453bad9 28
exopiped 0:8ee38453bad9 29 enum {
exopiped 0:8ee38453bad9 30 I2C_ERROR_NO_SLAVE = -1,
exopiped 0:8ee38453bad9 31 I2C_ERROR_BUS_BUSY = -2
exopiped 0:8ee38453bad9 32 };
exopiped 0:8ee38453bad9 33
exopiped 0:8ee38453bad9 34 void i2c_init (i2c_t *obj, PinName sda, PinName scl);
exopiped 0:8ee38453bad9 35 void i2c_frequency (i2c_t *obj, int hz);
exopiped 0:8ee38453bad9 36 int i2c_start (i2c_t *obj);
exopiped 0:8ee38453bad9 37 int i2c_stop (i2c_t *obj);
exopiped 0:8ee38453bad9 38 int i2c_read (i2c_t *obj, int address, char *data, int length, int stop);
exopiped 0:8ee38453bad9 39 int i2c_write (i2c_t *obj, int address, const char *data, int length, int stop);
exopiped 0:8ee38453bad9 40 void i2c_reset (i2c_t *obj);
exopiped 0:8ee38453bad9 41 int i2c_byte_read (i2c_t *obj, int last);
exopiped 0:8ee38453bad9 42 int i2c_byte_write (i2c_t *obj, int data);
exopiped 0:8ee38453bad9 43
exopiped 0:8ee38453bad9 44 #if DEVICE_I2CSLAVE
exopiped 0:8ee38453bad9 45 void i2c_slave_mode (i2c_t *obj, int enable_slave);
exopiped 0:8ee38453bad9 46 int i2c_slave_receive(i2c_t *obj);
exopiped 0:8ee38453bad9 47 int i2c_slave_read (i2c_t *obj, char *data, int length);
exopiped 0:8ee38453bad9 48 int i2c_slave_write (i2c_t *obj, const char *data, int length);
exopiped 0:8ee38453bad9 49 void i2c_slave_address(i2c_t *obj, int idx, uint32_t address, uint32_t mask);
exopiped 0:8ee38453bad9 50 #endif
exopiped 0:8ee38453bad9 51
exopiped 0:8ee38453bad9 52 #ifdef __cplusplus
exopiped 0:8ee38453bad9 53 }
exopiped 0:8ee38453bad9 54 #endif
exopiped 0:8ee38453bad9 55
exopiped 0:8ee38453bad9 56 #endif
exopiped 0:8ee38453bad9 57
exopiped 0:8ee38453bad9 58 #endif
exopiped 0:8ee38453bad9 59