引用 14 楼 hao507 的回复:
引用 13 楼 veabol 的回复:
写的控制码添加到你的AP和BSP中,注意不要和系统已有的冲突就可以。系统用到的值在pkfuncs.h里
在ioctl_tab.h中是这样映射ioctl code和实现函数:
C/C++ code
{ IOCTL_HAL_RTC_QUERY,0, OALIoCtlHalRtcQuery },
{ IOCTL_HAL_RTC_ALARM,0, OALIoCtlHalRtcAlarm },
{ IOCTL_HAL_RTC_UPDATE,0, OALIoCtlHalRtcUpdate },
{ IOCTL_HAL_TRANSLATE_IRQ,0, OALIoCtlHalRequestSysIntr },
{ IOCTL_HAL_REQUEST_SYSINTR,0, OALIoCtlHalRequestSysIntr },
{ IOCTL_HAL_RELEASE_SYSINTR,0, OALIoCtlHalReleaseSysIntr },
{ IOCTL_HAL_REQUEST_IRQ,0, OALIoCtlHalRequestIrq },
{ IOCTL_HAL_IRQ2SYSINTR,0, OALIoCtlHalIrq2Sysintr },
{ IOCTL_HAL_ILTIMING,0, OALIoCtlHalILTiming },
{ IOCTL_HAL_INITREGISTRY,0, BSPIoCtlHalInitRegistry },
{ IOCTL_HAL_INIT_RTC,0, OALIoCtlHalInitRTC },
{ IOCTL_HAL_REBOOT,0, OALIoCtlHalReboot },
{ IOCTL_HAL_DDK_CALL,0, OALIoCtlHalDdkCall },
{ IOCTL_HAL_DISABLE_WAKE,0, OALIoCtlHalDisableWake },
{ IOCTL_HAL_ENABLE_WAKE,0, OALIoCtlHalEnableWake },
{ IOCTL_HAL_GET_WAKE_SOURCE,0, OALIoCtlHalGetWakeSource },
{ IOCTL_HAL_GET_CACHE_INFO,0, OALIoCtlHalGetCacheInfo },
{ IOCTL_HAL_GET_DEVICE_INFO,0, OALIoCtlHalGetDeviceInfo },
{ IOCTL_HAL_GET_DEVICEID,0, OALIoCtlHalGetDeviceId },
{ IOCTL_HAL_GET_UUID,0, OALIoCtlHalGetUUID },
.......
.......
这些都是系统的ioctl code,所以定义在pkfuncs.h中,不知道自定义的ioctl code定义在什么地方比较合适
以前一个bsp包里的。可以参考一下
///*** for secure block only
{ IOCTL_HAL_SET_UUID, 0, OALIoCtlSetUUID },
{ IOCTL_HAL_READ_SLOT, 0, OALIoCtlReadSlot },
{ IOCTL_HAL_WRITE_SLOT, 0, OALIoCtlWriteSlot },
复制代码