You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
177 lines
2.8 KiB
177 lines
2.8 KiB
/* |
|
* Copyright (c) 2024 Kickmaker |
|
* |
|
* SPDX-License-Identifier: Apache-2.0 |
|
*/ |
|
|
|
/dts-v1/; |
|
#include <st/c0/stm32c011X6.dtsi> |
|
#include <st/c0/stm32c011f(4-6)ux-pinctrl.dtsi> |
|
#include <zephyr/dt-bindings/input/input-event-codes.h> |
|
|
|
/ { |
|
model = "STMicroelectronics STM32C0116-DK Discovery board"; |
|
compatible = "st,stm32c011f6-dk"; |
|
|
|
chosen { |
|
zephyr,console = &usart1; |
|
zephyr,shell-uart = &usart1; |
|
zephyr,sram = &sram0; |
|
zephyr,flash = &flash0; |
|
}; |
|
|
|
leds: leds { |
|
compatible = "gpio-leds"; |
|
|
|
green_led_3: led_3 { |
|
gpios = <&gpiob 6 GPIO_ACTIVE_LOW>; |
|
label = "User LD3"; |
|
}; |
|
}; |
|
|
|
pwmleds { |
|
compatible = "pwm-leds"; |
|
|
|
green_pwm_led: green_pwm_led { |
|
pwms = <&pwm1 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>; |
|
}; |
|
}; |
|
|
|
gpio_keys { |
|
compatible = "gpio-keys"; |
|
|
|
reset_button: button { |
|
label = "reset button"; |
|
gpios = <&gpiof 2 GPIO_ACTIVE_LOW>; |
|
status = "okay"; |
|
zephyr,code = <INPUT_KEY_0>; |
|
}; |
|
}; |
|
|
|
adc-keys { |
|
compatible = "adc-keys"; |
|
io-channels = <&adc1 8>; |
|
keyup-threshold-mv = <3300>; |
|
|
|
select_key { |
|
press-thresholds-mv = <0>; |
|
zephyr,code = <INPUT_KEY_ENTER>; |
|
}; |
|
|
|
left_key { |
|
press-thresholds-mv = <670>; |
|
zephyr,code = <INPUT_KEY_LEFT>; |
|
}; |
|
|
|
down_key { |
|
press-thresholds-mv = <1320>; |
|
zephyr,code = <INPUT_KEY_DOWN>; |
|
}; |
|
|
|
up_key { |
|
press-thresholds-mv = <2010>; |
|
zephyr,code = <INPUT_KEY_UP>; |
|
}; |
|
|
|
right_key { |
|
press-thresholds-mv = <2650>; |
|
zephyr,code = <INPUT_KEY_RIGHT>; |
|
}; |
|
}; |
|
|
|
aliases { |
|
led0 = &green_led_3; |
|
pwm-led0 = &green_pwm_led; |
|
sw0 = &reset_button; |
|
watchdog0 = &iwdg; |
|
die-temp0 = &die_temp; |
|
volt-sensor0 = &vref; |
|
}; |
|
}; |
|
|
|
&clk_hsi { |
|
status = "okay"; |
|
}; |
|
|
|
&rcc { |
|
clocks = <&clk_hsi>; |
|
clock-frequency = <DT_FREQ_M(48)>; |
|
ahb-prescaler = <1>; |
|
apb1-prescaler = <1>; |
|
}; |
|
|
|
&pinctrl { |
|
remap-pa11; |
|
remap-pa12; |
|
}; |
|
|
|
&usart1 { |
|
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>; |
|
pinctrl-names = "default"; |
|
current-speed = <115200>; |
|
status = "okay"; |
|
}; |
|
|
|
&usart2 { |
|
pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3>; |
|
pinctrl-names = "default"; |
|
current-speed = <115200>; |
|
status = "okay"; |
|
}; |
|
|
|
&rtc { |
|
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00000400>, |
|
<&rcc STM32_SRC_LSE RTC_SEL(1)>; |
|
status = "okay"; |
|
}; |
|
|
|
&iwdg { |
|
status = "okay"; |
|
}; |
|
|
|
&timers1 { |
|
st,prescaler = <10000>; |
|
status = "okay"; |
|
|
|
pwm1: pwm { |
|
pinctrl-0 = <&tim1_ch3_pb6>; |
|
pinctrl-names = "default"; |
|
status = "okay"; |
|
}; |
|
}; |
|
|
|
&adc1 { |
|
pinctrl-0 = <&adc1_in8_pa8>; |
|
pinctrl-names = "default"; |
|
st,adc-clock-source = "SYNC"; |
|
st,adc-prescaler = <2>; |
|
status = "okay"; |
|
|
|
#address-cells = <1>; |
|
#size-cells = <0>; |
|
|
|
channel@8 { |
|
reg = <0x8>; |
|
zephyr,gain = "ADC_GAIN_1"; |
|
zephyr,reference = "ADC_REF_INTERNAL"; |
|
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>; |
|
zephyr,resolution = <12>; |
|
zephyr,vref-mv = <3300>; |
|
}; |
|
}; |
|
|
|
&die_temp { |
|
status = "okay"; |
|
}; |
|
|
|
&vref { |
|
status = "okay"; |
|
}; |
|
|
|
&dma1 { |
|
status = "okay"; |
|
}; |
|
|
|
&dmamux1 { |
|
status = "okay"; |
|
};
|
|
|