mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
STM32, STM32 F7, and STM32 L4: Clone Freddie Chopin's I2C change to similar STM32 I2C drivers.
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
* With extensions, modifications by:
|
* With extensions, modifications by:
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-2014, 2016 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011-2014, 2016-2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -670,15 +670,15 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
/* Calculate the elapsed time */
|
||||||
|
|
||||||
|
elapsed = clock_systimer() - start;
|
||||||
|
|
||||||
/* Poll by simply calling the timer interrupt handler until it
|
/* Poll by simply calling the timer interrupt handler until it
|
||||||
* reports that it is done.
|
* reports that it is done.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
stm32_i2c_isr(priv);
|
stm32_i2c_isr(priv);
|
||||||
|
|
||||||
/* Calculate the elapsed time */
|
|
||||||
|
|
||||||
elapsed = clock_systimer() - start;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Loop until the transfer is complete. */
|
/* Loop until the transfer is complete. */
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
* With extensions, modifications by:
|
* With extensions, modifications by:
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-2014, 2016 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011-2014, 2016-2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Copyright( C) 2014 Patrizio Simona. All rights reserved.
|
* Copyright( C) 2014 Patrizio Simona. All rights reserved.
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
* With extensions and modifications for the F1, F2, and F4 by:
|
* With extensions and modifications for the F1, F2, and F4 by:
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-2013, 2016 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011-2013, 2016-2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregroy Nutt <gnutt@nuttx.org>
|
* Author: Gregroy Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* And this version for the STM32 F3 by
|
* And this version for the STM32 F3 by
|
||||||
@@ -704,15 +704,15 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
/* Calculate the elapsed time */
|
||||||
|
|
||||||
|
elapsed = clock_systimer() - start;
|
||||||
|
|
||||||
/* Poll by simply calling the timer interrupt handler until it
|
/* Poll by simply calling the timer interrupt handler until it
|
||||||
* reports that it is done.
|
* reports that it is done.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
stm32_i2c_isr(priv);
|
stm32_i2c_isr(priv);
|
||||||
|
|
||||||
/* Calculate the elapsed time */
|
|
||||||
|
|
||||||
elapsed = clock_systimer() - start;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Loop until the transfer is complete. */
|
/* Loop until the transfer is complete. */
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
* With extensions, modifications by:
|
* With extensions, modifications by:
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-2014, 2016 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011-2014, 2016-2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -672,15 +672,15 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
/* Calculate the elapsed time */
|
||||||
|
|
||||||
|
elapsed = clock_systimer() - start;
|
||||||
|
|
||||||
/* Poll by simply calling the timer interrupt handler until it
|
/* Poll by simply calling the timer interrupt handler until it
|
||||||
* reports that it is done.
|
* reports that it is done.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
stm32_i2c_isr(priv);
|
stm32_i2c_isr(priv);
|
||||||
|
|
||||||
/* Calculate the elapsed time */
|
|
||||||
|
|
||||||
elapsed = clock_systimer() - start;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Loop until the transfer is complete. */
|
/* Loop until the transfer is complete. */
|
||||||
|
|||||||
@@ -897,15 +897,15 @@ static inline int stm32_i2c_sem_waitdone(FAR struct stm32_i2c_priv_s *priv)
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
/* Calculate the elapsed time */
|
||||||
|
|
||||||
|
elapsed = clock_systimer() - start;
|
||||||
|
|
||||||
/* Poll by simply calling the timer interrupt handler until it
|
/* Poll by simply calling the timer interrupt handler until it
|
||||||
* reports that it is done.
|
* reports that it is done.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
stm32_i2c_isr(priv);
|
stm32_i2c_isr(priv);
|
||||||
|
|
||||||
/* Calculate the elapsed time */
|
|
||||||
|
|
||||||
elapsed = clock_systimer() - start;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Loop until the transfer is complete. */
|
/* Loop until the transfer is complete. */
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (C) 2011 Uros Platise. All rights reserved.
|
* Copyright (C) 2011 Uros Platise. All rights reserved.
|
||||||
* Author: Uros Platise <uros.platise@isotel.eu>
|
* Author: Uros Platise <uros.platise@isotel.eu>
|
||||||
* Copyright (C) 2011-2013, 2016 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011-2013, 2016-2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregroy Nutt <gnutt@nuttx.org>
|
* Author: Gregroy Nutt <gnutt@nuttx.org>
|
||||||
* Author: John Wharington
|
* Author: John Wharington
|
||||||
* Author: Sebastien Lorquet
|
* Author: Sebastien Lorquet
|
||||||
@@ -648,15 +648,15 @@ static inline int stm32l4_i2c_sem_waitdone(FAR struct stm32l4_i2c_priv_s *priv)
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
/* Calculate the elapsed time */
|
||||||
|
|
||||||
|
elapsed = clock_systimer() - start;
|
||||||
|
|
||||||
/* Poll by simply calling the timer interrupt handler until it
|
/* Poll by simply calling the timer interrupt handler until it
|
||||||
* reports that it is done.
|
* reports that it is done.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
stm32l4_i2c_isr(priv);
|
stm32l4_i2c_isr(priv);
|
||||||
|
|
||||||
/* Calculate the elapsed time */
|
|
||||||
|
|
||||||
elapsed = clock_systimer() - start;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Loop until the transfer is complete. */
|
/* Loop until the transfer is complete. */
|
||||||
|
|||||||
Reference in New Issue
Block a user