35#include <linux/i2c-dev.h>
41#ifndef I2C_THREAD_PRIO
42#define I2C_THREAD_PRIO 10
63 fprintf(
stderr,
"i2c_arch_init: Could not create I2C thread.\n");
95 p->errors->queue_full_cnt++;
104 p->trans[
p->trans_insert_idx] =
t;
117#pragma GCC diagnostic push
118#pragma GCC diagnostic ignored "-Wcast-qual"
136 if (
p->trans_insert_idx ==
p->trans_extract_idx) {
140 int fd = (
int)
p->reg_addr;
153 p->errors->ack_fail_cnt++;
167 p->errors->arb_lost_cnt++;
187 p->errors->miss_start_stop_cnt++;
205#pragma GCC diagnostic pop
static pthread_mutex_t mutex
void i2c_event(void)
i2c_event() function
#define ZEROS_ERR_COUNTER(_i2c_err)
#define I2C_TRANSACTION_QUEUE_LEN
I2C transaction queue length.
@ I2CTransSuccess
transaction successfully finished by I2C driver
@ I2CTransFailed
transaction failed
@ I2CTransPending
transaction is pending in queue
@ I2CTransRx
receive only transaction
@ I2CTransTx
transmit only transaction
@ I2CTransTxRx
transmit and receive transaction
I2C transaction structure.
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
static void UNUSED i2c_arch_init(struct i2c_periph *p)
static bool i2c_linux_submit(struct i2c_periph *p, struct i2c_transaction *t)
static void * i2c_thread(void *thread_data)
static bool i2c_linux_idle(struct i2c_periph *p)
static void i2c_linux_setbitrate(struct i2c_periph *p, int bitrate)
Functions to obtain rt priority or set the nice level.
static int get_rt_prio(int prio)
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.