#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) |
|
#define I2C_DEFAULT_TIMEOUT 30000 |
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 |
| ) |
|
|
static |
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 |
|
) |
| |
uint16_t i2cGetErrorCounter |
( |
void |
| ) |
|
static bool i2cHandleHardwareFailure |
( |
void |
| ) |
|
|
static |
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(*)(uint8_t) |
CB |
|
) |
| |
static void i2cUnstick |
( |
void |
| ) |
|
|
static |
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(*)(uint8_t) |
CB |
|
) |
| |
bool i2cWriteBuffer |
( |
uint8_t |
addr_, |
|
|
uint8_t |
reg_, |
|
|
uint8_t |
len_, |
|
|
uint8_t * |
data |
|
) |
| |
void(* complete_CB) (uint8_t) |
|
static |
volatile bool error = false |
|
static |
volatile uint8_t i2c_buffer_count |
|
static |
volatile uint8_t i2c_buffer_head |
|
static |
bool i2c_buffer_lock = false |
|
static |
volatile uint8_t i2c_buffer_tail |
|
static |
volatile uint16_t i2cErrorCount = 0 |
|
static |
Initial value:= {
}
#define RCC_APB1Periph_I2C1
#define RCC_APB1Periph_I2C2
Definition at line 58 of file drv_i2c.c.
volatile uint8_t* write_p |
|
static |