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

adc: Introduce mcux shim driver #804

Merged
merged 12 commits into from
Jul 15, 2017
Merged

Conversation

MaureenHelm
Copy link
Member

Introduces a new mcux shim driver for the adc, and enables the driver on all Kinetis boards.

Remove repetitive dependencies on ADC and instead wrap everything in one
big if.

Jira: ZEP-1396

Signed-off-by: Maureen Helm <[email protected]>
The Kconfig assumed that there would only ever be one instance of an
adc, but some Kinetis devices have multiple adc instances.

Jira: ZEP-1396

Signed-off-by: Maureen Helm <[email protected]>
Adds common and Kinetis-specific adc device tree properties, and updates
all Kinetis SoC and board dts files to include adc nodes.

Jira: ZEP-1396

Signed-off-by: Maureen Helm <[email protected]>
Adds a shim layer around the mcux adc16 driver to adapt it to the Zephyr
adc interface.

Jira: ZEP-1396

Signed-off-by: Maureen Helm <[email protected]>
If the adc driver configuration is enabled (CONFIG_ADC=y), then enable
the mcux shim driver by default for all Kinetis SoCs.

Jira: ZEP-1396

Signed-off-by: Maureen Helm <[email protected]>
Enables a usable adc driver instance based on the board design and
configures the pinmux to enable one adc channel on the SoC's PTB2 pin,
which is routed to the Arduino header A2 pin. Updates the board
documentation to reflect that the board now supports an adc driver.

Jira: ZEP-1396

Signed-off-by: Maureen Helm <[email protected]>
Enables a usable adc driver instance based on the board design and
configures the pinmux to enable one adc channel on the SoC's PTB2 pin,
which is routed to the Arduino header A2 pin. Updates the board
documentation to reflect that the board now supports an adc driver.

Jira: ZEP-1396

Signed-off-by: Maureen Helm <[email protected]>
Enables a usable adc driver instance based on the board design and
configures the pinmux to enable the SoC's PTB10 pin, which is routed to
the Arduino header A2 pin. Updates the board documentation to reflect
that the board now supports an adc driver.

Jira: ZEP-1396

Signed-off-by: Maureen Helm <[email protected]>
Enables a usable adc driver instance based on the board design and
configures the pinmux to enable the SoC's PTB1 pin, which is routed to
the board's battery sense circuit. Updates the board documentation to
reflect that the board now supports an adc driver.

Jira: ZEP-1396

Signed-off-by: Maureen Helm <[email protected]>
Enables a usable adc driver instance based on the board design. No
additional pinmux configuration is necessary because a dedicated adc pin
is routed to the board's battery sense circuit. Updates the board
documentation to reflect that the board now supports an adc driver.

Jira: ZEP-1396

Signed-off-by: Maureen Helm <[email protected]>
Adds a Kconfig option and pinmuxing to enable the battery sense circuit.

Jira: ZEP-1396

Signed-off-by: Maureen Helm <[email protected]>
Adds support for freedom and hexiwear boards to the adc_api test.

Jira: ZEP-1396

Signed-off-by: Maureen Helm <[email protected]>
@MaureenHelm
Copy link
Member Author

@grgustaf

Copy link
Contributor

@dbkinder dbkinder left a comment

Choose a reason for hiding this comment

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

+1 for doc changes

config ADC_MCUX_ADC16
bool "MCUX ADC16 driver"
depends on HAS_MCUX && HAS_ADC16
select HAS_DTS_ADC
Copy link
Collaborator

Choose a reason for hiding this comment

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

select HAS_DTS_ADC should probably be added when you add the DTS support.

Copy link
Member Author

Choose a reason for hiding this comment

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

It doesn't look it in GitHub, but I actually added the dts first in the patch series before the driver. GitHub appears to show patches ordered by AuthorDate rather than CommitDate, so the fact that I originally implemented this driver without dts, amended it, and inserted a new commit adding dts before it, got GitHub a little confused.

@galak galak merged commit cf6f868 into zephyrproject-rtos:arm Jul 15, 2017
@MaureenHelm MaureenHelm deleted the adc-mcux branch July 24, 2017 17:15
nagineni pushed a commit to nagineni/zephyr that referenced this pull request Nov 20, 2017
- cleanup routine to free any open FD's

Signed-off-by: James Prestwood <[email protected]>
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.

3 participants