forked from fossasia/neurolab-firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Neurolab.h
134 lines (114 loc) · 3.36 KB
/
Neurolab.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#ifndef ____Neurolab__
#define ____Neurolab__
#include "AD7173.h"
#include "definitions.h"
class Neurolab{
public:
AD7173Class ads;
/* VARIABLES */
int outputType;
/* BOARD WIDE FUNCTIONS
TO-DO list */
void initialize(void);
void updateChannelSettings(void);
void writeChannelSettings(void);
void setChannelsToDefault(void);
void sendChannelData(byte);
void reportDefaultChannelSettings(void);
void startStreaming(void);
void stopStreaming(void);
/* ADS1299 FUNCITONS */
/*
============================================
initializes the SPI connection with the ADC
============================================
*/
void initialize_adc(void);
/*
==============================================
resets the ADC registers to the default state
==============================================
*/
void reset_adc(void);
/*
==================================================
cancels the current transaction to resync the ADC
==================================================
*/
void sync_adc(void);
/*
=============================================
gets the current conversion results channel
@param byte - current data channel
@return int - error code
=============================================
*/
void get_current_adc_data_channel(adc7173_register_t &);
/*
================================
sets the ADC mode configuration
@param clock_mode_t - clock mode
@return int - error code
================================
*/
void set_adc_mode_config(data_mode_t, clock_mode_t);
/*
==================================================
sets the ADC interface mode configuration
@param bool - ensable/disable continuous read mode
@return int - error code
==================================================
*/
void set_adc_interface_mode_config(bool, bool);
/*
==========================================
gets the ADC conversion result
@return byte[] - the ADC conversion result
==========================================
*/
void get_adc_data(byte *);
/*
=====================================
configures ADC channels
@param byte - channel register
@param bool - enable/disable channel
@param byte - setup register
@param byte - analog input positive
@param byte - analog input negative
@return int - error code
=====================================
*/
void set_adc_channel_config(adc7173_register_t, bool, adc7173_register_t, analog_input_t, analog_input_t);
/*
==================================
sets the ADC setups coding mode
@param byte - setup register
@param condig_mode_t - coding mode
@return int - error code
==================================
*/
void set_adc_setup_config(adc7173_register_t, coding_mode_t);
/*
==========================================
sets the ADC filters data conversion rate
@param byte - filter register
@param byte - data rate
@return int - error code
==========================================
*/
void set_adc_filter_config(adc7173_register_t, data_rate_t);
/*
======================================
sets the ADC offset compensation value
@param byte - offset register
@param uint32_t - offset value
@return int - error code
======================================
*/
void set_adc_gain_registers(adc7173_register_t, uint32_t);
/*
Here you can implement other functions related to Neurolab like
accelerometer, sdcard, wifi module etc..
*/
};
#endif