STM32F0 CPAL I2C bibliotheek
1.0
ST Microelectronics CPALv2 bibliotheek documentatie
|
This file provides all the CPAL firmware functions for I2C peripheral. More...
#include "stm32f0xx_i2c_cpal.h"
Macros | |
#define | __CPAL_I2C_TIMEOUT_DETECT |
#define | __CPAL_I2C_TIMEOUT(cmd, timeout) |
Functions | |
uint32_t | CPAL_I2C_Init (CPAL_InitTypeDef *pDevInitStruct) |
Initialize the peripheral and all related clocks, GPIOs, DMA and Interrupts according to the specified parameters in the CPAL_InitTypeDef structure. More... | |
uint32_t | CPAL_I2C_DeInit (CPAL_InitTypeDef *pDevInitStruct) |
Deinitialize the peripheral and all related clocks, GPIOs, DMA and NVIC to their reset values. More... | |
uint32_t | CPAL_I2C_StructInit (CPAL_InitTypeDef *pDevInitStruct) |
Initialize the peripheral structure with default values according to the specified parameters in the CPAL_I2CDevTypeDef structure. More... | |
uint32_t | CPAL_I2C_Write (CPAL_InitTypeDef *pDevInitStruct) |
Allows to send a data or a buffer of data through the peripheral to a selected device in a selected location address. More... | |
uint32_t | CPAL_I2C_Read (CPAL_InitTypeDef *pDevInitStruct) |
Allows to receive a data or a buffer of data through the peripheral from a selected device in a selected location address. More... | |
uint32_t | CPAL_I2C_IsDeviceReady (CPAL_InitTypeDef *pDevInitStruct) |
Wait until target device is ready for communication (This function is used with Memory devices). More... | |
uint32_t | CPAL_I2C_EV_IRQHandler (CPAL_InitTypeDef *pDevInitStruct) |
This function handles I2C interrupt request for preparing communication and for transfer phase in case of using Interrupt Programming Model. More... | |
uint32_t | CPAL_I2C_ER_IRQHandler (CPAL_InitTypeDef *pDevInitStruct) |
Allows to handle errors occurred during initialization or communication in order to recover the correct communication status or call specific user functions. More... | |
void | CPAL_I2C_TIMEOUT_Manager (void) |
This function Manages I2C Timeouts when waiting for specific events. More... | |
Variables | |
I2C_TypeDef * | CPAL_I2C_DEVICE [] |
I2C_InitTypeDef | I2C_InitStructure |
__IO uint32_t | Num_Data = 0 |
uint32_t | CR2_tmp = 0 |
This file provides all the CPAL firmware functions for I2C peripheral.
Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at:
http://www.st.com/software_license_agreement_liberty_v2
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
#define __CPAL_I2C_TIMEOUT | ( | cmd, | |
timeout | |||
) |
#define __CPAL_I2C_TIMEOUT_DETECT |
uint32_t CPAL_I2C_DeInit | ( | CPAL_InitTypeDef * | pDevInitStruct | ) |
Deinitialize the peripheral and all related clocks, GPIOs, DMA and NVIC to their reset values.
pDevInitStruct,: | Pointer to the peripheral configuration structure. |
CPAL_PASS | or CPAL_FAIL |
uint32_t CPAL_I2C_ER_IRQHandler | ( | CPAL_InitTypeDef * | pDevInitStruct | ) |
Allows to handle errors occurred during initialization or communication in order to recover the correct communication status or call specific user functions.
pDevInitStruct,: | Pointer to the peripheral configuration structure. |
CPAL_PASS. |
uint32_t CPAL_I2C_EV_IRQHandler | ( | CPAL_InitTypeDef * | pDevInitStruct | ) |
This function handles I2C interrupt request for preparing communication and for transfer phase in case of using Interrupt Programming Model.
pDevInitStruct,: | Pointer to the peripheral configuration structure. |
CPAL_PASS. |
uint32_t CPAL_I2C_Init | ( | CPAL_InitTypeDef * | pDevInitStruct | ) |
Initialize the peripheral and all related clocks, GPIOs, DMA and Interrupts according to the specified parameters in the CPAL_InitTypeDef structure.
pDevInitStruct | : Pointer to the peripheral configuration structure. |
CPAL_PASS | or CPAL_FAIL |
uint32_t CPAL_I2C_IsDeviceReady | ( | CPAL_InitTypeDef * | pDevInitStruct | ) |
Wait until target device is ready for communication (This function is used with Memory devices).
pDevInitStruct,: | Pointer to the peripheral configuration structure. |
CPAL_PASS | or CPAL_FAIL. |
uint32_t CPAL_I2C_Read | ( | CPAL_InitTypeDef * | pDevInitStruct | ) |
Allows to receive a data or a buffer of data through the peripheral from a selected device in a selected location address.
pDevInitStruct,: | Pointer to the peripheral configuration structure. |
CPAL_PASS | or CPAL_FAIL. |
uint32_t CPAL_I2C_StructInit | ( | CPAL_InitTypeDef * | pDevInitStruct | ) |
Initialize the peripheral structure with default values according to the specified parameters in the CPAL_I2CDevTypeDef structure.
pDevInitStruct,: | Pointer to the peripheral configuration structure. |
CPAL_PASS | or CPAL_FAIL. |
void CPAL_I2C_TIMEOUT_Manager | ( | void | ) |
This function Manages I2C Timeouts when waiting for specific events.
None |
CPAL_PASS | or CPAL_FAIL. |
uint32_t CPAL_I2C_Write | ( | CPAL_InitTypeDef * | pDevInitStruct | ) |
Allows to send a data or a buffer of data through the peripheral to a selected device in a selected location address.
pDevInitStruct,: | Pointer to the peripheral configuration structure. |
CPAL_PASS | or CPAL_FAIL. |