Initial commit

This commit is contained in:
2019-09-21 14:41:54 +02:00
commit b76b9fbbf7
156 changed files with 962832 additions and 0 deletions

15
code/inc/DS3231.h Normal file
View File

@@ -0,0 +1,15 @@
#ifndef _DS3231_h
#define _DS3231_h
#define DS3231_ADDRESS 0b1101000
#define REG_SECONDS 0x00 //Sekunden Register
void DS3231_init(void);
int DS3231_seconds(void);
#endif

BIN
code/inc/DS3231.h.gch Normal file

Binary file not shown.

7
code/inc/adc.h Normal file
View File

@@ -0,0 +1,7 @@
#ifndef _ADC_H
#define _ADC_H
void adc_setup(void);
int adc_read(unsigned char adc_pin);
#endif

BIN
code/inc/i2c Normal file

Binary file not shown.

22
code/inc/i2c.h Normal file
View File

@@ -0,0 +1,22 @@
#ifndef _I2C_h
#define _I2C_h
/** defines the data direction (reading from I2C device) in i2c_start(),i2c_rep_start() */
#define I2C_READ 1
/** defines the data direction (writing to I2C device) in i2c_start(),i2c_rep_start() */
#define I2C_WRITE 0
#define SCL_CLOCK 96000L //i2c clockspeed
void i2c_init(void);
unsigned char i2c_start(unsigned char address);
/*
void i2c_stop(void);
unsigned char i2c_write( unsigned char data );
unsigned char i2c_readAck(void);
unsigned char i2c_readNak(void);
*/
#endif

BIN
code/inc/i2c.h.gch Normal file

Binary file not shown.

BIN
code/inc/pinout Normal file

Binary file not shown.

41
code/inc/pinout.h Normal file
View File

@@ -0,0 +1,41 @@
//Register A
#define TUBE_PSU_FEEDBACK 0 //PA0 Tube PSU feedback
#define ENABLE_TUBE_SUPPLY 1 << 1 //PA1 Verbindet PSU-Spannung mit Röhren PMOS! -> activ low
#define CURRENTSENSING_TUBE_6 2 //PA2 CURRENTSENSING_TUBE_6
#define CURRENTSENSING_TUBE_5 3 //PA3 CURRENTSENSING_TUBE_5
#define CURRENTSENSING_TUBE_4 4 //PA4 CURRENTSENSING_TUBE_4
#define CURRENTSENSING_TUBE_3 5 //PA5 CURRENTSENSING_TUBE_3
#define CURRENTSENSING_TUBE_2 6 //PA6 CURRENTSENSING_TUBE_2
#define CURRENTSENSING_TUBE_1 7 //PA7 CURRENTSENSING_TUBE_1
//Register B
#define STATUS_LED_B 1 << 0 //PB0 Status LED b
#define STATUS_LED_C 1 << 1 //PB1 Status LED c
#define DIP_1 1 << 2 //PB2 Dip-Schalter Stelle 1
#define DIP_2 1 << 3 //PB3 Dip-Schalter Stelle 2
#define DIP_3 1 << 4 //PB4 Dip-Schalter Stelle 3
#define MOSI 1 << 5 //PB5 MOSI
#define MISO 1 << 6 //PB6 MISO
#define CLK 1 << 7 //PB7 Clock
//Register C
#define SCL 1 << 0 //PC0 SCL
#define SDA 1 << 1 //PC1 SDA
#define LATCH_SR 1 << 2 //PC2 Latch Shiftregister
#define ENABLE_SR 1 << 3 //PC3 Enable Shiftregister
#define DOT 1 << 4 //PC4 Doppelpunkt LEDs
#define BUTTON_A 1 << 5 //PC5 Button a
#define BUTTON_C 1 << 6 //PC6 Button c
#define ENABLE_TUBE_PSU 1 << 7 //PC7 Enable Tube PSU
//Register D
// PD0 RX
// PD1 TX
#define ENCODER_A 1 << 2 //PD2 Encoder A
#define ENCODER_PUSH 1 << 3 //PD3 Encoder Button
#define ENCODER_B 1 << 4 //PD4 Encoder B
#define RESET_SR 1 << 5 //PD5 Reset Shift Register
#define BUTTON_B 1 << 6 //PD6 Button b
#define TUBE_LED 1 << 7 //PD7 Tube LED

BIN
code/inc/pinout.h.gch Normal file

Binary file not shown.

18
code/inc/print.h Normal file
View File

@@ -0,0 +1,18 @@
#ifndef _PRINT_H
#define _PRINT_H
extern const unsigned char character_Font[26];
extern const unsigned char number_Font[10];
extern unsigned char SR_Buffer[];
void clear_SR_Buffer(void);
void print_SR_Buffer(void);
void add_Decimal_Point_to_SR_Buffer(int pos);
void add_Character_to_SR_Buffer(unsigned char character, int pos);
void add_Number_to_SR_Buffer(int number, int pos);
void print_String(char* string);
void add_ASCII_to_SR_Buffer(unsigned char, int pos);
#endif

BIN
code/inc/print.h.gch Normal file

Binary file not shown.

BIN
code/inc/uart Normal file

Binary file not shown.

13
code/inc/uart.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef _UART_H
#define _UART_H
#define BAUD 9600
#define MYUBRR F_CPU/16/BAUD-1
void USART_Init(unsigned int ubrr);
void USART_Transmit(unsigned char data );
void uart_puts( char* string);
int putchar(int c);
void search_i2c_devices(void);
#endif

BIN
code/inc/uart.h.gch Normal file

Binary file not shown.