Missing SCT functions in lpcopen for LPC15xx

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by sidheroor on Tue Dec 15 16:11:50 MST 2015
Hi all,

I was looking at AN11538 for some code to get started on SCT and the simplest example seems to be the periph_SCT2_repetitive_irq. However, the example code will not work with lpcopen as functions for EventState and EventControl are not defined in lpcopen. The example code in the Application note is as follows -

void SCT2_Init(void)
Chip_SCT_Init(LPC_SCT2);                   // enable the SCT2 clock

Chip_SCT_Config(LPC_SCT2, SCT_CONFIG_32BIT_COUNTER  |// unified timers,
                              SCT_CONFIG_AUTOLIMIT_L    );// auto limit

Chip_SCT_SetMatchCount(LPC_SCT2, SCT_MATCH_0,(SystemCoreClock/100) - 1);//match 0 @ 100 Hz = 10 msec
Chip_SCT_SetMatchReload(LPC_SCT2, SCT_MATCH_0, (SystemCoreClock/100) - 1);

Chip_SCT_EventState(LPC_SCT2, SCT_EVENT_0, ENABLE_ALL_STATES); // event 0 happens in all states ----> FUNCTION IS MISSING IN LPCOPEN
Chip_SCT_EventControl(LPC_SCT2, SCT_EVENT_0, SCT_COMBMODE_MATCH);// match 0 only condition ----> FUNCTION IS MISSING IN LPCOPEN

Chip_SCT_EnableEventInt(LPC_SCT2,SCT_EVT_0);// event 0 generates an interrupt

NVIC_EnableIRQ(SCT2_IRQn);                             // enable SCT2 interrupt

Chip_SCT_ClearControl(LPC_SCT2,SCT_CTRL_HALT_L);// start timer

For now, I'm accessing the registers directly, but it will be nice to know if this is a known issue and when it will be fixed.