This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C129XNCZAD: Peripheral Disable, Reset, Enable sequence

Part Number: TM4C129XNCZAD

Hi,

When is it enough to use only (for e.g.):

SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

 

When to use the whole sequence:

SysCtlPeripheralDisable(SYSCTL_PERIPH_GPIOA);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
SysCtlPeripheralReset(SYSCTL_PERIPH_GPIOA);

And is there a difference when reversing reset and enable like this:

SysCtlPeripheralDisable(SYSCTL_PERIPH_GPIOA);
SysCtlPeripheralReset(SYSCTL_PERIPH_GPIOA);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

You can give some examples and use cases.

  • Hi,

      If you look at most of the TivaWare examples (e.g. GPIO, UART, SSI or etc) you would normally see just SysCtlPeripheralEnable() getting called during initialization because the peripherals after a reset will be in their default state which means they are disabled. All of three example sequences you show will work. SysCtlPeripheralEnable is used to enable the clock for the selected peripheral while SysCtlPeripheralReset is used to reset the selected peripheral to its default state.