#include <i2c.h>
|
bool | check_busy () |
|
void | handle_error () |
|
void | handle_event () |
|
void | hardware_failure () |
|
void | init (const i2c_hardware_struct_t *c) |
|
bool | is_initialized () |
|
uint16_t | num_errors () |
|
int8_t | read (uint8_t addr, uint8_t reg, uint8_t num_bytes, uint8_t *data, void(*callback)(uint8_t)=nullptr, bool blocking=false) |
|
int8_t | read (uint8_t addr, uint8_t reg, uint8_t *data) |
|
void | transfer_complete_cb () |
|
void | unstick () |
|
int8_t | write (uint8_t addr, uint8_t reg, uint8_t data, void(*callback)(uint8_t), bool blocking=false) |
|
int8_t | write (uint8_t addr, uint8_t reg, uint8_t data) |
|
|
enum | {
SB = 0x0001,
ADDR = 0x0002,
BTF = 0x0004,
ADD10 = 0x0008,
STOPF = 0x0010,
RES1 = 0x0020,
RXNE = 0x0040,
TXE = 0x0080,
BERR = 0x0100,
ARLO = 0x0200,
AF = 0x0400,
OVR = 0x0800,
PEC_ERR = 0x1000,
RES2 = 0x2000,
TIMEOUT = 0x4000,
SMB_ALERT = 0x8000,
MSL = 0x1 << 16,
BUSY = 0x2 << 16,
TRA = 0x4 << 16,
RES3 = 0x8 << 16,
GEN_CALL = 0x10 << 16,
SMBDE_FAULT = 0x20 << 16,
DUALF = 0x40 << 16
} |
|
enum | current_status_t { IDLE,
READING,
WRITING
} |
|
Definition at line 39 of file i2c.h.
◆ anonymous enum
Enumerator |
---|
SB | |
ADDR | |
BTF | |
ADD10 | |
STOPF | |
RES1 | |
RXNE | |
TXE | |
BERR | |
ARLO | |
AF | |
OVR | |
PEC_ERR | |
RES2 | |
TIMEOUT | |
SMB_ALERT | |
MSL | |
BUSY | |
TRA | |
RES3 | |
GEN_CALL | |
SMBDE_FAULT | |
DUALF | |
Definition at line 44 of file i2c.h.
◆ anonymous enum
Enumerator |
---|
RESULT_ERROR | |
RESULT_SUCCESS | |
RESULT_BUSY | |
Definition at line 102 of file i2c.h.
◆ current_status_t
Enumerator |
---|
IDLE | |
READING | |
WRITING | |
Definition at line 73 of file i2c.h.
◆ check_busy()
◆ handle_error()
void I2C::handle_error |
( |
| ) |
|
◆ handle_event()
void I2C::handle_event |
( |
| ) |
|
◆ handle_hardware_failure()
void I2C::handle_hardware_failure |
( |
| ) |
|
|
private |
◆ hardware_failure()
void I2C::hardware_failure |
( |
| ) |
|
◆ init()
◆ is_initialized()
bool I2C::is_initialized |
( |
| ) |
|
|
inline |
◆ num_errors()
uint16_t I2C::num_errors |
( |
| ) |
|
|
inline |
◆ read() [1/2]
int8_t I2C::read |
( |
uint8_t |
addr, |
|
|
uint8_t |
reg, |
|
|
uint8_t |
num_bytes, |
|
|
uint8_t * |
data, |
|
|
void(*)(uint8_t) |
callback = nullptr , |
|
|
bool |
blocking = false |
|
) |
| |
◆ read() [2/2]
int8_t I2C::read |
( |
uint8_t |
addr, |
|
|
uint8_t |
reg, |
|
|
uint8_t * |
data |
|
) |
| |
◆ transfer_complete_cb()
void I2C::transfer_complete_cb |
( |
| ) |
|
◆ unstick()
◆ write() [1/2]
int8_t I2C::write |
( |
uint8_t |
addr, |
|
|
uint8_t |
reg, |
|
|
uint8_t |
data, |
|
|
void(*)(uint8_t) |
callback, |
|
|
bool |
blocking = false |
|
) |
| |
◆ write() [2/2]
int8_t I2C::write |
( |
uint8_t |
addr, |
|
|
uint8_t |
reg, |
|
|
uint8_t |
data |
|
) |
| |
◆ addr_
volatile uint8_t I2C::addr_ |
|
private |
Definition at line 92 of file i2c.h.
◆ c_
Definition at line 99 of file i2c.h.
◆ cb_
void(* I2C::cb_) (uint8_t) |
◆ current_status_
Definition at line 86 of file i2c.h.
◆ data_
volatile uint8_t I2C::data_ |
|
private |
Definition at line 95 of file i2c.h.
◆ DMA_InitStructure_
Definition at line 97 of file i2c.h.
◆ done_
Definition at line 89 of file i2c.h.
◆ error_count_
uint16_t I2C::error_count_ = 0 |
|
private |
Definition at line 83 of file i2c.h.
◆ event_history_
◆ initialized_
bool I2C::initialized_ = false |
|
private |
Definition at line 90 of file i2c.h.
◆ interrupt_history_
◆ last_event_us_
uint64_t I2C::last_event_us_ |
◆ len_
volatile uint8_t I2C::len_ |
|
private |
Definition at line 94 of file i2c.h.
◆ reg_
volatile uint8_t I2C::reg_ |
|
private |
Definition at line 93 of file i2c.h.
◆ return_code_
volatile uint8_t I2C::return_code_ |
|
private |
Definition at line 87 of file i2c.h.
◆ scl_
Definition at line 80 of file i2c.h.
◆ sda_
Definition at line 81 of file i2c.h.
◆ subaddress_sent_
bool I2C::subaddress_sent_ = false |
|
private |
Definition at line 88 of file i2c.h.
The documentation for this class was generated from the following files: