TM4C129X: Increated power/clocking macros into I2C driver

This commit is contained in:
Gregory Nutt 2014-12-21 13:02:12 -06:00
parent 582966260d
commit 240b57428f
4 changed files with 16 additions and 12 deletions

View File

@ -837,7 +837,7 @@ int tiva_configgpio(uint32_t cfgset)
/* Enable power and clocking for this GPIO peripheral. */
tiva_gpio_enablepwr(port);
tiva_gpio_enablepwr(port); /* State will be retained of clocking disabled */
tiva_gpio_enableclk(port);
/* First, set the port to digital input. This is the safest state in which

View File

@ -65,6 +65,8 @@
#include "up_arch.h"
#include "tiva_enablepwr.h"
#include "tiva_enableclks.h"
#include "tiva_gpio.h"
#include "chip/tiva_pinmap.h"
#include "chip/tiva_syscontrol.h"
@ -171,7 +173,7 @@ enum tiva_trace_e
I2CEVENT_SENDBYTE, /* Send byte, param = mcnt */
I2CEVENT_SPURIOUS, /* Spurious interrupt received, param = msgc */
I2CEVENT_NEXTMSG, /* Starting next message, param = msgc */
I2CEVENT_TIMEOUT, /* Software detectected timeout, param = RIS */
I2CEVENT_TIMEOUT, /* Software detected timeout, param = RIS */
I2CEVENT_DONE /* All messages transferred, param = intstate */
};
@ -1521,7 +1523,8 @@ static int tiva_i2c_initialize(struct tiva_i2c_priv_s *priv, uint32_t frequency)
/* Enable clocking to the I2C peripheral */
#ifdef TIVA_SYSCON_RCGCI2C
modifyreg32(TIVA_SYSCON_RCGCI2C, 0, SYSCON_RCGCI2C(config->devno));
tiva_i2c_enablepwr(config->devno); /* State will be retained if clocking stopped */
tiva_i2c_enableclk(config->devno);
i2cvdbg("I2C%d: RCGI2C[%08x]=%08x\n",
config->devno, TIVA_SYSCON_RCGCI2C, getreg32(TIVA_SYSCON_RCGCI2C));

View File

@ -258,7 +258,7 @@ void up_lowsetup(void)
*/
#ifdef CONFIG_TIVA_UART0
tiva_uart0_enablepwr();
tiva_uart0_enablepwr(); /* State will be retained if clocking disabled */
tiva_uart0_enableclk();
tiva_configgpio(GPIO_UART0_RX);
@ -266,7 +266,7 @@ void up_lowsetup(void)
#endif
#ifdef CONFIG_TIVA_UART1
tiva_uart1_enablepwr();
tiva_uart1_enablepwr(); /* State will be retained if clocking disabled */
tiva_uart1_enableclk();
tiva_configgpio(GPIO_UART1_RX);
@ -274,7 +274,7 @@ void up_lowsetup(void)
#endif
#ifdef CONFIG_TIVA_UART2
tiva_uart2_enablepwr();
tiva_uart2_enablepwr(); /* State will be retained if clocking disabled */
tiva_uart2_enableclk();
tiva_configgpio(GPIO_UART2_RX);
@ -282,7 +282,7 @@ void up_lowsetup(void)
#endif
#ifdef CONFIG_TIVA_UART3
tiva_uart3_enablepwr();
tiva_uart3_enablepwr(); /* State will be retained if clocking disabled */
tiva_uart3_enableclk();
tiva_configgpio(GPIO_UART3_RX);
@ -290,6 +290,7 @@ void up_lowsetup(void)
#endif
#ifdef CONFIG_TIVA_UART4
tiva_uart4_enablepwr(); /* State will be retained if clocking disabled */
tiva_uart4_enableclk();
tiva_configgpio(GPIO_UART4_RX);
@ -297,7 +298,7 @@ void up_lowsetup(void)
#endif
#ifdef CONFIG_TIVA_UART5
tiva_uart5_enablepwr();
tiva_uart5_enablepwr(); /* State will be retained if clocking disabled */
tiva_uart5_enableclk();
tiva_configgpio(GPIO_UART5_RX);
@ -305,7 +306,7 @@ void up_lowsetup(void)
#endif
#ifdef CONFIG_TIVA_UART6
tiva_uart6_enablepwr();
tiva_uart6_enablepwr(); /* State will be retained if clocking disabled */
tiva_uart6_enableclk();
tiva_configgpio(GPIO_UART6_RX);
@ -313,7 +314,7 @@ void up_lowsetup(void)
#endif
#ifdef CONFIG_TIVA_UART7
tiva_uart7_enablepwr();
tiva_uart7_enablepwr(); /* State will be retained if clocking disabled */
tiva_uart7_enableclk();
tiva_configgpio(GPIO_UART7_RX);

View File

@ -1477,7 +1477,7 @@ FAR struct spi_dev_s *up_spiinitialize(int port)
/* Enable power and clocking to the SSI0 peripheral */
tiva_ssi0_enablepwr();
tiva_ssi0_enablepwr(); /* State will be ratained if clocking disabled */
tiva_ssi0_enableclk();
/* Configure SSI0 GPIOs (NOTE that SS is not initialized here, the
@ -1499,7 +1499,7 @@ FAR struct spi_dev_s *up_spiinitialize(int port)
/* Enable power and clocking to the SSI1 peripheral */
tiva_ssi1_enablepwr();
tiva_ssi1_enablepwr(); /* State will be ratained if clocking disabled */
tiva_ssi1_enableclk();
/* Configure SSI1 GPIOs */