Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2 | Rev 9 | ||
---|---|---|---|
Line 4... | Line 4... | ||
4 | * @author MCD Application Team |
4 | * @author MCD Application Team |
5 | * @brief Header file of I2C LL module. |
5 | * @brief Header file of I2C LL module. |
6 | ****************************************************************************** |
6 | ****************************************************************************** |
7 | * @attention |
7 | * @attention |
8 | * |
8 | * |
9 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
9 | * <h2><center>© Copyright (c) 2016 STMicroelectronics. |
- | 10 | * All rights reserved.</center></h2> |
|
10 | * |
11 | * |
11 | * Redistribution and use in source and binary forms, with or without modification, |
12 | * This software component is licensed by ST under BSD 3-Clause license, |
12 | * are permitted provided that the following conditions are met: |
13 | * the "License"; You may not use this file except in compliance with the |
13 | * 1. Redistributions of source code must retain the above copyright notice, |
- | |
14 | * this list of conditions and the following disclaimer. |
- | |
15 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
- | |
16 | * this list of conditions and the following disclaimer in the documentation |
- | |
17 | * and/or other materials provided with the distribution. |
14 | * License. You may obtain a copy of the License at: |
18 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
- | |
19 | * may be used to endorse or promote products derived from this software |
15 | * opensource.org/licenses/BSD-3-Clause |
20 | * without specific prior written permission. |
- | |
21 | * |
- | |
22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
- | |
23 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
- | |
24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
- | |
25 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
- | |
26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
- | |
27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
- | |
28 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
- | |
29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
- | |
30 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
- | |
31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
- | |
32 | * |
16 | * |
33 | ****************************************************************************** |
17 | ****************************************************************************** |
34 | */ |
18 | */ |
35 | 19 | ||
36 | /* Define to prevent recursive inclusion -------------------------------------*/ |
20 | /* Define to prevent recursive inclusion -------------------------------------*/ |
Line 743... | Line 727... | ||
743 | * @retval None |
727 | * @retval None |
744 | */ |
728 | */ |
745 | __STATIC_INLINE void LL_I2C_ConfigSpeed(I2C_TypeDef *I2Cx, uint32_t PeriphClock, uint32_t ClockSpeed, |
729 | __STATIC_INLINE void LL_I2C_ConfigSpeed(I2C_TypeDef *I2Cx, uint32_t PeriphClock, uint32_t ClockSpeed, |
746 | uint32_t DutyCycle) |
730 | uint32_t DutyCycle) |
747 | { |
731 | { |
748 | register uint32_t freqrange = 0x0U; |
732 | uint32_t freqrange = 0x0U; |
749 | register uint32_t clockconfig = 0x0U; |
733 | uint32_t clockconfig = 0x0U; |
750 | 734 | ||
751 | /* Compute frequency range */ |
735 | /* Compute frequency range */ |
752 | freqrange = __LL_I2C_FREQ_HZ_TO_MHZ(PeriphClock); |
736 | freqrange = __LL_I2C_FREQ_HZ_TO_MHZ(PeriphClock); |
753 | 737 | ||
754 | /* Configure I2Cx: Frequency range register */ |
738 | /* Configure I2Cx: Frequency range register */ |
Line 1199... | Line 1183... | ||
1199 | return (READ_BIT(I2Cx->SR1, I2C_SR1_ADDR) == (I2C_SR1_ADDR)); |
1183 | return (READ_BIT(I2Cx->SR1, I2C_SR1_ADDR) == (I2C_SR1_ADDR)); |
1200 | } |
1184 | } |
1201 | 1185 | ||
1202 | /** |
1186 | /** |
1203 | * @brief Indicate the status of 10-bit header sent (master mode). |
1187 | * @brief Indicate the status of 10-bit header sent (master mode). |
1204 | * @note RESET: When no ADD10 event occured. |
1188 | * @note RESET: When no ADD10 event occurred. |
1205 | * SET: When the master has sent the first address byte (header). |
1189 | * SET: When the master has sent the first address byte (header). |
1206 | * @rmtoll SR1 ADD10 LL_I2C_IsActiveFlag_ADD10 |
1190 | * @rmtoll SR1 ADD10 LL_I2C_IsActiveFlag_ADD10 |
1207 | * @param I2Cx I2C Instance. |
1191 | * @param I2Cx I2C Instance. |
1208 | * @retval State of bit (1 or 0). |
1192 | * @retval State of bit (1 or 0). |
1209 | */ |
1193 | */ |