Unverified Commit 021e08eb authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

atmega2560: provide one DMX driver per extra UART

parent 21816645
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -4,18 +4,18 @@
 * SPDX-License-Identifier: BSD-2-Clause
 */

class DMX {
class DMX1 {
	private:
		DMX(const DMX &copy);
		DMX1(const DMX1 &copy);

	public:
		static unsigned char const num_frames = 32;
		unsigned char frames[num_frames];

		DMX() {}
		DMX1() {}

		void setup();
		void write();
};

extern DMX dmx;
extern DMX1 dmx1;
+21 −0
Original line number Diff line number Diff line
/*
 * Copyright 2022 Birte Kristina Friesel
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

class DMX2 {
	private:
		DMX2(const DMX2 &copy);

	public:
		static unsigned char const num_frames = 32;
		unsigned char frames[num_frames];

		DMX2() {}

		void setup();
		void write();
};

extern DMX2 dmx2;
+21 −0
Original line number Diff line number Diff line
/*
 * Copyright 2022 Birte Kristina Friesel
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

class DMX3 {
	private:
		DMX3(const DMX3 &copy);

	public:
		static unsigned char const num_frames = 32;
		unsigned char frames[num_frames];

		DMX3() {}

		void setup();
		void write();
};

extern DMX3 dmx3;
+3 −0
Original line number Diff line number Diff line
@@ -7,18 +7,21 @@ bool "DMX1 Output on PD3 (D18)"
help
  TX: PD3 (UART1) (D18)
select meta_driver_dmx
select meta_driver_dmx1

config arch_atmega2560_driver_dmx2
bool "DMX2 Output on PH1 (D16)"
help
  TX: PH1 (UART2) (D16)
select meta_driver_dmx
select meta_driver_dmx2

config arch_atmega2560_driver_dmx3
bool "DMX3 Output on PJ1 (D14)"
help
  TX: PJ1 (UART3) (D14)
select meta_driver_dmx
select meta_driver_dmx3

config arch_atmega2560_driver_i2c
bool "I2C"
+10 −2
Original line number Diff line number Diff line
@@ -83,8 +83,16 @@ ifdef CONFIG_arch_atmega2560_driver_adc
	CXX_TARGETS += src/arch/atmega2560/driver/adc.cc
endif

ifdef CONFIG_arch_atmega2560_driver_dmx
	CXX_TARGETS += src/arch/atmega2560/driver/dmx.cc
ifdef CONFIG_arch_atmega2560_driver_dmx1
	CXX_TARGETS += src/arch/atmega2560/driver/dmx1.cc
endif

ifdef CONFIG_arch_atmega2560_driver_dmx2
	CXX_TARGETS += src/arch/atmega2560/driver/dmx2.cc
endif

ifdef CONFIG_arch_atmega2560_driver_dmx3
	CXX_TARGETS += src/arch/atmega2560/driver/dmx3.cc
endif

ifdef CONFIG_arch_atmega2560_driver_spi
Loading