aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Barksdale <amatus@amatus.name>2016-04-18 19:03:36 -0500
committerDavid Barksdale <amatus@amatus.name>2016-04-18 19:29:08 -0500
commit5a0164d8a9b8af427c2b7c6db3bdadcf58c8c9b2 (patch)
tree085919d02a15acb2681849a60b9ba174c8e6ab40
parent99cc0e2559bd99fe551208e68d91d71ac6a8bdf9 (diff)
Make compatible with V0 badges again
Since we don't need to control reset to fix EPD stuck problems wire it back to PTA20 and revert the code changes.
-rw-r--r--laser-tag badge/laser-tag.brd52
-rw-r--r--laser-tag badge/laser-tag.sch14
-rw-r--r--laser-tag software/epaper.c25
3 files changed, 25 insertions, 66 deletions
diff --git a/laser-tag badge/laser-tag.brd b/laser-tag badge/laser-tag.brd
index 1d27067..c67c595 100644
--- a/laser-tag badge/laser-tag.brd
+++ b/laser-tag badge/laser-tag.brd
@@ -2689,33 +2689,6 @@ Source: Comchip CGRM4001-G.pdf</description>
<contactref element="R4" pad="1"/>
<contactref element="BAT2" pad="-"/>
<via x="85.725" y="71.755" extent="1-16" drill="0.5"/>
-<wire x1="63.44" y1="73.695" x2="85.725" y2="71.755" width="0" layer="19" extent="1-16"/>
-<wire x1="52.07" y1="63.5" x2="61.74" y2="73.695" width="0" layer="19" extent="1-16"/>
-<wire x1="67.31" y1="42.94" x2="65.630621875" y2="46.91558125" width="0" layer="19" extent="1-16"/>
-<wire x1="69.85" y1="41.275" x2="68.34" y2="42.94" width="0" layer="19" extent="1-1"/>
-<wire x1="72.878478125" y1="38.253515625" x2="73.265" y2="38.34" width="0" layer="19" extent="1-16"/>
-<wire x1="64.77" y1="42.545" x2="67.31" y2="42.94" width="0" layer="19" extent="1-1"/>
-<wire x1="67.31" y1="38.735" x2="69.85" y2="41.275" width="0" layer="19" extent="1-1"/>
-<wire x1="68.635828125" y1="34.0108625" x2="67.31" y2="37.705" width="0" layer="19" extent="1-16"/>
-<wire x1="61.03441875" y1="38.96061875" x2="64.135" y2="41.515" width="0" layer="19" extent="1-16"/>
-<wire x1="77.685" y1="41.275" x2="73.66" y2="40.64" width="0" layer="19" extent="1-1"/>
-<wire x1="83.185" y1="42.545" x2="78.74" y2="41.275" width="0" layer="19" extent="1-1"/>
-<wire x1="87.63" y1="42.15" x2="85.18" y2="42.29" width="0" layer="19" extent="1-16"/>
-<wire x1="31.15" y1="31.89" x2="29.845" y2="26.035" width="0" layer="19" extent="16-16"/>
-<wire x1="27.94" y1="33.415" x2="31.15" y2="31.89" width="0" layer="19" extent="16-16"/>
-<wire x1="21.2725" y1="58.6325" x2="29.21" y2="64.135" width="0" layer="19" extent="16-16"/>
-<wire x1="22.225" y1="51.675" x2="21.2725" y2="58.6325" width="0" layer="19" extent="16-16"/>
-<wire x1="24.13" y1="51.675" x2="22.225" y2="51.675" width="0" layer="19" extent="16-16"/>
-<wire x1="26.035" y1="51.675" x2="24.13" y2="51.675" width="0" layer="19" extent="16-16"/>
-<wire x1="27.94" y1="51.675" x2="26.035" y2="51.675" width="0" layer="19" extent="16-16"/>
-<wire x1="20.32" y1="51.675" x2="22.225" y2="51.675" width="0" layer="19" extent="16-16"/>
-<wire x1="31.15" y1="46.89" x2="27.94" y2="51.675" width="0" layer="19" extent="16-16"/>
-<wire x1="64.4525" y1="8.255" x2="52.705" y2="8.89" width="0" layer="19" extent="1-16"/>
-<wire x1="72.35" y1="15.875" x2="64.48" y2="12.455" width="0" layer="19" extent="1-1"/>
-<wire x1="77.18" y1="12.455" x2="72.35" y2="15.875" width="0" layer="19" extent="1-1"/>
-<wire x1="80.645" y1="12.485" x2="77.18" y2="12.455" width="0" layer="19" extent="1-16"/>
-<wire x1="83.355" y1="16.19" x2="80.645" y2="12.485" width="0" layer="19" extent="16-16"/>
-<wire x1="7.874" y1="23.825" x2="11.43" y2="7.62" width="0" layer="19" extent="16-16"/>
</signal>
<signal name="VCC">
<contactref element="U1" pad="48"/>
@@ -2864,15 +2837,23 @@ Source: Comchip CGRM4001-G.pdf</description>
<wire x1="22.86" y1="13.335" x2="22.86" y2="5.08" width="0.254" layer="16"/>
</signal>
<signal name="PTA20">
-<contactref element="BREAKOUT2" pad="2"/>
<contactref element="U1" pad="34"/>
+<contactref element="BREAKOUT2" pad="2"/>
+<contactref element="P1" pad="7"/>
<wire x1="61.03441875" y1="42.319378125" x2="55.88" y2="47.473796875" width="0.254" layer="16"/>
<wire x1="55.88" y1="47.473796875" x2="55.88" y2="51.435" width="0.254" layer="16"/>
<wire x1="55.88" y1="51.435" x2="52.07" y2="55.245" width="0.254" layer="16"/>
-<wire x1="52.07" y1="55.245" x2="29.845" y2="55.245" width="0.254" layer="16"/>
<wire x1="29.845" y1="55.245" x2="12.7" y2="72.39" width="0.254" layer="16"/>
<wire x1="12.7" y1="72.39" x2="12.7" y2="76.2" width="0.254" layer="16"/>
<wire x1="12.7" y1="76.2" x2="11.43" y2="77.47" width="0.254" layer="16"/>
+<wire x1="52.07" y1="55.245" x2="29.845" y2="55.245" width="0.254" layer="16"/>
+<wire x1="31.15" y1="33.89" x2="31.985" y2="33.89" width="0.254" layer="16"/>
+<wire x1="31.985" y1="33.89" x2="33.02" y2="34.925" width="0.254" layer="16"/>
+<via x="33.02" y="34.925" extent="1-16" drill="0.5"/>
+<wire x1="33.02" y1="34.925" x2="33.02" y2="38.735" width="0.254" layer="1"/>
+<wire x1="33.02" y1="38.735" x2="12.7" y2="59.055" width="0.254" layer="1"/>
+<wire x1="12.7" y1="59.055" x2="12.7" y2="76.2" width="0.254" layer="1"/>
+<wire x1="12.7" y1="76.2" x2="11.43" y2="77.47" width="0.254" layer="1"/>
</signal>
<signal name="PTE0">
<contactref element="BREAKOUT1" pad="1"/>
@@ -3562,13 +3543,6 @@ Source: Comchip CGRM4001-G.pdf</description>
<wire x1="29.845" y1="54.61" x2="11.43" y2="73.025" width="0.254" layer="16"/>
<wire x1="11.43" y1="73.025" x2="11.43" y2="74.93" width="0.254" layer="16"/>
<wire x1="52.07" y1="54.61" x2="29.845" y2="54.61" width="0.254" layer="16"/>
-<contactref element="P1" pad="7"/>
-<wire x1="31.15" y1="33.89" x2="31.985" y2="33.89" width="0.254" layer="16"/>
-<wire x1="31.985" y1="33.89" x2="33.02" y2="34.925" width="0.254" layer="16"/>
-<via x="33.02" y="34.925" extent="1-16" drill="0.5"/>
-<wire x1="33.02" y1="34.925" x2="33.02" y2="39.37" width="0.254" layer="1"/>
-<wire x1="33.02" y1="39.37" x2="11.43" y2="60.96" width="0.254" layer="1"/>
-<wire x1="11.43" y1="60.96" x2="11.43" y2="74.93" width="0.254" layer="1"/>
</signal>
<signal name="VOUT33">
<via x="70.485" y="38.1" extent="1-16" drill="0.5"/>
@@ -3624,11 +3598,6 @@ Source: Comchip CGRM4001-G.pdf</description>
<contactref element="C7" pad="1"/>
<wire x1="31.15" y1="48.39" x2="25.665" y2="48.39" width="0.254" layer="16"/>
<wire x1="25.665" y1="48.39" x2="24.13" y2="49.925" width="0.254" layer="16"/>
-<wire x1="24.13" y1="49.925" x2="23.1775" y2="50.8775" width="0" layer="19" extent="1-16"/>
-<wire x1="23.1775" y1="50.8775" x2="23.1775" y2="55.88" width="0" layer="19" extent="1-16"/>
-<wire x1="23.1775" y1="55.88" x2="22.225" y2="56.8325" width="0" layer="19" extent="1-16"/>
-<wire x1="22.225" y1="56.8325" x2="20.32" y2="56.8325" width="0" layer="19" extent="1-16"/>
-<wire x1="20.32" y1="56.8325" x2="18.9025" y2="55.415" width="0" layer="19" extent="1-16"/>
</signal>
<signal name="N$6">
<contactref element="P1" pad="35"/>
@@ -3644,7 +3613,6 @@ Source: Comchip CGRM4001-G.pdf</description>
<contactref element="C9" pad="1"/>
<wire x1="31.15" y1="47.39" x2="22.855" y2="47.39" width="0.254" layer="16"/>
<wire x1="22.855" y1="47.39" x2="20.32" y2="49.925" width="0.254" layer="16"/>
-<wire x1="20.32" y1="49.925" x2="14.83" y2="55.415" width="0" layer="19" extent="1-16"/>
</signal>
<signal name="N$8">
<contactref element="P1" pad="9"/>
diff --git a/laser-tag badge/laser-tag.sch b/laser-tag badge/laser-tag.sch
index 9a8e882..56a72eb 100644
--- a/laser-tag badge/laser-tag.sch
+++ b/laser-tag badge/laser-tag.sch
@@ -10068,13 +10068,18 @@ support interrupts</text>
</net>
<net name="PTA20" class="0">
<segment>
+<pinref part="U1" gate="A" pin="PTA20"/>
+<wire x1="116.84" y1="22.86" x2="121.92" y2="22.86" width="0.1524" layer="91"/>
+</segment>
+<segment>
<pinref part="BREAKOUT2" gate="A" pin="2"/>
<wire x1="-63.5" y1="60.96" x2="-58.42" y2="60.96" width="0.1524" layer="91"/>
<label x="-58.42" y="60.96" size="1.778" layer="95"/>
</segment>
<segment>
-<pinref part="U1" gate="A" pin="PTA20"/>
-<wire x1="116.84" y1="22.86" x2="121.92" y2="22.86" width="0.1524" layer="91"/>
+<pinref part="P1" gate="G$1" pin="/RESET"/>
+<wire x1="12.7" y1="-17.78" x2="7.62" y2="-17.78" width="0.1524" layer="91"/>
+<label x="7.62" y="-17.78" size="1.778" layer="95" rot="R180"/>
</segment>
</net>
<net name="PTE0" class="0">
@@ -10749,11 +10754,6 @@ support interrupts</text>
<wire x1="-71.12" y1="60.96" x2="-76.2" y2="60.96" width="0.1524" layer="91"/>
<label x="-76.2" y="60.96" size="1.778" layer="95" rot="R180"/>
</segment>
-<segment>
-<pinref part="P1" gate="G$1" pin="/RESET"/>
-<wire x1="12.7" y1="-17.78" x2="7.62" y2="-17.78" width="0.1524" layer="91"/>
-<label x="7.62" y="-17.78" size="1.778" layer="95" rot="R180"/>
-</segment>
</net>
<net name="VOUT33" class="0">
<segment>
diff --git a/laser-tag software/epaper.c b/laser-tag software/epaper.c
index af6aa90..a1c6391 100644
--- a/laser-tag software/epaper.c
+++ b/laser-tag software/epaper.c
@@ -2,8 +2,6 @@
#include "fsl_gpio_driver.h"
#include "fsl_spi_dma_master_driver.h"
-#define HAS_RESET 0
-
typedef enum { /* Image pixel -> Display pixel */
EPD_compensate, /* B -> W, W -> B (Current Image) */
EPD_white, /* B -> N, W -> W (Current Image) */
@@ -11,14 +9,14 @@ typedef enum { /* Image pixel -> Display pixel */
EPD_normal /* B -> B, W -> W (New Image) */
} EPD_stage;
-static const gpio_output_pin_user_config_t pinReset = {
+static const gpio_output_pin_user_config_t pinDischarge = {
.pinName = GPIO_MAKE_PIN(GPIOA_IDX, 19),
.config.outputLogic = 0,
};
static const gpio_output_pin_user_config_t pinCS = {
.pinName = GPIO_MAKE_PIN(GPIOD_IDX, 4),
- .config.outputLogic = 0,
+ .config.outputLogic = 1,
};
static const spi_dma_master_user_config_t spiConfig = {
@@ -48,7 +46,7 @@ void EPD_Init()
PORT_HAL_SetMuxMode(g_portBase[GPIOD_IDX], 5, kPortMuxAlt2);
PORT_HAL_SetMuxMode(g_portBase[GPIOD_IDX], 6, kPortMuxAlt2);
PORT_HAL_SetMuxMode(g_portBase[GPIOD_IDX], 7, kPortMuxAlt2);
- GPIO_DRV_OutputPinInit(&pinReset);
+ GPIO_DRV_OutputPinInit(&pinDischarge);
GPIO_DRV_OutputPinInit(&pinCS);
}
@@ -223,18 +221,6 @@ int EPD_Draw(const uint8_t *old_image, const uint8_t *new_image)
uint32_t calculatedBaudRate;
SPI_DRV_DmaMasterConfigureBus(1, &spiConfig, &calculatedBaudRate);
- /* Reset */
-#if HAS_RESET
- GPIO_DRV_WritePinOutput(pinReset.pinName, 0);
-#endif
- GPIO_DRV_WritePinOutput(pinCS.pinName, 0);
- EPD_Delay(5);
-#if HAS_RESET
- GPIO_DRV_WritePinOutput(pinReset.pinName, 1);
-#endif
- GPIO_DRV_WritePinOutput(pinCS.pinName, 1);
- EPD_Delay(5);
-
/* read the COG ID */
uint8_t id = EPD_ReadCogID();
if ((id & 0x0f) != 0x02) {
@@ -341,6 +327,11 @@ int EPD_Draw(const uint8_t *old_image, const uint8_t *new_image)
EPD_WriteCommandByte(0x07, 0x01);
EPD_Delay(50);
+ /* discharge external */
+ GPIO_DRV_WritePinOutput(pinDischarge.pinName, 1);
+ EPD_Delay(150);
+ GPIO_DRV_WritePinOutput(pinDischarge.pinName, 0);
+
out:
SPI_DRV_DmaMasterDeinit(1);
return rc;