Well well, hello there again. It has been quite some time, unfortunately the schools started again, so I won't have much time to post. I'll try to make this a quick one.
I once said I should write a 1 wire library, to avoid rewriting code, and make coding more fun and productive .. and whatever. So, I have got the finished "thermometer" project with 3x8 segment displays. And I should admit, it work's quite nice indeed :)
In the process of designing the library, the most important part was choosing the way of how it all will come together. For instance, in my design I chose to have several rather "repeating" functions, but they would shorten the time of writing, and they would be more comfortable, so heck whatever. In that design I had..
Simple functions
I once said I should write a 1 wire library, to avoid rewriting code, and make coding more fun and productive .. and whatever. So, I have got the finished "thermometer" project with 3x8 segment displays. And I should admit, it work's quite nice indeed :)
In the process of designing the library, the most important part was choosing the way of how it all will come together. For instance, in my design I chose to have several rather "repeating" functions, but they would shorten the time of writing, and they would be more comfortable, so heck whatever. In that design I had..
Simple functions
- one_wire_reset - the reset presence pulse thingy
- one_wire_read - read one byte
- one_wire_write - write one byte
- one_wire_receive - to receive given amount of bytes into an array
- one_wire_send_data - send bytes from given array
- one_wire_send_package - send reset/presence, ROM command, and function command, with arguments
- one_wire_send - send reset/presence, ROM command and function command, but without arguments