PxRegisterSetMask()
Write all bits of value to a SFR register according to the mask.
- APPLIES TO
- 
8.2.0 
- SYNOPSIS
- 
PxError_t PxRegisterSetMask (volatile PxULong_t *addr, PxULong_t mask, PxULong_t val);
- ARGUMENTS
| 
 | |
| 
 | |
| 
 | 
- RETURN VALUES
- 
- 
PXROS error code 
 
- 
- ERROR CODES
- 
PXERR_ACCESS_RIGHTThe task has not the right to access peripheral registers PXERR_PROT_ILL_REGIONaddris not within additional protection region
- DESCRIPTION
- 
PxRegisterSetMasksets the bits described in mask of the peripheral registeraddrto val if the calling task has write access right to this special function register. It should only be used from tasks (not handlers).The peripheral register addrmust be covered in the additional protection region table passed in the element ts_protect_region ofPxTaskSpec_tduringPxTaskCreate.
- IMPLEMENTATION GUIDELINES
- 
- Before call
- 
- 
addrhas to be a valid pointer to a special function register (V).
 
- 
 - After call
- 
- 
The function returns PXERR_NOERRORif the register could be modified. Any other return value describes an error, which has to be interpreted (C).
 
- 
 - Best Practice
- 
- 
The peripheral register addrmust be covered in the additional protection region table passed in the elementts_protect_regionofPxTaskSpec_tduringPxTaskCreate.
 
- 
 
- USAGE
- 
#include "pxdef.h" PxError_t error = PxRegisterSetMask(addr, mask, val); if (error != PXERR_NOERROR) { // Report error }