I've had a quick look at the 1-wire library (downloaded from http://www.pjrc.com/teensy/arduino_libraries/OneWire.zip)
It uses direct access to pins. It is nicely isolated in some macros, but it relies on those macros being implemented.
Reading Wikipedia, 1-wire is so slow that you might get this library working using ordinary digitalWrite/digitalRead to implement the macros. This might be fast enough. I imagine the application doesn't spend a lot of its time reading data from 1-wire sensors.
Also, when talking 1-wire, it barely matters how quick the digital I/O is (on a Maple) because the 1-wire protocol is so slow that the MCU is stuck waiting for the data exchange.
Wikipedia says a USART and some external components is enough to talk (in hardware) to 1-wire
http://en.wikipedia.org/wiki/1-Wire
Anyway, I think I'd start with something like (COMPLETELY UNTESTED):
#define PIN_TO_BASEREG(pin) ((IO_REG_TYPE*)(pin))
#define PIN_TO_BITMASK(pin) ((IO_REG_TYPE)(pin))
Then implement the macros using base
as the pin number or mask as the pin number.
If you needed to get 1-Wire software library working faster (which I don't think is important because the protocol speed dominates), you'd have to dig into the Maple library and the STM32F103 hardware. That would be more challenging.
Two macros PIN_TO_BASEREG
andf PIN_TO_BITMASK
use portInputRegister and digitalPinToBitMask which are not available on Maple, so you'd have to dig into the maple infrastructure, and look at PIN_MAP to implement them.
The other macros DIRECT_READ
DIRECT_MODE_INPUT
, DIRECT_MODE_OUTPUT
, DIRECT_WRITE_LOW
, DIRECT_WRITE_HIGH
use the underlying hardware representation of the digital ports. This is documented in the STM32F103 hardware manual (RM0008).
The code also switches interrupts on and off, which would be mapped onto the Maples NVIC controller.
How much C and microcontroller stuff have you done?
Have you got access to an oscilloscope? If not, implement the 7 macros using digitalRead/digitalWrite and call it a day.
(Edit: or you might use something like a DS2482 to interface to 1-wire from I2C)