Skip to content
New issue

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

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

Closed
raiden00pl opened this issue Aug 16, 2023 · 3 comments · Fixed by #10396
Closed

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

raiden00pl opened this issue Aug 16, 2023 · 3 comments · Fixed by #10396
Assignees
Labels
modularity Needed to support modular architecture

Comments

@raiden00pl
Copy link
Contributor

raiden00pl commented Aug 16, 2023

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

@raiden00pl raiden00pl added the modularity Needed to support modular architecture label Aug 16, 2023
@acassis
Copy link
Contributor

acassis commented Aug 16, 2023

Agree! I think sensors need to be generic and companies could create a layer/wrap around it to support things specific for their needs like uorb and the Spresense sequence (SCU)

@SPRESENSE
Copy link
Contributor

I agree. I will create a pull request to fix modularity.

@raiden00pl
Copy link
Contributor Author

thanks @SPRESENSE !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modularity Needed to support modular architecture
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants