Skip to content

Sensor function prototypes using the SCU should be private to cxd56xx. #10240

@raiden00pl

Description

@raiden00pl

The SCU is a Spresense-specific peripheral so we shouldn't depend on it in common code.

Some sensors now have two different interfaces that depend on the architecture, e.g. :

#ifdef CONFIG_SENSORS_AK09912_SCU
int ak09912_register(FAR const char *devpath, int minor,
                         FAR struct i2c_master_s *i2c, int port);
#else
int ak09912_register(FAR const char *devpath, FAR struct i2c_master_s *i2c);
#endif

I don't think this is a modular solution. Additionally, we introduce board-specific data in the sensor interface (argument int port in the example above).

So, it seem to me that the SCU-specific interface should be moved to boards/cxd56xx/drivers as it is with the rest of the code related to the SCU (Kconfig, driver implementation). Function names should also be updated e.g. to 'ak09912_scu_register()` to avoid the same functions with incompatible arguments.

Ping Spresense team @jerpelea @SPRESENSE

Metadata

Metadata

Assignees

Labels

Area: ModularityNeeded to support modular architecture

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions