zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.04k stars 6.18k forks source link

drivers: modem: improve modem pin API #27873

Open chris-schra opened 3 years ago

chris-schra commented 3 years ago

Dear All,

currently the modem_context / modem_pin depend on aggregating the modem's pins in an array. ATM the vint pin is optional (and macro-checked for existence). I need to add a second optional pin (WAKE) and that's not going to work within an array (because indices get messed up).

I suggest to refactor the modem's pins from an array to a struct like so:

struct modem_pins {
    struct modem_pin* power;
    struct modem_pin* reset;
    struct modem_pin* vint;
    struct modem_pin* wake;
};

This struct could be extended whenever needed (I guess "my" modem also has a wake OUT / IRQ out). I've already did some refactoring but before I create a PR I want to make sure that everyone involved gets the idea and agrees.

zephyrbot commented 4 months ago

Hi @mike-scott,

This issue, marked as an Enhancement, was opened a while ago and did not get any traction. Please confirm the issue is correctly assigned and re-assign it otherwise.

Please take a moment to review if the issue is still relevant to the project. If it is, please provide feedback and direction on how to move forward. If it is not, has already been addressed, is a duplicate, or is no longer relevant, please close it with a short comment explaining the reason.

@chris-schra you are also encouraged to help moving this issue forward by providing additional information and confirming this request/issue is still relevant to you.

Thanks!