group::USB

The HWPL USB module provides an API for accessing the devices USB hardware. The full USB device stack is part of the Hardware Device Library (HWDL). The HWPL API is used for low level initialization, and the HWDL is used for application level functionality such as implementing USB Device Classes.

More information about accessing peripheral IO is in the Device Interface section.

Details

defineUSB_VERSION


defineUSB_IOC_IDENT_CHAR


defineUSB_PIN_ASSIGNMENT_COUNT


defineUSB_TX_FIFO_WORD_SIZE_COUNT


defineI_USB_GETVERSION


defineI_USB_GETINFO


defineI_USB_SETATTR


defineI_USB_SETACTION


defineI_USB_ISCONNECTED

This request checks to see if the USB is connected to an upstream port. It is connected, once is has been reset and disconnected when suspended.

  • Example: cpp void my_handler(usb_spec_event_t event); if ( ioctl(usb_fd, I_USB_ISCONNECTED) ){ //The USB is connected } else { //The USB is not connected }

defineI_USB_CONNECTED


defineI_USB_TOTAL


enumusb_flag_t

  • USB_FLAG_SET_UNCONFIGURED unconfigured mode
  • USB_FLAG_SET_DEVICE device mode
  • USB_FLAG_SET_HOST host mode
  • USB_FLAG_SET_OTG on-the-go mode
  • USB_FLAG_RESET Rest the USB
  • USB_FLAG_ATTACH Attach USB device
  • USB_FLAG_DETACH Detach USB device
  • USB_FLAG_CONFIGURE Configure USB device
  • USB_FLAG_UNCONFIGURE Unconfigure USB device
  • USB_FLAG_SET_ADDRESS
  • USB_FLAG_RESET_ENDPOINT
  • USB_FLAG_ENABLE_ENDPOINT
  • USB_FLAG_DISABLE_ENDPOINT
  • USB_FLAG_STALL_ENDPOINT
  • USB_FLAG_UNSTALL_ENDPOINT
  • USB_FLAG_CONFIGURE_ENDPOINT
  • USB_FLAG_IS_SOF_ENABLED
  • USB_FLAG_IS_LOW_POWER_MODE_ENABLED
  • USB_FLAG_IS_VBUS_SENSING_ENABLED
  • USB_FLAG_IS_HIGH_SPEED
  • USB_FLAG_IS_BATTERY_CHARGING_ENABLED
  • USB_FLAG_FLUSH_ENDPOINT

This lists the valid USB modes.



date: “2019-06-27” layout: post title: struct::usb_info_t katex: true

categories: struct

Methods

Details

public u32o_flags


public u32o_events


public u32resd



date: “2019-06-27” layout: post title: struct::usb_pin_assignment_t katex: true

categories: struct

Methods

Details

publicmcu_pin_tdp


publicmcu_pin_tdm


publicmcu_pin_tid


publicmcu_pin_tvbus



date: “2019-06-27” layout: post title: struct::usb_attr_t katex: true

categories: struct

This defines the USB IOCTL data structure.

Methods

Details

public u32o_flags

Configuration flags


public usb_pin_assignment_tpin_assignment

Pin assignments


public u32freq

The crystal oscillator frequency


public u32address

USB endpoint address or device address (USB_FLAG_SET_ADDRESS)


public u16max_packet_size

USB endpoing max packet size


public u16type

USB endpoint type as bmAttributes


public u16rx_fifo_word_size

RX FIFO word size for all endpoints (STM32)


public u8tx_fifo_word_size

TX FIFO word size (used on STM32)


public u32resd


X

Thanks for Coming!

Subscribe to news and updates