Skip to content

USBDevice HAL specification improvements #6276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

c1728p9
Copy link
Contributor

@c1728p9 c1728p9 commented Mar 6, 2018

Expand USBPhy API, cleanup the code and add doxygen.

c1728p9 added 8 commits March 5, 2018 16:57
Add a function to check if the USBPhy is powered.
Move the powerdown code from destructor to deinit. This is required to
so USB interrupts can be disabled before calling the destructor.

This patch also performs cosmetic cleanup.
Make use of the new init and deinit APIs provided by USBDevice. This
allows for graceful USB shutdown.
Add the following new USBDevice functions:
init()
deinit()
sof_enable()
sof_disable()
callback_sof();

Additionally, move USBDevice specific types out of USBDevice_Types
and into USBDevice itself.
Make the USB lock functions virtual so they can be overridden.
Prefix all the private USBDevice methods and members with an
underscore to match the mbed-os naming convention.
Add doxygen to functions in USBDevice which were missing it.
Add additional requirements to the defined and undefined behavior of
USBPhy.
@c1728p9 c1728p9 changed the title Feature hal spec usb device USBDevice HAL specification improvements Mar 6, 2018
@c1728p9 c1728p9 requested a review from ashok-rao March 6, 2018 01:25
@c1728p9
Copy link
Contributor Author

c1728p9 commented Mar 6, 2018

I can't seem to add you as reviewers @maciejbocianski and @fkjagodzinski. Could you review this PR?

@c1728p9 c1728p9 requested a review from 0xc0170 March 6, 2018 01:28
@c1728p9
Copy link
Contributor Author

c1728p9 commented Mar 6, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Mar 6, 2018

Build : SUCCESS

Build number : 1349
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6276/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@c1728p9 c1728p9 force-pushed the feature-hal-spec-usb-device branch from ee26096 to 77e9329 Compare March 6, 2018 02:19
@c1728p9
Copy link
Contributor Author

c1728p9 commented Mar 6, 2018

/morph test

@cmonr
Copy link
Contributor

cmonr commented Mar 6, 2018

@c1728p9 Is there a reason that you're triggering builds and tests before reviewers have OK'd the PR?

Also, if you add a commit to a PR, you'll need to do a morph build, since the other morph commands use the artifacts from the last morph build to do their thing.

@mbed-ci
Copy link

mbed-ci commented Mar 6, 2018

@mbed-ci
Copy link

mbed-ci commented Mar 6, 2018

@mbed-ci
Copy link

mbed-ci commented Mar 6, 2018

@c1728p9
Copy link
Contributor Author

c1728p9 commented Mar 6, 2018

@c1728p9 Is there a reason that you're triggering builds and tests before reviewers have OK'd the PR?

This was to get a head start on testing. It was the evening so I figured the CI pipeline would be empty. Is this a problem?

Break apart USBPhy into three separate header files. Also make some
doxygen updates.
@c1728p9 c1728p9 force-pushed the feature-hal-spec-usb-device branch from 77e9329 to 2a94a3d Compare March 6, 2018 16:55
@c1728p9
Copy link
Contributor Author

c1728p9 commented Mar 6, 2018

Update doxygen which should now be in sync with ARMmbed/mbed-os-5-docs#438

@c1728p9
Copy link
Contributor Author

c1728p9 commented Mar 7, 2018

/morph build

@c1728p9
Copy link
Contributor Author

c1728p9 commented Mar 7, 2018

Work in progress for the USB technology page can be found here:
ARMmbed/mbed-os-5-docs#440

@mbed-ci
Copy link

mbed-ci commented Mar 7, 2018

Build : SUCCESS

Build number : 1373
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6276/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Mar 7, 2018

@maciejbocianski
Copy link
Contributor

Looks good to me

@mbed-ci
Copy link

mbed-ci commented Mar 7, 2018

Copy link
Member

@fkjagodzinski fkjagodzinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@c1728p9
Copy link
Contributor Author

c1728p9 commented Mar 7, 2018

Add a commit to simplify handling of aborted control transfers. Updated docs reflecting this can be found here:
https://github.com/c1728p9/Handbook/blob/09cbc12f62839ed65feacaec5cd3460532ada6e0/docs/reference/technology/USB.md
On the image USBDevice Control Request Handling.

Call callback_request_xfer_done regardless of if the current transfer
is aborted if complete_request is called with a buffer to send or fill.
This makes memory management much easier.

This patch also adds an aborted parameter to callback_request_xfer_done
so the code can check if the transfer was aborted.
@c1728p9 c1728p9 force-pushed the feature-hal-spec-usb-device branch from 1685204 to a899993 Compare March 7, 2018 20:44
@c1728p9
Copy link
Contributor Author

c1728p9 commented Mar 7, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Mar 7, 2018

Build : SUCCESS

Build number : 1383
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6276/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Mar 8, 2018

@mbed-ci
Copy link

mbed-ci commented Mar 8, 2018

@0xc0170 0xc0170 merged commit bd3c09a into ARMmbed:feature-hal-spec-usb-device Mar 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants