How to access IO port in QT?



  • Hello everyone
    does anyone know how to access I/O port in QT?
    ex: RTC CMOS have IO port 0x70,0x71
    serial port have IO 0x3F8,0x2F8....
    we have some device that need to access by this operation
    is there any function or lib could access I/O directly?


  • Qt Champions 2017

    Hi @HaCoMaTaTa,

    about which platform and operating system are you talking?

    Direct port access was done in MS-DOS times. All modern operating systems provides and API for that.

    To access serial ports you can use QSerialPort.

    Regards



  • Hi @aha_1980
    hi
    thanks for your reply
    i use QT in windows platform,
    i need direct port access in QT to control my hardware device,
    is there any direct port access method tutorial?
    or it need include extra library such as winio to done that?


  • Qt Champions 2017

    Hi @HaCoMaTaTa,

    There is no direct port access possible in all Windows NT related versions (Windows NT, XP, Vista, 7, 8, 10).

    It was possible in the MS-DOS based Windows versions (3.1, 95, 98, ME). You can google for that.

    Regards



  • hi @aha_1980

    if it don't have direct method to access, is there any indirect port access method on QT?
    or we only could use 3 party library such as WINIO library


  • Qt Champions 2017

    Hi @HaCoMaTaTa,

    there is no integrated support for accessing hardware ports in Qt. You will need external libraries (with appropriate Kernel driver).

    You didn't say what you want to do with the RS-232 ports. QSerialPort also provides functions to set some of the control pins. Maybe that's already enough for you.

    Regards



  • Hi @aha_1980

    thanks for your reply
    Serial port is not my purpose, i want create an UI interface to access hardware register , so it need to access many type of device such as SuperIO (use io port 0x2e 0x2f...), DIO through smbus (io port 0xf040..), or Embeded Controller (EC), even my custom io information in memory IO,


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.