50 lines
1.8 KiB
C
50 lines
1.8 KiB
C
/*
|
|
Copyright 2022, Savanni D'Gerinel <savanni@luminescent-dreams.com>
|
|
|
|
This file is part of Savanni's AVR library.
|
|
|
|
Lumeto 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 3 of the License, or (at your option) any later version.
|
|
|
|
Lumeto 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 Lumeto. If not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#include <avr/io.h>
|
|
#include <util/delay.h>
|
|
#include <base.h>
|
|
#include <spi.h>
|
|
#include <shift_register.h>
|
|
#include <display.h>
|
|
|
|
int main(void) {
|
|
display_t display = {
|
|
.reg = {
|
|
.output = { .ddr = &DDRB, .port = &PORTB, .pin = &PINB, .addr = 5 },
|
|
.latch_clock = { .ddr = &DDRB, .port = &PORTB, .pin = &PINB, .addr = 6 },
|
|
.shift_clock = { .ddr = &DDRB, .port = &PORTB, .pin = &PINB, .addr = 7 },
|
|
},
|
|
.register_select = { .ddr = &DDRF, .port = &PORTF, .pin = &PINF, .addr = 1 },
|
|
.enable = { .ddr = &DDRF, .port = &PORTF, .pin = &PINF, .addr = 0 },
|
|
};
|
|
|
|
gpio_t light = { .ddr = &DDRC, .port = &PORTC, .pin = &PINC, .addr = 7 };
|
|
set_line_direction(&light, LINE_OUT);
|
|
clear_line(&light);
|
|
|
|
display_init(&display);
|
|
|
|
display_clear(&display);
|
|
_delay_ms(500);
|
|
|
|
display_write_message(&display, "Hello, my bat");
|
|
display_set_location(&display, 0, 1);
|
|
display_write_message(&display, " -- Savanni");
|
|
display_enable(&display);
|
|
|
|
set_line(&light);
|
|
|
|
while(1) { _delay_ms(1); }
|
|
}
|
|
|