Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion boards/arm/frdm_k22f/frdm_k22f.dts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
status = "okay";
};

&i2c0 {
arduino_i2c: &i2c0 {
status = "okay";

fxos8700@1c {
Expand Down
1 change: 1 addition & 0 deletions boards/arm/frdm_k22f/frdm_k22f.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ toolchain:
supported:
- adc
- arduino_gpio
- arduino_i2c
- gpio
- i2c
- nvs
Expand Down
12 changes: 12 additions & 0 deletions boards/arm/frdm_k22f/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ static int frdm_k22f_pinmux_init(const struct device *dev)
| PORT_PCR_ODE_MASK);
#endif

#if CONFIG_SHIELD_FRDM_STBC_AGM01
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the correct way? I mean, adding a CONFIG option for a shield in the board part itself. I remember I had a similar request adding a shield for a microphone but I seem to remember I just added the pinmux part in the shield context itself. But I'm not able to recall it neither to find this out. @erwango, do you remember?

Copy link
Member

Choose a reason for hiding this comment

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

Indeed, when possible this should be avoided but this depends if platform has a more generic way to enable pins.
On that part I rely on @MaureenHelm

Copy link
Member

Choose a reason for hiding this comment

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

Indeed it isn't ideal, but we don't have more generic way to configure pins on this SoC family yet.

/* FXOS8700 INT1 */
pinmux_pin_set(portb, 16, PORT_PCR_MUX(kPORT_MuxAsGpio));
/* FXOS8700 INT2 */
pinmux_pin_set(porta, 4, PORT_PCR_MUX(kPORT_MuxAsGpio));

/* FXAS21002 INT1 */
pinmux_pin_set(portb, 18, PORT_PCR_MUX(kPORT_MuxAsGpio));
/* FXAS21002 INT2 */
pinmux_pin_set(portb, 19, PORT_PCR_MUX(kPORT_MuxAsGpio));
#endif

return 0;
}

Expand Down
5 changes: 5 additions & 0 deletions boards/shields/frdm_stbc_agm01/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2021 Ryan Holleran
# SPDX-License-Identifier: Apache-2.0
Copy link
Member

Choose a reason for hiding this comment

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

The scan code check is failing because you need to add a copyright here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, thank you. Not sure why I missed that.


config SHIELD_FRDM_STBC_AGM01
def_bool $(shields_list_contains,frdm_stbc_agm01)
Binary file added boards/shields/frdm_stbc_agm01/doc/AGM01.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions boards/shields/frdm_stbc_agm01/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
.. _frdm_stbc_agm01_shield:

NXP FRDM-STBC-AGM01
###################

Overview
********

The FRDM-STBC-AGM01 is an NXP Freedom development board with
FXOS8700 and FXAS21002. This 9-axis solution (FXAS21002C Gyroscope,
+ FXOS8700CQ E-compass sensor) is compatible with any board that
provides an Arduino R3 header.

.. image:: ./AGM01.jpg
:width: 500px
:align: center
:alt: FRDM-STBC-AGM01

Pin Assignment of the FRDM-STBC-AGM01 Shield
============================================

+-----------------------+---------------------+
| Shield Connector Pin | Function |
+=======================+=====================+
| A5 | I2C - SCL1 |
+-----------------------+---------------------+
| A4 | I2C - SDA1 |
+-----------------------+---------------------+
| D15 | I2C - SCL0 |
+-----------------------+---------------------+
| D14 | I2C - SDA0 |
+-----------------------+---------------------+
| D2 | INT1 - 8700 |
+-----------------------+---------------------+
| D4 | INT2 - 8700 |
+-----------------------+---------------------+
| D5 | INT1 - 21002 |
+-----------------------+---------------------+
| D8 | INT2 - 21002 |
+-----------------------+---------------------+
| A3 | RST - GPIO |
+-----------------------+---------------------+

For more information about the FXOS8700, FXAS21002, and FRDM-STBC-AGM01
board:

- :ref:`fxos8700`
- :ref:`fxas21002`
- `FRDM-STBC-AGM01 Website`_
- `FRDM-STBC-AGM01 Quick Reference Card`_
- `FRDM-STBC-AGM01 Schematics`_

Programming
***********

Set ``-DSHIELD=frdm_stbc_agm01`` when you invoke ``west build``. For example:

.. zephyr-app-commands::
:zephyr-app: samples/sensor/fxas21002
:board: frdm_k22f
:shield: frdm_stbc_agm01
:goals: build

.. _FRDM-STBC-AGM01 Website:
https://www.nxp.com/design/development-boards/freedom-development-boards/sensors/sensor-toolbox-development-boards-for-a-9-axis-solution-using-fxas21002c-and-fxos8700cq:FRDM-STBC-AGM01

.. _FRDM-STBC-AGM01 Quick Reference Card:
https://www.nxp.com/docs/en/supporting-information/FRDM-STBC-AGM01-QRC.pdf

.. _FRDM-STBC-AGM01 Schematics:
https://www.nxp.com/downloads/en/schematics/FRDM-STBC-AGM01-SCH.pdf
22 changes: 22 additions & 0 deletions boards/shields/frdm_stbc_agm01/frdm_stbc_agm01.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2021 Ryan Holleran
* SPDX-License-Identifier: Apache-2.0
*/

&arduino_i2c {
fxos8700@1e {
compatible = "nxp,fxos8700";
reg = <0x1e>;
label = "AGM01_FXOS8700";
int1-gpios = <&arduino_header 8 GPIO_ACTIVE_LOW>;
int2-gpios = <&arduino_header 10 GPIO_ACTIVE_LOW>;
};

fxas21002@20 {
compatible = "nxp,fxas21002";
reg = <0x20>;
label = "AGM01_FXAS21002";
int1-gpios = <&arduino_header 11 GPIO_ACTIVE_LOW>;
int2-gpios = <&arduino_header 14 GPIO_ACTIVE_LOW>;
};
};