mbed.h verzija za koristenje na predmetu PAI

Committer:
esokic
Date:
Tue Mar 10 09:51:52 2015 +0000
Revision:
0:05aad811ea07
mbed.h verzija od marta 2014, za koristenje na predmetu PAI

Who changed what in which revision?

UserRevisionLine numberNew contents of line
esokic 0:05aad811ea07 1 /* mbed Microcontroller Library
esokic 0:05aad811ea07 2 * Copyright (c) 2006-2013 ARM Limited
esokic 0:05aad811ea07 3 *
esokic 0:05aad811ea07 4 * Licensed under the Apache License, Version 2.0 (the "License");
esokic 0:05aad811ea07 5 * you may not use this file except in compliance with the License.
esokic 0:05aad811ea07 6 * You may obtain a copy of the License at
esokic 0:05aad811ea07 7 *
esokic 0:05aad811ea07 8 * http://www.apache.org/licenses/LICENSE-2.0
esokic 0:05aad811ea07 9 *
esokic 0:05aad811ea07 10 * Unless required by applicable law or agreed to in writing, software
esokic 0:05aad811ea07 11 * distributed under the License is distributed on an "AS IS" BASIS,
esokic 0:05aad811ea07 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
esokic 0:05aad811ea07 13 * See the License for the specific language governing permissions and
esokic 0:05aad811ea07 14 * limitations under the License.
esokic 0:05aad811ea07 15 */
esokic 0:05aad811ea07 16 #ifndef MBED_SPI_API_H
esokic 0:05aad811ea07 17 #define MBED_SPI_API_H
esokic 0:05aad811ea07 18
esokic 0:05aad811ea07 19 #include "device.h"
esokic 0:05aad811ea07 20
esokic 0:05aad811ea07 21 #if DEVICE_SPI
esokic 0:05aad811ea07 22
esokic 0:05aad811ea07 23 #ifdef __cplusplus
esokic 0:05aad811ea07 24 extern "C" {
esokic 0:05aad811ea07 25 #endif
esokic 0:05aad811ea07 26
esokic 0:05aad811ea07 27 typedef struct spi_s spi_t;
esokic 0:05aad811ea07 28
esokic 0:05aad811ea07 29 void spi_init (spi_t *obj, PinName mosi, PinName miso, PinName sclk, PinName ssel);
esokic 0:05aad811ea07 30 void spi_free (spi_t *obj);
esokic 0:05aad811ea07 31 void spi_format (spi_t *obj, int bits, int mode, int slave);
esokic 0:05aad811ea07 32 void spi_frequency (spi_t *obj, int hz);
esokic 0:05aad811ea07 33 int spi_master_write (spi_t *obj, int value);
esokic 0:05aad811ea07 34 int spi_slave_receive(spi_t *obj);
esokic 0:05aad811ea07 35 int spi_slave_read (spi_t *obj);
esokic 0:05aad811ea07 36 void spi_slave_write (spi_t *obj, int value);
esokic 0:05aad811ea07 37 int spi_busy (spi_t *obj);
esokic 0:05aad811ea07 38
esokic 0:05aad811ea07 39 #ifdef __cplusplus
esokic 0:05aad811ea07 40 }
esokic 0:05aad811ea07 41 #endif
esokic 0:05aad811ea07 42
esokic 0:05aad811ea07 43 #endif
esokic 0:05aad811ea07 44
esokic 0:05aad811ea07 45 #endif