Skip to content

stmhal - fixed up adc stuff#372

Merged
dpgeorge merged 1 commit intomicropython:masterfrom
dhylands:stmhal-adc
Mar 24, 2014
Merged

stmhal - fixed up adc stuff#372
dpgeorge merged 1 commit intomicropython:masterfrom
dhylands:stmhal-adc

Conversation

@dhylands
Copy link
Copy Markdown
Contributor

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.

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.
@dpgeorge dpgeorge merged commit 1403298 into micropython:master Mar 24, 2014
@dpgeorge
Copy link
Copy Markdown
Member

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.

@dhylands
Copy link
Copy Markdown
Contributor Author

@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).

@dpgeorge
Copy link
Copy Markdown
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants