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.
16 #ifndef __PERIPHERAL_GDBUS_SPI_H_
17 #define __PERIPHERAL_GDBUS_SPI_H_
19 void spi_proxy_init(void);
20 void spi_proxy_deinit();
22 int peripheral_gdbus_spi_open(peripheral_spi_h spi, int bus, int cs);
23 int peripheral_gdbus_spi_close(peripheral_spi_h spi);
24 int peripheral_gdbus_spi_set_mode(peripheral_spi_h spi, peripheral_spi_mode_e mode);
25 int peripheral_gdbus_spi_set_bit_order(peripheral_spi_h spi, bool lsb);
26 int peripheral_gdbus_spi_set_bits_per_word(peripheral_spi_h spi, unsigned char bits);
27 int peripheral_gdbus_spi_set_frequency(peripheral_spi_h spi, unsigned int freq_hz);
28 int peripheral_gdbus_spi_read(peripheral_spi_h spi, unsigned char *data, int length);
29 int peripheral_gdbus_spi_write(peripheral_spi_h spi, unsigned char *data, int length);
30 int peripheral_gdbus_spi_transfer(peripheral_spi_h spi, unsigned char *tx_data, unsigned char *rx_data, int length);
32 #endif /* __PERIPHERAL_GDBUS_SPI_H_ */