Click here to Skip to main content
15,891,607 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Memory aligned bit fields Pin
Trevor Johansen25-Sep-10 11:15
Trevor Johansen25-Sep-10 11:15 
AnswerRe: Memory aligned bit fields Pin
Luc Pattyn25-Sep-10 8:55
sitebuilderLuc Pattyn25-Sep-10 8:55 
GeneralRe: Memory aligned bit fields Pin
Trevor Johansen25-Sep-10 9:34
Trevor Johansen25-Sep-10 9:34 
GeneralRe: Memory aligned bit fields Pin
Luc Pattyn25-Sep-10 9:45
sitebuilderLuc Pattyn25-Sep-10 9:45 
GeneralRe: Memory aligned bit fields Pin
Trevor Johansen25-Sep-10 10:57
Trevor Johansen25-Sep-10 10:57 
AnswerRe: Memory aligned bit fields Pin
Luc Pattyn25-Sep-10 11:18
sitebuilderLuc Pattyn25-Sep-10 11:18 
GeneralRe: Memory aligned bit fields Pin
Trevor Johansen25-Sep-10 11:56
Trevor Johansen25-Sep-10 11:56 
GeneralRe: Memory aligned bit fields Pin
Luc Pattyn25-Sep-10 12:14
sitebuilderLuc Pattyn25-Sep-10 12:14 
1. one can write a header file that contains:
- register addresses (relative to some base address);
- bit numbers, bit masks, bitfield masks
- structs, unions, typedefs
these are pretty much independent of the actual compiler.

2.
you can write executable code that manipulates the registers, based on such header files, AND on some assumptions about the compiler and micro-processor. Most often a vendor offers a free development environment (IDE, compiler, ...), header files and executable code, all working together. There is no guarantee that source code files (other than header files) will work well on another compiler, let alone another micro-processor + compiler combination.

3.
if you're lucky, the peripherals won't have nasty characteristics like the ones I described. Older ones typically do, as they tried to cram all functionality in a small number of (narrow) registers. Newer devices tend to have more registers, wider registers, and several unused bits, alleviating the need for design tricks.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.


GeneralRe: Memory aligned bit fields Pin
Alain Rist25-Sep-10 9:57
Alain Rist25-Sep-10 9:57 
GeneralRe: Memory aligned bit fields Pin
Aescleal25-Sep-10 10:19
Aescleal25-Sep-10 10:19 
AnswerRe: Memory aligned bit fields Pin
Alain Rist25-Sep-10 11:26
Alain Rist25-Sep-10 11:26 
GeneralRe: Memory aligned bit fields Pin
Aescleal25-Sep-10 22:31
Aescleal25-Sep-10 22:31 
GeneralRe: Memory aligned bit fields Pin
Trevor Johansen25-Sep-10 10:51
Trevor Johansen25-Sep-10 10:51 
GeneralRe: Memory aligned bit fields Pin
Aescleal25-Sep-10 22:34
Aescleal25-Sep-10 22:34 
QuestionDirectX - Antialiasing and Plotting Pixels Query [Moved] Pin
simon alec smith24-Sep-10 9:52
simon alec smith24-Sep-10 9:52 
QuestionHow to process multiple commands on CAccessor. Pin
Spawn@Melmac24-Sep-10 8:36
Spawn@Melmac24-Sep-10 8:36 
QuestionGetHeaderCtrl returns null Pin
genush24-Sep-10 6:09
genush24-Sep-10 6:09 
AnswerRe: GetHeaderCtrl returns null Pin
genush24-Sep-10 7:39
genush24-Sep-10 7:39 
QuestionPop sound at the end of playing .wav audio Pin
Danzy8324-Sep-10 2:34
Danzy8324-Sep-10 2:34 
AnswerRe: Pop sound at the end of playing .wav audio Pin
Code-o-mat24-Sep-10 3:03
Code-o-mat24-Sep-10 3:03 
GeneralRe: Pop sound at the end of playing .wav audio Pin
Danzy8324-Sep-10 3:11
Danzy8324-Sep-10 3:11 
GeneralRe: Pop sound at the end of playing .wav audio [modified] Pin
Code-o-mat24-Sep-10 4:43
Code-o-mat24-Sep-10 4:43 
QuestionDelete a View Pin
john563224-Sep-10 1:24
john563224-Sep-10 1:24 
AnswerRe: Delete a View Pin
Eugen Podsypalnikov24-Sep-10 2:29
Eugen Podsypalnikov24-Sep-10 2:29 
GeneralRe: Delete a View Pin
john563224-Sep-10 4:48
john563224-Sep-10 4:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.