Well, it's been a month and just retake the ADC and this is what I have.
I make work the ADC in other OS by just adding some memory directives to the file
in the core system. But here this appears to not work that way. Is there anything that can suguest to do?
This is an example of the way It's used to be in other OS to work.
Code: Select all
#define AD0_BASE_ADDR 0xE0034000
#define AD0CR (AD0_BASE_ADDR + 0x00)
#define AD0GDR (AD0_BASE_ADDR + 0x04)
#define AD0STAT (AD0_BASE_ADDR + 0x30)
#define AD0INTEN (AD0_BASE_ADDR + 0x0C)
#define AD0DR0 (AD0_BASE_ADDR + 0x10)
#define AD0DR1 (AD0_BASE_ADDR + 0x14)
#define AD0DR2 (AD0_BASE_ADDR + 0x18)
#define AD0DR3 (AD0_BASE_ADDR + 0x1C)
#define AD0DR4 (AD0_BASE_ADDR + 0x20)
#define AD0DR5 (AD0_BASE_ADDR + 0x24)
#define AD0DR6 (AD0_BASE_ADDR + 0x28)
#define AD0DR7 (AD0_BASE_ADDR + 0x2C)
or maybe like this:
Code: Select all
#define AD0_BASE_ADDR 0xE0034000
#define AD0CR (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x00))
#define AD0GDR (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x04))
#define AD0STAT (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x30))
#define AD0INTEN (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x0C))
#define AD0DR0 (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x10))
#define AD0DR1 (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x14))
#define AD0DR2 (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x18))
#define AD0DR3 (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x1C))
#define AD0DR4 (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x20))
#define AD0DR5 (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x24))
#define AD0DR6 (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x28))
#define AD0DR7 (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x2C))
and of course this is not my code, this was an header file that was in other OS and is kinda different from what I used to know...
The questions are:
How can I add memory directives that can be modifited like the
PINSEL0 or
PINSEL1 in the board.h file?
How can I make it simple?
Something that at the end will look like this:
Code: Select all
#define VAL_PINSEL0 0xCF05FF55
#define VAL_PINSEL1 0x15041800
#define VAL_PINSEL2 0x00000004
I know is going to be hard... but maybe someone can help...
Thanks for reading. Hope you can help.
