20 GCONF(GCONF_register.sr);
31 SHORT_CONF_register.s2vs_level = 6;
32 SHORT_CONF_register.s2g_level = 6;
33 SHORT_CONF_register.shortfilter = 0b01;
34 SHORT_CONF_register.shortdelay = 0;
35 DRV_CONF_register.bbmtime = 0;
36 DRV_CONF_register.bbmclks = 4;
37 DRV_CONF_register.otselect = 0b00;
38 DRV_CONF_register.drvstrength = 0b10;
39 DRV_CONF_register.filt_isense = 0b00;
40 TPOWERDOWN_register.sr = 10;
52 CHOPCONF_register.sr = 0x10410150;
53 PWMCONF_register.sr = 0xC40C001E;
68 constexpr uint32_t V_fs = 325;
72 const uint16_t RS_scaled =
Rsense * 0xFFFF;
73 uint32_t numerator = 11585;
74 numerator *= RS_scaled;
79 uint32_t denominator = V_fs * 0xFFFF >> 8;
81 scaler = numerator / denominator;
83 if (scaler > 255) scaler = 0;
84 else if (scaler < 128) CS--;
85 }
while(0 < scaler && scaler < 128);
101 if (!scaler) scaler = 256;
102 uint32_t numerator = scaler * (CS+1);
105 numerator *= 1000000;
106 uint32_t denominator =
Rsense*1000;
109 return numerator / denominator;
114 GCONF(GCONF_register.sr);
119 THIGH(THIGH_register.sr);
121 VDCMIN(VDCMIN_register.sr);
124 DCCTRL(DCCTRL_register.sr);
147 GLOBAL_SCALER_register.sr = input;
148 write(GLOBAL_SCALER_register.address, GLOBAL_SCALER_register.sr);