Hi Jacopo On Mon, 17 Oct 2022 at 17:32, Jacopo Mondi <jacopo@xxxxxxxxxx> wrote: > > Hi Sakari, > > On Mon, Oct 17, 2022 at 06:57:48PM +0300, Sakari Ailus wrote: > > Hi Jacopo, > > > > On Mon, Oct 17, 2022 at 05:10:03PM +0200, Jacopo Mondi wrote: > > > > which is also named analog_gain_code_global, but is documented > > > > differently. > > > > > > > > Could you btw read registers 0x0000 to 0x00ff and provide the data ? > > > > > > There is nothing interesting there if not default values. I was hoping > > > that analogue_gain_m0 analogue_gain_c0 and analogue_gain_m1 > > > analogue_gain_c1 would provide a way to inject gains using the > > > standard CCS gain model, but those registers are said to be read-only > > > > The m[01] and c[01] factors in the CCS analogue gain formula are constants > > that determine how the sensor's analogue gain setting translates to actual > > analogue gain. They are not intended to be modifiable at runtime. > > > > You're right sorry, indeed they're constant. > > For this sensor: > analogue_gain_type: 0 > analogue_gain_m0: 1 > analogue_gain_c0: 0 > analogue_gain_m1: 0 > analogue_gain_c1: 4 > > I should be capable of programming the global analog gain using the linear > CCS gain model if the sensor is actually CCS compliant. > > gain = m0 * x + c0 / m1 * x + c1 > = R0x0204 / 4 > > However, the application developer guide shows the gain to be set > through manufacturer specific registers (0x3028 or 0x305e) and I cannot > find much correlations between the manufacturer specific gain model > (a piecewise exponential function) and the model described by CCS, which > seems way simpler. I do see a reference to register 0x0204 as analogue_gain_code_global in the register reference (page 4), and it is listed as programmable (7 bits). No idea if it works or not. Dave > > -- > > Kind regards, > > > > Sakari Ailus