28.2.74 __builtin_write_PWMSFR
Description
Writes the PWM unlock sequence to the SFR pointed to by PWM_KEY
and then writes value
to the SFR pointed to by
PWM_sfr
Prototype
void __builtin_write_PWMSFR(volatile unsigned int *PWM_sfr,
unsigned int value, volatile unsigned int *PWM_KEY);
Argument
PWM_sfr
– register to be written
value
– value to write
PWM_KEY
– hardware unlock key location
Return Value
None
Assembler Operator/ Machine Instruction
mov #PWM_KEY, w3
mov #value, w2
mov #0x4321, w1
mov #0xABCD, w0
mov w1,[w3]
mov w0,[w3]
mov w2,[w3]
Error Messages
None
Examples
Example 1:
__builtin_write_PWMSFR(&PWM1CON1, 0x123, &PWM1KEY);
Example 2:
__builtin_write_PWMSFR(&P1FLTACON, 0x123, &PWMKEY);
The choice of PWM_KEY
may depend upon architecture.