Пример #1
0

# initialize the ioctl constants
from pycopia.OS.Linux.IOCTL import _IO, _IOW, _IOR
# taken from /usr/include/linux/rtc.h
p = ord('p')
RTC_AIE_ON = _IO(p, 0x01)  # /* Alarm int. enable on     */
RTC_AIE_OFF = _IO(p, 0x02)  # /* ... off          */
RTC_UIE_ON = _IO(p, 0x03)  # /* Update int. enable on    */
RTC_UIE_OFF = _IO(p, 0x04)  # /* ... off          */
RTC_PIE_ON = _IO(p, 0x05)  # /* Periodic int. enable on  */
RTC_PIE_OFF = _IO(p, 0x06)  # /* ... off          */
RTC_WIE_ON = _IO(p, 0x0f)  #  /* Watchdog int. enable on */
RTC_WIE_OFF = _IO(p, 0x10)  #  /* ... off         */

RTC_ALM_SET = _IOW(p, 0x07, rtc_time.FMT)  # /* Set alarm time  */
RTC_ALM_READ = _IOR(p, 0x08, rtc_time.FMT)  # /* Read alarm time */
RTC_RD_TIME = _IOR(p, 0x09, rtc_time.FMT)  # /* Read RTC time   */
RTC_SET_TIME = _IOW(p, 0x0a, rtc_time.FMT)  # /* Set RTC time    */
RTC_IRQP_READ = _IOR(p, 0x0b, "L")  #    /* Read IRQ rate   */
RTC_IRQP_SET = _IOW(p, 0x0c, "L")  #   /* Set IRQ rate    */
RTC_EPOCH_READ = _IOR(p, 0x0d, "L")  #   /* Read epoch      */
RTC_EPOCH_SET = _IOW(p, 0x0e, "L")  #   /* Set epoch       */

RTC_WKALM_SET = _IOW(p, 0x0f, rtc_wkalrm.FMT)  #/* Set wakeup alarm*/
RTC_WKALM_RD = _IOR(p, 0x10, rtc_wkalrm.FMT)  #/* Get wakeup alarm*/
# no longer needed
del _IO, _IOW, _IOR

if __name__ == "__main__":
Пример #2
0
INT = "i"
INT2 = "ii"
INT5 = "iiiii"
SHORT = "h"
USHORT = "H"
SHORT4 = "hhhh"

# Initialize the ioctl constants
from pycopia.OS.Linux.IOCTL import _IOC, _IO, _IOW, _IOR, _IOC_READ
# taken from /usr/include/linux/input.h

EVIOCGVERSION = _IOR(69, 0x01, INT)  # get driver version */
EVIOCGID = _IOR(69, 0x02, SHORT4)  # get device ID */
EVIOCGREP = _IOR(69, 0x03, INT2)  # get repeat settings */
EVIOCSREP = _IOW(69, 0x03, INT2)  # set repeat settings */
EVIOCGKEYCODE = _IOR(69, 0x04, INT2)  # get keycode */
EVIOCSKEYCODE = _IOW(69, 0x04, INT2)  # set keycode */
EVIOCGKEY = _IOR(69, 0x05, INT2)  # get key value */
EVIOCGNAME = _IOC(_IOC_READ, 69, 0x06, 255)  # get device name */
EVIOCRMFF = _IOW(69, 0x81, INT)  # Erase a force effect */
EVIOCSGAIN = _IOW(69, 0x82, USHORT)  # Set overall gain */
EVIOCSAUTOCENTER = _IOW(69, 0x83,
                        USHORT)  # Enable or disable auto-centering */
EVIOCGEFFECTS = _IOR(
    69, 0x84, INT)  # Report number of effects playable at the same time */

# XXX
#EVIOCGBIT(ev,len)= _IOC(_IOC_READ, 69, 0x20 + ev, len) # get event bits */
#EVIOCGABS(abs) = _IOR(69, 0x40 + abs, "iiiii")     # get abs value/limits */
#EVIOCSFF       = _IOC(_IOC_WRITE, 69, 0x80, sizeof(struct ff_effect))  # send a force effect to a force feedback device */
Пример #3
0
INT = "i"
INT2 = "ii"
INT5 = "iiiii"
SHORT = "h"
USHORT = "H"
SHORT4 = "hhhh"

# Initialize the ioctl constants
from pycopia.OS.Linux.IOCTL import _IOC, _IO, _IOW, _IOR, _IOC_READ
# taken from /usr/include/linux/input.h

EVIOCGVERSION   = _IOR(69, 0x01, INT)           # get driver version */
EVIOCGID        = _IOR(69, 0x02, SHORT4)        # get device ID */
EVIOCGREP       = _IOR(69, 0x03, INT2)          # get repeat settings */
EVIOCSREP       = _IOW(69, 0x03, INT2)          # set repeat settings */
EVIOCGKEYCODE   = _IOR(69, 0x04, INT2)          # get keycode */
EVIOCSKEYCODE   = _IOW(69, 0x04, INT2)          # set keycode */
EVIOCGKEY       = _IOR(69, 0x05, INT2)          # get key value */
EVIOCGNAME      = _IOC(_IOC_READ, 69, 0x06, 255)# get device name */
EVIOCRMFF       = _IOW(69, 0x81, INT)           # Erase a force effect */
EVIOCSGAIN      = _IOW(69, 0x82, USHORT)        # Set overall gain */
EVIOCSAUTOCENTER= _IOW(69, 0x83, USHORT)        # Enable or disable auto-centering */
EVIOCGEFFECTS   = _IOR(69, 0x84, INT)           # Report number of effects playable at the same time */
# XXX
#EVIOCGBIT(ev,len)= _IOC(_IOC_READ, 69, 0x20 + ev, len) # get event bits */
#EVIOCGABS(abs) = _IOR(69, 0x40 + abs, "iiiii")     # get abs value/limits */
#EVIOCSFF       = _IOC(_IOC_WRITE, 69, 0x80, sizeof(struct ff_effect))  # send a force effect to a force feedback device */

# these take parameters.
def EVIOCGBIT(ev, len):
Пример #4
0

# initialize the ioctl constants
from pycopia.OS.Linux.IOCTL import _IO, _IOW, _IOR
# taken from /usr/include/linux/rtc.h
p = ord('p')
RTC_AIE_ON  = _IO(p, 0x01)# /* Alarm int. enable on     */
RTC_AIE_OFF = _IO(p, 0x02)# /* ... off          */
RTC_UIE_ON  = _IO(p, 0x03)# /* Update int. enable on    */
RTC_UIE_OFF = _IO(p, 0x04)# /* ... off          */
RTC_PIE_ON  = _IO(p, 0x05)# /* Periodic int. enable on  */
RTC_PIE_OFF = _IO(p, 0x06)# /* ... off          */
RTC_WIE_ON  = _IO(p, 0x0f)#  /* Watchdog int. enable on */
RTC_WIE_OFF = _IO(p, 0x10)#  /* ... off         */

RTC_ALM_SET = _IOW(p, 0x07, rtc_time.FMT)# /* Set alarm time  */
RTC_ALM_READ    = _IOR(p, 0x08, rtc_time.FMT)# /* Read alarm time */
RTC_RD_TIME = _IOR(p, 0x09, rtc_time.FMT)# /* Read RTC time   */
RTC_SET_TIME    = _IOW(p, 0x0a, rtc_time.FMT)# /* Set RTC time    */
RTC_IRQP_READ   = _IOR(p, 0x0b, "L")#    /* Read IRQ rate   */
RTC_IRQP_SET    = _IOW(p, 0x0c, "L" )#   /* Set IRQ rate    */
RTC_EPOCH_READ  = _IOR(p, 0x0d, "L" )#   /* Read epoch      */
RTC_EPOCH_SET   = _IOW(p, 0x0e, "L" )#   /* Set epoch       */

RTC_WKALM_SET   = _IOW(p, 0x0f, rtc_wkalrm.FMT)#/* Set wakeup alarm*/
RTC_WKALM_RD    = _IOR(p, 0x10, rtc_wkalrm.FMT)#/* Get wakeup alarm*/
# no longer needed
del _IO, _IOW, _IOR

if __name__ == "__main__":