Regarding the porting of ugfx or LittlevGL, I also have to suggest that you play a bit with EVE Screen Editor.
EVE uses an approach that is a bit different to be highly efficent especially on small µC.
If you attach a basic CCS Project or send me one ( drone42(at)t-online.de ) for your target controller with a main.c that at least initialises one timer for a 5ms interrupt I can try to "port" my library to the MSP430.
Or rather make it support the MSP430 as there is nothing really to be ported.
I also need code to setup the SPI to mode 0 with a speed of less than 11MHz, code to set and release the I/Os for chip-select and power down as well as code to read and write data bus with the SPI.
To give you an example what the target portion of my library looks like, this is what I have for MSP432 now.
And I even consider the second block a bit misplaced as I normally use main.c for basic init.
Whats left is a crude delay function, five one-liners and three two-line functions.
#if defined (__TI_ARM__)
#if defined (__MSP432P401R__)
#include <ti/devices/msp432p4xx/inc/msp.h>
#include <ti/devices/msp432p4xx/driverlib/driverlib.h>
#include <stdint.h>
#define RIVERDI_PORT GPIO_PORT_P1
#define RIVERDI_SIMO BIT6 // P1.6
#define RIVERDI_SOMI BIT7 // P1.7
#define RIVERDI_CLK BIT5 // P1.5
#define EVE_CS_PORT GPIO_PORT_P5
#define EVE_CS GPIO_PIN0 //P5.0
#define EVE_PDN_PORT GPIO_PORT_P5
#define EVE_PDN GPIO_PIN1 //P5.1
void EVE_SPI_Init(void);
static inline void DELAY_MS(uint16_t val)
{
uint16_t counter;
while(val > 0)
{
for(counter=0; counter < 8000;counter++) // ~1ms at 48MHz Core-Clock
{
__nop();
}
val--;
}
}
static inline void EVE_pdn_set(void)
{
P5OUT &= ~EVE_PDN; /* Power-Down low */
}
static inline void EVE_pdn_clear(void)
{
P5OUT |= EVE_PDN; /* Power-Down high */
}
static inline void EVE_cs_set(void)
{
P5OUT &= ~EVE_CS; /* CS low */
}
static inline void EVE_cs_clear(void)
{
P5OUT |= EVE_CS; /* CS high */
}
static inline void spi_transmit_async(uint8_t data)
{
#if defined (EVE_DMA)
#else
UCB0TXBUF_SPI = data;
while(!(UCB0IFG_SPI & UCTXIFG)); /* wait for transmission to complete */
#endif
}
static inline void spi_transmit(uint8_t data)
{
UCB0TXBUF_SPI = data;
while(!(UCB0IFG_SPI & UCTXIFG)); /* wait for transmission to complete */
}
static inline uint8_t spi_receive(uint8_t data)
{
UCB0TXBUF_SPI = data;
while(!(UCB0IFG_SPI & UCTXIFG)); /* wait for transmission to complete */
return UCB0RXBUF_SPI;
}
static inline uint8_t fetch_flash_byte(const uint8_t *data)
{
return *data;
}
#endif /* __MSP432P401R__ */
#endif /* __TI_ARM */
#if defined (__TI_ARM__)
#if defined (__MSP432P401R__)
/* SPI Master Configuration Parameter */
const eUSCI_SPI_MasterConfig EVE_Config =
{
EUSCI_B_SPI_CLOCKSOURCE_SMCLK, // SMCLK Clock Source
48000000, // SMCLK = 48MHZ
500000, // SPICLK = 1Mhz
EUSCI_B_SPI_MSB_FIRST, // MSB First
EUSCI_B_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT, // Phase
EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_LOW, // High polarity
EUSCI_B_SPI_3PIN // 3Wire SPI Mode
};
void EVE_SPI_Init(void)
{
GPIO_setAsOutputPin(EVE_CS_PORT,EVE_CS);
GPIO_setAsOutputPin(EVE_PDN_PORT,EVE_PDN);
GPIO_setOutputHighOnPin(EVE_CS_PORT,EVE_CS);
GPIO_setOutputHighOnPin(EVE_PDN_PORT,EVE_PDN);
GPIO_setAsPeripheralModuleFunctionInputPin(RIVERDI_PORT, RIVERDI_SIMO | RIVERDI_SOMI | RIVERDI_CLK, GPIO_PRIMARY_MODULE_FUNCTION);
SPI_initMaster(EUSCI_B0_BASE, &EVE_Config);
SPI_enableModule(EUSCI_B0_BASE);
}
#endif
#endif
I have Code Composer Studio installed and can turn a given project into a basic demo.
I never used MSP430 oder MSP432 though, or any other TI controller.