stmhal - fixed up adc stuff#372
Conversation
Added support for the ADC channels and mappings to make_pins.py I'm not sure if the hal properly deals with the channel 16/18 differences between the 40x and 42x. It seems to deal with it partially. This particular aspect will need testing on a 42x or 43x.
|
Thank you. That HAL ADC structure is pretty beefy. I don't like that for all these HAL objects you need to keep the Init information around for the life of the object. It seems like a big waste of RAM. |
|
@dpgeorge Yeah - I had the same feeling about the init stuff. On the plus side you probably won't instantiate very many of these, but it still adds up. My view is to get it working, and then look at optimizing later. The HAL gets you off the ground, but I think it makes sense to go back and optimize these to just do direct register access. Perhaps have a version that uses the HAL (controlled by a #if), and a version that bypasses the hal (then you can switch back and forth). |
|
Some of the HAL is very neat and gives a good abstraction. Eg the I2C stuff is much easier, basically 1 call to read/write a set of registers on an I2C device. Agreed though that now is about working features. |
Added support for the ADC channels and mappings to make_pins.py
I'm not sure if the hal properly deals with the channel 16/18 differences
between the 40x and 42x. It seems to deal with it partially. This particular
aspect will need testing on a 42x or 43x.