This library creates the interface to operate the TLC5940. This device manages 16 PWM outputs.
tlc5940.h
- Committer:
- Fiuba
- Date:
- 2010-11-27
- Revision:
- 2:500ec33cd4b6
- Parent:
- 1:e8c8347fa919
- Child:
- 3:40cb2f9adc4d
File content as of revision 2:500ec33cd4b6:
/* * tlc5940 - Interface to operate TI's IC TLC5940 * Copyright (C) 2010 German Bassi. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef MBED_TLC5940_H #define MBED_TLC5940_H #include "mbed.h" class tlc5940 { private: bool first_cycle_flag; int GSCLK_counter, data_counter; int aux_value, aux_ind; int num_ic; DigitalOut VPROG; DigitalOut SIN; DigitalOut SCLK; DigitalOut XLAT; DigitalOut BLANK; DigitalOut DCPROG; DigitalOut GSCLK; DigitalIn SOUT; DigitalIn XERR; public: /** Create a tlc5940 interface object connected to some specifics pins * * @param num_ics Number of TLC5940 connected in series * @param DC_data[] Dot Correction values for initialization */ tlc5940 (int num_ics, int DC_data[]); /** Send the specified set of grayscale values * * @param data[] Array of 12-bit Grayscale values for transmission */ void send_data (int data[]); }; #endif