Paparazzi UAS  v5.15_devel-88-gb3ad7fe
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
spi_arch.c File Reference

Handling of SPI hardware for Linux. More...

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <sys/ioctl.h>
#include <linux/spi/spidev.h>
#include "mcu_periph/spi.h"
#include <BOARD_CONFIG>
+ Include dependency graph for spi_arch.c:

Go to the source code of this file.

Macros

#define SPI0_MODE   (SPI_CPOL | SPI_CPHA)
 
#define SPI0_LSB_FIRST   0
 
#define SPI0_BITS_PER_WORD   8
 
#define SPI0_MAX_SPEED_HZ   1000000
 
#define SPI1_MODE   (SPI_CPOL | SPI_CPHA)
 
#define SPI1_LSB_FIRST   0
 
#define SPI1_BITS_PER_WORD   8
 
#define SPI1_MAX_SPEED_HZ   1000000
 

Functions

void spi_init_slaves (void)
 Initialize all used slaves and unselect them. More...
 
bool spi_submit (struct spi_periph *p, struct spi_transaction *t)
 Submit a spi transaction. More...
 
bool spi_lock (struct spi_periph *p, uint8_t slave)
 Lock the SPI fifo. More...
 
bool spi_resume (struct spi_periph *p, uint8_t slave)
 Resume the SPI fifo. More...
 
void spi0_arch_init (void)
 Architecture dependent SPI0 initialization. More...
 
void spi1_arch_init (void)
 Architecture dependent SPI1 initialization. More...
 

Detailed Description

Handling of SPI hardware for Linux.

Definition in file spi_arch.c.

Macro Definition Documentation

#define SPI0_BITS_PER_WORD   8

Definition at line 130 of file spi_arch.c.

Referenced by spi0_arch_init().

#define SPI0_LSB_FIRST   0

Definition at line 126 of file spi_arch.c.

Referenced by spi0_arch_init().

#define SPI0_MAX_SPEED_HZ   1000000

Definition at line 134 of file spi_arch.c.

Referenced by spi0_arch_init().

#define SPI0_MODE   (SPI_CPOL | SPI_CPHA)

Definition at line 122 of file spi_arch.c.

Referenced by spi0_arch_init().

#define SPI1_BITS_PER_WORD   8

Definition at line 186 of file spi_arch.c.

Referenced by spi1_arch_init().

#define SPI1_LSB_FIRST   0

Definition at line 182 of file spi_arch.c.

Referenced by spi1_arch_init().

#define SPI1_MAX_SPEED_HZ   1000000

Definition at line 190 of file spi_arch.c.

Referenced by spi1_arch_init().

#define SPI1_MODE   (SPI_CPOL | SPI_CPHA)

Definition at line 178 of file spi_arch.c.

Referenced by spi1_arch_init().