mirror of
https://github.com/eddyem/stm32samples.git
synced 2026-03-21 17:21:04 +03:00
F0 testbrd: I2C, DAC
This commit is contained in:
@@ -27,7 +27,7 @@ uint8_t getI2Caddr(){
|
||||
return i2caddr;
|
||||
}
|
||||
|
||||
void init_scan_mode(){
|
||||
void i2c_init_scan_mode(){
|
||||
i2caddr = 0;
|
||||
scanmode = 1;
|
||||
}
|
||||
@@ -35,7 +35,7 @@ void init_scan_mode(){
|
||||
// return 1 if next addr is active & return in as `addr`
|
||||
// if addresses are over, return 1 and set addr to I2C_NOADDR
|
||||
// if scan mode inactive, return 0 and set addr to I2C_NOADDR
|
||||
int scan_next_addr(uint8_t *addr){
|
||||
int i2c_scan_next_addr(uint8_t *addr){
|
||||
*addr = i2caddr;
|
||||
if(!scanmode || i2caddr == I2C_ADDREND){
|
||||
*addr = I2C_ADDREND;
|
||||
|
||||
@@ -27,8 +27,8 @@ extern uint8_t scanmode;
|
||||
|
||||
uint8_t getI2Caddr();
|
||||
|
||||
void init_scan_mode();
|
||||
int scan_next_addr(uint8_t *addr);
|
||||
void i2c_init_scan_mode();
|
||||
int i2c_scan_next_addr(uint8_t *addr);
|
||||
|
||||
int read_reg(uint8_t reg, uint8_t *val, uint8_t N);
|
||||
int write_reg(uint8_t reg, uint8_t val);
|
||||
|
||||
Reference in New Issue
Block a user