Chapter 6
6
6-6 MEMORY ALLOCATION
Memory allocation in the driver can be simplified by the use of memory allocation functions
available from μC/LIB. μC/LIB’s memory allocation functions provide allocation of memory
from dedicated memory space (e.g., USB RAM) or general purpose heap. The driver may
use the pool functionality offered by μC/LIB. Memory pools use fixed-sized blocks that can
be dynamically allocated and freed during application execution. Memory pools may be
convenient to manage objects needed by the driver. The objects could be for instance data
structures mandatory for DMA operations. For more information on using μC/LIB memory
allocation functions, consult the μC/LIB documentation.
6-7 CPU AND BOARD SUPPORT
The USB device stack supports big-endian and little-endian CPU architectures. The setup
packet received as part of a control transfer must provide the content of the setup packet in
little-endian format to the stack. Therefore, if the USB device controller provides the content
in big-endian format, device drivers must swap the endianness of the setup packet’s
content.
In order for device drivers to be platform-independent, it is necessary to provide a layer of
code that abstracts details such as clocks, interrupt controllers, general-purpose input/
output (GPIO) pins, and other hardware modules configuration. With this board support
package (BSP) code layer, it is possible for the majority of the USB device stack to be
independent of any specific hardware, and for device drivers to be reused on different
architectures and bus configurations without the need to modify stack or driver source
code. These procedures are also referred as the USB BSP for a particular development
board.
A sample device BSP interface API structure is shown below.
const
USBD_DRV_BSP_API
USBD_DrvBSP_<controller> = { USBD_BSP_Init,
USBD_BSP_Conn,
USBD_BSP_Disconn
(1)
(2)
(3)
};
Listing 6-7 Device BSP Interface API
88
相关PDF资料
AD637-EVALZ BOARD EVALUATION FOR AD637
AD736-EVALZ BOARD EVALUATION FOR AD736
AD737-EVALZ BOARD EVALUATION FOR AD737
AD8007AKS-EBZ BOARD EVAL FOR AD8007AKS
AD8018ARU-EVAL BOARD EVAL FOR AD8018
AD8034ART-EBZ BOARD EVAL FOR AD8034ART
AD8040AR-EBZ BOARD EVAL FOR AD8040AR
AD8045ARD-EBZ BOARD EVAL FOR AD8045ARD
相关代理商/技术参数
AD-UCUSB-HCCDC-SPL 制造商:Analog Devices 功能描述:?C/USB HC CDC FOR CCES SINGLE PROD LIC - Virtual or Non-Physical Inventory (Software & Literature)
AD-UCUSB-HCMSC-SPL 制造商:Analog Devices 功能描述:?C/USB HC MSC FOR CCES SINGLE PROD LIC - Virtual or Non-Physical Inventory (Software & Literature)
AD-UCUSBH-MCDC-SPL 制造商:Analog Devices 功能描述:MAINTENANCE ?C/USBH CDC SINGLE PRD LIC - Virtual or Non-Physical Inventory (Software & Literature)
AD-UCUSBH-MHID-SPL 制造商:Analog Devices 功能描述:MAINTENANCE ?C/USBH HID SINGLE PRD LIC - Virtual or Non-Physical Inventory (Software & Literature)
AD-UCUSBH-MMSC-SPL 制造商:Analog Devices 功能描述:MAINTENANCE ?C/USBH MSC SINGLE PRD LIC - Virtual or Non-Physical Inventory (Software & Literature)
AD-UCUSBH-SPRD 功能描述:PRD LIC UCUSB DEV CORE CCES SGL 制造商:analog devices inc. 系列:CrossCore? Embedded Studio 零件状态:在售 类型:- 应用:- 版本:- 许可长度:- 许可 - 用户明细:- 操作系统:- 配套使用产品/相关产品:Blackfin? 处理器 媒体分发类型:- 标准包装:1
ADUM1100 制造商:AD 制造商全称:Analog Devices 功能描述:iCoupler Digital Isolator
ADUM1100AR 功能描述:IC DIGITAL ISOLATOR 1CH 8-SOIC RoHS:否 类别:隔离器 >> 数字隔离器 系列:iCoupler® 产品培训模块:IsoLoop® Isolator 标准包装:50 系列:IsoLoop® 输入 - 1 侧/2 侧:5/0 通道数:5 电源电压:3 V ~ 5.5 V 电压 - 隔离:2500Vrms 数据速率:110Mbps 传输延迟:12ns 输出类型:CMOS 封装/外壳:16-SOIC(0.154",3.90mm 宽) 供应商设备封装:16-SOIC N 包装:管件 工作温度:-40°C ~ 85°C 其它名称:390-1053-5