Hi guys,

I'm about to modify i2c hardware slave ISR API, and would require your
feedback, 'cause I have doubts about how clear (or not) the API is. ISR
implements a finite state machine (well, here my post :)
http://jallib.blogspot.com/2009/01/step-by-step-building-i2c-slave-with.html).
Each state calls a procedure which must be defined by users.

Previous callbacks names were:

 - i2c_hw_slave_on_master_talks for state 1
 - i2c_hw_slave_on_master_writes for state 2
 - i2c_hw_slave_on_master_reads for state 3
 - i2c_hw_slave_on_master_stillreads for state 4
 - i2c_hw_slave_on_master_hangsup for state 5

I was not happy with this, mainly because state 1 is a new write operation,
and callbacks is not explicit about it. I also first thought there were a
symmetry between write and read operation, so callbacks should reflect it,
but that's not completely true: when master is willing to write, it must go
to state 1, then state 2, whereas reading only require state 3 (and
optionally state 4).

So I was thinking about renaming state 1 callback from
i2c_hw_slave_on_master_talks to i2c_hw_slave_on_master_begins_to_write
(well, that's a long name, but it's explicitly, and "write once read
thousands" principle would allow this...)

What do you think about this ? Is this pure nit-picking or philosophically
non-pragmatic ? In a word, who cares ? (except me, of course :))


Thanks for your feedback !
Seb



2009/1/18 Sebastien Lelong <[email protected]>

> Hi Joep,
>
>
>> I've seen your postings on the blog and I like them :)
>> Do we have an idea if many people visit this blog or use jallib?
>
>
> Thanks. I don't know how many use jallib (download counter says ~ 100 to
> 150). Blog stats are very low, few follow it, but there are some, and it may
> take time. Once I've finished the 3rd and last part of my howto implement an
> i2c slave, I'm thinking about posting something on jallist. Do you think we
> should announce on jallist too ? Or it is too much ?
>
>
>>
>> Today I had a brief look at the i2c slave lib and I agree with you
>> that my lib should be on top of this one and carefully selected inline
>> statements should be able prevent exhaustion.
>
>
> OK, but be patient, I need to rename some callbacks. This is just renaming,
> no signrature change (I hope). This is because currently it's not clear if
> master wants to read or writes. eg. i2c_hw_slave_on_master_talks should
> become
> i2c_hw_slave_on_master_starts_write, and i2c_hw_slave_on_master_reads
> should become i2c_hw_slave_on_master_starts_read. These are subtleties, but
> callbacks name should show the symmetry between read and write operation.
> I'll take of this probably tomorrow.
>
>
>
> Cheers,
> Seb
> --
> Sébastien Lelong
> http://www.sirloon.net
> http://sirbot.org
>



-- 
Sébastien Lelong
http://www.sirloon.net
http://sirbot.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to