Add PMM and UCS functions
* Originally developed by Texas Instruments
* Add comments to help understand the code
* Reformat source code