Re: pull request for ADC and PWM APIs

2016-03-24 Thread will sanfilippo
I think it makes sense :-) There are some things I am not quite sure I get… So I think the pointer approach like you describe below is the better way, with the possible exception of gpio (I will explain that later). Having a hal_spi_dev * or hal_adc_dev * passed to the hal api is a common way

Re: pull request for ADC and PWM APIs

2016-03-23 Thread p...@wrada.com
I was thinking the same as you. I had one thought for a way to get this functionality. Im actually pretty excited about it. Hope this makes sense. We could declare a structure in hal_xxx.h struct hal_xxx_device; This could be the ³this" argument to all the hal_xxx functions. Example

Re: pull request for ADC and PWM APIs

2016-03-23 Thread p...@wrada.com
To answer your question below with more questions: For example, how would tell that for my Olimex board, I want to use pin X as input for my ADC? Or that my PWM for sysid 0 should go out to pin Y? Here are three questions after reflecting on yours (yours is the first one below) 1) How to I

Re: pull request for ADC and PWM APIs

2016-03-23 Thread marko kiiskila
Good stuff. > On Mar 22, 2016, at 5:21 PM, p...@wrada.com wrote: > > All, > > I'm having so much fun with my newt. Please comment and help me improve this > work. > > I've submitted two HAL API pull requests. They are to add new HAL_xxx.h > files for two new sets of core functionality: ADC

pull request for ADC and PWM APIs

2016-03-22 Thread p...@wrada.com
All, I'm having so much fun with my newt. Please comment and help me improve this work. I've submitted two HAL API pull requests. They are to add new HAL_xxx.h files for two new sets of core functionality: ADC and PWM. When designing these hal_xxx.h interfaces, I considered the APIs from