Skip to content
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

Update MCUXpresso AnalogIn driver for LPC devices #11052

Merged
merged 3 commits into from
Jul 17, 2019

Conversation

mmahadevan108
Copy link
Contributor

Description

Update the MCUXpresso AnalogIn driver to pass the FPGA test shield tests. Below are updates

  1. Updated the ADC SDK driver for LPC546XX and LPC54114
  2. Update the Analogin HAL driver to fix clock setup and the return of conversion results. The ADC has 12-bit resolution and the API expects results in 16-bit format.

FPGA test result below:
mbedgt: test on hardware with target id: 105600001984a78e00000000000000000000000097969905
mbedgt: test suite 'mbed-os-tests-mbed_hal_fpga_ci_test_shield-analogin' ............................. OK in 15.02 sec
test case: 'AnalogIn - init test' ............................................................ OK in 0.40 sec
test case: 'AnalogIn - read test' ............................................................ OK in 0.40 sec
mbedgt: test case summary: 2 passes, 0 failures

Pull request type

[X] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
1. Update the clock divider setting
2. ADC resolution is 12-bits, update the API return value
   to return 16-bit result
3. Update IOMUX setup

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
@mmahadevan108
Copy link
Contributor Author

cc @maclobdell @c1728p9

@ciarmcom ciarmcom requested review from maclobdell and a team July 15, 2019 21:00
@ciarmcom
Copy link
Member

@mmahadevan108, thank you for your changes.
@maclobdell @ARMmbed/mbed-os-maintainers please review.

@@ -49,7 +49,7 @@ void analogin_init(analogin_t *obj, PinName pin)
ADC_ClockPower_Configuration();

/* Ensure the ADC clock derived from the system clock is less than 80MHz */
Copy link
Member

Choose a reason for hiding this comment

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

The comments are not matching the code.

Copy link
Contributor Author

@mmahadevan108 mmahadevan108 Jul 16, 2019

Choose a reason for hiding this comment

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

The system clock is managed as BusClock by the internal clocking code structure :). Comment is correct but code needed to be changed.

@mbed-ci
Copy link

mbed-ci commented Jul 17, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@SeppoTakalo SeppoTakalo merged commit 4cdde1d into ARMmbed:master Jul 17, 2019
@mmahadevan108 mmahadevan108 deleted the Update_LPC546XX_ADC branch July 18, 2019 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants