main.c File Reference

firmware for the i2c-ledmatrix More...

#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/wdt.h>
#include <util/delay.h>
#include <avr/pgmspace.h>
#include "twislave.h"

Go to the source code of this file.

Functions

void init_ports (void)
 initialize hardware
void selectDigit (uint8_t digit)
 select which digit should be displayed
void showByte (uint8_t byte)
 set output of the currently selected digit
void showDigitByte (uint8_t digit, uint8_t byte)
 show a pattern on a certain digit (or row, if you don't use 7segment displays).
int main (void)
 main-function.


Detailed Description

firmware for the i2c-ledmatrix

this is a really simple piece of code, since the main work is done by the I2C-library.

Author:
Ronald Schaten <ronald@schatenseite.de>
Version:
Id
main.c,v 1.1 2008/07/16 05:44:45 rschaten Exp

Permission to use, copy, modify, and distribute this software and its documentation under the terms of the GNU General Public License is hereby granted. No representations are made about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. See the GNU General Public License for more details.

Definition in file main.c.


Function Documentation

void init_ports ( void   ) 

initialize hardware

Definition at line 200 of file main.c.

Referenced by main().

int main ( void   ) 

main-function.

initializes everything and contains the main loop which controls the actual output. the rxbuffer[] is filled from the I2C-library, so we just have go through the array and display its values on the corresponding digit.

Returns:
An integer. Whatever... :-)

Definition at line 271 of file main.c.

References init_ports(), init_twi_slave(), rxbuffer, and showDigitByte().

void selectDigit ( uint8_t  digit  ) 

select which digit should be displayed

Parameters:
digit number of the digit

Definition at line 216 of file main.c.

Referenced by showDigitByte().

void showByte ( uint8_t  byte  ) 

set output of the currently selected digit

Parameters:
byte bit-pattern to show

Definition at line 247 of file main.c.

Referenced by showDigitByte().

void showDigitByte ( uint8_t  digit,
uint8_t  byte 
)

show a pattern on a certain digit (or row, if you don't use 7segment displays).

the output is cleared before selecting the new digit, so there won't be 'shadows' on the display.

Parameters:
digit number of the digit
byte bit-pattern to show

Definition at line 258 of file main.c.

References selectDigit(), and showByte().

Referenced by main().


Generated on Wed May 6 20:07:40 2009 for I2C LED Matrix by  doxygen 1.5.7.1