Skip to main content
Lsy.1
Associate
February 13, 2022
Solved

Toggle led controlled by MFX_v3?

  • February 13, 2022
  • 1 reply
  • 1185 views

I am using STM32L496 discovery board and I want to toggle LD1 which is controlled by MFX_GPIO4 on MFX_v3 chip according to UM2160. I'd like to do this within STM32CubeIDE, but I am not clear how to manage the MFX expansion device properly. Is it possible to generate these MFX setup code in Cube software? Also, is there any details on MFX_v3 registers and functions?

This topic has been closed for replies.
Best answer by Peter BENSCH

MFX_V3 is a port expander, which is connected via I2C to the STM32L496. For the control of periphery, which is behind the MFX_V3 from the view of the STM32L496, the software from the BSP (see the repository on Github or local) can be used.

For accessing the signal LED2 (a bit confusing it leads to the hardware LED named LD1) an enum is defined in the header file, so you can access it with LED_ORANGE.

There are also examples in the DISCO repository (just search for LED_ORANGE), how it can be used. To use the BSP, normally only the header file in main.h has to be included: 

#include "stm32l496g_discovery.h"

Good luck!

Regards

/Peter

1 reply

Peter BENSCH
Peter BENSCHBest answer
ST Technical Moderator
February 14, 2022

MFX_V3 is a port expander, which is connected via I2C to the STM32L496. For the control of periphery, which is behind the MFX_V3 from the view of the STM32L496, the software from the BSP (see the repository on Github or local) can be used.

For accessing the signal LED2 (a bit confusing it leads to the hardware LED named LD1) an enum is defined in the header file, so you can access it with LED_ORANGE.

There are also examples in the DISCO repository (just search for LED_ORANGE), how it can be used. To use the BSP, normally only the header file in main.h has to be included: 

#include "stm32l496g_discovery.h"

Good luck!

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.