My bad
I forgot to controle the CS pin
controller = GpioController.GetDefault();
var cs = controller.OpenPin(5, GpioSharingMode.Exclusive);
cs.SetDriveMode(GpioPinDriveMode.Output);
cs.Write(GpioPinValue.High);
public void writeRegister8(byte addr, byte data)
{
cs.Write(GpioPinValue.Low);
Console.WriteLine($"Write at adress {addr}: {data}");
addr |= 0x80; // make sure top bit is set
addr &= 0xFF;
byte[] buffer = { addr, data };
spi_dev.Write(buffer);
cs.Write(GpioPinValue.High);
}