2020-03-27 08:58 AM
I'm using ST Visual Developer with Cosmic-C compiler.
Writing code for STM8S903K3.
Making a pointer to get the value from a SPR register, ADC_DRH:
uint8_t *pv;
pv = *0x005404;
I keep getting the errors;
#error cpstm8 main.c:85(8+8) invalid indirection operand
#error cpstm8 main.c:86(1+7) misplaced local declaration
Don't know what I'm doing wrong.
2020-03-27 05:53 PM
STVD hasn't provided the register definitions? Code'll never be pretty if you're poking memory like this. But if you insist...
volatile uint8_t *pv = (uint8_t *)0x005404;
*pv = <whatever you want to write>;