Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ CONFIG_BT_BUF_CMD_TX_COUNT=10
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512

CONFIG_ADC=y
#CONFIG_PWM=y
CONFIG_PWM=y
CONFIG_COUNTER=y

CONFIG_LLEXT_STORAGE_WRITABLE=n
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,110 @@
prescaler = <1>; // Optional: sets the RTC tick to ~30.5 µs
};

&adc {
zephyr,deferred-init;
};

&pinctrl {
empty_default: empty_default {
group1 {
psels = <>;
};
};

pwm1_default: pwm1_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 10)>,
<NRF_PSEL(PWM_OUT1, 0, 9)>,
<NRF_PSEL(PWM_OUT2, 0, 20)>,
<NRF_PSEL(PWM_OUT3, 0, 23)>;
nordic,invert;
};
};

pwm1_sleep: pwm1_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 10)>,
<NRF_PSEL(PWM_OUT1, 0, 9)>,
<NRF_PSEL(PWM_OUT2, 0, 20)>,
<NRF_PSEL(PWM_OUT3, 0, 23)>;
low-power-enable;
};
};

pwm2_default: pwm2_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 22)>,
<NRF_PSEL(PWM_OUT1, 0, 24)>,
<NRF_PSEL(PWM_OUT2, 0, 29)>,
<NRF_PSEL(PWM_OUT3, 0, 28)>;
nordic,invert;
};
};

pwm2_sleep: pwm2_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 22)>,
<NRF_PSEL(PWM_OUT1, 0, 24)>,
<NRF_PSEL(PWM_OUT2, 0, 29)>,
<NRF_PSEL(PWM_OUT3, 0, 28)>;
low-power-enable;
};
};

pwm3_default: pwm3_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 27)>,
<NRF_PSEL(PWM_OUT1, 0, 11)>,
<NRF_PSEL(PWM_OUT2, 0, 2)>,
<NRF_PSEL(PWM_OUT3, 0, 30)>;
nordic,invert;
};
};

pwm3_sleep: pwm3_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 27)>, /* keep original config */
<NRF_PSEL(PWM_OUT1, 0, 11)>,
<NRF_PSEL(PWM_OUT2, 0, 2)>,
<NRF_PSEL(PWM_OUT3, 0, 30)>;
low-power-enable;
};
};
};

&pwm0 {
status = "okay";
zephyr,deferred-init;
pinctrl-0 = <&empty_default>;
pinctrl-1 = <&pwm1_sleep>;
pinctrl-2 = <&pwm1_default>;
pinctrl-names = "default", "sleep", "arduino";
};

&pwm1 {
status = "okay";
zephyr,deferred-init;
pinctrl-0 = <&empty_default>;
pinctrl-1 = <&pwm2_sleep>;
pinctrl-2 = <&pwm2_default>;
pinctrl-names = "default", "sleep", "arduino";
};

&pwm2 {
status = "okay";
zephyr,deferred-init;
pinctrl-0 = <&empty_default>;
pinctrl-1 = <&pwm3_sleep>;
pinctrl-2 = <&pwm3_default>;
pinctrl-names = "default", "sleep", "arduino";
};

&i2c1 {
status = "okay";
zephyr,deferred-init;
};

/ {
zephyr,user {
digital-pin-gpios = <&gpio0 10 0>, // 0: GPIO3
Expand Down Expand Up @@ -58,6 +162,33 @@
io-channels = <&adc 0>,
<&adc 6>;

pwm-pin-gpios = <&gpio0 10 0>,
<&gpio0 9 0>,
<&gpio0 20 0>,
<&gpio0 23 0>,
<&gpio0 22 0>,
<&gpio0 24 0>,
<&gpio0 29 0>,
<&gpio0 28 0>,
<&gpio0 27 0>,
<&gpio0 11 0>,
<&gpio0 2 0>,
<&gpio0 30 0>;


pwms = <&pwm0 0 PWM_HZ(500) PWM_POLARITY_NORMAL>,
<&pwm0 1 PWM_HZ(500) PWM_POLARITY_NORMAL>,
<&pwm0 2 PWM_HZ(500) PWM_POLARITY_NORMAL>,
<&pwm0 3 PWM_HZ(500) PWM_POLARITY_NORMAL>,
<&pwm1 0 PWM_HZ(500) PWM_POLARITY_NORMAL>,
<&pwm1 1 PWM_HZ(500) PWM_POLARITY_NORMAL>,
<&pwm1 2 PWM_HZ(500) PWM_POLARITY_NORMAL>,
<&pwm1 3 PWM_HZ(500) PWM_POLARITY_NORMAL>,
<&pwm2 0 PWM_HZ(500) PWM_POLARITY_NORMAL>,
<&pwm2 1 PWM_HZ(500) PWM_POLARITY_NORMAL>,
<&pwm2 2 PWM_HZ(500) PWM_POLARITY_NORMAL>,
<&pwm2 3 PWM_HZ(500) PWM_POLARITY_NORMAL>;

serials = <&uart0>;
i2cs = <&i2c1>;
// spis = <&spi0>; // conflicts with uart0 (same peripheral)
Expand Down
Loading