26 #ifndef PIOS_I2C_PRIV_H
27 #define PIOS_I2C_PRIV_H
60 #if defined(STM32F30X)
63 #elif defined(STM32F4XX)
66 I2C_STATE_R_MORE_TXN_ADDR,
67 I2C_STATE_R_MORE_TXN_PRE_ONE,
68 I2C_STATE_R_MORE_TXN_PRE_FIRST,
69 I2C_STATE_R_MORE_TXN_PRE_MIDDLE,
70 I2C_STATE_R_MORE_TXN_PRE_LAST,
72 I2C_STATE_MORE_TXN_POST_LAST,
74 I2C_STATE_R_LAST_TXN_ADDR,
75 I2C_STATE_R_LAST_TXN_PRE_ONE,
76 I2C_STATE_R_LAST_TXN_PRE_FIRST,
77 I2C_STATE_R_LAST_TXN_PRE_MIDDLE,
78 I2C_STATE_R_LAST_TXN_PRE_LAST,
79 I2C_STATE_R_LAST_TXN_POST_LAST,
81 I2C_STATE_W_MORE_TXN_ADDR,
82 I2C_STATE_W_MORE_TXN_MIDDLE,
83 I2C_STATE_W_MORE_TXN_LAST,
85 I2C_STATE_W_LAST_TXN_ADDR,
86 I2C_STATE_W_LAST_TXN_MIDDLE,
87 I2C_STATE_W_LAST_TXN_LAST,
89 I2C_STATE_W_MORE_TXN_PRE,
90 I2C_STATE_W_LAST_TXN_PRE,
91 I2C_STATE_W_LAST_TXN_POST_LAST,
105 #if defined(STM32F30X)
106 I2C_EVENT_RECEIVER_BUFFER_NOT_EMPTY,
107 I2C_EVENT_TRANSMIT_BUFFER_EMPTY,
108 I2C_EVENT_TRANSFER_COMPLETE,
109 #elif defined(STM32F4XX)
110 I2C_EVENT_R_MORE_TXN_STARTED,
111 I2C_EVENT_W_MORE_TXN_STARTED,
112 I2C_EVENT_R_LAST_TXN_STARTED,
113 I2C_EVENT_W_LAST_TXN_STARTED,
114 I2C_EVENT_ADDR_SENT_LEN_EQ_0,
115 I2C_EVENT_ADDR_SENT_LEN_EQ_1,
116 I2C_EVENT_ADDR_SENT_LEN_EQ_2,
117 I2C_EVENT_ADDR_SENT_LEN_GT_2,
118 I2C_EVENT_TRANSFER_DONE_LEN_EQ_0,
119 I2C_EVENT_TRANSFER_DONE_LEN_EQ_1,
120 I2C_EVENT_TRANSFER_DONE_LEN_EQ_2,
121 I2C_EVENT_TRANSFER_DONE_LEN_GT_2,
137 #if defined(PIOS_I2C_DIAGNOSTICS)
138 #define I2C_LOG_DEPTH 20
140 struct pios_i2c_fault_history {
142 uint32_t evirq[I2C_LOG_DEPTH];
143 uint32_t erirq[I2C_LOG_DEPTH];
Types that are specific to the STM32 peripherals.
Main PiOS header to include all the compiled in PiOS options.
int32_t PIOS_I2C_Init(pios_i2c_t *i2c_id, const char *path)
static struct flyingpicmd_cfg_fa cfg
struct pios_i2c_adapter * pios_i2c_t
uint32_t transfer_timeout_ms