Skip to content

Commit 83961a7

Browse files
committed
Feat|>[drv] read aw9527 id
1 parent 45e308d commit 83961a7

4 files changed

Lines changed: 28 additions & 29 deletions

File tree

platform/wscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def is_obelix(ctx):
4949

5050
@conf
5151
def is_obelix_bb(ctx):
52-
return ctx.get_board() in ('obelix_bb')
52+
return ctx.get_board() == ('obelix_bb')
5353

5454
@conf
5555
def get_platform_name(ctx):

src/fw/board/boards/board_obelix_bb.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ I2CBus I2C1_BUS = {
7979
.state = &I2C1_BUS_STATE,
8080
.scl_gpio =
8181
{
82-
.gpio_pin = 29,
82+
.gpio_pin = 11,
8383
},
8484
.sda_gpio =
8585
{
86-
.gpio_pin = 28,
86+
.gpio_pin = 10,
8787
},
8888
.name = "i2c1",
8989
};
@@ -95,11 +95,11 @@ I2CBus I2C2_BUS = {
9595
.state = &I2C2_BUS_STATE,
9696
.scl_gpio =
9797
{
98-
.gpio_pin = 21,
98+
.gpio_pin = 29,
9999
},
100100
.sda_gpio =
101101
{
102-
.gpio_pin = 20,
102+
.gpio_pin = 28,
103103
},
104104
.name = "i2c2",
105105
};
@@ -111,11 +111,11 @@ I2CBus I2C3_BUS = {
111111
.state = &I2C2_BUS_STATE,
112112
.scl_gpio =
113113
{
114-
.gpio_pin = 33,
114+
.gpio_pin = 21,
115115
},
116116
.sda_gpio =
117117
{
118-
.gpio_pin = 32,
118+
.gpio_pin = 20,
119119
},
120120
.name = "i2c3",
121121
};
@@ -406,7 +406,7 @@ void board_init(void) {
406406

407407
PBL_LOG(LOG_LEVEL_DEBUG, "enr1:0x%08lx", *(uint32_t *)&hwp_hpsys_rcc->ENR1);
408408
PBL_LOG(LOG_LEVEL_DEBUG, "enr2:0x%08lx", *(uint32_t *)&hwp_hpsys_rcc->ENR2);
409-
//ioexp_init();
409+
ioexp_init();
410410
//vibe_init();
411411
//PBL_LOG(LOG_LEVEL_DEBUG, "enr1:0x%08lx", *(uint32_t *)&hwp_hpsys_rcc->ENR1);
412412
//PBL_LOG(LOG_LEVEL_DEBUG, "enr2:0x%08lx", *(uint32_t *)&hwp_hpsys_rcc->ENR2);

src/fw/drivers/ioexp_aw9527.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ void ioexp_init(void) {
4545
gpio_output_set(&BOARD_CONFIG.ioe_rst, true);
4646

4747
uint8_t rv;
48-
bool found = prv_read_register(0x23, &rv);
48+
bool found = prv_read_register(0x10, &rv);
4949
if (found) {
50-
PBL_LOG(LOG_LEVEL_DEBUG, "Found AW9527 with STATUS register %02x", rv);
50+
PBL_LOG(LOG_LEVEL_DEBUG, "Found AW9527 with STATUS register ID:%02x", rv);
5151
} else {
5252
PBL_LOG(LOG_LEVEL_ERROR, "Failed to read the STATUS register");
5353
}

src/fw/drivers/wscript_build

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -201,36 +201,35 @@ elif bld.is_asterix():
201201
'driver_voltage_monitor',
202202
],
203203
)
204-
205-
elif bld.is_obelix():
204+
elif bld.is_obelix_bb():
206205
bld(
207206
name='drivers',
208207
use=[
209208
'driver_uart',
210209
'driver_sf32lb',
211-
'driver_vibe',
212210
'driver_mpu',
213211
'driver_flash',
214212
'driver_gpio_defaults',
215-
'driver_imu'
213+
'driver_ioe',
214+
'driver_motor',
215+
'driver_imu',
216+
'driver_touch',
216217
],
217-
)
218-
219-
elif bld.is_obelix_bb():
218+
)
219+
elif bld.is_obelix():
220220
bld(
221221
name='drivers',
222222
use=[
223223
'driver_uart',
224224
'driver_sf32lb',
225+
'driver_vibe',
225226
'driver_mpu',
226227
'driver_flash',
227228
'driver_gpio_defaults',
228-
'driver_ioe',
229-
'driver_motor',
230-
'driver_imu',
231-
'driver_touch',
229+
'driver_imu'
232230
],
233-
)
231+
)
232+
234233

235234
if bld.env.BOARD == "obelix_bb":
236235
bld.objects(
@@ -950,34 +949,34 @@ elif bld.is_asterix():
950949
'root_includes',
951950
],
952951
)
953-
elif bld.is_obelix():
952+
elif bld.is_obelix_bb():
954953
bld.objects(
955954
name='driver_imu',
956955
source=[
957-
'imu/imu_asterix.c',
958-
'sf32lb/stubs/mag.c',
956+
'imu/imu_obelix_bb.c',
957+
'imu/mmc5603/mmc5603.c',
959958
],
960959
use=[
961960
'fw_includes',
962961
'root_includes',
963962
],
964963
)
965-
elif bld.is_obelix_bb():
964+
elif bld.is_obelix():
966965
bld.objects(
967966
name='driver_imu',
968967
source=[
969-
'imu/imu_obelix_bb.c',
970-
'imu/mmc5603/mmc5603.c',
968+
'imu/imu_asterix.c',
969+
'sf32lb/stubs/mag.c',
971970
],
972971
use=[
973-
'driver_mmc5603',
974972
'fw_includes',
975973
'root_includes',
976974
],
977975
)
978976

979977

980978

979+
981980
if bld.env.BOARD == "v2_0":
982981
bld.objects(
983982
name='driver_led_controller',

0 commit comments

Comments
 (0)