Shuffling headers again
This commit is contained in:
parent
8f47841b72
commit
aaa9ed0770
3 changed files with 17 additions and 19 deletions
17
GDM1602K.c
17
GDM1602K.c
|
@ -1,23 +1,8 @@
|
||||||
#include "config.h"
|
#include "GDM1602K.h"
|
||||||
|
|
||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <util/delay.h>
|
#include <util/delay.h>
|
||||||
|
|
||||||
#define LCD_DATA_PORT PORTB
|
|
||||||
#define LCD_DATA_DDR DDRB
|
|
||||||
#define LCD_RS_PIN PB1
|
|
||||||
#define LCD_EN_PIN PB2
|
|
||||||
#define LCD_DB4 PB3
|
|
||||||
#define LCD_DB5 PB4
|
|
||||||
#define LCD_DB6 PB5
|
|
||||||
#define LCD_DB7 PB6
|
|
||||||
|
|
||||||
// Delay constants from the datasheet. These are mostly in nanoseconds
|
|
||||||
#define LAG 10
|
|
||||||
#define TW 300
|
|
||||||
#define TSU1 100
|
|
||||||
|
|
||||||
void lcd_4bit_init() {
|
void lcd_4bit_init() {
|
||||||
LCD_DATA_DDR = 0xFF;
|
LCD_DATA_DDR = 0xFF;
|
||||||
LCD_DATA_PORT = (1 << LCD_DB5);
|
LCD_DATA_PORT = (1 << LCD_DB5);
|
||||||
|
|
16
GDM1602K.h
16
GDM1602K.h
|
@ -1,9 +1,23 @@
|
||||||
#ifndef GDM1602K_H_
|
#ifndef GDM1602K_H_
|
||||||
#define GDM1602K_H_
|
#define GDM1602K_H_
|
||||||
|
|
||||||
|
#define LCD_DATA_PORT PORTB
|
||||||
|
#define LCD_DATA_DDR DDRB
|
||||||
|
#define LCD_RS_PIN PB1
|
||||||
|
#define LCD_EN_PIN PB2
|
||||||
|
#define LCD_DB4 PB3
|
||||||
|
#define LCD_DB5 PB4
|
||||||
|
#define LCD_DB6 PB5
|
||||||
|
#define LCD_DB7 PB6
|
||||||
|
|
||||||
|
// Delay constants from the datasheet. These are mostly in nanoseconds
|
||||||
|
#define LAG 10
|
||||||
|
#define TW 300
|
||||||
|
#define TSU1 100
|
||||||
|
|
||||||
void lcd_write_strings(const char *top, const char *bottom);
|
void lcd_write_strings(const char *top, const char *bottom);
|
||||||
void lcd_write_string(const char *string);
|
void lcd_write_string(const char *string);
|
||||||
void lcd_init();
|
void lcd_init();
|
||||||
void lcd_clear();
|
void lcd_clear();
|
||||||
|
|
||||||
#endif /* GDM1602K_H_ */
|
#endif /* GDM1602K_H_ */
|
||||||
|
|
3
LM335.c
3
LM335.c
|
@ -1,5 +1,4 @@
|
||||||
#include "LM335.h"
|
#include "LM335.h"
|
||||||
#include "config.h"
|
|
||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
#include <util/delay.h>
|
#include <util/delay.h>
|
||||||
|
|
||||||
|
@ -40,4 +39,4 @@ float LM335_ReadTemperature() {
|
||||||
float temperature = (voltage - 2.92) * vfactor;
|
float temperature = (voltage - 2.92) * vfactor;
|
||||||
|
|
||||||
return temperature;
|
return temperature;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue