@jon and @kevin
I had some time free this morning to test out a bit-banged 1-Wire implementation. On the surface it's very similar to what I've done for other platforms. Below is one of the more timing/interrupt sensitive routines, which involves reading a single bit from the 1-Wire bus and simulating an open-drain port.
The concern I have is around interrupts. Normally, one would disable interrupts during the time and port direction sensitive operations. I suspect that with patterns followed on the Tessel, this might lead to some resource issues. At minimum, as it's a self-clocked protocol, the bit reads can be conducted asynchronously (although the performance will be something to see). The individual read/write bits, especially at overdrive speeds are less flexible.
A sample with clutter removed for ease of reading:
uint8_t ow_read_bit(uint8_t ulPin)
// Disable Interrupts Here (Normally done with something like __disable_irq())
GPIO_SetDir(..., ..., GPIO_OUTPUT);
GPIO_ClearValue(..., ...); // Drive bus low
GPIO_SetDir(..., ..., GPIO_INPUT); // Release the bus (Pulled up by external resistor)
res = (GPIO_ReadValue(port & (1<<bitnum)) ? 1 : 0 // Read bit value
// Enable Interrupts Here (Normally accomplished with __enable_irq())
Clearly this protocol is best suited to an external bus master, as it frees up the uC for other tasks. I believe a similar approach was taken with the IR module. Most folks though would probably look to be able to just plug their device in as they've done on an arduino, espruino, mbed, etc. without the need for a separate DS2482/2484/2480b/2465.
Could I get some thoughts/feedback on the disabling/enabling of interrupts? If it's agreeable to do so, what platform methods should be used?