Skip to content

[feature-nrf528xx] Extended PeripheralPins and pinmap for NRF52 series #6234

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

Merged
merged 2 commits into from
Mar 5, 2018
Merged

[feature-nrf528xx] Extended PeripheralPins and pinmap for NRF52 series #6234

merged 2 commits into from
Mar 5, 2018

Conversation

marcuschangarm
Copy link
Contributor

The NRF52 series can map digital signals to any physical pin which
makes it challenging to associate pin names with hardware instances.

  • pinmap_ex:
    Keep track of which hardware instance is in use and what pins are
    associated with it. Currently only supports I2C and SPI, but
    provides a mechanism for allocating the shared I2C/SPI hardware.

  • PeripheralPinsDefault:
    Optional pin map for pre-assigning hardware instances at compile
    time. This makes it easier to optimize hardware utilization.

  • Helper functions for sharing hardware peripherals on NRF52
    Common functions for getting and setting the instance owner of a
    hardware peripheral. Used for reconfiguring SPI/I2C after change
    of ownership.

Copy link
Contributor

@cmonr cmonr left a comment

Choose a reason for hiding this comment

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

Small docygen nit, but LGTM!

static void * nordic_spi2c_owners[SPI2C_INSTANCES] = { NULL, NULL, NULL };

/**
* @brief Set instance owner for the SPI/I2C peripheral.
Copy link
Contributor

Choose a reason for hiding this comment

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

Doxygen. Define in only the header please.


#include <stdio.h>

#if 0
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be wrapped around a #define (MBED_DEBUG, or something similar), or is this just for debugging in the feature branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its really only for debugging this specific file if someone has to go back to the future.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not certain about leaving it here, I would remove it .

Copy link
Contributor

Choose a reason for hiding this comment

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

@marcuschangarm Ok for now, but will definitely need to be changed before coming into master.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a requirement for this? I've noticed similar logging/debug code in partner's SDKs.

Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like there should be, but I'm not certain there is.
@0xc0170 @adbridge ?

Copy link
Contributor

Choose a reason for hiding this comment

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

We have no control over what partners put in their SDKs, however that doesn't mean we should do such things ourselves...

@cmonr cmonr requested a review from pan- February 28, 2018 23:30
Blackstone Engineering and others added 2 commits March 1, 2018 12:04
The NRF52 series can map digital signals to any physical pin which
makes it challenging to associate pin names with hardware instances.

pinmap_ex:
  Keep track of which hardware instance is in use and what pins are
  associated with it. Currently only supports I2C and SPI, but
  provides a mechanism for allocating the shared I2C/SPI hardware.

PeripheralPinsDefault:
  Optional pin map for pre-assigning hardware instances at compile
  time. This makes it easier to optimize hardware utilization.
Common functions for getting and setting the instance owner of a
hardware peripheral. Used for reconfiguring SPI/I2C after change
of ownership.
@marcuschangarm
Copy link
Contributor Author

@cmonr I changed the Doxygen comments to regular comments.

@cmonr
Copy link
Contributor

cmonr commented Mar 2, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Mar 2, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Mar 3, 2018

@mbed-ci
Copy link

mbed-ci commented Mar 3, 2018

@cmonr cmonr merged commit 46dbc90 into ARMmbed:feature-nrf528xx Mar 5, 2018
@cmonr cmonr removed the needs: CI label Mar 5, 2018
@marcuschangarm marcuschangarm deleted the feature-pinmap branch March 6, 2018 15:01
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.

5 participants