Home
last modified time | relevance | path

Searched full:device (Results 1 – 25 of 480) sorted by relevance

12345678910>>...20

/nrf52832-nimble/rt-thread/components/drivers/spi/
H A Dspi_core.c12 * Added take/release SPI device/bus interface.
43 rt_err_t rt_spi_bus_attach_device(struct rt_spi_device *device, in rt_spi_bus_attach_device() argument
55 device->bus = (struct rt_spi_bus *)bus; in rt_spi_bus_attach_device()
57 /* initialize spidev device */ in rt_spi_bus_attach_device()
58 result = rt_spidev_device_init(device, name); in rt_spi_bus_attach_device()
62 rt_memset(&device->config, 0, sizeof(device->config)); in rt_spi_bus_attach_device()
63 device->parent.user_data = user_data; in rt_spi_bus_attach_device()
72 rt_err_t rt_spi_configure(struct rt_spi_device *device, in rt_spi_configure() argument
77 RT_ASSERT(device != RT_NULL); in rt_spi_configure()
80 device->config.data_width = cfg->data_width; in rt_spi_configure()
[all …]
H A Dspi_dev.c13 /* SPI bus device interface, compatible with RT-Thread 0.3.x/1.0.x */
49 case 0: /* set device */ in _spi_bus_device_control()
72 struct rt_device *device; in rt_spi_bus_device_init() local
75 device = &bus->parent; in rt_spi_bus_device_init()
77 /* set device type */ in rt_spi_bus_device_init()
78 device->type = RT_Device_Class_SPIBUS; in rt_spi_bus_device_init()
79 /* initialize device interface */ in rt_spi_bus_device_init()
81 device->ops = &spi_bus_ops; in rt_spi_bus_device_init()
83 device->init = RT_NULL; in rt_spi_bus_device_init()
84 device->open = RT_NULL; in rt_spi_bus_device_init()
[all …]
H A Dspi_flash_w25qxx_mtd.c30 /* JEDEC Device ID: Memory type and Capacity */
65 static void w25qxx_lock(struct rt_mtd_nor_device *device) in w25qxx_lock() argument
67 struct spi_flash_mtd *mtd = (struct spi_flash_mtd *)device; in w25qxx_lock()
71 static void w25qxx_unlock(struct rt_mtd_nor_device *device) in w25qxx_unlock() argument
73 struct spi_flash_mtd *mtd = (struct spi_flash_mtd *)device; in w25qxx_unlock()
77 static rt_uint8_t w25qxx_read_status(struct rt_mtd_nor_device *device) in w25qxx_read_status() argument
79 struct spi_flash_mtd *mtd = (struct spi_flash_mtd *)device; in w25qxx_read_status()
83 static void w25qxx_wait_busy(struct rt_mtd_nor_device *device) in w25qxx_wait_busy() argument
85 while( w25qxx_read_status(device) & (0x01)); in w25qxx_wait_busy()
88 static rt_err_t w25qxx_read_id(struct rt_mtd_nor_device *device) in w25qxx_read_id() argument
[all …]
H A Dqspi_core.c13 rt_err_t rt_qspi_configure(struct rt_qspi_device *device, struct rt_qspi_configuration *cfg) in rt_qspi_configure() argument
15 RT_ASSERT(device != RT_NULL); in rt_qspi_configure()
18 struct rt_qspi_device *qspi_device = (struct rt_qspi_device *)device; in rt_qspi_configure()
30 result = rt_spi_configure(&device->parent, &cfg->parent); in rt_qspi_configure()
49 rt_size_t rt_qspi_transfer_message(struct rt_qspi_device *device, struct rt_qspi_message *message) in rt_qspi_transfer_message() argument
53 RT_ASSERT(device != RT_NULL); in rt_qspi_transfer_message()
56 result = rt_mutex_take(&(device->parent.bus->lock), RT_WAITING_FOREVER); in rt_qspi_transfer_message()
68 if (device->parent.bus->owner != &device->parent) in rt_qspi_transfer_message()
71 result = device->parent.bus->ops->configure(&device->parent, &device->parent.config); in rt_qspi_transfer_message()
75 device->parent.bus->owner = &device->parent; in rt_qspi_transfer_message()
[all …]
/nrf52832-nimble/rt-thread/components/drivers/usb/usbhost/core/
H A Dcore.c17 * This function will allocate an usb device instance from system.
19 * @param parent the hub instance to which the new allocated device attached.
36 /* initialize the usb device instance */ in rt_usbh_alloc_instance()
57 * This function will attatch an usb device instance to a host controller,
58 * and do device enumunation process.
61 * @param device the usb device instance.
85 rt_err_t rt_usbh_attatch_instance(uinst_t device) in rt_usbh_attatch_instance() argument
97 RT_ASSERT(device != RT_NULL); in rt_usbh_attatch_instance()
100 dev_desc = &device->dev_desc; in rt_usbh_attatch_instance()
105 rt_usb_hcd_alloc_pipe(device->hcd, &device->pipe_ep0_out, device, &ep0_out_desc); in rt_usbh_attatch_instance()
[all …]
/nrf52832-nimble/rt-thread/components/drivers/usb/usbdevice/core/
H A Dcore.c22 static rt_size_t rt_usbd_ep_write(udevice_t device, uep_t ep, void *buffer, rt_size_t size);
23 static rt_size_t rt_usbd_ep_read_prepare(udevice_t device, uep_t ep, void *buffer, rt_size_t size);
24 static rt_err_t rt_usbd_ep_assign(udevice_t device, uep_t ep);
25 rt_err_t rt_usbd_ep_unassign(udevice_t device, uep_t ep);
30 * @param device the usb device object.
35 static rt_err_t _get_device_descriptor(struct udevice* device, ureq_t setup) in _get_device_descriptor() argument
40 RT_ASSERT(device != RT_NULL); in _get_device_descriptor()
45 /* device descriptor wLength should less than USB_DESC_LENGTH_DEVICE*/ in _get_device_descriptor()
49 /* send device descriptor to endpoint 0 */ in _get_device_descriptor()
50 rt_usbd_ep0_write(device, (rt_uint8_t*) &device->dev_desc, size); in _get_device_descriptor()
[all …]
/nrf52832-nimble/rt-thread/libcpu/ppc/ppc405/
H A Dserial.c40 /* PPC405 serial device */
43 /* inherit from device */
56 /* serial character device */
64 struct rt_ppc405_serial* device; in rt_serial_open() local
65 device = (struct rt_ppc405_serial*) dev; in rt_serial_open()
67 RT_ASSERT(device != RT_NULL); in rt_serial_open()
71 out_8((rt_uint8_t*)device->hw_base + UART_IER, 0x01); in rt_serial_open()
73 out_8((rt_uint8_t*)device->hw_base + UART_FCR, 1); in rt_serial_open()
76 rt_hw_interrupt_unmask(device->irqno); in rt_serial_open()
84 struct rt_ppc405_serial* device; in rt_serial_close() local
[all …]
/nrf52832-nimble/rt-thread/components/drivers/
H A DKconfig1 menu "Device Drivers"
4 bool "Using device drivers IPC"
14 bool "Using serial device drivers"
26 bool "Using CAN device drivers"
36 bool "Using hardware timer device drivers"
68 bool "Using I2C device drivers"
78 bool "Using generic GPIO device drivers"
82 bool "Using ADC device drivers"
86 bool "Using PWM device drivers"
90 bool "Using MTD Nor Flash device drivers"
[all …]
/nrf52832-nimble/rt-thread/components/drivers/include/drivers/
H A Dspi.h38 #define RT_SPI_MASTER (0<<3) /* SPI master device */
39 #define RT_SPI_SLAVE (1<<3) /* SPI slave device */
98 rt_err_t (*configure)(struct rt_spi_device *device, struct rt_spi_configuration *configuration);
99 rt_uint32_t (*xfer)(struct rt_spi_device *device, struct rt_spi_message *message);
103 * SPI Virtual BUS, one device must connected to a virtual BUS
157 void (*enter_qspi_mode)(struct rt_qspi_device *device);
159 void (*exit_qspi_mode)(struct rt_qspi_device *device);
169 /* attach a device on SPI bus */
170 rt_err_t rt_spi_bus_attach_device(struct rt_spi_device *device,
178 * @param device the SPI device attached to SPI bus
[all …]
H A Dmtd_nand.h22 #define RT_MTD_NAND_DEVICE(device) ((struct rt_mtd_nand_device*)(device)) argument
53 rt_err_t (*read_id) (struct rt_mtd_nand_device* device);
55 rt_err_t (*read_page)(struct rt_mtd_nand_device* device,
60 rt_err_t (*write_page)(struct rt_mtd_nand_device * device,
64 rt_err_t (*move_page) (struct rt_mtd_nand_device *device, rt_off_t src_page, rt_off_t dst_page);
66 rt_err_t (*erase_block)(struct rt_mtd_nand_device* device, rt_uint32_t block);
67 rt_err_t (*check_block)(struct rt_mtd_nand_device* device, rt_uint32_t block);
68 rt_err_t (*mark_badblock)(struct rt_mtd_nand_device* device, rt_uint32_t block);
71 rt_err_t rt_mtd_nand_register_device(const char* name, struct rt_mtd_nand_device* device);
73 rt_inline rt_uint32_t rt_mtd_nand_read_id(struct rt_mtd_nand_device* device) in rt_mtd_nand_read_id() argument
[all …]
H A Dmtd_nor.h17 #define RT_MTD_NOR_DEVICE(device) ((struct rt_mtd_nor_device*)(device)) argument
33 rt_err_t (*read_id) (struct rt_mtd_nor_device* device);
35 …rt_size_t (*read) (struct rt_mtd_nor_device* device, rt_off_t offset, rt_uint8_t* data, rt_uint…
36 …rt_size_t (*write) (struct rt_mtd_nor_device* device, rt_off_t offset, const rt_uint8_t* data, r…
38 rt_err_t (*erase_block)(struct rt_mtd_nor_device* device, rt_off_t offset, rt_uint32_t length);
41 rt_err_t rt_mtd_nor_register_device(const char* name, struct rt_mtd_nor_device* device);
43 rt_inline rt_uint32_t rt_mtd_nor_read_id(struct rt_mtd_nor_device* device) in rt_mtd_nor_read_id() argument
45 return device->ops->read_id(device); in rt_mtd_nor_read_id()
49 struct rt_mtd_nor_device* device, in rt_mtd_nor_read() argument
52 return device->ops->read(device, offset, data, length); in rt_mtd_nor_read()
[all …]
/nrf52832-nimble/rt-thread/components/drivers/wlan/
H A Dwlan_dev.c49 rt_err_t rt_wlan_dev_init(struct rt_wlan_device *device, rt_wlan_mode_t mode) in rt_wlan_dev_init() argument
53 /* init wlan device */ in rt_wlan_dev_init()
54 LOG_D("F:%s L:%d is run device:0x%08x mode:%d", __FUNCTION__, __LINE__, device, mode); in rt_wlan_dev_init()
55 if ((device == RT_NULL) || (mode >= RT_WLAN_MODE_MAX)) in rt_wlan_dev_init()
57 … LOG_E("F:%s L:%d Parameter Wrongful device:0x%08x mode:%d", __FUNCTION__, __LINE__, device, mode); in rt_wlan_dev_init()
61 result = rt_device_init(RT_DEVICE(device)); in rt_wlan_dev_init()
67 result = rt_device_control(RT_DEVICE(device), RT_WLAN_CMD_MODE, (void *)&mode); in rt_wlan_dev_init()
73 device->mode = mode; in rt_wlan_dev_init()
77 rt_err_t rt_wlan_dev_connect(struct rt_wlan_device *device, struct rt_wlan_info *info, const char *… in rt_wlan_dev_connect() argument
82 if (device == RT_NULL) in rt_wlan_dev_connect()
[all …]
H A Dwlan_dev.h359 typedef void (*rt_wlan_dev_event_handler)(struct rt_wlan_device *device, rt_wlan_dev_event_t event,…
361 typedef void (*rt_wlan_pormisc_callback_t)(struct rt_wlan_device *device, void *data, int len);
438 struct rt_device device; member
502 * wlan device init
504 rt_err_t rt_wlan_dev_init(struct rt_wlan_device *device, rt_wlan_mode_t mode);
507 * wlan device station interface
509 rt_err_t rt_wlan_dev_connect(struct rt_wlan_device *device, struct rt_wlan_info *info, const char *…
510 rt_err_t rt_wlan_dev_disconnect(struct rt_wlan_device *device);
511 int rt_wlan_dev_get_rssi(struct rt_wlan_device *device);
514 * wlan device ap interface
[all …]
/nrf52832-nimble/rt-thread/components/drivers/usb/usbhost/class/
H A Dadk.c46 * This function will do USB_REQ_GET_PROTOCOL request to set idle period to the usb adk device
57 uinst_t device; in rt_usbh_adk_get_protocol() local
62 RT_ASSERT(intf->device != RT_NULL); in rt_usbh_adk_get_protocol()
64 device = intf->device; in rt_usbh_adk_get_protocol()
73 if(rt_usb_hcd_control_xfer(device->hcd, device, &setup, (void*)protocol, 2, in rt_usbh_adk_get_protocol()
79 * This function will do USB_REQ_SEND_STRING request to set idle period to the usb adk device
91 uinst_t device; in rt_usbh_adk_send_string() local
96 RT_ASSERT(intf->device != RT_NULL); in rt_usbh_adk_send_string()
98 device = intf->device; in rt_usbh_adk_send_string()
107 if(rt_usb_hcd_control_xfer(device->hcd, device, &setup, (void*)str, in rt_usbh_adk_send_string()
[all …]
H A Dhid.c21 * This function will do USB_REQ_SET_IDLE request to set idle period to the usb hid device
32 struct uinstance* device; in rt_usbh_hid_set_idle() local
37 RT_ASSERT(intf->device != RT_NULL); in rt_usbh_hid_set_idle()
39 device = intf->device; in rt_usbh_hid_set_idle()
48 if(rt_usb_hcd_control_xfer(device->hcd, device, &setup, RT_NULL, 0, in rt_usbh_hid_set_idle()
54 * This function will do USB_REQ_GET_REPORT request to get report from the usb hid device
66 struct uinstance* device; in rt_usbh_hid_get_report() local
71 RT_ASSERT(intf->device != RT_NULL); in rt_usbh_hid_get_report()
73 device = intf->device; in rt_usbh_hid_get_report()
82 if(rt_usb_hcd_control_xfer(device->hcd, device, &setup, buffer, size, in rt_usbh_hid_get_report()
[all …]
/nrf52832-nimble/rt-thread/examples/test/
H A Ddevice_test.c43 static rt_err_t _block_device_test(rt_device_t device) in _block_device_test() argument
52 if( (device->flag & RT_DEVICE_FLAG_RDWR) == RT_DEVICE_FLAG_RDWR ) in _block_device_test()
54 // device can read and write. in _block_device_test()
55 // step 1: open device in _block_device_test()
56 result = rt_device_open(device,RT_DEVICE_FLAG_RDWR); in _block_device_test()
62 // step 2: get device info in _block_device_test()
64 result = rt_device_control(device, in _block_device_test()
69 rt_kprintf("device : %s cmd RT_DEVICE_CTRL_BLK_GETGEOME failed.\r\n"); in _block_device_test()
72 rt_kprintf("device info:\r\n"); in _block_device_test()
96 i = rt_device_read(device, 0, read_buffer, 1); in _block_device_test()
[all …]
/nrf52832-nimble/rt-thread/src/
H A Ddevice.c10 * 2012-10-20 Bernard add device check in register function,
12 * 2012-12-25 Bernard return RT_EOK if the device interface not exist.
41 * This function registers a device driver with specified name.
43 * @param dev the pointer of device driver structure
44 * @param name the device driver's name
45 * @param flags the capabilities flag of device
74 * This function removes a previously registered device driver
76 * @param dev the pointer of device driver structure
93 * This function initializes all registered device driver
98 * of a device is performed when applicaiton opens it.
[all …]
/nrf52832-nimble/rt-thread/components/drivers/misc/
H A Drt_drv_pwm.c103 rt_err_t rt_device_pwm_register(struct rt_device_pwm *device, const char *name, const struct rt_pwm… in rt_device_pwm_register() argument
107 memset(device, 0, sizeof(struct rt_device_pwm)); in rt_device_pwm_register()
110 device->parent.ops = &pwm_device_ops; in rt_device_pwm_register()
112 device->parent.init = RT_NULL; in rt_device_pwm_register()
113 device->parent.open = RT_NULL; in rt_device_pwm_register()
114 device->parent.close = RT_NULL; in rt_device_pwm_register()
115 device->parent.read = _pwm_read; in rt_device_pwm_register()
116 device->parent.write = _pwm_write; in rt_device_pwm_register()
117 device->parent.control = _pwm_control; in rt_device_pwm_register()
120 device->parent.type = RT_Device_Class_Miscellaneous; in rt_device_pwm_register()
[all …]
/nrf52832-nimble/rt-thread/components/utilities/zmodem/
H A Dzstart.c35 zmodem.device->flag &=(~flag); in finsh_rz()
39 rx_indicate = zmodem.device->rx_indicate; in finsh_rz()
41 rt_device_set_rx_indicate(zmodem.device, RT_NULL); in finsh_rz()
44 zmodem.device->flag |=flag; in finsh_rz()
46 rt_device_set_rx_indicate(zmodem.device, rx_indicate); in finsh_rz()
57 zmodem.device->flag &=(~flag); in finsh_sz()
61 rx_indicate = zmodem.device->rx_indicate; in finsh_sz()
63 rt_device_set_rx_indicate(zmodem.device, zmodem_rx_ind); in finsh_sz()
65 zmodem.device->flag |=flag; in finsh_sz()
67 rt_device_set_rx_indicate(zmodem.device, rx_indicate); in finsh_sz()
[all …]
/nrf52832-nimble/rt-thread/components/drivers/watchdog/
H A Dwatchdog.c14 /* RT-Thread Device Interface */
80 * This function register a watchdog device
87 struct rt_device *device; in rt_hw_watchdog_register() local
90 device = &(wtd->parent); in rt_hw_watchdog_register()
92 device->type = RT_Device_Class_Miscellaneous; in rt_hw_watchdog_register()
93 device->rx_indicate = RT_NULL; in rt_hw_watchdog_register()
94 device->tx_complete = RT_NULL; in rt_hw_watchdog_register()
97 device->ops = &wdt_ops; in rt_hw_watchdog_register()
99 device->init = rt_watchdog_init; in rt_hw_watchdog_register()
100 device->open = rt_watchdog_open; in rt_hw_watchdog_register()
[all …]
/nrf52832-nimble/rt-thread/components/drivers/usb/usbdevice/class/
H A Drndis.c45 /* inherit from ethernet device */
210 "RT-Thread RNDIS device", /* PRODUCT */
292 rt_rndis_eth_t device = (rt_rndis_eth_t)func->user_data; in _rndis_response_available() local
294 if(device->need_notify == RT_TRUE) in _rndis_response_available()
296 device->need_notify = RT_FALSE; in _rndis_response_available()
297 data = (rt_uint32_t *)device->eps.ep_cmd->buffer; in _rndis_response_available()
300 device->eps.ep_cmd->request.buffer = device->eps.ep_cmd->buffer; in _rndis_response_available()
301 device->eps.ep_cmd->request.size = 8; in _rndis_response_available()
302 device->eps.ep_cmd->request.req_type = UIO_REQUEST_WRITE; in _rndis_response_available()
303 rt_usbd_io_request(func->device, device->eps.ep_cmd, &device->eps.ep_cmd->request); in _rndis_response_available()
[all …]
/nrf52832-nimble/rt-thread/components/drivers/pm/
H A Dpm.c31 _pm.device_pm[index].ops->suspend(_pm.device_pm[index].device); in _pm_device_suspend()
47 _pm.device_pm[index].ops->resume(_pm.device_pm[index].device); in _pm_device_resume()
64 _pm.device_pm[index].ops->frequency_change(_pm.device_pm[index].device); in _pm_device_frequency_change()
204 /* resume the device with PM feature */ in rt_pm_exit()
213 * Upper application or device driver requests the system
276 * Upper application or device driver releases the stall
301 * Register a device with PM feature
303 * @param device the device with PM feature
304 * @param ops the PM ops for device
306 void rt_pm_register_device(struct rt_device *device, const struct rt_device_pm_ops *ops) in rt_pm_register_device() argument
[all …]
/nrf52832-nimble/rt-thread/libcpu/arm/AT91SAM7S/
H A Dserial.c9 * 2009-05-14 Bernard add RT-THread device interface
76 struct rt_device* device; in rt_hw_serial_isr() local
95 /* get generic device object */ in rt_hw_serial_isr()
96 device = (rt_device_t)serial; in rt_hw_serial_isr()
121 if (device->rx_indicate != RT_NULL) in rt_hw_serial_isr()
122 device->rx_indicate(device, 1); in rt_hw_serial_isr()
297 /* it's a stream mode device */ in rt_serial_write()
339 rt_device_t device; in rt_hw_serial_init() local
342 device = (rt_device_t) &serial1; in rt_hw_serial_init()
344 /* init serial device private data */ in rt_hw_serial_init()
[all …]
/nrf52832-nimble/rt-thread/libcpu/arm/s3c24x0/
H A Dserial.c21 /* RT-Thread Device Interface */
228 /* suspend device */ in rt_serial_control()
233 /* resume device */ in rt_serial_control()
244 rt_err_t rt_hw_serial_register(rt_device_t device, const char* name, rt_uint32_t flag, struct seria… in rt_hw_serial_register() argument
246 RT_ASSERT(device != RT_NULL); in rt_hw_serial_register()
248 device->type = RT_Device_Class_Char; in rt_hw_serial_register()
249 device->rx_indicate = RT_NULL; in rt_hw_serial_register()
250 device->tx_complete = RT_NULL; in rt_hw_serial_register()
251 device->init = rt_serial_init; in rt_hw_serial_register()
252 device->open = rt_serial_open; in rt_hw_serial_register()
[all …]
/nrf52832-nimble/rt-thread/libcpu/arm/sep4020/
H A Dserial.c21 /* RT-Thread Device Interface */
214 /* suspend device */ in rt_serial_control()
219 /* resume device */ in rt_serial_control()
230 rt_err_t rt_hw_serial_register(rt_device_t device, const char* name, rt_uint32_t flag, struct seria… in rt_hw_serial_register() argument
232 RT_ASSERT(device != RT_NULL); in rt_hw_serial_register()
234 device->type = RT_Device_Class_Char; in rt_hw_serial_register()
235 device->rx_indicate = RT_NULL; in rt_hw_serial_register()
236 device->tx_complete = RT_NULL; in rt_hw_serial_register()
237 device->init = rt_serial_init; in rt_hw_serial_register()
238 device->open = rt_serial_open; in rt_hw_serial_register()
[all …]

12345678910>>...20