How to initialize the value of a union struct?

I have this struct to easily access the bits of a byte

typedef union
 {
  uint8_t vbyte;
  struct
   {
    uint8_t b0:1;
    uint8_t b1:1;
    uint8_t b2:1;
    uint8_t b3:1;
    uint8_t b4:1;
    uint8_t b5:1;
    uint8_t b6:1;
    uint8_t b7:1;
   };
 } byte_bits;

I need to declare and initialize the value of the variable to 0xFF.

The compile is OK with

static byte_bits long_press_ack;

But the compiler does not like

static byte_bits long_press_ack.vbyte = 0xFF;

I can't believe google can't find a declaration for this. This must be possible.

static byte_bits long_press_ack.vbyte = 0xFF;

Whereabouts in the program are you doing this ?

In a subroutine, hence the static.

void scan_buttons()
 {
  static byte_bits long_press_ack;
...
 }

Even as a global (without the static), it doesn't like

byte_bits long_press_ack.vbyte = 0xFF;

The struct in the union has no name, and you probably need to:

static byte_bits long_press_ack = { 0xFF };

This seems to work:

typedef union
 {
  uint8_t vbyte;
  struct
   {
    uint8_t b0:1;
    uint8_t b1:1;
    uint8_t b2:1;
    uint8_t b3:1;
    uint8_t b4:1;
    uint8_t b5:1;
    uint8_t b6:1;
    uint8_t b7:1;
   }Bits;
 } byte_bits;

    
void setup() 
{
  // put your setup code here, to run once:
    Serial.begin(9600);
    while(!Serial);  
  
}//setup

void loop() {
    // put your main code here, to run repeatedly:
    foo();
    delay(500);
}//loop

void foo( void )
{
    static byte_bits
        long_press_ack = 
        {
            .vbyte = 0xa5
        }; 
    
    Serial.println( long_press_ack.vbyte,HEX );
    Serial.print( long_press_ack.Bits.b7 );
    Serial.print( long_press_ack.Bits.b6 );
    Serial.print( long_press_ack.Bits.b5 );
    Serial.print( long_press_ack.Bits.b4 );
    Serial.print( long_press_ack.Bits.b3 );
    Serial.print( long_press_ack.Bits.b2 );
    Serial.print( long_press_ack.Bits.b1 );
    Serial.println( long_press_ack.Bits.b0 );

}//foo