Flash write example? or low power mode alternative

My application reads 2 bit rotary encoders and continually computes a simulated absolute position, which then gets sent to a second wixel, which in turn will drive some digital potentiometers. These potentiometers will be used to control things like audio volume, so it would be of obvious advantage to ensure the last digital counts be saved and applied on power up.

So I would like to explore the option of occasionally writing to flash from within the program. I’m still a newbie at the CC2510, so I’d be much obliged if anyone who has already does something like this could share their code.

in the mean time, I guess I could use low power mode as an alternative to a complete power down.