This PlatformIO-internal information is not exposed in a macro by default and would need an extraScripts to work, see e.g. Inject Board Name into Code. That’s why the extraFlags in the board definition usually contains one macro unique to the board variant, say -DNUVOTON_N76E003.