Recently, I have begun designing and writing code for microcontrollers in order to get a deeper understanding of how they work. The first major project I have undertaken involves writing a driver for the trusty Hitachi HD44780 LCD controller. In no time at all, I was able to implement a communication interface with the LCD and all the defined LCD commands. I am happy with the basic driver, I'm sure it follows convention. It uses a layered top-down approach such that there is a well defined public interface and the bottom layer contains the only functions to talk to the GPIO hardware.
However, I have started to implement advanced features such a vertical shifting/scrolling, animations etc. Implementation so far has been done within a single module which is good because it keeps all the functions together and the user of the driver can just call the functions provided to him/her. The downside of this is the driver is becoming more complex to maintain which tells me that I may need to break it up rather than pursue monolithic design.
I'm thinking of creating another module just for say vertical scrolling. The public interface will contain the data structure and functions required to perform scrolling which is all handled by main. Is this a valid approach or am I missing something completely?
When I say module, I am talking about a group of inter-related functions. My understanding is that a driver is a module for controlling a bit of hardware but module doesn't necessarily mean driver e.g. C string library.