Problem interfacing PCF8574 with custom data structure

Hello guys,
As mentioned in the subject line I have an issue with my PCF8574 combined with a custom data structure.

Background: I built a 5x5x5 LED cube in combination with 5 PCF8574 chips which should be controlled by an arduino nano. Due to this mess I considered to create a custom data structure as adresse for each LED to simplify the cube lighting process.
The adresse consists of the respective PCF, the pin number of the PCF and the pin number of the layer:

struct adresse {
PCF8574 pcf;
int pin;
int layer;
}

To simplify this problem consider just one PCF8574 with 8 LEDs, one connected to each output pin. With the following code

#include "adresse.h"
#include "PCF8574.h"
#include <Wire.h>

PCF8574 pcf1(0x20);

adresse led2 = {pcf1, 2, 1};

void setup() {
Serial.begin(9600);
for(int i =0; i<8;i++){
pcf1.pinMode(i, OUTPUT) ;
} 
pcf1.begin();
for(int i =0; i<8;i++){
pcf1.digitalWrite(i, HIGH) ; // turn all LEDs off
}
pcf1.digitalWrite(0, LOW) ; //blink first one 
delay(100);
pcf1.digitalWrite(0, HIGH) ;
delay(100);
} 

void loop() {
power(led2, LOW);
delay(50);
power(led2, HIGH);
delay(50);
}

With additional adresse.h file:

#include "PCF8574.h"

struct adresse {
PCF8574 pcf;
int pin;
int layer;
} 
//layer is not used here, because it's a shortened example
void power(adresse led, uint8_t state) {
led.pcf.digitalWrite(led.pin, state);
}

So my problem:
It is not a problem for me to control the different LEDs. So my first one blinks short and all are turned off after the setup.
The problem is the PCF as function parameter.
Starting the loop all LEDs are switched on and nothing else happens. In fact ALL even just led2 was commited to the power function.
The IDE is not throwing any errors.
I hope you have some suggestions on solving this problem.

Thanks in advance
BBQ-wue

I guess that in your struct adresse, pcf should be a pointer to an existing object of type PCF8574.

6v6gt:
I guess that in your struct adresse, pcf should be a pointer to an existing object of type PCF8574.

That might be the problem ...
And where should this pointer be added ?

Something like this:

struct adresse {
PCF8574 *pcf;   // *
int pin;
int layer;
} ;

but then:

PCF8574 pcf1(0x20);
adresse led2 = {&pcf1, 2, 1};  // &

and:

void power(adresse led, uint8_t state) {
	led.pcf->digitalWrite(led.pin, state);  //  ->
}

Thanks a lot 6v6gt.

That was such a great advice - and it is working great!

Thanks for improving my skills, too!

Kind regards!