Hi
I want to access the individual bits in the rcsta register by their names ie cren, and not by rcsta.4.
so I can say set bit/ clear bit "cren" by name.
Hope someone can help me with this as I have rephrased an earlier post to get a response.
Thanks
Dave
accessing individual bits in sfr's
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: accessing individual bits in sfr's
Hi Dave,
This should work,
set_bit(rcsta, CREN);
or
clear_bit(rcsta, CREN);
or
rcsta.CREN = 1;
or
rcsta.CREN = 0;
The rule in BoostC is lowercase register name and uppercase bit name.
This should work,
set_bit(rcsta, CREN);
or
clear_bit(rcsta, CREN);
or
rcsta.CREN = 1;
or
rcsta.CREN = 0;
The rule in BoostC is lowercase register name and uppercase bit name.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel