So I'm playing with the Model Conductor Hardware architecture. I'm
sure there's merit to this architecture but I'm still trying to grasp
it. I've read "Mocking the Embedded World" four times.
For simplicity sake, let's say I have two triads:
- "Display" which is is a LED array controlled by a MAX265 (programmed via SPI)
- "UART" which is connected up to various devices, including the LED array.
Currently I've got something like this (from the top of my head):
DisplayConductor.c
void DisplayConductor_Init(void) {
DisplayHardware_Init();
DisplayHardware_StartupTest();
}
void DisplayConductor_Run(void) {
// Somehow receive message to display something
}
DisplayHardware.c
void DisplayHardware_Init(void) {
.. do some direction and output port setup ..
}
void DisplayHardware_StartupTest(void) {
// CS port set low
// Somehow send data word to UART?
// CS port set high
// CS port set low
}
void DisplayModel.c
// What goes here???
UartConductor.c
void UartConductor_Init(void) {
UartHardware_SetupPorts();
}
UartHardware.c
void UartHardware_Init(void) {
UartHardware_SetupPorts();
}
void UartHardware_SendSPIData(address, data) {
// Put it on the line etc.
}
So if you quickly read through the above pseudo code you'll see a
couple of issues that I'm not sure how it all fits together:
1. Message passing between triads - Why go through the models? How
would a Hardware part talk to another triad? How can
DisplayHardware_StartupTest know when the UART has sent the data so it
can finish with the Chip Select toggle?
2. What goes in the model? The pdf says the logic, does this mean
like the statefull part of the device? I'd like to see how this
works.
So I'm trying not to get overwhelmed as I'm sure lots of people have
thought long and hard about this architecture. Any help appreciated.
Sorry about the post. Hope it's not confusing and helps someone else,
Jevin