jaredwolff Funny, I just was editing my post to talk about this. So I’ll add it here instead.
I have been trying to build my own driver similar to the PCF85063A driver you have in the nfed. It’s all pretty straightforward I think (probably not :-P). My idea is to set its priority to something like PRE_KERNEL_2
since my sensor is POST_KERNEL
and it will initialize the mux first, but I’m happy for any tips or corrections.
My bigger issue is that I don’t see any __subsystem
APIs that seem appropriate for the device. The device only has one register, so you send a write to the address then set the one byte register, or you send a read to the address and it sends back the one byte register. That’s it. The API sounds like it should just be something like
__subsystem struct some_api {
some_api_set set;
some_api_get get;
};
but I’m not seeing one that looks like this. Any ideas? Is there some way to make your own API? Do I just make it up myself then pass the pointer to DEVICE_DT_INST_DEFINE
and I’m all set?