I am porting c code of a firmware to c# and not sure how this keyword
"sbit"
can be written in c#. Thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
link @Ben Robinson,
“(…)With typical 8051 applications, it is often necessary to access individual bits within an SFR. The sbit type provides access to bit-addressable SFRs and other bit-addressable objects. For example:
This declaration defines EA as the SFR bit at address 0xAF. On the 8051, this is the enable all bit in the interrupt enable register.(…)”.
This too low level, you might try to use c++.net, for that matter. C# is a high level language, using pointers can be a little tricky, it can be done, but escapes from c# real intent.
You could use c++.net made functions, as the final code of both is the same [clr (Common Language Run-Time)], the machine will not note the diference.