#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. |
this is a really simple piece of code, since the main work is done by the I2C-library.
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.
void init_ports | ( | void | ) |
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.
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
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
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.
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().