All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches

PIO I2C program interface. More...

Detailed Description

PIO I2C program interface.

Author
Fabian Hüßler fabia.nosp@m.n.hu.nosp@m.essle.nosp@m.r@ov.nosp@m.gu.de

Definition in file i2c.h.

#include "periph/i2c.h"
#include "periph/pio.h"
#include "mutex.h"
+ Include dependency graph for i2c.h:

Go to the source code of this file.

Data Structures

struct  pio_program_i2c
 PIO I2C program type. More...
 
struct  pio_i2c_bus
 PIO I2C emulated bus type. More...
 

Typedefs

typedef i2c_t pio_i2c_t
 PIO I2C descriptor type compatible with i2c_t.
 
typedef struct pio_program_i2c pio_program_i2c_t
 PIO I2C program type.
 
typedef struct pio_i2c_bus pio_i2c_bus_t
 PIO I2C emulated bus type.
 

Functions

pio_i2c_bus_tpio_i2c_get (pio_i2c_t id)
 Get access to a PIO I2C instance configured with PIO_I2C_CONFIG.
 
unsigned pio_i2c_numof (void)
 Query the number of PIO I2C instances configured with PIO_I2C_CONFIG.
 
const pio_program_i2c_tpio_i2c_get_program (pio_t pio)
 Get const I2C program reference.
 
int pio_i2c_init_program (pio_t pio)
 Create, allocate, and write a PIO I2C program.
 
void pio_i2c_deinit_program (pio_t pio)
 Free a PIO I2C program.
 
pio_sm_t pio_i2c_sm_lock (pio_t pio, pio_i2c_bus_t *i2c)
 Acquire a PIO state machine of PIO pio to run the PIO I2C program.
 
void pio_i2c_sm_unlock (pio_i2c_bus_t *i2c)
 Release a PIO state machine of PIO pio.
 
void pio_i2c_start_programs (void)
 Start PIO I2C programs configured with PIO_I2C_CONFIG.
 
void pio_i2c_stop_programs (void)
 Stop PIO I2C programs configured with PIO_I2C_CONFIG.
 
int pio_i2c_write_program (pio_t pio, pio_program_i2c_t *pro)
 Write a PIO I2C program to instruction memory.
 
int pio_i2c_init (pio_i2c_bus_t *bus, const pio_program_i2c_t *pro, gpio_t sda, gpio_t scl, unsigned irq)
 Setup a state machine to run the I2C program.
 
void pio_i2c_acquire (pio_i2c_bus_t *bus)
 Get exclusive access to the emulated I2C bus.
 
void pio_i2c_release (pio_i2c_bus_t *bus)
 Release emulated I2C bus.
 
int pio_i2c_read_regs (pio_t pio, pio_sm_t sm, uint16_t addr, uint16_t reg, void *data, size_t len, uint8_t flags)
 Emulate i2c_read_regs.
 
static int pio_i2c_read_reg (pio_t pio, pio_sm_t sm, uint16_t addr, uint16_t reg, void *data, uint8_t flags)
 Emulate i2c_read_reg.
 
int pio_i2c_read_bytes (pio_t pio, pio_sm_t sm, uint16_t addr, void *data, size_t len, uint8_t flags)
 Emulate i2c_read_bytes.
 
static int pio_i2c_read_byte (pio_t pio, pio_sm_t sm, uint16_t addr, void *data, uint8_t flags)
 Emulate i2c_read_byte.
 
int pio_i2c_write_bytes (pio_t pio, pio_sm_t sm, uint16_t addr, const void *data, size_t len, uint8_t flags)
 Emulate i2c_write_bytes.
 
static int pio_i2c_write_byte (pio_t pio, pio_sm_t sm, uint16_t addr, uint8_t data, uint8_t flags)
 Emulate i2c_write_byte.
 
int pio_i2c_write_regs (pio_t pio, pio_sm_t sm, uint16_t addr, uint16_t reg, const void *data, size_t len, uint8_t flags)
 Emulate i2c_write_regs.
 
static int pio_i2c_write_reg (pio_t pio, pio_sm_t sm, uint16_t addr, uint16_t reg, uint8_t data, uint8_t flags)
 Emulate i2c_write_reg.