Я так и делал. Не 1-wire, а I2C, но суть-то похожая. PT_THREAD(i2c_thread(void))
{
PT_BEGIN(&i2c_pt);
I2C1->CR1 |= I2C_CR1_START;
PT_YIELD(&i2c_pt);
(void)I2C1->SR1;
I2C1->DR = ADDRESS;
PT_YIELD(&i2c_pt);
(void)I2C1->SR1;
(void)I2C1->SR2;
...
PT_END(&i2c_pt);
}
void
i2c1_handler(void)
{
PT_SCHEDULE(i2c_thread());
}