THB2/bthome_phy6222/source/dev_i2c.h
2024-01-26 00:18:00 +03:00

20 lines
488 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* dev_i2c.h
*
* Created on: 25 янв. 2024 г.
* Author: pvvx
*/
#ifndef _DEV_I2C_H_
#define _DEV_I2C_H_
void init_i2c(bool speed400khz);
void deinit_i2c(void);
int send_i2c_byte(uint8_t addr, uint8_t data);
int send_i2c_wreg(uint8 addr, uint8 reg, uint16 data);
int send_i2c_buf(uint8 addr, uint8 * pdata, int len);
int read_i2c_bytes(uint8 addr, uint8 reg, uint8 * data, uint8 size);
int read_i2c_nabuf(uint8 addr, uint8 * data, uint8 size);
#endif /* _DEV_I2C_H_ */