We currently have the problem, that the most developmend boards to do not have a full, free port. On my board, for example, the LCD is interfaces from PORTE 0 to PORTE 15.
This allows to just do: palWritePort(GPIOE, data); where data is of type uint16_t.
But since the most users need some way to split the data lines, we need to find a way to make it easy to configure, and not neccessary to edit the actual drivers sourcecode.
I thought about just splitting it into two 8-bit lanes like this:
Code: Select all
#define LCD_DATA_PORT_1 GPIOB
#define LCD_DATA_PORT_2 GPIOC
#define LCD_DATA_PORT_1_BASE 0
#define LCD_DATA_PORT_2_BASE 8
This would use GPIOB[0:7] for the DB0 to DB7 of the LCD, and GPIOC[8:15] for DB8 to DB15 of the LCD.
The main problem here is that we still need 8 continous pins on one free port. So we would have to be able to also provide 4+12 lanes, or 4+4+4 etc.
How do make this easy to configure for the user?
Abhishek thought about writing a small generator program/script which will automaticly generate the lld write and read functions depending on the config file of the user.
Does anybody else have another idea?
~ Tectu