Hi Eric,

On Wed, Sep 18, 2013 at 11:09 AM, Eric Decker <cire...@gmail.com> wrote:
>
> First I understand this is an Atmega HPL so there will be some machine
> dependent stuff.

The names were taken from old Atmega interfaces, so that is why some
are not optimal.

> But I'm looking for a HPL interface for across MCUs.   Basically abstract
> the useful essence of the h/w.

There is no such MCU independent interface.

>> HplAtmegaCapture defines the following:
>>
>> async command size_type get();
>> async command void set(size_type value);
>
> I'm not sure what set would get for.   What value is this?   ie.   what does
> it get used for?

This allows raw access to the hardware, and since the HW allows you to
set this register, I support it too. It will not hurt, since if it is
never called then it is optimized away. (If some driver wants to reset
the captured value to some known value for whatever reason, then it
can do it).

>>
>> /* Signalled when the captured event has occured */
>> async event void fired();
>
>
>>
>> /* Tests if there is a pending captured event */
>> async command bool test();
>
>  Reasonable.  Can we come up with a better name?  If not I'm fine with test.
>
>> /* Resets a pending interrupt */
>> async command void reset();
>
>
> clear seems to in vogue in other parts of the system.   Interrupts/Flags are
> cleared.
>
>>
>> /* Enables the capture interrupt */
>> async command void start();
>
>  I prefer "enable"
>>
>> /* Disables the capture interrupt */
>> async command void stop();
>
>  ditto for "disable"
>>
>> /* Checks is the overflow interrupt is enabled */
>> async command bool isOn();
>
>
> "overflow" interrupt.     Doesn't this say that the capture is
> enabled/armed?
>
>>
>> /* Sets the input capture mode bits */
>> async command void setMode(uint8_t mode);
>
>
> What modes are available?   I suspect there is something like "rising",
> "falling", "both"
> possibly level which would be "0", or "1".

The modes are completely depend on the actual implementation of the
capture register. For example, an async timer based radio SFD capture
register has different modes than something which is connected to a
GPIO. I have checked most of the Amtega family of microprocessors, and
in all of them the other functionality is present but the
initialization of the capture register depends on many factors. So
this is an opaque value, and code which needs capture functionality
should be configured with the appropriate mode value.

Best,
Miklos

>
>>
>> /* Returns the input capture mode bits */
>> async command uint8_t getMode();
>>
>> --
>> Eric B. Decker
>
> Senior (over 50 :-) Researcher
>
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to