Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

C6748 LCDK- How to access registers in C?

$
0
0

Hello.

I have C6748 LCDK and I want to learn some basics. First I wish to control led´s. 

I want to switch off the led D4.

I found in manual, that D4 is connected with processor via GPIO6[13].

To switch off D4 I need to programm registers: DIR67 and CLR_DATA67, that have following adresses: 0x01E26088, 0x01E26094.

I tried to access to this registers via pointers, but I´m a C beginner and my code doesn´t work. The error message  was:

#515 a value of type "unsigned int" cannot be assigned to an entity of type "unsigned int *"

please have a look on my code and correct it. 

The errors appear in red rows.

/*
 * main.c
 */
// LED D4 is connected to GPIO6[13], it is default on. I wish to switch it off.
#define DIR67            ((unsigned int)0x01E26088) // GPIO register for banks 6 and 7, which determines I/O character of pins
#define CLR_DATA67       ((unsigned int)0x01E26094) // GPIO register for banks 6 and 7, which sets chosen pins to low

unsigned int *pDIR67;
unsigned int *pCLR_DATA67;

void main() {
pDIR67=(unsigned int)0x01E26088;
*pDIR67=*pDIR67&0xFFFFEFFF; //GPIO6[13] is set to be output
pCLR_DATA67=(unsigned int)0x01E26094;
*pCLR_DATA67=*pCLR_DATA67|0x00001000;//GPIO6[13] is set low
}


Thank you.

Petr Duga


Viewing all articles
Browse latest Browse all 17527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>