We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
你好,非常感谢大佬开源的库! 有个问题向你请教,我使用你的库通过ESP32读写SW3518S制作了一个模型电池转手机快充的模块,当电池放电到设定电压时需要关闭模块的输出,以保护电池不至于过放,但是我通过修改你的库,在0x16寄存器写入0x01后,输出只有短暂的关闭后又会重新开启,时间可能还不到1秒,如果不断的执行上述关闭BUCK的操作,输出就会循环关闭、开启。我想实现的是关闭所有输出,包括5V,想问大佬有办法吗? #define SW35XX_PWR_ENABLE 0x15 //BUCK 使能控制 #define SW35XX_PWR_CTRL 0x16 //BUCK 开关
void SW35xx::turnOff_BUCK(){ unlock_PWR_write(); i2cWriteReg8(SW35XX_PWR_CTRL, 0x01); lock_PWR_write(); }
void SW35xx::turnOn_BUCK(){ unlock_PWR_write(); i2cWriteReg8(SW35XX_PWR_CTRL, 0x02); lock_PWR_write(); }
void SW35xx::unlock_PWR_write() { i2cWriteReg8(SW35XX_PWR_ENABLE, 0x20); i2cWriteReg8(SW35XX_PWR_ENABLE, 0x40); i2cWriteReg8(SW35XX_PWR_ENABLE, 0x80); }
void SW35xx::lock_PWR_write() { i2cWriteReg8(SW35XX_PWR_ENABLE, 0x00); }
The text was updated successfully, but these errors were encountered:
就我所知SW3518似乎并没有公开的直接控制接口开关的寄存器. 也许你需要向厂家咨询.
Sorry, something went wrong.
好的,谢谢啦
No branches or pull requests
你好,非常感谢大佬开源的库!
有个问题向你请教,我使用你的库通过ESP32读写SW3518S制作了一个模型电池转手机快充的模块,当电池放电到设定电压时需要关闭模块的输出,以保护电池不至于过放,但是我通过修改你的库,在0x16寄存器写入0x01后,输出只有短暂的关闭后又会重新开启,时间可能还不到1秒,如果不断的执行上述关闭BUCK的操作,输出就会循环关闭、开启。我想实现的是关闭所有输出,包括5V,想问大佬有办法吗?
#define SW35XX_PWR_ENABLE 0x15 //BUCK 使能控制
#define SW35XX_PWR_CTRL 0x16 //BUCK 开关
void SW35xx::turnOff_BUCK(){
unlock_PWR_write();
i2cWriteReg8(SW35XX_PWR_CTRL, 0x01);
lock_PWR_write();
}
void SW35xx::turnOn_BUCK(){
unlock_PWR_write();
i2cWriteReg8(SW35XX_PWR_CTRL, 0x02);
lock_PWR_write();
}
void SW35xx::unlock_PWR_write() {
i2cWriteReg8(SW35XX_PWR_ENABLE, 0x20);
i2cWriteReg8(SW35XX_PWR_ENABLE, 0x40);
i2cWriteReg8(SW35XX_PWR_ENABLE, 0x80);
}
void SW35xx::lock_PWR_write() {
i2cWriteReg8(SW35XX_PWR_ENABLE, 0x00);
}
The text was updated successfully, but these errors were encountered: