Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
c95ee04b
Commit
c95ee04b
authored
6 years ago
by
Alexandre Abadie
Committed by
dylad
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
boards/*: adapt stm32l0 based board to new I2C api
parent
ebc17acb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
boards/b-l072z-lrwan1/include/periph_conf.h
+17
-20
17 additions, 20 deletions
boards/b-l072z-lrwan1/include/periph_conf.h
boards/nucleo-l073rz/include/periph_conf.h
+28
-37
28 additions, 37 deletions
boards/nucleo-l073rz/include/periph_conf.h
with
45 additions
and
57 deletions
boards/b-l072z-lrwan1/include/periph_conf.h
+
17
−
20
View file @
c95ee04b
...
@@ -155,26 +155,23 @@ static const spi_conf_t spi_config[] = {
...
@@ -155,26 +155,23 @@ static const spi_conf_t spi_config[] = {
* @name I2C configuration
* @name I2C configuration
* @{
* @{
*/
*/
#define I2C_0_EN 1
static
const
i2c_conf_t
i2c_config
[]
=
{
#define I2C_NUMOF I2C_0_EN
{
#define I2C_IRQ_PRIO 1
.
dev
=
I2C1
,
#define I2C_APBCLK (CLOCK_APB1)
.
speed
=
I2C_SPEED_NORMAL
,
.
scl_pin
=
GPIO_PIN
(
PORT_B
,
8
),
/* I2C 0 device configuration */
.
sda_pin
=
GPIO_PIN
(
PORT_B
,
9
),
#define I2C_0_DEV I2C1
.
scl_af
=
GPIO_AF4
,
#define I2C_0_CLKEN() (periph_clk_en(APB1, RCC_APB1ENR_I2C1EN))
.
sda_af
=
GPIO_AF4
,
#define I2C_0_CLKDIS() (periph_clk_dis(APB1, RCC_APB1ENR_I2C1EN))
.
bus
=
APB1
,
#define I2C_0_EVT_IRQ I2C1_IRQn
.
rcc_mask
=
RCC_APB1ENR_I2C1EN
,
#define I2C_0_EVT_ISR isr_i2c1
.
irqn
=
I2C1_IRQn
/* I2C 0 pin configuration */
}
#define I2C_0_SCL_PORT PORT_B
};
#define I2C_0_SCL_PIN 8
#define I2C_0_SCL_AF 4
#define I2C_0_ISR isr_i2c1
#define I2C_0_SCL_CLKEN() (periph_clk_en(AHB, RCC_IOPENR_GPIOBEN))
#define I2C_0_SDA_PORT PORT_B
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
#define I2C_0_SDA_PIN 9
#define I2C_0_SDA_AF 4
#define I2C_0_SDA_CLKEN() (periph_clk_en(AHB, RCC_IOPENR_GPIOBEN))
/** @} */
/** @} */
/**
/**
...
...
This diff is collapsed.
Click to expand it.
boards/nucleo-l073rz/include/periph_conf.h
+
28
−
37
View file @
c95ee04b
...
@@ -196,44 +196,35 @@ static const spi_conf_t spi_config[] = {
...
@@ -196,44 +196,35 @@ static const spi_conf_t spi_config[] = {
* @name I2C configuration
* @name I2C configuration
* @{
* @{
*/
*/
#define I2C_0_EN 1
static
const
i2c_conf_t
i2c_config
[]
=
{
#define I2C_1_EN 1
{
#define I2C_NUMOF (I2C_0_EN + I2C_1_EN)
.
dev
=
I2C1
,
#define I2C_IRQ_PRIO 1
.
speed
=
I2C_SPEED_NORMAL
,
#define I2C_APBCLK (CLOCK_APB1)
.
scl_pin
=
GPIO_PIN
(
PORT_B
,
8
),
.
sda_pin
=
GPIO_PIN
(
PORT_B
,
9
),
/* I2C 0 device configuration */
.
scl_af
=
GPIO_AF4
,
#define I2C_0_DEV I2C1
.
sda_af
=
GPIO_AF4
,
#define I2C_0_CLKEN() (periph_clk_en(APB1, RCC_APB1ENR_I2C1EN))
.
bus
=
APB1
,
#define I2C_0_CLKDIS() (periph_clk_dis(APB1, RCC_APB1ENR_I2C1EN))
.
rcc_mask
=
RCC_APB1ENR_I2C1EN
,
#define I2C_0_EVT_IRQ I2C1_IRQn
.
irqn
=
I2C1_IRQn
#define I2C_0_EVT_ISR isr_i2c1
},
/* I2C 0 pin configuration */
{
#define I2C_0_SCL_PORT PORT_B
.
dev
=
I2C2
,
#define I2C_0_SCL_PIN 8
.
speed
=
I2C_SPEED_NORMAL
,
#define I2C_0_SCL_AF 4
.
scl_pin
=
GPIO_PIN
(
PORT_B
,
13
),
#define I2C_0_SCL_CLKEN() (periph_clk_en(AHB, RCC_IOPENR_GPIOBEN))
.
sda_pin
=
GPIO_PIN
(
PORT_B
,
14
),
#define I2C_0_SDA_PORT PORT_B
.
scl_af
=
GPIO_AF5
,
#define I2C_0_SDA_PIN 9
.
sda_af
=
GPIO_AF5
,
#define I2C_0_SDA_AF 4
.
bus
=
APB1
,
#define I2C_0_SDA_CLKEN() (periph_clk_en(AHB, RCC_IOPENR_GPIOBEN))
.
rcc_mask
=
RCC_APB1ENR_I2C2EN
,
.
irqn
=
I2C2_IRQn
/* I2C 1 device configuration */
}
#define I2C_1_DEV I2C2
};
#define I2C_1_CLKEN() (periph_clk_en(APB1, RCC_APB1ENR_I2C2EN))
#define I2C_1_CLKDIS() (periph_clk_dis(APB1, RCC_APB1ENR_I2C2EN))
#define I2C_0_ISR isr_i2c1
#define I2C_1_EVT_IRQ I2C2_IRQn
#define I2C_1_ISR isr_i2c2
#define I2C_1_EVT_ISR isr_i2c2
/* I2C 1 pin configuration */
#define I2C_1_SCL_PORT PORT_B
#define I2C_1_SCL_PIN 13
#define I2C_1_SCL_AF 5
#define I2C_1_SCL_CLKEN() (periph_clk_en(AHB, RCC_IOPENR_GPIOBEN))
#define I2C_1_SDA_PORT PORT_B
#define I2C_1_SDA_PIN 14
#define I2C_1_SDA_AF 5
#define I2C_1_SDA_CLKEN() (periph_clk_en(AHB, RCC_IOPENR_GPIOBEN))
#define I2C_NUMOF (sizeof(i2c_config) / sizeof(i2c_config[0]))
/** @} */
/** @} */
/**
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment