diff options
| author | jepler <jepler@gmail.com> | 2019-11-01 16:25:34 -0500 |
|---|---|---|
| committer | jepler <jepler@gmail.com> | 2019-11-01 16:26:03 -0500 |
| commit | 2bdccf03a722fc1bdb0434e96361d3d8acd0ca09 (patch) | |
| tree | fd78d745c059ee2bef6cbf156482e3060dffba41 | |
| parent | fe47eba97fffb6a689592158bf6f97959c2ec798 (diff) | |
cpb: define the SPEAKER_ENABLE_PIN
This allows the board to disable the onboard speaker until explicitly
enabled in user code.
Testing performed on a CPB:
* Touching the AUDIO pin with a fingertip no longer generates noise/buzz
* Generating a waveform with `simpleio.tone` produces no sound by default
* When the board.SPEAKER_ENABLE is configured as a digital output and
set True, `simpleio.tone` does produce sound
Note that while guides should include information about SPEAKER_ENABLE, it's
possible that some users who omitted it could view this as a breaking change.
They can fix it by simply adding code similar to
speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE)
speaker_enable.direction = digitalio.Direction.OUTPUT
speaker_enable.value = True
before using the internal speaker.
Closes: #2258
| -rw-r--r-- | ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h index 1e55cd026..8c2018925 100644 --- a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h +++ b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h @@ -70,3 +70,5 @@ #define DEFAULT_UART_BUS_RX (&pin_P0_30) #define DEFAULT_UART_BUS_TX (&pin_P0_14) + +#define SPEAKER_ENABLE_PIN (&pin_P1_04) |
