-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.h
executable file
·63 lines (45 loc) · 1.67 KB
/
functions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <stdlib.h>
#include <msp430.h>
#include <stdint.h>
#include "peripherals.h"
// Temperature Sensor Calibration = Reading at 30 degrees C is stored at addr 1A1Ah
// See end of datasheet for TLV table memory mapping
#define CALADC12_15V_30C *((unsigned int *)0x1A1A)
// Temperature Sensor Calibration = Reading at 85 degrees C is stored at addr 1A1Ch
//See device datasheet for TLV table memory mapping
#define CALADC12_15V_85C *((unsigned int *)0x1A1C)
#define MOVING_AVERAGE_SIZE 36
#define ONE_MONTH_IN_ADC 342 // 12 segments from 0 --> 4095
// Enum for the program state
typedef enum {
DISPLAY,
EDIT,
} state;
// Run Timer A2
void runtimerA2(void);
// Display functions
// Display the Date
void displayDate(char date[7], volatile long unsigned int, volatile unsigned int, volatile unsigned int);
// Display the Time
void displayTime(char time[9], volatile long unsigned int, volatile unsigned int, volatile unsigned int, volatile unsigned int);
// Display the Temp in C
void displayTempC(char tempC[7], volatile float);
// Display the Temp in F
void displayTempF(char tempF[7], volatile float);
// ADC functions
// Configure the ADC12
void config_ADC(volatile float, volatile unsigned int, volatile unsigned int);
// Buttons functions
// Init user's launchpad buttons
void init_launchpad_button();
// Read user's launchpad button
unsigned int read_launchpad_button();
// TODO: clean up before submission
// // Initializes the two user LEDs
// void init_user_leds();
// //Sets the two user LEDs
// void set_user_leds(unsigned char uled);
// // Initializes the buttons for input
// void init_board_buttons();
// //Reads the four buttons
// unsigned int read_board_buttons();