#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include "stm32f10x_conf.h"
#include "drv_system.h"
#include "drv_gpio.h"
#include "drv_i2c.h"
Go to the source code of this file.
|
void | I2C1_ER_IRQHandler (void) |
|
void | I2C1_EV_IRQHandler (void) |
|
void | I2C2_ER_IRQHandler (void) |
|
void | I2C2_EV_IRQHandler (void) |
|
static void | i2c_er_handler (void) |
|
static void | i2c_ev_handler (void) |
|
static void | i2c_init_buffer (void) |
|
static void | i2c_job_handler (void) |
|
void | i2c_queue_job (i2cJobType_t type, uint8_t addr_, uint8_t reg_, uint8_t *data, uint8_t length, volatile uint8_t *status_, void(*CB)(uint8_t)) |
|
uint16_t | i2cGetErrorCounter (void) |
|
static bool | i2cHandleHardwareFailure (void) |
|
void | i2cInit (I2CDevice index) |
|
bool | i2cRead (uint8_t addr_, uint8_t reg_, uint8_t len, uint8_t *buf) |
|
bool | i2cReadAsync (uint8_t addr_, uint8_t reg_, uint8_t len, uint8_t *buf, volatile uint8_t *status_, void(*CB)(uint8_t)) |
|
static void | i2cUnstick (void) |
|
bool | i2cWrite (uint8_t addr_, uint8_t reg_, uint8_t data) |
|
bool | i2cWriteAsync (uint8_t addr_, uint8_t reg_, uint8_t len_, uint8_t *buf_, volatile uint8_t *status_, void(*CB)(uint8_t)) |
|
bool | i2cWriteBuffer (uint8_t addr_, uint8_t reg_, uint8_t len_, uint8_t *data) |
|
◆ I2C_DEFAULT_TIMEOUT
#define I2C_DEFAULT_TIMEOUT 30000 |
◆ I2C_DEVICE
◆ i2cDevice_t
◆ I2C1_ER_IRQHandler()
void I2C1_ER_IRQHandler |
( |
void |
| ) |
|
◆ I2C1_EV_IRQHandler()
void I2C1_EV_IRQHandler |
( |
void |
| ) |
|
◆ I2C2_ER_IRQHandler()
void I2C2_ER_IRQHandler |
( |
void |
| ) |
|
◆ I2C2_EV_IRQHandler()
void I2C2_EV_IRQHandler |
( |
void |
| ) |
|
◆ i2c_er_handler()
static void i2c_er_handler |
( |
void |
| ) |
|
|
static |
◆ i2c_ev_handler()
void i2c_ev_handler |
( |
void |
| ) |
|
|
static |
◆ i2c_init_buffer()
void i2c_init_buffer |
( |
void |
| ) |
|
|
static |
◆ i2c_job_handler()
void i2c_job_handler |
( |
void |
| ) |
|
|
static |
◆ i2c_queue_job()
void i2c_queue_job |
( |
i2cJobType_t |
type, |
|
|
uint8_t |
addr_, |
|
|
uint8_t |
reg_, |
|
|
uint8_t * |
data, |
|
|
uint8_t |
length, |
|
|
volatile uint8_t * |
status_, |
|
|
void(*)(uint8_t) |
CB |
|
) |
| |
◆ i2cGetErrorCounter()
uint16_t i2cGetErrorCounter |
( |
void |
| ) |
|
◆ i2cHandleHardwareFailure()
static bool i2cHandleHardwareFailure |
( |
void |
| ) |
|
|
static |
◆ i2cInit()
◆ i2cRead()
bool i2cRead |
( |
uint8_t |
addr_, |
|
|
uint8_t |
reg_, |
|
|
uint8_t |
len, |
|
|
uint8_t * |
buf |
|
) |
| |
◆ i2cReadAsync()
bool i2cReadAsync |
( |
uint8_t |
addr_, |
|
|
uint8_t |
reg_, |
|
|
uint8_t |
len, |
|
|
uint8_t * |
buf, |
|
|
volatile uint8_t * |
status_, |
|
|
void(*)(uint8_t) |
CB |
|
) |
| |
◆ i2cUnstick()
static void i2cUnstick |
( |
void |
| ) |
|
|
static |
◆ i2cWrite()
bool i2cWrite |
( |
uint8_t |
addr_, |
|
|
uint8_t |
reg_, |
|
|
uint8_t |
data |
|
) |
| |
◆ i2cWriteAsync()
bool i2cWriteAsync |
( |
uint8_t |
addr_, |
|
|
uint8_t |
reg_, |
|
|
uint8_t |
len_, |
|
|
uint8_t * |
buf_, |
|
|
volatile uint8_t * |
status_, |
|
|
void(*)(uint8_t) |
CB |
|
) |
| |
◆ i2cWriteBuffer()
bool i2cWriteBuffer |
( |
uint8_t |
addr_, |
|
|
uint8_t |
reg_, |
|
|
uint8_t |
len_, |
|
|
uint8_t * |
data |
|
) |
| |
◆ addr
◆ busy
◆ bytes
◆ complete_CB
void(* complete_CB) (uint8_t) |
|
static |
◆ error
volatile bool error = false |
|
static |
◆ i2c_buffer
◆ i2c_buffer_count
volatile uint8_t i2c_buffer_count |
|
static |
◆ i2c_buffer_head
volatile uint8_t i2c_buffer_head |
|
static |
◆ i2c_buffer_lock
bool i2c_buffer_lock = false |
|
static |
◆ i2c_buffer_tail
volatile uint8_t i2c_buffer_tail |
|
static |
◆ i2cErrorCount
volatile uint16_t i2cErrorCount = 0 |
|
static |
◆ i2cHardwareMap
Initial value:= {
}
#define RCC_APB1Periph_I2C1
#define RCC_APB1Periph_I2C2
Definition at line 58 of file drv_i2c.c.
◆ I2Cx
◆ I2Cx_index
◆ read_p
◆ reading
◆ reg
◆ status
◆ write_p
volatile uint8_t* write_p |
|
static |
◆ writing