What you trying to do seems to be what ST call Multiprocessor communication as explained at paragraph 27.3.6 in the F103 Reference Manual (RM0008).
I have never tried that but just wanted to let you know that is is documented by ST.
Without the mute PIn. It depends on the amount of data / the chance of collision whether you need the mute. Effectively you should not transmit if there are character(s) in the rx buffer ie there is an inward packet. If at the end of the tx the message in you rx buffer is the same you know the packet was successfully sent (Not 100% certain it would have been recieved). The recipient then sends either a reply or an acknowledge.
Also I have not done this but it should be possible to emulate the mute pin by setting a "BusBusy" flag when the rx pin goes low. This would get reset when complete message is read from the buffer and there are no longer any characters in the buffer.
I am not certain if you can attachInterupt to the RXpin but I can't see why not, if not you would need to wire the RX to another pin and use that. In the event you still only need one wire for your bus.
The other advantage to this approach is 3.3v devices and 5v devices can talk to each other the pull up needs to go to 3.3v as 3.3v is usually enough to be considered HIGH on most 5V systems. For example a 5V ATmega32U4 needs the pin to be over 1.9v to be considered high.
My data packet consists of a command byte and an operand. I often use upper and lower case letters to signify commands and replies. I usually have some kind of PING command to test the bus and that the other devices are live. On start up one device would send say 'p' as data meaning ping then the receiver would reply 'P' (Acknowledging Ping). Again if device one say wanted to read the second temp sensor from device "3" then. The Request data would look like 't2' the reply would be 'T2<data>' .
Something like this
Code: Select all
From - To - Length -Data -Checksum
01x - 03x - 01x - "p" - <checksum> <Ping Recipient
03x - 01x - 01x - "P" - <checksum> <Ping Reply
01x - 03x - 02x - "t2" - <checksum> <Temp Request
03x - 01x - 06x - "T2100C" - <checksum> <Temp Reply