Is using the vendors libary with bitfields for mapping register a good idea?

Announcements

Webinar: Integrated solutions for smaller, simpler low-voltage motor control design.
Join the webinar to experience!

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
FranCruzarianic
Level 1
Level 1
10 sign-ins 5 questions asked 5 sign-ins

For the TLE985x Infineon uses bitfields to map the registers in their library. Since I'm am kind of new to embedded programming, I read about bitfields. Many of the articles mentiond bad effects of bitfield. Now the question is, when bitfields are somehow bad, why is Infineon using it in their library?

Thank you for your help

0 Likes
1 Solution
RupakC
Moderator
Moderator
Moderator
100 solutions authored 250 sign-ins 25 likes received

Hello @FranCruzarianic 

The use of bitfields in controllers is a standard practice and is used extensively in the industry. Such a method is user friendly and simple to use. However, if you wish, you may use other methods to perform the same operation. 

Thanks and regards

RupakC

View solution in original post

0 Likes
1 Reply
RupakC
Moderator
Moderator
Moderator
100 solutions authored 250 sign-ins 25 likes received

Hello @FranCruzarianic 

The use of bitfields in controllers is a standard practice and is used extensively in the industry. Such a method is user friendly and simple to use. However, if you wish, you may use other methods to perform the same operation. 

Thanks and regards

RupakC
0 Likes