Skip to content

Commit 8f1ab86

Browse files
mbrossardmathias-arm
authored andcommitted
nrf52820_hic: I2C address configuration to RTE_Device.h
1 parent f966882 commit 8f1ab86

File tree

3 files changed

+13
-41
lines changed

3 files changed

+13
-41
lines changed

source/hic_hal/nordic/nrf52820/I2C_Slave_nRF52820.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* -----------------------------------------------------------------------------
2-
* Copyright (c) 2013-2021 Arm Limited (or its affiliates). All
2+
* Copyright (c) 2013-2021 Arm Limited (or its affiliates). All
33
* rights reserved.
44
*
55
* SPDX-License-Identifier: Apache-2.0
@@ -51,7 +51,7 @@ static const ARM_DRIVER_VERSION DriverVersion = {
5151
};
5252

5353
/* Driver Capabilities */
54-
static const ARM_I2C_CAPABILITIES DriverCapabilities = {
54+
static const ARM_I2C_CAPABILITIES DriverCapabilities = {
5555
0U // Does not support 10-bit addressing
5656
#if (defined(ARM_I2C_API_VERSION) && (ARM_I2C_API_VERSION >= 0x203U))
5757
, 0U // Reserved bits
@@ -164,8 +164,8 @@ static int32_t I2C_Initialize (ARM_I2C_SignalEvent_t cb_event, I2C_RESOURCES *i2
164164
}
165165

166166
// TWIS Configuration
167-
i2c->info->config.addr[0] = NRFX_TWIS_DEFAULT_CONFIG_ADDR0;
168-
i2c->info->config.addr[1] = NRFX_TWIS_DEFAULT_CONFIG_ADDR1;
167+
i2c->info->config.addr[0] = RTE_TWIS0_ADDR0;
168+
i2c->info->config.addr[1] = RTE_TWIS0_ADDR1;
169169
i2c->info->config.scl = RTE_TWIS0_SCL_PIN_NUM;
170170
i2c->info->config.scl_pull = NRF_GPIO_PIN_NOPULL;
171171
i2c->info->config.sda = RTE_TWIS0_SDA_PIN_NUM;
@@ -217,8 +217,8 @@ static int32_t I2C_PowerControl (ARM_POWER_STATE state, I2C_RESOURCES *i2c) {
217217
return ARM_DRIVER_ERROR;
218218
}
219219

220-
if ((state != ARM_POWER_OFF) &&
221-
(state != ARM_POWER_FULL) &&
220+
if ((state != ARM_POWER_OFF) &&
221+
(state != ARM_POWER_FULL) &&
222222
(state != ARM_POWER_LOW)) {
223223
return ARM_DRIVER_ERROR_PARAMETER;
224224
}

source/hic_hal/nordic/nrf52820/RTE_Device.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* -----------------------------------------------------------------------------
2-
* Copyright (c) 2013-2021 Arm Limited (or its affiliates). All
2+
* Copyright (c) 2013-2021 Arm Limited (or its affiliates). All
33
* rights reserved.
44
*
55
* SPDX-License-Identifier: Apache-2.0
@@ -65,5 +65,7 @@
6565
#define RTE_TWIS0_SDA_PIN_NUM I2C_SDA_PIN
6666
// </e>
6767

68+
#define RTE_TWIS0_ADDR0 0x70
69+
#define RTE_TWIS0_ADDR1 0x72
6870

6971
#endif /* __RTE_DEVICE_H */

source/hic_hal/nordic/nrf52820/nrfx/nrfx_config_nrf52820.h

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,36 +1264,6 @@
12641264
#define NRFX_TWIS_NO_SYNC_MODE 0
12651265
#endif
12661266

1267-
// <o> NRFX_TWIS_DEFAULT_CONFIG_ADDR0 - Address0
1268-
#ifndef NRFX_TWIS_DEFAULT_CONFIG_ADDR0
1269-
#define NRFX_TWIS_DEFAULT_CONFIG_ADDR0 0
1270-
#endif
1271-
1272-
// <o> NRFX_TWIS_DEFAULT_CONFIG_ADDR1 - Address1
1273-
#ifndef NRFX_TWIS_DEFAULT_CONFIG_ADDR1
1274-
#define NRFX_TWIS_DEFAULT_CONFIG_ADDR1 0
1275-
#endif
1276-
1277-
// <o> NRFX_TWIS_DEFAULT_CONFIG_SCL_PULL - SCL pin pull configuration
1278-
1279-
// <0=> Disabled
1280-
// <1=> Pull down
1281-
// <3=> Pull up
1282-
1283-
#ifndef NRFX_TWIS_DEFAULT_CONFIG_SCL_PULL
1284-
#define NRFX_TWIS_DEFAULT_CONFIG_SCL_PULL 0
1285-
#endif
1286-
1287-
// <o> NRFX_TWIS_DEFAULT_CONFIG_SDA_PULL - SDA pin pull configuration
1288-
1289-
// <0=> Disabled
1290-
// <1=> Pull down
1291-
// <3=> Pull up
1292-
1293-
#ifndef NRFX_TWIS_DEFAULT_CONFIG_SDA_PULL
1294-
#define NRFX_TWIS_DEFAULT_CONFIG_SDA_PULL 0
1295-
#endif
1296-
12971267
// <o> NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
12981268

12991269
// <0=> 0 (highest)
@@ -1611,9 +1581,9 @@
16111581
// <e> NRFX_USBD_ENABLED - nrfx_usbd - USBD peripheral driver
16121582
//==========================================================
16131583
#ifndef NRFX_USBD_ENABLED
1614-
#define NRFX_USBD_ENABLED 1
1584+
#define NRFX_USBD_ENABLED 0
16151585
#endif
1616-
// <o> NRFX_USBD_CONFIG_IRQ_PRIORITY - Interrupt priority
1586+
// <o> NRFX_USBD_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
16171587

16181588
// <0=> 0 (highest)
16191589
// <1=> 1
@@ -1624,8 +1594,8 @@
16241594
// <6=> 6
16251595
// <7=> 7
16261596

1627-
#ifndef NRFX_USBD_CONFIG_IRQ_PRIORITY
1628-
#define NRFX_USBD_CONFIG_IRQ_PRIORITY 7
1597+
#ifndef NRFX_USBD_DEFAULT_CONFIG_IRQ_PRIORITY
1598+
#define NRFX_USBD_DEFAULT_CONFIG_IRQ_PRIORITY 7
16291599
#endif
16301600

16311601
// <q> USBD_CONFIG_DMASCHEDULER_ISO_BOOST - Give priority to isochronous transfers

0 commit comments

Comments
 (0)