/* address declaration */
#define io_P2 (*(volatile unsigned short *) 0x00800200)
/* access to each bit (write 0 to extra bit) */
#define SET_P2_B5(x) (io_P2=(io_P2 & 0x03DF)|(x)<<5)
#define SET_P2_B8(x) (io_P2=(io_P2 & 0x02FF)|(x)<<8)
/* example function for accessing bit field with macro */
void
foo2()
{
/* write 0 to bit No. 8 */
SET_P2_B8(0);
/* write 0 to bit No. 5 */
SET_P2_B5(0);
}
[Reference]
CC32R does not generate a code for accessing the bit field with a specific size (half-word, etc.). It automatically accesses the bit
field with the minimum size.
Top of Page | Back to Previous Page
Terms of Use Privacy Policy
(C)2004 Renesas Technology Corp., All Rights Reserved.
Comentarios a estos manuales