Learning to write device-specific libraries based upon device datasheet.

I need help in learning to write libraries.

For now, I just want to learn the basics, but most examples I have browsed only explain on a simple level ( which is perfectly fine ) for writing functions, or repeated processes.

I want to be able to order an IC I am curious about, and using the datasheet that explains what that IC can do, write a custom library that uses that IC.

I do not have a specific IC in mind right now, as I realize I need to learn how to develop the basic skills I need that would let me read about the listed functions of an IC on its datasheet.

I will be using the Arduino IDE, CodeBlocks and KiCAD ( for PCB design ), as well as learning Python, all on an Ubuntu platform.

Thanx everyone!