Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
sol-spi.h File Reference

These routines are used for SPI access under Soletta. More...

#include <stdint.h>
#include <stdbool.h>
#include <sol-common-buildopts.h>
#include <sol-macros.h>

Go to the source code of this file.

Data Structures

struct  sol_spi_config
 SPI configuration struct. More...
 

Macros

#define SOL_SPI_CONFIG_API_VERSION   (1)
 
#define SOL_SPI_DATA_BITS_DEFAULT   8
 Default value for bits per word when using SPI. More...
 

Typedefs

typedef struct sol_spi sol_spi
 A handle to a SPI bus. More...
 
typedef struct sol_spi_config sol_spi_config
 SPI configuration struct. More...
 

Enumerations

enum  sol_spi_mode { SOL_SPI_MODE_0 = 0, SOL_SPI_MODE_1, SOL_SPI_MODE_2, SOL_SPI_MODE_3 }
 SPI Transfer Modes. More...
 

Functions

void sol_spi_close (struct sol_spi *spi)
 Close an SPI bus. More...
 
enum sol_spi_mode sol_spi_mode_from_str (const char *spi_mode)
 Converts a string SPI mode name to sol_spi_mode. More...
 
const char * sol_spi_mode_to_str (enum sol_spi_mode spi_mode)
 Converts sol_spi_mode to a string name. More...
 
struct sol_spisol_spi_open (unsigned int bus, const struct sol_spi_config *config)
 Open an SPI bus. More...
 
int sol_spi_transfer (struct sol_spi *spi, const uint8_t *tx, uint8_t *rx, size_t count, void(*transfer_cb)(void *cb_data, struct sol_spi *spi, const uint8_t *tx, uint8_t *rx, ssize_t status), const void *cb_data)
 Perform a SPI asynchronous transfer. More...
 

Detailed Description

These routines are used for SPI access under Soletta.

Macro Definition Documentation

#define SOL_SPI_CONFIG_API_VERSION   (1)