23 lines
717 B
C
23 lines
717 B
C
|
|
#ifndef _BSPI2C_H_
|
||
|
|
#define _BSPI2C_H_
|
||
|
|
|
||
|
|
#include <stdbool.h>
|
||
|
|
#include <stdint.h>
|
||
|
|
|
||
|
|
#define USR_I2C_NUM0 0
|
||
|
|
#define USR_I2C_NUM1 1
|
||
|
|
|
||
|
|
#define USR_I2C_SPEED100000 100000
|
||
|
|
#define USR_I2C_SPEED400000 400000
|
||
|
|
|
||
|
|
#define USR_I2C_MASTER 0
|
||
|
|
#define USR_I2C_SLAVE 1
|
||
|
|
|
||
|
|
int8_t BspI2CInit(uint8_t i2c_id, int32_t i2c_speed, uint8_t i2c_mode, uint8_t slave_address);
|
||
|
|
int8_t BspMasterSend(uint8_t i2c_id, uint8_t slave_address, uint8_t *send_data, uint32_t send_len);
|
||
|
|
int8_t BspMasterRecv(uint8_t i2c_id, uint8_t slave_address, uint8_t *recv_data, uint32_t recv_len);
|
||
|
|
int8_t BspSalveRecv(uint8_t i2c_id, uint8_t *recv_data, uint32_t recv_len);
|
||
|
|
int8_t BspSalveSend(uint8_t i2c_id, uint8_t *send_data, uint32_t send_len);
|
||
|
|
|
||
|
|
#endif
|