Don't encourage me Monica I am bound to start expounding on the philosophy of software design...oh oh here goes....
PE it starts with a great idea. That is, to take all of the registers in an MCU, and break out all the bit fields into a property sheet. Give each field a sensible name, provide documentation with a click, provide legal values for bit fields on lists...and so on. Great idea.
But with PE, that is combined with a lot of code behind the scenes, and that code is dubious.
- it is terribly verbose, the naming convention is long which makes it difficult to see the structure
- comments often only state the obvious, stuff like: file_read(); // read the file
- page-long headers for one-line macros and functions (makes it hard to navigate)
- there are several layers of indirection, making it difficult to find out what the code is actually doing
- the code generally uses interrupts which is dodgy in a realtime system
That last point is the main problem in my estimation. The first thing you learn about event-driven programming in the software world is that the results are often unpredictable. Interrupts are the hardware-level equivalent of software events. While there is a time and place for using every interrupt the MCU has to offer, generally in realtime systems it is better to use one timer interrupt, and poll everything. Then your timing can be 100% predictable and the system will be 100% reliable. As you add more and more interrupts firing off at random times, it becomes impossible to know the exact timing of your system, in fact, it is impossible to test all combinations. So when you take a dozen different PE peripheral drivers, put them on a system, the timing is "Lord knows what".
PE code is good for learning one peripheral, it isn't really suitable for a complex realtime system.
I realize this could become a religious argument, but the main point is, if the programmer chooses to follow this programming model (ie polling peripherals with a timer interrupt) then the PE code takes a lot of work to whip into shape. I would have appreciated some simpler examples, straight to the metal, so I could more easily co-relate the code to the documentation. But the job is done now. :smileyhappy: