aboutsummaryrefslogtreecommitdiffstats
path: root/target/Config.in
Commit message (Expand)AuthorAgeFilesLines
* base-files: add eMMC sysupgrade supportEnrico Mioso2021-12-021-0/+3
* base-files: rename 'sdcard' to 'legacy-sdcard'Daniel Golle2021-08-161-1/+1
* base-files: add generic sdcard upgrade methodStijn Tintel2021-08-071-0/+3
* include/image*: add support for device-tree overlaysDaniel Golle2021-03-171-0/+3
* treewide: fix spelling 'seperate' -> 'separate'Daniel Golle2021-02-281-1/+1
* image: allow building FIT and uImage with ramdiskDaniel Golle2021-02-241-0/+3
* build: define PWM_SUPPORT arch feature flagChristian Lamparter2020-09-251-0/+3
* build: define RTC_SUPPORT as a boolEneas U de Queiroz2020-04-091-2/+1
* build: add a config option for enabling a testing version of the target kernelFelix Fietkau2019-05-111-0/+3
* build: add support for enabling the rootfs/boot partition size option via tar...Felix Fietkau2018-09-031-0/+6
* config: set ARCH if powerpc64 is selected in the configurationFlorian Larysch2017-10-241-0/+1
* kernel: allow selecting RTC drivers on targets without explicit RTC supportFelix Fietkau2017-05-021-1/+2
* kernel: add plan 9 fs packageMatteo Croce2016-08-111-0/+3
* target.mk: rework arm architecture level detectionFelix Fietkau2016-07-151-6/+0
* tools: add kernel2minor utility for Mikrotik devicesSergey Sergeev2016-07-051-0/+3
* config: add a small_flash featureJohn Crispin2016-06-131-0/+3
* build: remove profile kernel/build system config override supportFelix Fietkau2016-05-151-3/+0
* toolchain: add support of ARC architectureFelix Fietkau2015-11-101-0/+9
* build: remove obsolete references to cris and avr32Felix Fietkau2015-03-241-9/+0
* aarch64: add initial supportFlorian Fainelli2014-11-241-0/+11
* kernel: add a NAND_SUPPORT symbolJohn Crispin2014-06-111-0/+4
* build: add a feature flag for low-memory systemsFelix Fietkau2014-06-021-0/+3
* add a feature flag for device tree supportImre Kaloz2013-11-221-0/+3
* build: drop FIT option until we actually need itLuka Perkov2013-10-171-3/+0
* build: add menuconfig option for building FIT imagesLuka Perkov2013-10-161-0/+3
* kernel: add a new global config symbol for enabling rfkill support (can be en...Felix Fietkau2013-07-211-0/+3
* target: split jffs2 NAND out of jffs2Jonas Gorski2013-06-051-0/+3
* build: add config symbols for different ARM arch levelsFelix Fietkau2013-05-131-0/+12
* build: consistently use 'depends on' instead of 'depends'Felix Fietkau2013-04-171-2/+2
* buildroot: factor knowledge of a 64bits architectureFlorian Fainelli2013-04-051-0/+7
* buildroot: allow enabling MIPS16 user-space buildFlorian Fainelli2013-04-051-0/+4
* kernel: remove references to TARGET_ubicom32Florian Fainelli2012-11-301-5/+0
* target: add a feature flag for RTC supportFelix Fietkau2012-05-171-0/+3
* mpc85xx: add a new 'spe_fpu' feature flag for the FPU used on freescale power...Felix Fietkau2011-01-161-0/+5
* switch from ext2 to ext4 (w/o) journalingImre Kaloz2010-11-221-1/+1
* make the display support feature flag selectableFelix Fietkau2010-11-021-3/+0
* as we only support 2.6, remove the useless bool for itImre Kaloz2010-10-051-3/+0
* Toto, we don't support Linux 2.4 anymore..Imre Kaloz2010-10-051-3/+0
* Add usb gadget feature flagMichael Büsch2010-08-251-0/+3
* buildsystem: rename tgz/TGZ "feature" and matching options to targz/TARGZNicolas Thill2010-04-281-1/+1
* Add audio feature flag.Lars-Peter Clausen2010-02-151-0/+5
* Add support for building ubifs images.Lars-Peter Clausen2010-01-111-1/+4
* sort & rearrange arch selectionNicolas Thill2009-12-231-38/+34
* Config.in: fix powerpc64 endiannessNicolas Thill2009-12-181-0/+1
* add nommu target feature flagFelix Fietkau2009-08-211-0/+3
* add a heavily cleaned up version of ubicom32 toolchain supportFelix Fietkau2009-08-211-0/+5
* powerpc: Create a powerpc64 config featureGeoff Levand2009-08-181-0/+3
* add preliminary coldfire v4e supportImre Kaloz2009-06-211-0/+4
* missing changes for pcie handlingImre Kaloz2009-06-021-0/+3
* add a modified version of the mips64 patch from #4603Felix Fietkau2009-04-181-0/+9
n> #define USB_MAX_ENDPOINTS 4 /** * @brief Status stage handling method. */ #define USB_EP0_STATUS_STAGE USB_EP0_STATUS_STAGE_SW /** * @brief The address can be changed immediately upon packet reception. */ #define USB_SET_ADDRESS_MODE USB_LATE_SET_ADDRESS /** * @brief Method for set address acknowledge. */ #define USB_SET_ADDRESS_ACK_HANDLING USB_SET_ADDRESS_ACK_SW /*===========================================================================*/ /* Driver pre-compile time settings. */ /*===========================================================================*/ /** * @name PLATFORM configuration options * @{ */ /** * @brief USB driver enable switch. * @details If set to @p TRUE the support for USB1 is included. * @note The default is @p FALSE. */ #if !defined(PLATFORM_USB_USE_USB1) || defined(__DOXYGEN__) #define PLATFORM_USB_USE_USB1 FALSE #endif /** @} */ /*===========================================================================*/ /* Derived constants and error checks. */ /*===========================================================================*/ /*===========================================================================*/ /* Driver data structures and types. */ /*===========================================================================*/ /** * @brief Type of an IN endpoint state structure. */ typedef struct { /** * @brief Requested transmit transfer size. */ size_t txsize; /** * @brief Transmitted bytes so far. */ size_t txcnt; /** * @brief Pointer to the transmission linear buffer. */ const uint8_t *txbuf; #if (USB_USE_WAIT == TRUE) || defined(__DOXYGEN__) /** * @brief Waiting thread. */ thread_reference_t thread; #endif /* End of the mandatory fields.*/ } USBInEndpointState; /** * @brief Type of an OUT endpoint state structure. */ typedef struct { /** * @brief Requested receive transfer size. */ size_t rxsize; /** * @brief Received bytes so far. */ size_t rxcnt; /** * @brief Pointer to the receive linear buffer. */ uint8_t *rxbuf; #if (USB_USE_WAIT == TRUE) || defined(__DOXYGEN__) /** * @brief Waiting thread. */ thread_reference_t thread; #endif /* End of the mandatory fields.*/ } USBOutEndpointState; /** * @brief Type of an USB endpoint configuration structure. * @note Platform specific restrictions may apply to endpoints. */ typedef struct { /** * @brief Type and mode of the endpoint. */ uint32_t ep_mode; /** * @brief Setup packet notification callback. * @details This callback is invoked when a setup packet has been * received. * @post The application must immediately call @p usbReadPacket() in * order to access the received packet. * @note This field is only valid for @p USB_EP_MODE_TYPE_CTRL * endpoints, it should be set to @p NULL for other endpoint * types. */ usbepcallback_t setup_cb; /** * @brief IN endpoint notification callback. * @details This field must be set to @p NULL if the IN endpoint is not * used. */ usbepcallback_t in_cb; /** * @brief OUT endpoint notification callback. * @details This field must be set to @p NULL if the OUT endpoint is not * used. */ usbepcallback_t out_cb; /** * @brief IN endpoint maximum packet size. * @details This field must be set to zero if the IN endpoint is not * used. */ uint16_t in_maxsize; /** * @brief OUT endpoint maximum packet size. * @details This field must be set to zero if the OUT endpoint is not * used. */ uint16_t out_maxsize; /** * @brief @p USBEndpointState associated to the IN endpoint. * @details This structure maintains the state of the IN endpoint. */ USBInEndpointState *in_state; /** * @brief @p USBEndpointState associated to the OUT endpoint. * @details This structure maintains the state of the OUT endpoint. */ USBOutEndpointState *out_state; /* End of the mandatory fields.*/ } USBEndpointConfig; /** * @brief Type of an USB driver configuration structure. */ typedef struct { /** * @brief USB events callback. * @details This callback is invoked when an USB driver event is registered. */ usbeventcb_t event_cb; /** * @brief Device GET_DESCRIPTOR request callback. * @note This callback is mandatory and cannot be set to @p NULL. */ usbgetdescriptor_t get_descriptor_cb; /** * @brief Requests hook callback. * @details This hook allows to be notified of standard requests or to * handle non standard requests. */ usbreqhandler_t requests_hook_cb; /** * @brief Start Of Frame callback. */ usbcallback_t sof_cb; /* End of the mandatory fields.*/ } USBConfig; /** * @brief Structure representing an USB driver. */ struct USBDriver { /** * @brief Driver state. */ usbstate_t state; /** * @brief Current configuration data. */ const USBConfig *config; /** * @brief Bit map of the transmitting IN endpoints. */ uint16_t transmitting; /** * @brief Bit map of the receiving OUT endpoints. */ uint16_t receiving; /** * @brief Active endpoints configurations. */ const USBEndpointConfig *epc[USB_MAX_ENDPOINTS + 1]; /** * @brief Fields available to user, it can be used to associate an * application-defined handler to an IN endpoint. * @note The base index is one, the endpoint zero does not have a * reserved element in this array. */ void *in_params[USB_MAX_ENDPOINTS]; /** * @brief Fields available to user, it can be used to associate an * application-defined handler to an OUT endpoint. * @note The base index is one, the endpoint zero does not have a * reserved element in this array. */ void *out_params[USB_MAX_ENDPOINTS]; /** * @brief Endpoint 0 state. */ usbep0state_t ep0state; /** * @brief Next position in the buffer to be transferred through endpoint 0. */ uint8_t *ep0next; /** * @brief Number of bytes yet to be transferred through endpoint 0. */ size_t ep0n; /** * @brief Endpoint 0 end transaction callback. */ usbcallback_t ep0endcb; /** * @brief Setup packet buffer. */ uint8_t setup[8]; /** * @brief Current USB device status. */ uint16_t status; /** * @brief Assigned USB address. */ uint8_t address; /** * @brief Current USB device configuration. */ uint8_t configuration; #if defined(USB_DRIVER_EXT_FIELDS) USB_DRIVER_EXT_FIELDS #endif /* End of the mandatory fields.*/ }; /*===========================================================================*/ /* Driver macros. */ /*===========================================================================*/ /** * @brief Returns the current frame number. * * @param[in] usbp pointer to the @p USBDriver object * @return The current frame number. * * @notapi */ #define usb_lld_get_frame_number(usbp) 0 /** * @brief Returns the exact size of a receive transaction. * @details The received size can be different from the size specified in * @p usbStartReceiveI() because the last packet could have a size * different from the expected one. * @pre The OUT endpoint must have been configured in transaction mode * in order to use this function. * * @param[in] usbp pointer to the @p USBDriver object * @param[in] ep endpoint number * @return Received data size. * * @notapi */ #define usb_lld_get_transaction_size(usbp, ep) \ ((usbp)->epc[ep]->out_state->rxcnt) /** * @brief Connects the USB device. * * @api */ #define usb_lld_connect_bus(usbp) /** * @brief Disconnect the USB device. * * @api */ #define usb_lld_disconnect_bus(usbp) /*===========================================================================*/ /* External declarations. */ /*===========================================================================*/ #if (PLATFORM_USB_USE_USB1 == TRUE) && !defined(__DOXYGEN__) extern USBDriver USBD1; #endif #ifdef __cplusplus extern "C" { #endif void usb_lld_init(void); void usb_lld_start(USBDriver *usbp); void usb_lld_stop(USBDriver *usbp); void usb_lld_reset(USBDriver *usbp); void usb_lld_set_address(USBDriver *usbp); void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep); void usb_lld_disable_endpoints(USBDriver *usbp); usbepstatus_t usb_lld_get_status_in(USBDriver *usbp, usbep_t ep); usbepstatus_t usb_lld_get_status_out(USBDriver *usbp, usbep_t ep); void usb_lld_read_setup(USBDriver *usbp, usbep_t ep, uint8_t *buf); void usb_lld_prepare_receive(USBDriver *usbp, usbep_t ep); void usb_lld_prepare_transmit(USBDriver *usbp, usbep_t ep); void usb_lld_start_out(USBDriver *usbp, usbep_t ep); void usb_lld_start_in(USBDriver *usbp, usbep_t ep); void usb_lld_stall_out(USBDriver *usbp, usbep_t ep); void usb_lld_stall_in(USBDriver *usbp, usbep_t ep); void usb_lld_clear_out(USBDriver *usbp, usbep_t ep); void usb_lld_clear_in(USBDriver *usbp, usbep_t ep); #ifdef __cplusplus } #endif #endif /* HAL_USE_USB == TRUE */ #endif /* HAL_USB_LLD_H */ /** @} */