fixed compatability with mcp23009. (naming of instantiated GPIO-Devices)

This commit is contained in:
Phil-Engljaehringer 2025-10-30 15:48:19 +01:00 committed by Alexander Lerach
parent 845a2d3632
commit ce81da0c8a
2 changed files with 13 additions and 3 deletions

View File

@ -22,7 +22,7 @@ netman update_default -i eth0
safety_button start
# GPIO Expander driver on external I2C3
GPIO Expander driver on external I2C3
if ver hwbasecmp 009 010 011
then
# No USB

View File

@ -282,9 +282,17 @@ __EXPORT int board_app_initialize(uintptr_t arg)
}
# endif /* CONFIG_MMCSD */
ret = mcp23009_register_gpios(3, 0x25);
ret |= mcp23017_register_gpios(2, 0x27, 0, 0x0000);
if (ret != OK) {
led_on(LED_RED);
return ret;
}
int offset = 8; // This is the offset for the naming of the instatiated GPIO-DEVICES.
uint16_t pin_types = 0x0000;// Set pin type. Set bit to 1 to mark pin as INPUT, set to 0 to mark as OUTPUT
ret = mcp23017_register_gpios(2, 0x27, offset, pin_types);
if (ret != OK) {
led_on(LED_RED);
@ -295,3 +303,5 @@ __EXPORT int board_app_initialize(uintptr_t arg)
return OK;
}