TM4C129X: Increated power/clocking macros into I2C driver
This commit is contained in:
parent
582966260d
commit
240b57428f
@ -837,7 +837,7 @@ int tiva_configgpio(uint32_t cfgset)
|
|||||||
|
|
||||||
/* Enable power and clocking for this GPIO peripheral. */
|
/* 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);
|
tiva_gpio_enableclk(port);
|
||||||
|
|
||||||
/* First, set the port to digital input. This is the safest state in which
|
/* First, set the port to digital input. This is the safest state in which
|
||||||
|
@ -65,6 +65,8 @@
|
|||||||
|
|
||||||
#include "up_arch.h"
|
#include "up_arch.h"
|
||||||
|
|
||||||
|
#include "tiva_enablepwr.h"
|
||||||
|
#include "tiva_enableclks.h"
|
||||||
#include "tiva_gpio.h"
|
#include "tiva_gpio.h"
|
||||||
#include "chip/tiva_pinmap.h"
|
#include "chip/tiva_pinmap.h"
|
||||||
#include "chip/tiva_syscontrol.h"
|
#include "chip/tiva_syscontrol.h"
|
||||||
@ -171,7 +173,7 @@ enum tiva_trace_e
|
|||||||
I2CEVENT_SENDBYTE, /* Send byte, param = mcnt */
|
I2CEVENT_SENDBYTE, /* Send byte, param = mcnt */
|
||||||
I2CEVENT_SPURIOUS, /* Spurious interrupt received, param = msgc */
|
I2CEVENT_SPURIOUS, /* Spurious interrupt received, param = msgc */
|
||||||
I2CEVENT_NEXTMSG, /* Starting next message, 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 */
|
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 */
|
/* Enable clocking to the I2C peripheral */
|
||||||
|
|
||||||
#ifdef TIVA_SYSCON_RCGCI2C
|
#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",
|
i2cvdbg("I2C%d: RCGI2C[%08x]=%08x\n",
|
||||||
config->devno, TIVA_SYSCON_RCGCI2C, getreg32(TIVA_SYSCON_RCGCI2C));
|
config->devno, TIVA_SYSCON_RCGCI2C, getreg32(TIVA_SYSCON_RCGCI2C));
|
||||||
|
@ -258,7 +258,7 @@ void up_lowsetup(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_TIVA_UART0
|
#ifdef CONFIG_TIVA_UART0
|
||||||
tiva_uart0_enablepwr();
|
tiva_uart0_enablepwr(); /* State will be retained if clocking disabled */
|
||||||
tiva_uart0_enableclk();
|
tiva_uart0_enableclk();
|
||||||
|
|
||||||
tiva_configgpio(GPIO_UART0_RX);
|
tiva_configgpio(GPIO_UART0_RX);
|
||||||
@ -266,7 +266,7 @@ void up_lowsetup(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_TIVA_UART1
|
#ifdef CONFIG_TIVA_UART1
|
||||||
tiva_uart1_enablepwr();
|
tiva_uart1_enablepwr(); /* State will be retained if clocking disabled */
|
||||||
tiva_uart1_enableclk();
|
tiva_uart1_enableclk();
|
||||||
|
|
||||||
tiva_configgpio(GPIO_UART1_RX);
|
tiva_configgpio(GPIO_UART1_RX);
|
||||||
@ -274,7 +274,7 @@ void up_lowsetup(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_TIVA_UART2
|
#ifdef CONFIG_TIVA_UART2
|
||||||
tiva_uart2_enablepwr();
|
tiva_uart2_enablepwr(); /* State will be retained if clocking disabled */
|
||||||
tiva_uart2_enableclk();
|
tiva_uart2_enableclk();
|
||||||
|
|
||||||
tiva_configgpio(GPIO_UART2_RX);
|
tiva_configgpio(GPIO_UART2_RX);
|
||||||
@ -282,7 +282,7 @@ void up_lowsetup(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_TIVA_UART3
|
#ifdef CONFIG_TIVA_UART3
|
||||||
tiva_uart3_enablepwr();
|
tiva_uart3_enablepwr(); /* State will be retained if clocking disabled */
|
||||||
tiva_uart3_enableclk();
|
tiva_uart3_enableclk();
|
||||||
|
|
||||||
tiva_configgpio(GPIO_UART3_RX);
|
tiva_configgpio(GPIO_UART3_RX);
|
||||||
@ -290,6 +290,7 @@ void up_lowsetup(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_TIVA_UART4
|
#ifdef CONFIG_TIVA_UART4
|
||||||
|
tiva_uart4_enablepwr(); /* State will be retained if clocking disabled */
|
||||||
tiva_uart4_enableclk();
|
tiva_uart4_enableclk();
|
||||||
|
|
||||||
tiva_configgpio(GPIO_UART4_RX);
|
tiva_configgpio(GPIO_UART4_RX);
|
||||||
@ -297,7 +298,7 @@ void up_lowsetup(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_TIVA_UART5
|
#ifdef CONFIG_TIVA_UART5
|
||||||
tiva_uart5_enablepwr();
|
tiva_uart5_enablepwr(); /* State will be retained if clocking disabled */
|
||||||
tiva_uart5_enableclk();
|
tiva_uart5_enableclk();
|
||||||
|
|
||||||
tiva_configgpio(GPIO_UART5_RX);
|
tiva_configgpio(GPIO_UART5_RX);
|
||||||
@ -305,7 +306,7 @@ void up_lowsetup(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_TIVA_UART6
|
#ifdef CONFIG_TIVA_UART6
|
||||||
tiva_uart6_enablepwr();
|
tiva_uart6_enablepwr(); /* State will be retained if clocking disabled */
|
||||||
tiva_uart6_enableclk();
|
tiva_uart6_enableclk();
|
||||||
|
|
||||||
tiva_configgpio(GPIO_UART6_RX);
|
tiva_configgpio(GPIO_UART6_RX);
|
||||||
@ -313,7 +314,7 @@ void up_lowsetup(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_TIVA_UART7
|
#ifdef CONFIG_TIVA_UART7
|
||||||
tiva_uart7_enablepwr();
|
tiva_uart7_enablepwr(); /* State will be retained if clocking disabled */
|
||||||
tiva_uart7_enableclk();
|
tiva_uart7_enableclk();
|
||||||
|
|
||||||
tiva_configgpio(GPIO_UART7_RX);
|
tiva_configgpio(GPIO_UART7_RX);
|
||||||
|
@ -1477,7 +1477,7 @@ FAR struct spi_dev_s *up_spiinitialize(int port)
|
|||||||
|
|
||||||
/* Enable power and clocking to the SSI0 peripheral */
|
/* Enable power and clocking to the SSI0 peripheral */
|
||||||
|
|
||||||
tiva_ssi0_enablepwr();
|
tiva_ssi0_enablepwr(); /* State will be ratained if clocking disabled */
|
||||||
tiva_ssi0_enableclk();
|
tiva_ssi0_enableclk();
|
||||||
|
|
||||||
/* Configure SSI0 GPIOs (NOTE that SS is not initialized here, the
|
/* 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 */
|
/* Enable power and clocking to the SSI1 peripheral */
|
||||||
|
|
||||||
tiva_ssi1_enablepwr();
|
tiva_ssi1_enablepwr(); /* State will be ratained if clocking disabled */
|
||||||
tiva_ssi1_enableclk();
|
tiva_ssi1_enableclk();
|
||||||
|
|
||||||
/* Configure SSI1 GPIOs */
|
/* Configure SSI1 GPIOs */
|
||||||
|
Loading…
Reference in New Issue
Block a user