2 * Copyright (c) 2016-2017 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __PERIPHERAL_INTERFACE_SPI_H__
18 #define __PERIPHERAL_INTERFACE_SPI_H__
20 #include "peripheral_io.h"
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);
31 #endif /* __PERIPHERAL_INTERFACE_SPI_H__ */