AnsweredAssumed Answered

Activation Level

Question asked by potgieter.mc on May 7, 2014
Latest reply on May 7, 2014 by potgieter.mc
I'm using the STM8L101F3 with IAR. I would like to set and clear the Activation level bit.
There is no library function to access this and I'm not sure how to access this register from code.

Looking at iostm8l101f3.h, the register and bit is defined:

/* Global configuration register */
#ifdef __IAR_SYSTEMS_ICC__
typedef struct
{
  unsigned char SWD         : 1;
  unsigned char AL          : 1;
} __BITS_CPU_CFG_GCR;
#endif
__IO_REG8_BIT(CPU_CFG_GCR, 0x7F60, __READ_WRITE, __BITS_CPU_CFG_GCR);

#define CPU_CFG_GCR_AL           CPU_CFG_GCR_bit.AL

But trying to modify the bit from code using:

CPU_CFG_GCR_AL = 1;

generates an error:  Error[Pe020]: identifier "CPU_CFG_GCR_AL" is undefined

How can I modify this bit?

Outcomes