pihwm
A lightweight C library for Raspberry Pi hardware modules.
 All Data Structures Files Functions Groups Pages
pi_spi.h File Reference

SPI library headers. More...

#include <linux/spi/spidev.h>
#include <inttypes.h>

Go to the source code of this file.

Macros

#define SPI_DEFAULT_MODE   0
 
#define SPI_DEFAULT_BPW   8
 
#define SPI_DEFAULT_SPEED   1000000
 
#define SPI_DEFAULT_DELAY   10
 

Functions

int spi_init (uint8_t channel)
 Initialises the spidev interface.
 
int spi_config (int fd, uint8_t mode, uint8_t bits, uint32_t speed, uint16_t delay)
 Configures the spidev interface.
 
int spi_config_default (int fd)
 Configures the spidev interface with default values.
 
int spi_transfer (int fd, uint8_t txbuf[], uint8_t rxbuf[], uint8_t len)
 Initiates SPI transfers.
 

Detailed Description

SPI library headers.

Author
Omer Kilic omerk.nosp@m.ilic.nosp@m.@gmai.nosp@m.l.co.nosp@m.m - Erlang Solutions

LICENSE

Copyright (C) 2013 Omer Kilic omerk.nosp@m.ilic.nosp@m.@gmai.nosp@m.l.co.nosp@m.m - Erlang Solutions

This file is part of pihwm http://omerk.github.io/pihwm

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file pi_spi.h.