boards: frdm_k82f: Add arduino_i2c and arduino_spi support
* Tested with adafruit_2_8_tft_touch_v2 shield * Shield uses GPIO Chip Select Signed-off-by: Tim Schumann <TimSchumann@gmail.com>
This commit is contained in:
parent
1de0b49212
commit
854bdf56b4
3 changed files with 36 additions and 0 deletions
|
@ -232,3 +232,21 @@
|
|||
&pit0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
arduino_i2c: &i2c0 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&I2C0_SDA_PTB3 &I2C0_SCL_PTB2>;
|
||||
};
|
||||
|
||||
&I2C0_SDA_PTB3 {
|
||||
drive-open-drain;
|
||||
};
|
||||
|
||||
&I2C0_SCL_PTB2 {
|
||||
drive-open-drain;
|
||||
};
|
||||
|
||||
arduino_spi: &spi0 {
|
||||
status = "okay";
|
||||
pinctrl-0 = <&SPI0_SCK_PTD1 &SPI0_SOUT_PTD2 &SPI0_SIN_PTD3 &SPI0_PCS1_PTD4>;
|
||||
};
|
||||
|
|
|
@ -11,6 +11,8 @@ flash: 256
|
|||
supported:
|
||||
- adc
|
||||
- arduino_gpio
|
||||
- arduino_i2c
|
||||
- arduino_spi
|
||||
- counter
|
||||
- gpio
|
||||
- i2c
|
||||
|
|
|
@ -61,6 +61,22 @@ static int frdm_k82f_pinmux_init(const struct device *dev)
|
|||
pinmux_pin_set(porte, 5, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||
#endif
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2c0), okay) && CONFIG_I2C
|
||||
/* I2C0 SDA, SCL */
|
||||
pinmux_pin_set(portb, 3, PORT_PCR_MUX(kPORT_MuxAlt2)
|
||||
| PORT_PCR_ODE_MASK);
|
||||
pinmux_pin_set(portb, 2, PORT_PCR_MUX(kPORT_MuxAlt2)
|
||||
| PORT_PCR_ODE_MASK);
|
||||
#endif
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi0), okay) && CONFIG_SPI
|
||||
/* SPI0 SCK, SOUT, SIN, PCS1 */
|
||||
pinmux_pin_set(portd, 1, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||
pinmux_pin_set(portd, 2, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||
pinmux_pin_set(portd, 3, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||
pinmux_pin_set(portd, 4, PORT_PCR_MUX(kPORT_MuxAlt2));
|
||||
#endif
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(lpuart4), okay) && CONFIG_SERIAL
|
||||
/* LPUART4 RX, TX */
|
||||
pinmux_pin_set(portc, 14, PORT_PCR_MUX(kPORT_MuxAlt3));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue