Commit 0d84f5e5 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Add Sharp96 display driver, split up msp430 SPI into a1 / b

parent 1978e406
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -14,6 +14,14 @@ ifneq ($(findstring lm75,${drivers}), )
	COMMON_FLAGS += -DDRIVER_LM75
endif

ifneq ($(findstring sharp96,${drivers}), )
	TARGETS += src/driver/sharp96.cc
	COMMON_FLAGS += -DDRIVER_SHARP6
	COMMON_FLAGS += -DSHARP96_POWER_PIN=GPIO::${sharp96_power_pin}
	COMMON_FLAGS += -DSHARP96_EN_PIN=GPIO::${sharp96_en_pin}
	COMMON_FLAGS += -DSHARP96_CS_PIN=GPIO::${sharp96_cs_pin}
endif

ifeq (${timer_cycles}, 1)
	COMMON_FLAGS += -DTIMER_CYCLES
endif
+24 −0
Original line number Diff line number Diff line
#ifndef SHARP96_H
#define SHARP96_H

class Sharp96 {
	private:
		Sharp96(const Sharp96 &copy);
		unsigned char txbuf[2];
		unsigned char vcom;
		unsigned char swap_bits(unsigned char byte);

	public:
		Sharp96() : vcom(0) {}

		void setup();
		void powerOn();
		void powerOff();
		void clear();
		void writeLine(unsigned char line_no, unsigned char* data);
		void toggleVCOM();
};

extern Sharp96 sharp96;

#endif
+0 −18
Original line number Diff line number Diff line
#ifndef SPI_H
#define SPI_H

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

	public:
		SPI () {}
		signed char setup();
		signed char xmit(
				unsigned char tx_len, unsigned char *tx_buf,
				unsigned char rx_len, unsigned char *rx_buf);
};

extern SPI spi;

#endif
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ class SPI {

	public:
		SPI () {}
		signed char setup();
		void setup();
		signed char xmit(
				unsigned char tx_len, unsigned char *tx_buf,
				unsigned char rx_len, unsigned char *rx_buf);
+1 −0
Original line number Diff line number Diff line
driver_sharp96 ?= 1
Loading