The library has the goal having the bytes for the packet to provide you an interface to read all the relevant information in an understandable way and the opposite - having desired values for all the of the fields, to generate the bytes for the packet. It does not try to obtain the bytes themselves from the hardware hat. This can be done on a number of hardwares using the semtech packet forwarder (can be found here). The packet forwarder sends UDP packets that contain JSON and inside the JSON are the raw bytes of the LoRaWAN MAC layer.
If you want, you can write your own implementation that communicates with the GPIO pins - that will sure be interesting as well I think.
The connection with LoRaWAN(Go) is inspiration, test data and clarifications how to read some of the fields (otherwise I need to perform tests to see this).
As for the specification, the "official" way is to use the request link here