SPRAA85E November 2005 – December 2017
/////////////////////////////////////////////////////////////////////
//
// Example function implementation from Driverlib adc.h
//
/////////////////////////////////////////////////////////////////////
static inline void
ADC_setupSOC(uint32_t base, ADC_SOCNumber socNumber,
ADC_Trigger trigger, ADC_Channel channel,
uint32_t sampleWindow)
{
uint32_t ctlRegAddr;
...
// Calculate address for the SOC control register.
ctlRegAddr = base + ADC_SOCxCTL_OFFSET_BASE +
((uint32_t)socNumber * 2U);
// Set the configuration of the specified SOC.
EALLOW;
HWREG(ctlRegAddr) = ((uint32_t)channel << ADC_SOC0CTL_CHSEL_S) |
((uint32_t)trigger << ADC_SOC0CTL_TRIGSEL_S) |
(sampleWindow - 1U);
EDIS;
}