Contiki-NG
Data Structures | Functions

Header file for the SPI HAL. More...

#include "contiki.h"
#include "gpio-hal.h"
#include <stdint.h>
#include <stdbool.h>

Go to the source code of this file.

Data Structures

struct  spi_device
 SPI Device Configuration. More...
 

Typedefs

typedef struct spi_device spi_device_t
 SPI Device Configuration. More...
 

Enumerations

Functions

spi_status_t spi_acquire (spi_device_t *dev)
 Locks and then opens an SPI controller. More...
 
spi_status_t spi_release (spi_device_t *dev)
 Closes and then unlocks an SPI controller. More...
 
spi_status_t spi_select (spi_device_t *dev)
 Selects the SPI peripheral. More...
 
spi_status_t spi_deselect (spi_device_t *dev)
 Deselects the SPI peripheral. More...
 
bool spi_has_bus (spi_device_t *dev)
 Checks if a device has locked an SPI controller. More...
 
spi_status_t spi_write_byte (spi_device_t *dev, uint8_t data)
 Writes a single byte to an SPI device. More...
 
spi_status_t spi_read_byte (spi_device_t *dev, uint8_t *data)
 Reads a single byte from an SPI device. More...
 
spi_status_t spi_write (spi_device_t *dev, const uint8_t *data, int size)
 Writes a buffer to an SPI device. More...
 
spi_status_t spi_read (spi_device_t *dev, uint8_t *data, int size)
 Reads a buffer from an SPI device. More...
 
spi_status_t spi_read_skip (spi_device_t *dev, int size)
 Reads and ignores data from an SPI device. More...
 
spi_status_t spi_transfer (spi_device_t *dev, const uint8_t *data, int wsize, uint8_t *buf, int rsize, int ignore)
 Performs a generic SPI transfer. More...
 
spi_status_t spi_strobe (spi_device_t *dev, uint8_t strobe, uint8_t *status)
 Reads and Writes one byte from/to an SPI device. More...
 
spi_status_t spi_read_register (spi_device_t *dev, uint8_t reg, uint8_t *data, int size)
 Reads a buffer of bytes from a register of an SPI device. More...
 
bool spi_arch_has_lock (spi_device_t *dev)
 Checks if a device has locked an SPI controller. More...
 
bool spi_arch_is_bus_locked (spi_device_t *dev)
 Checks if an SPI controller is locked by any device. More...
 
spi_status_t spi_arch_lock_and_open (spi_device_t *dev)
 Locks and opens an SPI controller to the configuration specified. More...
 
spi_status_t spi_arch_close_and_unlock (spi_device_t *dev)
 Closes and unlocks an SPI controller. More...
 
spi_status_t spi_arch_transfer (spi_device_t *dev, const uint8_t *data, int wlen, uint8_t *buf, int rlen, int ignore_len)
 Performs an SPI transfer. More...
 
spi_status_t spi_arch_select (spi_device_t *dev)
 Selects an SPI device. More...
 
spi_status_t spi_arch_deselect (spi_device_t *dev)
 Deselects an SPI device. More...
 

Detailed Description

Header file for the SPI HAL.

Definition in file spi.h.