Intel® FPGA University Program
University Program Material, Education Boards, and Laboratory Exercises
1175 Discussions

How to use PS/2 mouse in DE1 on NIOS II and UP Cores

Honored Contributor II


I'm trying to use the library "altera_up_ps2_mouse.h" to use a ps2 mouse on a DE1 board. I can not find any example about how to use this library. 

In the project I'm realizing, I would use the mouse to move a pointer on the screen (through VGA). 

Does anyone have any example or resource to suggest? 


To initialize the ps2 device and read the data, I try to do like follow: 


alt_up_ps2_dev * ps2_dev; ps2_dev = alt_up_ps2_open_dev("/dev/ps2"); alt_up_ps2_clear_fifo(ps2_dev); alt_up_ps2_init(ps2_dev); unsigned char byte1, byte2, byte3; while(1){ alt_up_ps2_read_data_byte(ps2_dev, byte1);//read 1 byte alt_up_ps2_read_data_byte(ps2_dev, byte2); alt_up_ps2_read_data_byte(ps2_dev, byte3); }
0 Kudos
0 Replies