i2c.h
Go to the documentation of this file.
1 /*
2  * KubOS HAL
3  * Copyright (C) 2016 Kubos Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #if (defined YOTTA_CFG_HARDWARE_I2C) && (YOTTA_CFG_HARDWARE_I2C_COUNT > 0)
19 #ifndef K_I2C_STM32F4
20 #define K_I2C_STM32F4
21 
22 #include "stm32f4xx_hal.h"
23 #include "stm32f4xx_hal_i2c.h"
24 
25 typedef struct
26 {
27  uint16_t scl;
28  uint16_t scl_mode;
29  uint16_t scl_pullup;
30  uint16_t scl_speed;
31  uint16_t sda;
32  uint16_t sda_mode;
33  uint16_t sda_pullup;
34  uint16_t sda_speed;
35  uint16_t alt;
36  uint16_t ev_irqn;
37  uint16_t er_irqn;
38  GPIO_TypeDef * gpio_port;
39 } hal_i2c_pins;
40 
41 typedef struct
42 {
43  /* Kubos-HAL structure */
44  KI2C * ki2c;
45  /* STM32CubeF4 HAL structure */
46  I2C_HandleTypeDef hal_handle;
47  /* GPIO config pins/ports */
50 
51 #endif
52 #endif
uint16_t er_irqn
Definition: i2c.h:37
hal_i2c_pins pins
Definition: i2c.h:48
GPIO_TypeDef * gpio_port
Definition: i2c.h:38
uint16_t sda_speed
Definition: i2c.h:34
uint16_t sda_pullup
Definition: i2c.h:33
Definition: i2c.h:41
uint16_t alt
Definition: i2c.h:35
uint16_t scl_mode
Definition: i2c.h:28
KI2C * ki2c
Definition: i2c.h:44
uint16_t sda_mode
Definition: i2c.h:32
I2C_HandleTypeDef hal_handle
Definition: i2c.h:46
uint16_t sda
Definition: i2c.h:31
uint16_t scl
Definition: i2c.h:27
uint16_t ev_irqn
Definition: i2c.h:36
uint16_t scl_speed
Definition: i2c.h:30
uint16_t scl_pullup
Definition: i2c.h:29
Definition: i2c.h:25