allow define calibration parametrs for bl09xx (#22030)

Co-authored-by: PavelSheremetev <spd@aira.life>
This commit is contained in:
Pavel Sheremetev 2024-09-11 10:55:43 +04:00 committed by GitHub
parent d8f01ed4c0
commit 1edc4b57b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 22 additions and 0 deletions

View File

@ -44,26 +44,48 @@
//#define DEBUG_BL09XX
#ifndef BL0939_PREF
#define BL0939_PREF 713 // =(4046*1*0,51*1000)/(1,218*1,218*(390*5+0,51)) = 713,105
#endif
#ifndef BL0939_UREF
#define BL0939_UREF 17159 // =(79931*0,51*1000)/(1,218*(390*5+0,51)) = 17158,92
#endif
#ifndef BL0939_IREF
#define BL0939_IREF 266013 // =(324004*1)/1,218 = 266013,14
#endif
#ifndef BL0940_PREF
#define BL0940_PREF 1430
#endif
#ifndef BL0940_UREF
#define BL0940_UREF 33000
#endif
#ifndef BL0940_IREF
#define BL0940_IREF 275000
#endif
#ifndef BL0942_PREF
#define BL0942_PREF 596
#endif
#ifndef BL0942_UREF
#define BL0942_UREF 15187
#endif
#ifndef BL0942_IREF
#define BL0942_IREF 251213
#endif
#ifndef BL09XX_WRITE_COMMAND
#define BL09XX_WRITE_COMMAND 0xA0 // 0xA8 according to documentation
#endif
#define BL09XX_REG_I_FAST_RMS_CTRL 0x10
#define BL09XX_REG_MODE 0x18
#define BL09XX_REG_SOFT_RESET 0x19
#define BL09XX_REG_USR_WRPROT 0x1A
#define BL09XX_REG_TPS_CTRL 0x1B
#ifndef BL09XX_READ_COMMAND
#define BL09XX_READ_COMMAND 0x50 // 0x58 according to documentation
#endif
#define BL09XX_FULL_PACKET 0xAA
#define BL09XX_PACKET_HEADER 0x55 // 0x58 according to documentation