937caa7864d615096cc48c956a706a1250d26f69
[platform/core/api/peripheral-io.git] / include / interface / peripheral_interface_spi.h
1 /*
2  * Copyright (c) 2016-2017 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __PERIPHERAL_INTERFACE_SPI_H__
18 #define __PERIPHERAL_INTERFACE_SPI_H__
19
20 #include "peripheral_io.h"
21
22 int peripheral_interface_spi_close(peripheral_spi_h spi);
23 int peripheral_interface_spi_set_mode(peripheral_spi_h spi, unsigned char mode);
24 int peripheral_interface_spi_set_bit_order(peripheral_spi_h spi, unsigned char lsb);
25 int peripheral_interface_spi_set_bits_per_word(peripheral_spi_h spi, unsigned char bits);
26 int peripheral_interface_spi_set_frequency(peripheral_spi_h spi, unsigned int freq);
27 int peripheral_interface_spi_read(peripheral_spi_h spi, unsigned char *rxbuf, int length);
28 int peripheral_interface_spi_write(peripheral_spi_h spi, unsigned char *txbuf, int length);
29 int peripheral_interface_spi_transfer(peripheral_spi_h spi, unsigned char *txbuf, unsigned char *rxbuf, int length);
30
31 #endif /* __PERIPHERAL_INTERFACE_SPI_H__ */