|
WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
|

结构体 | |
| struct | LosDeviceRegs |
| struct | LosDeviceConfig |
| struct | LosDevice |
| struct | LosPowerMgrOps |
| struct | LosDriverOps |
| struct | LosDriver |
函数 | |
| UINT32 | LOS_DriverRegister (struct LosDriver *drv) |
| register a new driver to the system. | |
| UINT32 | LOS_DriverUnregister (struct LosDriver *drv) |
| unregister a driver from the system. | |
| UINT32 | LOS_DeviceRegister (struct LosDevice *dev) |
| register a new device to the system. | |
| void | LOS_DeviceUnregister (struct LosDevice *dev) |
| unregister a device from the system. | |
| VOID * | LOS_DeviceDataGet (const struct LosDevice *dev) |
| get data form a device. | |
| UINTPTR | LOS_DeviceRegBaseGet (const struct LosDevice *dev, UINT32 index) |
| get register base address form a device. | |
| UINTPTR | LOS_DeviceRegSizeGet (const struct LosDevice *dev, UINT32 index) |
| get register size form a device. | |
| UINTPTR | LOS_DeviceIrqNumGet (const struct LosDevice *dev) |
| get interrupt number form a device. | |
| INT32 | LOS_PmSuspend (VOID) |
| suspend all devices in preparedList. | |
| VOID | LOS_PmResume (VOID) |
| resume all devices in suspendedList. | |
| #define LOS_ERRNO_DRIVER_DEVICE_BOUNDED LOS_ERRNO_OS_ERROR(LOS_MOD_DRIVER, 0x30) |
Task error code: Device already attach to driver.
Value: 0x02004130
Solution: Check the Input.
| #define LOS_ERRNO_DRIVER_DEVICE_BUSY LOS_ERRNO_OS_ERROR(LOS_MOD_DRIVER, 0x33) |
Task error code: Device busy.
Value: 0x02004133
Solution: Check the Input.
| #define LOS_ERRNO_DRIVER_DEVICE_INITIALFAIL LOS_ERRNO_OS_ERROR(LOS_MOD_DRIVER, 0x31) |
Task error code: Invalid input.
Value: 0x02004131
Solution: Check the Input.
| #define LOS_ERRNO_DRIVER_DEVICE_REGISTERED LOS_ERRNO_OS_ERROR(LOS_MOD_DRIVER, 0x32) |
Task error code: Device register twice.
Value: 0x02004132
Solution: Check the Input.
| #define LOS_ERRNO_DRIVER_DRIVER_MATCH_FAIL LOS_ERRNO_OS_ERROR(LOS_MOD_DRIVER, 0x20) |
Task error code: Do match function failed.
Value: 0x02004120
Solution: This error code is not in use temporarily.
| #define LOS_ERRNO_DRIVER_DRIVER_NOTFOUND LOS_ERRNO_OS_ERROR(LOS_MOD_DRIVER, 0x23) |
Task error code: Invalid input.
Value: 0x02004123
Solution: Check the Input.
| #define LOS_ERRNO_DRIVER_DRIVER_PROBE_FAIL LOS_ERRNO_OS_ERROR(LOS_MOD_DRIVER, 0x21) |
Task error code: Do probe function failed.
Value: 0x02004121
Solution: This error code is not in use temporarily.
| #define LOS_ERRNO_DRIVER_DRIVER_REGISTERED LOS_ERRNO_OS_ERROR(LOS_MOD_DRIVER, 0x22) |
Task error code: driver register twice.
Value: 0x02004122
Solution: Check the Input.
| #define LOS_ERRNO_DRIVER_INPUT_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_DRIVER, 0x10) |
Task error code: Invalid input.
Value: 0x02004110
Solution: Check the Input.
| #define LOS_ERRNO_DRIVER_MUX_FAIL LOS_ERRNO_OS_ERROR(LOS_MOD_DRIVER, 0x11) |
Task error code: Mutex failed.
Value: 0x02004111
Solution: Check the Input.
| #define LOS_FOREACH_DEVICE | ( | device | ) | LOS_FOREACH_DEVICE_HOOK(device, NULL) |
iterate over a device list.
| device | [IN] Pointer to the structure that contains the doubly linked list that is to be traversed. |
| None. |
| #define LOS_FOREACH_DEVICE_BY_DRIVER | ( | device, | |
| driver | |||
| ) | LOS_FOREACH_DEVICE_LIST_HOOK(device, &(driver)->deviceList, NULL) |
iterate over a driver's deviceList.
| device | [IN] Pointer to the structure that contains the doubly linked list that is to be traversed. |
| driver | [IN] Pointer to the structure that contains deviceList to be traversed. |
| None. |
| #define LOS_FOREACH_DEVICE_HOOK | ( | device, | |
| hook | |||
| ) | LOS_DL_LIST_FOR_EACH_ENTRY_HOOK(device, &g_deviceList, struct LosDevice, deviceItem, hook) |
iterate over g_deviceList and execute hook function.
| device | [IN] Pointer to the structure that contains the doubly linked list that is to be traversed. |
| hook | [IN] Hook function. |
| None. |
| #define LOS_FOREACH_DEVICE_LIST_HOOK | ( | device, | |
| list, | |||
| hook | |||
| ) | LOS_DL_LIST_FOR_EACH_ENTRY_HOOK(device, list, struct LosDevice, driverNode, hook) |
iterate over a device list and execute hook function.
| device | [IN] Pointer to the structure that contains the doubly linked list that is to be traversed. |
| list | [IN] Pointer to the doubly linked list to be traversed. |
| hook | [IN] Hook function. |
| None. |
get data form a device.
| dev | [IN]A pointer to device.dev/dev->name can not be NULL. |
| #VOID* | the data of the device. |
get interrupt number form a device.
| dev | [IN]A pointer to device.dev/dev->name can not be NULL. |
| UINTPTR | the interrupt number of the device. |
get register base address form a device.
| dev | [IN]A pointer to device.dev/dev->name can not be NULL. |
| index | [IN]The number of which reg base to get. |
| UINTPTR | the register base address of the device. |
register a new device to the system.
| dev | [IN]A pointer to device. |
| LOS_ERRNO_DRIVER_INPUT_INVALID | Invalid input.dev/dev->name can not be NULL. |
| LOS_ERRNO_DRIVER_DEVICE_REGISTERED | Device register twice. |
| LOS_OK | The device register success. |
get register size form a device.
| dev | [IN]A pointer to device.dev/dev->name can not be NULL. |
| index | [IN]The number of which reg size to get. |
| UINTPTR | the register size of the device. |
| void LOS_DeviceUnregister | ( | struct LosDevice * | dev | ) |
unregister a device from the system.
| dev | [IN]A pointer to device.dev/dev->name can not be NULL. |
register a new driver to the system.
| drv | [IN]A pointer to LosDriver. |
| LOS_ERRNO_DRIVER_INPUT_INVALID | Invalid input.drv/drv->name can not be NULL. |
| LOS_ERRNO_DRIVER_DRIVER_REGISTERED | Invalid input.drv node register twice. |
| LOS_ERRNO_DRIVER_MUX_FAIL | Mux create failed. |
| LOS_OK | The driver register success. |
unregister a driver from the system.
| drv | [IN]A pointer to device_driver.drv/drv->name can not be NULL. |
| LOS_ERRNO_DRIVER_INPUT_INVALID | Invalid input.drv and drv.driver->name can not be NULL. |
| LOS_ERRNO_DRIVER_DRIVER_NOTFOUND | Driver not found. |
| LOS_ERRNO_DRIVER_DEVICE_BUSY | Device busy. |
| LOS_OK | The driver unregister success. |
resume all devices in suspendedList.
| VOID. |
| #VOID. |
suspend all devices in preparedList.
| VOID. |
| #VOID. |