diff options
author | vg <vgm+dev@devys.org> | 2020-07-07 16:24:01 +0200 |
---|---|---|
committer | vg <vgm+dev@devys.org> | 2020-07-07 16:24:01 +0200 |
commit | 66dcf910bd4744d8ced56cb9586aa937a1a2d4c5 (patch) | |
tree | df4dca1ae4af1e5df0be0d1f4f2cd0d54751f8e8 /instructables/cube8/main.h | |
download | hic-66dcf910bd4744d8ced56cb9586aa937a1a2d4c5.tar.gz hic-66dcf910bd4744d8ced56cb9586aa937a1a2d4c5.tar.bz2 hic-66dcf910bd4744d8ced56cb9586aa937a1a2d4c5.zip |
Diffstat (limited to 'instructables/cube8/main.h')
-rw-r--r-- | instructables/cube8/main.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/instructables/cube8/main.h b/instructables/cube8/main.h new file mode 100644 index 0000000..0a755f7 --- /dev/null +++ b/instructables/cube8/main.h @@ -0,0 +1,45 @@ +#ifndef MAIN_H +#define MAIN_H + +#include <avr/io.h> +#include <avr/pgmspace.h> +#include <avr/interrupt.h> +#include <stdlib.h> + +#include "cube.h" + +// Define USART stuff +#define FOSC 14745600 +#define BAUD 38400 +#define MYUBRR (((((FOSC * 10) / (16L * BAUD)) + 5) / 10) - 1) + +#define DATA_BUS PORTA +#define LAYER_SELECT PORTC +#define LATCH_ADDR PORTB +#define LATCH_MASK 0x07 +#define LATCH_MASK_INV 0xf8 +#define OE_PORT PORTB +#define OE_MASK 0x08 + +// Red led on D2 +#define LED_RED 0x04 +// Green led D3 +#define LED_GREEN 0x08 +// Program led on D4 +#define LED_PGM 0x10; +// Leds connected to port D +#define LED_PORT PORTD +// Rs232 button on D5 +#define RS232_BTN 0x20 +// Main button on B4 +#define MAIN_BTN 0x10 + +void ioinit (void); +void bootmsg (void); + +volatile unsigned char current_layer; +volatile unsigned char pgm_mode; +void rs232(void); +unsigned int bootwait (void); +#endif + |