The most relevant document that exists right now is the
Bluetooth profile that describes the micro:bit BLE functionality. Below is a summary of the relevant portions:
There are three relevant characteristics: Pin AD, Pin IO, and Pin. Pin AD is a 19-bit number that controls whether a pin is analog (1) or digital (0). Pin IO is similar in structure, except it controls input (1) or output (0). Therefore, if you want to write an analog value on pin 3, you have to set pins 3 of both characteristics to 1. Once you've written these two characteristics, you can then write the Pins characteristic with a (pin, value) pair where value is in [0, 1] or [0, 255] depending on whether the pin is configured for digital or analog. If you are doing a read operation, reading the characteristic will return bytes corresponding to (key, value) pairs for only those pins that have changed since the last read operation.
I've written a
sample project that demonstrates some of the functionality. Due to the way the data are packed, there is a lot of bit-level manipulation that needs to occur and there are helper functions in the project to do this. Our team is also working on designing a better level of abstraction beyond the raw BLE interface provided by micro:bit to make the I/O pin extension easier to use.
Regards,
Evan