From 8b614921529e79e01c2cd5b27e9fe300b8ba28e1 Mon Sep 17 00:00:00 2001 From: Jelmer Tiete Date: Wed, 22 May 2013 17:46:12 +0200 Subject: [PATCH 1/6] first implementation for tlc59116 on z1 --- examples/z1/Makefile | 2 +- examples/z1/test-tlc59116.c | 74 ++++++++++++++++ platform/z1/Makefile.common | 2 +- platform/z1/dev/tlc59116.c | 171 ++++++++++++++++++++++++++++++++++++ platform/z1/dev/tlc59116.h | 132 ++++++++++++++++++++++++++++ 5 files changed, 379 insertions(+), 2 deletions(-) create mode 100644 examples/z1/test-tlc59116.c create mode 100644 platform/z1/dev/tlc59116.c create mode 100644 platform/z1/dev/tlc59116.h diff --git a/examples/z1/Makefile b/examples/z1/Makefile index 3e9362b06..99f08955a 100644 --- a/examples/z1/Makefile +++ b/examples/z1/Makefile @@ -2,7 +2,7 @@ ifndef TARGET TARGET=z1 endif -CONTIKI_PROJECT = test-phidgets blink test-adxl345 test-tmp102 test-light-ziglet test-battery test-sht11 test-relay-phidget #test-potent +CONTIKI_PROJECT = test-phidgets blink test-adxl345 test-tmp102 test-light-ziglet test-battery test-sht11 test-relay-phidget test-tlc59116 #test-potent CONTIKI_SOURCEFILES += sht11.c# potentiometer-sensor.c APPS=serial-shell diff --git a/examples/z1/test-tlc59116.c b/examples/z1/test-tlc59116.c new file mode 100644 index 000000000..6fbee8d03 --- /dev/null +++ b/examples/z1/test-tlc59116.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2010, Swedish Institute of Computer Science. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * This file is part of the Contiki operating system. + * + */ + +/** + * \file + * A simple program for testing the TLC59116 I2C led driver. + * \author + * Jelmer Tiete, VUB + */ + +#include +#include "contiki.h" +#include "dev/tlc59116.h" + +#define BLINK_INTERVAL CLOCK_SECOND/2 + +/*---------------------------------------------------------------------------*/ +PROCESS(tlc59116_process, "Test tlc59116 process"); +AUTOSTART_PROCESSES(&tlc59116_process); + +/*---------------------------------------------------------------------------*/ +/* Main process, setups */ + +static struct etimer et; + +PROCESS_THREAD(tlc59116_process, ev, data) { + PROCESS_BEGIN(); + { + + /* Start and setup the led driver with default values, eg outputs on and pwm enabled. */ + tlc59116_init(); + + while (1) { + + tlc59116_led(0x02,0xFF); +printf("Ping.\n"); + etimer_set(&et, BLINK_INTERVAL); + PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et)); + } + } + PROCESS_END(); +} + +/*---------------------------------------------------------------------------*/ + diff --git a/platform/z1/Makefile.common b/platform/z1/Makefile.common index 57536b3e2..2eb30ac89 100644 --- a/platform/z1/Makefile.common +++ b/platform/z1/Makefile.common @@ -33,7 +33,7 @@ CFLAGS += -DMACID=$(nodemac) endif CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS) -CONTIKI_TARGET_SOURCEFILES += i2cmaster.c adxl345.c +CONTIKI_TARGET_SOURCEFILES += i2cmaster.c adxl345.c tlc59116.c MCU=msp430f2617 include $(CONTIKI)/cpu/msp430/Makefile.msp430 diff --git a/platform/z1/dev/tlc59116.c b/platform/z1/dev/tlc59116.c new file mode 100644 index 000000000..9e5bd5df3 --- /dev/null +++ b/platform/z1/dev/tlc59116.c @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2010, Swedish Institute of Computer Science. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * This file is part of the Contiki operating system. + * + */ + +/** + * \file + * Device drivers for tlc5916 led driver in Zolertia Z1. + * \author + * Jelmer Tiete, VUB + */ + + +#include +#include "contiki.h" +#include "tlc59116.h" +#include "i2cmaster.h" + +/*---------------------------------------------------------------------------*/ +/* Write to a register. + args: + reg register to write to + val value to write +*/ + +void +tlc59116_write_reg(uint8_t reg, uint8_t val) { + uint8_t tx_buf[] = {reg, val}; + + i2c_transmitinit(TLC59116_ADDR); + while (i2c_busy()); + PRINTFDEBUG("I2C Ready to TX\n"); + + i2c_transmit_n(2, tx_buf); + while (i2c_busy()); + PRINTFDEBUG("WRITE_REG 0x%02X @ reg 0x%02X\n", val, reg); +} +/*---------------------------------------------------------------------------*/ +/* Write several registers from a stream. + args: + len number of bytes to read + data pointer to where the data is read from + + First byte in stream must be the register address to begin writing to. + The data is then written from second byte and increasing. */ + +void +tlc59116_write_stream(uint8_t len, uint8_t *data) { + i2c_transmitinit(TLC59116_ADDR); + while (i2c_busy()); + PRINTFDEBUG("I2C Ready to TX(stream)\n"); + + i2c_transmit_n(len, data); // start tx and send conf reg + while (i2c_busy()); + PRINTFDEBUG("WRITE_STR %u B to 0x%02X\n", len, data[0]); +} + +/*---------------------------------------------------------------------------*/ +/* Read one register. + args: + reg what register to read + returns the value of the read register +*/ + +uint8_t +tlc59116_read_reg(uint8_t reg) { + uint8_t retVal = 0; + uint8_t rtx = reg; + PRINTFDEBUG("READ_REG 0x%02X\n", reg); + + /* transmit the register to read */ + i2c_transmitinit(TLC59116_ADDR); + while (i2c_busy()); + i2c_transmit_n(1, &rtx); + while (i2c_busy()); + + /* receive the data */ + i2c_receiveinit(TLC59116_ADDR); + while (i2c_busy()); + i2c_receive_n(1, &retVal); + while (i2c_busy()); + + return retVal; +} + +/*---------------------------------------------------------------------------*/ +/* Read several registers in a stream. + args: + reg what register to start reading from + len number of bytes to read + whereto pointer to where the data is saved +*/ + +void +tlc59116_read_stream(uint8_t reg, uint8_t len, uint8_t *whereto) { + uint8_t rtx = reg; + PRINTFDEBUG("READ_STR %u B from 0x%02X\n", len, reg); + + /* transmit the register to start reading from */ + i2c_transmitinit(TLC59116_ADDR); + while (i2c_busy()); + i2c_transmit_n(1, &rtx); + while (i2c_busy()); + + /* receive the data */ + i2c_receiveinit(TLC59116_ADDR); + while (i2c_busy()); + i2c_receive_n(len, whereto); + while (i2c_busy()); +} + +/*---------------------------------------------------------------------------*/ +/* Set pwm value for individual led + */ + +void +tlc59116_led(uint8_t led, uint8_t pwm) { + if (led<1 | led>16) { + PRINTFDEBUG("TLC59116: wrong led value."); + } + + tlc59116_write_reg(led, pwm); +} + +/*---------------------------------------------------------------------------*/ +/* Init the led driver: ports, pins, registers, interrupts (none enabled), I2C, + default threshold values etc. */ + +void +tlc59116_init(void) { + /* Set up ports and pins for I2C communication */ + i2c_enable(); + + /* set default register values. */ + tlc59116_write_reg(TLC59116_MODE1, TLC59116_MODE1_DEFAULT); + tlc59116_write_reg(TLC59116_MODE2, TLC59116_MODE2_DEFAULT); + + /* set all leds to PWM control */ + tlc59116_write_reg(TLC59116_LEDOUT0,TLC59116_LEDOUT_PWM); + tlc59116_write_reg(TLC59116_LEDOUT1,TLC59116_LEDOUT_PWM); + tlc59116_write_reg(TLC59116_LEDOUT2,TLC59116_LEDOUT_PWM); + tlc59116_write_reg(TLC59116_LEDOUT3,TLC59116_LEDOUT_PWM); +} + diff --git a/platform/z1/dev/tlc59116.h b/platform/z1/dev/tlc59116.h new file mode 100644 index 000000000..daa40bb3e --- /dev/null +++ b/platform/z1/dev/tlc59116.h @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2010, Swedish Institute of Computer Science. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * This file is part of the Contiki operating system. + * + */ + +/** + * \file + * Device drivers header file for TLC59116 led driver in Zolertia Z1. + * \author + * Jelmer Tiete, VUB + */ + +#ifndef __TLC59116_H__ +#define __TLC59116_H__ +#include +#include "dev/i2cmaster.h" + +/* -------------------------------------------------------------------------- */ +/* Init the led driver: ports, pins, registers, I2C*/ +void tlc59116_init(void); + +/* Write to a register. + args: + reg register to write to + val value to write +*/ +void tlc59116_write_reg(uint8_t reg, uint8_t val); + +/* Write several registers from a stream. + args: + len number of bytes to read + data pointer to where the data is read from + First byte in stream must be the register address to begin writing to. + The data is then written from the second byte and increasing. The address byte + is not included in length len. */ +void tlc59116_write_stream(uint8_t len, uint8_t *data); + +/* Read one register. + args: + reg what register to read + returns the value of the read register +*/ +uint8_t tlc59116_read_reg(uint8_t reg); + +/* Read several registers in a stream. + args: + reg what register to start reading from + len number of bytes to read + whereto pointer to where the data is saved +*/ +void tlc59116_read_stream(uint8_t reg, uint8_t len, uint8_t *whereto); + +/* Set pwm value for individual led + args: + led led output -> 1 till 16 + pwm led pwm value +*/ + +void tlc59116_led(uint8_t led, uint8_t pwm); + + +/* -------------------------------------------------------------------------- */ +/* Application definitions, change if required by application. */ + +/* Suggested defaults according to the data sheet etc */ +#define TLC59116_MODE1_DEFAULT 0x80 // +#define TLC59116_MODE2_DEFAULT 0x00 // + +/* -------------------------------------------------------------------------- */ +/* Reference definitions, should not be changed */ +/* TLC59116 slave address */ +#define TLC59116_ADDR 0xC0 //adress with all adress pins pulled to ground +#define TLC59116_ALLCALL 0xD0 +#define TLC59116_LEDOUT_PWM 0xAA // LDRx = 01 -> PWM, 4 leds per reg: 01010101 -> 0xAA + +/* TLC59116 registers */ +#define TLC59116_MODE1 0x00 +#define TLC59116_MODE2 0x01 +#define TLC59116_PWM0 0x02 +#define TLC59116_PWM1 0x03 +#define TLC59116_PWM2 0x04 +#define TLC59116_PWM3 0x05 +#define TLC59116_PWM4 0x06 +#define TLC59116_PWM5 0x07 +#define TLC59116_PWM6 0x08 +#define TLC59116_PWM7 0x09 +#define TLC59116_PWM8 0x0A +#define TLC59116_PWM9 0x0B +#define TLC59116_PWM10 0x0C +#define TLC59116_PWM11 0x0D +#define TLC59116_PWM12 0x0E +#define TLC59116_PWM13 0x0F +#define TLC59116_PWM14 0x10 +#define TLC59116_PWM15 0x11 +#define TLC59116_GRPPWM 0x12 +#define TLC59116_GRPFREQ 0x13 +#define TLC59116_LEDOUT0 0x14 +#define TLC59116_LEDOUT1 0x15 +#define TLC59116_LEDOUT2 0x16 +#define TLC59116_LEDOUT3 0x17 + +/* More registers, but not used in this implementation */ + +/* -------------------------------------------------------------------------- */ +#endif /* ifndef __ADXL345_H__ */ From cc2567b9880e37cd683ad8cf5a2ca40285dd814c Mon Sep 17 00:00:00 2001 From: Jelmer Tiete Date: Thu, 23 May 2013 17:52:02 +0200 Subject: [PATCH 2/6] working tlc59116 implementation for z1 --- examples/z1/test-tlc59116.c | 13 ++++++++++--- platform/z1/dev/tlc59116.c | 17 +++++++++++++---- platform/z1/dev/tlc59116.h | 4 ++-- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/examples/z1/test-tlc59116.c b/examples/z1/test-tlc59116.c index 6fbee8d03..f2d771cd5 100644 --- a/examples/z1/test-tlc59116.c +++ b/examples/z1/test-tlc59116.c @@ -41,7 +41,7 @@ #include "contiki.h" #include "dev/tlc59116.h" -#define BLINK_INTERVAL CLOCK_SECOND/2 +#define BLINK_INTERVAL CLOCK_SECOND/25 /*---------------------------------------------------------------------------*/ PROCESS(tlc59116_process, "Test tlc59116 process"); @@ -51,6 +51,7 @@ AUTOSTART_PROCESSES(&tlc59116_process); /* Main process, setups */ static struct etimer et; +static uint8_t count = 0; PROCESS_THREAD(tlc59116_process, ev, data) { PROCESS_BEGIN(); @@ -61,8 +62,14 @@ PROCESS_THREAD(tlc59116_process, ev, data) { while (1) { - tlc59116_led(0x02,0xFF); -printf("Ping.\n"); + tlc59116_led(count,0x00); + tlc59116_led((count+1)%16,0x20); + tlc59116_led((count+2)%16,0x40); + tlc59116_led((count+3)%16,0xFF); + + count++; + if(count>15) count=0; + etimer_set(&et, BLINK_INTERVAL); PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et)); } diff --git a/platform/z1/dev/tlc59116.c b/platform/z1/dev/tlc59116.c index 9e5bd5df3..b1c01ca61 100644 --- a/platform/z1/dev/tlc59116.c +++ b/platform/z1/dev/tlc59116.c @@ -43,6 +43,15 @@ #include "tlc59116.h" #include "i2cmaster.h" + +#if 0 +#include +#define PRINTFDEBUG(...) printf(__VA_ARGS__) +#else +#define PRINTFDEBUG(...) +#endif + + /*---------------------------------------------------------------------------*/ /* Write to a register. args: @@ -142,11 +151,11 @@ tlc59116_read_stream(uint8_t reg, uint8_t len, uint8_t *whereto) { void tlc59116_led(uint8_t led, uint8_t pwm) { - if (led<1 | led>16) { + if (led<0 | led>15) { PRINTFDEBUG("TLC59116: wrong led value."); - } - - tlc59116_write_reg(led, pwm); + }//else{ + tlc59116_write_reg(led+TLC59116_PWM0, pwm); +// } } /*---------------------------------------------------------------------------*/ diff --git a/platform/z1/dev/tlc59116.h b/platform/z1/dev/tlc59116.h index daa40bb3e..33e742c5a 100644 --- a/platform/z1/dev/tlc59116.h +++ b/platform/z1/dev/tlc59116.h @@ -96,8 +96,8 @@ void tlc59116_led(uint8_t led, uint8_t pwm); /* -------------------------------------------------------------------------- */ /* Reference definitions, should not be changed */ /* TLC59116 slave address */ -#define TLC59116_ADDR 0xC0 //adress with all adress pins pulled to ground -#define TLC59116_ALLCALL 0xD0 +#define TLC59116_ADDR 0x60 //7bit adress 0xC0 8bit adress; adress with all adress pins pulled to ground +//#define TLC59116_ALLCALL 0xD0 #define TLC59116_LEDOUT_PWM 0xAA // LDRx = 01 -> PWM, 4 leds per reg: 01010101 -> 0xAA /* TLC59116 registers */ From ed8be502db616c6fee083941c8b73a056524b3d0 Mon Sep 17 00:00:00 2001 From: Jelmer Tiete Date: Thu, 23 May 2013 23:35:21 +0200 Subject: [PATCH 3/6] tlc59116 for zolertia, added 0 values at init and code clean-up --- examples/z1/test-tlc59116.c | 4 ++-- platform/z1/dev/tlc59116.c | 33 +++++++++++++++------------------ platform/z1/dev/tlc59116.h | 33 +++++++++++++++++++++------------ 3 files changed, 38 insertions(+), 32 deletions(-) diff --git a/examples/z1/test-tlc59116.c b/examples/z1/test-tlc59116.c index f2d771cd5..cd8e24e3e 100644 --- a/examples/z1/test-tlc59116.c +++ b/examples/z1/test-tlc59116.c @@ -33,6 +33,7 @@ /** * \file * A simple program for testing the TLC59116 I2C led driver. + * All 16 outputs will sequencially light up. * \author * Jelmer Tiete, VUB */ @@ -57,7 +58,7 @@ PROCESS_THREAD(tlc59116_process, ev, data) { PROCESS_BEGIN(); { - /* Start and setup the led driver with default values, eg outputs on and pwm enabled. */ + /* Start and setup the led driver with default values, eg outputs on and pwm enabled and 0. */ tlc59116_init(); while (1) { @@ -78,4 +79,3 @@ PROCESS_THREAD(tlc59116_process, ev, data) { } /*---------------------------------------------------------------------------*/ - diff --git a/platform/z1/dev/tlc59116.c b/platform/z1/dev/tlc59116.c index b1c01ca61..2dd2e20e1 100644 --- a/platform/z1/dev/tlc59116.c +++ b/platform/z1/dev/tlc59116.c @@ -32,7 +32,7 @@ /** * \file - * Device drivers for tlc5916 led driver in Zolertia Z1. + * Device drivers for tlc5916 i2c led driver on Zolertia Z1. * \author * Jelmer Tiete, VUB */ @@ -44,14 +44,6 @@ #include "i2cmaster.h" -#if 0 -#include -#define PRINTFDEBUG(...) printf(__VA_ARGS__) -#else -#define PRINTFDEBUG(...) -#endif - - /*---------------------------------------------------------------------------*/ /* Write to a register. args: @@ -74,8 +66,8 @@ tlc59116_write_reg(uint8_t reg, uint8_t val) { /*---------------------------------------------------------------------------*/ /* Write several registers from a stream. args: - len number of bytes to read - data pointer to where the data is read from + len number of bytes to write + data pointer to where the data is written from First byte in stream must be the register address to begin writing to. The data is then written from second byte and increasing. */ @@ -86,7 +78,7 @@ tlc59116_write_stream(uint8_t len, uint8_t *data) { while (i2c_busy()); PRINTFDEBUG("I2C Ready to TX(stream)\n"); - i2c_transmit_n(len, data); // start tx and send conf reg + i2c_transmit_n(len, data); // start tx and send conf reg while (i2c_busy()); PRINTFDEBUG("WRITE_STR %u B to 0x%02X\n", len, data[0]); } @@ -146,21 +138,22 @@ tlc59116_read_stream(uint8_t reg, uint8_t len, uint8_t *whereto) { } /*---------------------------------------------------------------------------*/ -/* Set pwm value for individual led - */ +/* Set pwm value for individual led. Make sure PWM mode is enabled. +*/ void tlc59116_led(uint8_t led, uint8_t pwm) { if (led<0 | led>15) { PRINTFDEBUG("TLC59116: wrong led value."); - }//else{ + }else{ tlc59116_write_reg(led+TLC59116_PWM0, pwm); -// } + } } /*---------------------------------------------------------------------------*/ /* Init the led driver: ports, pins, registers, interrupts (none enabled), I2C, - default threshold values etc. */ + default threshold values etc. +*/ void tlc59116_init(void) { @@ -171,10 +164,14 @@ tlc59116_init(void) { tlc59116_write_reg(TLC59116_MODE1, TLC59116_MODE1_DEFAULT); tlc59116_write_reg(TLC59116_MODE2, TLC59116_MODE2_DEFAULT); + /*Set all PWM values to 0x00 (off)*/ + //This would maybe be better with a SWRST + uint8_t tx_buf[] = {TLC59116_PWM0_AUTOINCR,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + tlc59116_write_stream(17,&tx_buf); + /* set all leds to PWM control */ tlc59116_write_reg(TLC59116_LEDOUT0,TLC59116_LEDOUT_PWM); tlc59116_write_reg(TLC59116_LEDOUT1,TLC59116_LEDOUT_PWM); tlc59116_write_reg(TLC59116_LEDOUT2,TLC59116_LEDOUT_PWM); tlc59116_write_reg(TLC59116_LEDOUT3,TLC59116_LEDOUT_PWM); } - diff --git a/platform/z1/dev/tlc59116.h b/platform/z1/dev/tlc59116.h index 33e742c5a..b481efb60 100644 --- a/platform/z1/dev/tlc59116.h +++ b/platform/z1/dev/tlc59116.h @@ -32,7 +32,7 @@ /** * \file - * Device drivers header file for TLC59116 led driver in Zolertia Z1. + * Device drivers header file for TLC59116 i2c led driver on Zolertia Z1. * \author * Jelmer Tiete, VUB */ @@ -42,6 +42,14 @@ #include #include "dev/i2cmaster.h" +#if 0 +#include +#define PRINTFDEBUG(...) printf(__VA_ARGS__) +#else +#define PRINTFDEBUG(...) +#endif + + /* -------------------------------------------------------------------------- */ /* Init the led driver: ports, pins, registers, I2C*/ void tlc59116_init(void); @@ -59,7 +67,8 @@ void tlc59116_write_reg(uint8_t reg, uint8_t val); data pointer to where the data is read from First byte in stream must be the register address to begin writing to. The data is then written from the second byte and increasing. The address byte - is not included in length len. */ + is not included in length len. +*/ void tlc59116_write_stream(uint8_t len, uint8_t *data); /* Read one register. @@ -77,12 +86,11 @@ uint8_t tlc59116_read_reg(uint8_t reg); */ void tlc59116_read_stream(uint8_t reg, uint8_t len, uint8_t *whereto); -/* Set pwm value for individual led +/* Set pwm value for individual led args: - led led output -> 1 till 16 + led led output -> 0 till 15 pwm led pwm value */ - void tlc59116_led(uint8_t led, uint8_t pwm); @@ -90,19 +98,20 @@ void tlc59116_led(uint8_t led, uint8_t pwm); /* Application definitions, change if required by application. */ /* Suggested defaults according to the data sheet etc */ -#define TLC59116_MODE1_DEFAULT 0x80 // -#define TLC59116_MODE2_DEFAULT 0x00 // +#define TLC59116_MODE1_DEFAULT 0x80 // +#define TLC59116_MODE2_DEFAULT 0x00 // + +#define TLC59116_LEDOUT_PWM 0xAA // LDRx = 01 -> PWM, 4 leds per reg: 01010101 -> 0xAA /* -------------------------------------------------------------------------- */ /* Reference definitions, should not be changed */ /* TLC59116 slave address */ -#define TLC59116_ADDR 0x60 //7bit adress 0xC0 8bit adress; adress with all adress pins pulled to ground -//#define TLC59116_ALLCALL 0xD0 -#define TLC59116_LEDOUT_PWM 0xAA // LDRx = 01 -> PWM, 4 leds per reg: 01010101 -> 0xAA - +#define TLC59116_ADDR 0x60 //7bit adress, 8bit write adress: 0xC0 + //address with all address pins pulled to ground /* TLC59116 registers */ #define TLC59116_MODE1 0x00 #define TLC59116_MODE2 0x01 +#define TLC59116_PWM0_AUTOINCR 0xA2 // #define TLC59116_PWM0 0x02 #define TLC59116_PWM1 0x03 #define TLC59116_PWM2 0x04 @@ -126,7 +135,7 @@ void tlc59116_led(uint8_t led, uint8_t pwm); #define TLC59116_LEDOUT2 0x16 #define TLC59116_LEDOUT3 0x17 -/* More registers, but not used in this implementation */ +/* More registers follow, but not used in this implementation */ /* -------------------------------------------------------------------------- */ #endif /* ifndef __ADXL345_H__ */ From 0a4a14aacb4a538b36693a3f487dd026a2112a78 Mon Sep 17 00:00:00 2001 From: Jelmer Tiete Date: Fri, 24 May 2013 00:07:57 +0200 Subject: [PATCH 4/6] added tlc59116 datasheet url --- platform/z1/dev/tlc59116.c | 1 + platform/z1/dev/tlc59116.h | 1 + 2 files changed, 2 insertions(+) diff --git a/platform/z1/dev/tlc59116.c b/platform/z1/dev/tlc59116.c index 2dd2e20e1..df4c83ca3 100644 --- a/platform/z1/dev/tlc59116.c +++ b/platform/z1/dev/tlc59116.c @@ -33,6 +33,7 @@ /** * \file * Device drivers for tlc5916 i2c led driver on Zolertia Z1. + * See http://www.ti.com/product/tlc59116 for datasheet. * \author * Jelmer Tiete, VUB */ diff --git a/platform/z1/dev/tlc59116.h b/platform/z1/dev/tlc59116.h index b481efb60..4845967fd 100644 --- a/platform/z1/dev/tlc59116.h +++ b/platform/z1/dev/tlc59116.h @@ -33,6 +33,7 @@ /** * \file * Device drivers header file for TLC59116 i2c led driver on Zolertia Z1. + * See http://www.ti.com/product/tlc59116 for datasheet. * \author * Jelmer Tiete, VUB */ From 9810bfbcfde8b884f286f2319ad4b2c0a92ccd7d Mon Sep 17 00:00:00 2001 From: Jelmer Tiete Date: Wed, 29 May 2013 00:41:06 +0200 Subject: [PATCH 5/6] contiki code style changes and copyright update + added source to ARCH instead of SOURCEFILES in platform Makefile --- examples/z1/test-tlc59116.c | 19 +++--- platform/z1/Makefile.common | 4 +- platform/z1/dev/tlc59116.c | 123 ++++++++++++++++++++---------------- platform/z1/dev/tlc59116.h | 76 +++++++++++----------- 4 files changed, 119 insertions(+), 103 deletions(-) diff --git a/examples/z1/test-tlc59116.c b/examples/z1/test-tlc59116.c index cd8e24e3e..a7f3dd4e7 100644 --- a/examples/z1/test-tlc59116.c +++ b/examples/z1/test-tlc59116.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Swedish Institute of Computer Science. + * Copyright (c) 2013, Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -54,22 +54,25 @@ AUTOSTART_PROCESSES(&tlc59116_process); static struct etimer et; static uint8_t count = 0; -PROCESS_THREAD(tlc59116_process, ev, data) { +PROCESS_THREAD(tlc59116_process, ev, data) +{ PROCESS_BEGIN(); { /* Start and setup the led driver with default values, eg outputs on and pwm enabled and 0. */ tlc59116_init(); - while (1) { + while(1) { - tlc59116_led(count,0x00); - tlc59116_led((count+1)%16,0x20); - tlc59116_led((count+2)%16,0x40); - tlc59116_led((count+3)%16,0xFF); + tlc59116_led(count, 0x00); + tlc59116_led((count + 1) % 16, 0x20); + tlc59116_led((count + 2) % 16, 0x40); + tlc59116_led((count + 3) % 16, 0xFF); count++; - if(count>15) count=0; + if(count > 15) { + count = 0; + } etimer_set(&et, BLINK_INTERVAL); PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et)); diff --git a/platform/z1/Makefile.common b/platform/z1/Makefile.common index 2eb30ac89..da194f9f7 100644 --- a/platform/z1/Makefile.common +++ b/platform/z1/Makefile.common @@ -17,7 +17,7 @@ ARCH=msp430.c leds.c watchdog.c xmem.c \ checkpoint-arch.c slip.c slip_uart0.c \ z1-phidgets.c sht11.c sht11-sensor.c light-sensor.c \ battery-sensor.c sky-sensors.c tmp102.c temperature-sensor.c light-ziglet.c \ - relay-phidget.c + relay-phidget.c tlc59116.c CONTIKI_TARGET_DIRS = . dev apps net ifndef CONTIKI_TARGET_MAIN @@ -33,7 +33,7 @@ CFLAGS += -DMACID=$(nodemac) endif CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS) -CONTIKI_TARGET_SOURCEFILES += i2cmaster.c adxl345.c tlc59116.c +CONTIKI_TARGET_SOURCEFILES += i2cmaster.c adxl345.c MCU=msp430f2617 include $(CONTIKI)/cpu/msp430/Makefile.msp430 diff --git a/platform/z1/dev/tlc59116.c b/platform/z1/dev/tlc59116.c index df4c83ca3..0efbf5412 100644 --- a/platform/z1/dev/tlc59116.c +++ b/platform/z1/dev/tlc59116.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Swedish Institute of Computer Science. + * Copyright (c) 2013, Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,7 +32,7 @@ /** * \file - * Device drivers for tlc5916 i2c led driver on Zolertia Z1. + * Device drivers for tlc59116 i2c led driver on Zolertia Z1. * See http://www.ti.com/product/tlc59116 for datasheet. * \author * Jelmer Tiete, VUB @@ -47,117 +47,129 @@ /*---------------------------------------------------------------------------*/ /* Write to a register. - args: - reg register to write to - val value to write -*/ + * args: + * reg register to write to + * val value to write + */ void -tlc59116_write_reg(uint8_t reg, uint8_t val) { - uint8_t tx_buf[] = {reg, val}; +tlc59116_write_reg(uint8_t reg, uint8_t val) +{ + uint8_t tx_buf[] = { reg, val }; i2c_transmitinit(TLC59116_ADDR); - while (i2c_busy()); + while(i2c_busy()); PRINTFDEBUG("I2C Ready to TX\n"); i2c_transmit_n(2, tx_buf); - while (i2c_busy()); + while(i2c_busy()); PRINTFDEBUG("WRITE_REG 0x%02X @ reg 0x%02X\n", val, reg); } /*---------------------------------------------------------------------------*/ /* Write several registers from a stream. - args: - len number of bytes to write - data pointer to where the data is written from - - First byte in stream must be the register address to begin writing to. - The data is then written from second byte and increasing. */ + * args: + * len number of bytes to write + * data pointer to where the data is written from + * + * First byte in stream must be the register address to begin writing to. + * The data is then written from second byte and increasing. + */ void -tlc59116_write_stream(uint8_t len, uint8_t *data) { +tlc59116_write_stream(uint8_t len, uint8_t * data) +{ i2c_transmitinit(TLC59116_ADDR); - while (i2c_busy()); + while(i2c_busy()); PRINTFDEBUG("I2C Ready to TX(stream)\n"); - i2c_transmit_n(len, data); // start tx and send conf reg - while (i2c_busy()); + i2c_transmit_n(len, data); // start tx and send conf reg + while(i2c_busy()); PRINTFDEBUG("WRITE_STR %u B to 0x%02X\n", len, data[0]); } /*---------------------------------------------------------------------------*/ /* Read one register. - args: - reg what register to read - returns the value of the read register -*/ + * args: + * reg what register to read + * returns the value of the read register + */ uint8_t -tlc59116_read_reg(uint8_t reg) { +tlc59116_read_reg(uint8_t reg) +{ uint8_t retVal = 0; uint8_t rtx = reg; + PRINTFDEBUG("READ_REG 0x%02X\n", reg); /* transmit the register to read */ i2c_transmitinit(TLC59116_ADDR); - while (i2c_busy()); + while(i2c_busy()); i2c_transmit_n(1, &rtx); - while (i2c_busy()); + while(i2c_busy()); /* receive the data */ i2c_receiveinit(TLC59116_ADDR); - while (i2c_busy()); + while(i2c_busy()); i2c_receive_n(1, &retVal); - while (i2c_busy()); + while(i2c_busy()); return retVal; } /*---------------------------------------------------------------------------*/ /* Read several registers in a stream. - args: - reg what register to start reading from - len number of bytes to read - whereto pointer to where the data is saved -*/ + * args: + * reg what register to start reading from + * len number of bytes to read + * whereto pointer to where the data is saved + */ void -tlc59116_read_stream(uint8_t reg, uint8_t len, uint8_t *whereto) { +tlc59116_read_stream(uint8_t reg, uint8_t len, uint8_t * whereto) +{ uint8_t rtx = reg; + PRINTFDEBUG("READ_STR %u B from 0x%02X\n", len, reg); /* transmit the register to start reading from */ i2c_transmitinit(TLC59116_ADDR); - while (i2c_busy()); + while(i2c_busy()); i2c_transmit_n(1, &rtx); - while (i2c_busy()); + while(i2c_busy()); /* receive the data */ i2c_receiveinit(TLC59116_ADDR); - while (i2c_busy()); + while(i2c_busy()); i2c_receive_n(len, whereto); - while (i2c_busy()); + while(i2c_busy()); } /*---------------------------------------------------------------------------*/ /* Set pwm value for individual led. Make sure PWM mode is enabled. -*/ + * args: + * led led output -> 0 till 15 + * pwm led pwm value + */ void -tlc59116_led(uint8_t led, uint8_t pwm) { - if (led<0 | led>15) { +tlc59116_led(uint8_t led, uint8_t pwm) +{ + if(led < 0 | led > 15) { PRINTFDEBUG("TLC59116: wrong led value."); - }else{ - tlc59116_write_reg(led+TLC59116_PWM0, pwm); + } else { + tlc59116_write_reg(led + TLC59116_PWM0, pwm); } } /*---------------------------------------------------------------------------*/ /* Init the led driver: ports, pins, registers, interrupts (none enabled), I2C, - default threshold values etc. -*/ + * default threshold values etc. + */ void -tlc59116_init(void) { +tlc59116_init(void) +{ /* Set up ports and pins for I2C communication */ i2c_enable(); @@ -165,14 +177,15 @@ tlc59116_init(void) { tlc59116_write_reg(TLC59116_MODE1, TLC59116_MODE1_DEFAULT); tlc59116_write_reg(TLC59116_MODE2, TLC59116_MODE2_DEFAULT); - /*Set all PWM values to 0x00 (off)*/ - //This would maybe be better with a SWRST - uint8_t tx_buf[] = {TLC59116_PWM0_AUTOINCR,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; - tlc59116_write_stream(17,&tx_buf); + /*Set all PWM values to 0x00 (off) */ + /*This would maybe be better with a SWRST */ + uint8_t tx_buf[] = + { TLC59116_PWM0_AUTOINCR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + tlc59116_write_stream(17, &tx_buf); /* set all leds to PWM control */ - tlc59116_write_reg(TLC59116_LEDOUT0,TLC59116_LEDOUT_PWM); - tlc59116_write_reg(TLC59116_LEDOUT1,TLC59116_LEDOUT_PWM); - tlc59116_write_reg(TLC59116_LEDOUT2,TLC59116_LEDOUT_PWM); - tlc59116_write_reg(TLC59116_LEDOUT3,TLC59116_LEDOUT_PWM); + tlc59116_write_reg(TLC59116_LEDOUT0, TLC59116_LEDOUT_PWM); + tlc59116_write_reg(TLC59116_LEDOUT1, TLC59116_LEDOUT_PWM); + tlc59116_write_reg(TLC59116_LEDOUT2, TLC59116_LEDOUT_PWM); + tlc59116_write_reg(TLC59116_LEDOUT3, TLC59116_LEDOUT_PWM); } diff --git a/platform/z1/dev/tlc59116.h b/platform/z1/dev/tlc59116.h index 4845967fd..0eb9b8d2f 100644 --- a/platform/z1/dev/tlc59116.h +++ b/platform/z1/dev/tlc59116.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Swedish Institute of Computer Science. + * Copyright (c) 2013, Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -53,66 +53,66 @@ /* -------------------------------------------------------------------------- */ /* Init the led driver: ports, pins, registers, I2C*/ -void tlc59116_init(void); +void tlc59116_init(void); /* Write to a register. - args: - reg register to write to - val value to write -*/ -void tlc59116_write_reg(uint8_t reg, uint8_t val); + * args: + * reg register to write to + * val value to write + */ +void tlc59116_write_reg(uint8_t reg, uint8_t val); /* Write several registers from a stream. - args: - len number of bytes to read - data pointer to where the data is read from - First byte in stream must be the register address to begin writing to. - The data is then written from the second byte and increasing. The address byte - is not included in length len. -*/ -void tlc59116_write_stream(uint8_t len, uint8_t *data); + * args: + * len number of bytes to read + * data pointer to where the data is read from + * First byte in stream must be the register address to begin writing to. + * The data is then written from the second byte and increasing. The address byte + * is not included in length len. + */ +void tlc59116_write_stream(uint8_t len, uint8_t * data); /* Read one register. - args: - reg what register to read - returns the value of the read register -*/ -uint8_t tlc59116_read_reg(uint8_t reg); + * args: + * reg what register to read + * returns the value of the read register + */ +uint8_t tlc59116_read_reg(uint8_t reg); /* Read several registers in a stream. - args: - reg what register to start reading from - len number of bytes to read - whereto pointer to where the data is saved -*/ -void tlc59116_read_stream(uint8_t reg, uint8_t len, uint8_t *whereto); + * args: + * reg what register to start reading from + * len number of bytes to read + * whereto pointer to where the data is saved + */ +void tlc59116_read_stream(uint8_t reg, uint8_t len, uint8_t * whereto); /* Set pwm value for individual led - args: - led led output -> 0 till 15 - pwm led pwm value -*/ -void tlc59116_led(uint8_t led, uint8_t pwm); + * args: + * led led output -> 0 till 15 + * pwm led pwm value + */ +void tlc59116_led(uint8_t led, uint8_t pwm); /* -------------------------------------------------------------------------- */ /* Application definitions, change if required by application. */ /* Suggested defaults according to the data sheet etc */ -#define TLC59116_MODE1_DEFAULT 0x80 // -#define TLC59116_MODE2_DEFAULT 0x00 // +#define TLC59116_MODE1_DEFAULT 0x00 // Default (no sub or all call) + OSC on +#define TLC59116_MODE2_DEFAULT 0x00 // Default (output change on stop) -#define TLC59116_LEDOUT_PWM 0xAA // LDRx = 01 -> PWM, 4 leds per reg: 01010101 -> 0xAA +#define TLC59116_LEDOUT_PWM 0xAA // LDRx = 01 -> PWM; 4 leds per reg: 01010101b -> 0xAA /* -------------------------------------------------------------------------- */ /* Reference definitions, should not be changed */ /* TLC59116 slave address */ -#define TLC59116_ADDR 0x60 //7bit adress, 8bit write adress: 0xC0 - //address with all address pins pulled to ground +#define TLC59116_ADDR 0x60 //7bit adress, 8bit write adress: 0xC0 + //address with all address pins pulled to ground /* TLC59116 registers */ #define TLC59116_MODE1 0x00 #define TLC59116_MODE2 0x01 -#define TLC59116_PWM0_AUTOINCR 0xA2 // +#define TLC59116_PWM0_AUTOINCR 0xA2 //auto increment address for first pwm register #define TLC59116_PWM0 0x02 #define TLC59116_PWM1 0x03 #define TLC59116_PWM2 0x04 @@ -139,4 +139,4 @@ void tlc59116_led(uint8_t led, uint8_t pwm); /* More registers follow, but not used in this implementation */ /* -------------------------------------------------------------------------- */ -#endif /* ifndef __ADXL345_H__ */ +#endif /* ifndef __TLC59116_H__ */ From 4e0d5cf65e6399292e82101034c0c11f4f39df70 Mon Sep 17 00:00:00 2001 From: Jelmer Tiete Date: Mon, 24 Jun 2013 16:13:35 +0200 Subject: [PATCH 6/6] Corrected copyright holder. --- examples/z1/test-tlc59116.c | 38 ++++++++++++++++++------------------- platform/z1/dev/tlc59116.c | 38 ++++++++++++++++++------------------- platform/z1/dev/tlc59116.h | 38 ++++++++++++++++++------------------- 3 files changed, 57 insertions(+), 57 deletions(-) diff --git a/examples/z1/test-tlc59116.c b/examples/z1/test-tlc59116.c index a7f3dd4e7..36dda845e 100644 --- a/examples/z1/test-tlc59116.c +++ b/examples/z1/test-tlc59116.c @@ -1,7 +1,7 @@ /* - * Copyright (c) 2013, Swedish Institute of Computer Science. + * Copyright (c) 2013, Jelmer Tiete. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -10,24 +10,24 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * * This file is part of the Contiki operating system. - * + * */ /** diff --git a/platform/z1/dev/tlc59116.c b/platform/z1/dev/tlc59116.c index 0efbf5412..3afb3b91b 100644 --- a/platform/z1/dev/tlc59116.c +++ b/platform/z1/dev/tlc59116.c @@ -1,7 +1,7 @@ /* - * Copyright (c) 2013, Swedish Institute of Computer Science. + * Copyright (c) 2013, Jelmer Tiete. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -10,24 +10,24 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * * This file is part of the Contiki operating system. - * + * */ /** diff --git a/platform/z1/dev/tlc59116.h b/platform/z1/dev/tlc59116.h index 0eb9b8d2f..39708de77 100644 --- a/platform/z1/dev/tlc59116.h +++ b/platform/z1/dev/tlc59116.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2013, Swedish Institute of Computer Science. + * Copyright (c) 2013, Jelmer Tiete. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -10,24 +10,24 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * * This file is part of the Contiki operating system. - * + * */ /**