Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Write in I/O ports

Altera_Forum
Honored Contributor II
1,007 Views

Hello, I want to write from my aplication in eCos only a bit, or led in the I/O ports in Nios II for mesure the timing latency. Can someone help me please? I don't know do this, and I don't find any documentation about. 

 

Thanks, Guillem
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
279 Views

For my test I use : 

# include <cyg/hal/io.h> 

 

unsigned char ledpio;  

 

myfunct() { 

IOWR(LED_PIO_BASE,0, 1); // 1 for bit 0 

................. 

IOWR(LED_PIO_BASE,0, 0); 

// or 

ledpio = ledpio|4; // 4 for bit 2 

IOWR_8DIRECT(LED_PIO_BASE , 0, ledpio); 

.............. 

ledpio = ledpio&~4;  

IOWR_8DIRECT(LED_PIO_BASE , 0, ledpio); 

 

LED_PIO_BASE is defined in cyg/hal/system.h for my project
0 Kudos
Reply