![]() |
ADS_BP
|
#include "ADS1299.h"
Functions | |
unsigned char | ADS1299ReadReg (unsigned char addr) |
Routine to read a value from a ADS1299 register passing its address. More... | |
void | ADS1299WriteReg (unsigned char addr, unsigned char value) |
Routine to write a value into a ADS1299 register passing its address and the value. More... | |
int | Interpret24bitAsInt32 (unsigned char *byteArray) |
This function translates 24 bits information (3 bytes) from complement of 2 format into an integer value. More... | |
void | ADS1299Init (void) |
This function executes the ADS1299 power-on procedure and initializes all needed config registers. More... | |
void | ADS1299ReadAllReg (unsigned char *registers) |
Routine to read all values from ADS1299 registers. It receives a pointer to a 25 bytes chars array. More... | |
void | ADS1299ReadContinuousMode (void) |
Routine to start the continuous acquisition mode. More... | |
void | ADS1299StopContinuousMode (void) |
Routine to stop the continuous acquisition mode. More... | |
void | ADS1299SetInputModeSetGain (unsigned char mode, unsigned char gain) |
This function writes the ADS1299 channel config registers in way to set the output mode of the multiplexer and the gain. More... | |
void | ADS1299SetDataRate (unsigned char mode) |
This function writes the ADS1299 CONFIG1 register in way to set the output data rate. More... | |
void | ADS1299AcquireSample (unsigned char nCh, int *chValues) |
This function reads the 27 bytes coming from ADS1299, processes them converting from complement-of-two form into integer value. More... | |
unsigned char | ADS1299TestSignal (unsigned char enable) |
This function enables or disables the generation of a test signal built in the ADS1299. It also modifies the input multiplexer configuration shorting the input channels to the test signal. More... | |
Variables | |
volatile unsigned char | adsGain = 1 |
unsigned int | clockFreq |
Source file for the ADS1299 device.
----------------— Function Description ---------------— This c file includes all functions relative to the ADS1299 Analog Front-End. ----------------------— Updates ----------------------—
2015-05-29 / Enzo Mastinu / Creation
void ADS1299AcquireSample | ( | unsigned char | nCh, |
int * | chValues | ||
) |
This function reads the 27 bytes coming from ADS1299, processes them converting from complement-of-two form into integer value.
[in] | nCh | specifies the number of channels |
[out] | *chValues | points to the array where store the values |
Measured Execution Time @80MHz: 14/07/2016 -> 22 us
void ADS1299Init | ( | void | ) |
This function executes the ADS1299 power-on procedure and initializes all needed config registers.
[in] | none |
Measured Execution Time @80MHz: 13/07/2016 -> 1.22 s
void ADS1299ReadAllReg | ( | unsigned char * | registers | ) |
Routine to read all values from ADS1299 registers. It receives a pointer to a 25 bytes chars array.
[out] | registers | points to an array where store the values |
void ADS1299ReadContinuousMode | ( | void | ) |
Routine to start the continuous acquisition mode.
[in] | none |
Measured Execution Time @80MHz: 13/07/2016 -> 145 us
unsigned char ADS1299ReadReg | ( | unsigned char | addr | ) |
Routine to read a value from a ADS1299 register passing its address.
[in] | addr | is the address of the register |
void ADS1299SetDataRate | ( | unsigned char | mode | ) |
This function writes the ADS1299 CONFIG1 register in way to set the output data rate.
[in] | mode | specifies the output data rate mode |
There are in total 7 possible values for the mode parameter:
void ADS1299SetInputModeSetGain | ( | unsigned char | mode, |
unsigned char | gain | ||
) |
This function writes the ADS1299 channel config registers in way to set the output mode of the multiplexer and the gain.
[in] | mode | is the output mode |
[in] | gain | is the gain |
Each acquisition channel can be independently configured with its gain and input mode. There are in total 7 possible configuration for the gain parameter:
There are in total 8 possible configuration for the mode parameter:
void ADS1299StopContinuousMode | ( | void | ) |
Routine to stop the continuous acquisition mode.
[in] | none |
unsigned char ADS1299TestSignal | ( | unsigned char | enable | ) |
This function enables or disables the generation of a test signal built in the ADS1299. It also modifies the input multiplexer configuration shorting the input channels to the test signal.
[in] | enable | can be either 0 (disable) or 1 (enable) |
void ADS1299WriteReg | ( | unsigned char | addr, |
unsigned char | value | ||
) |
Routine to write a value into a ADS1299 register passing its address and the value.
[in] | addr | is the address of the register |
[in] | value | is the value to write |
int Interpret24bitAsInt32 | ( | unsigned char * | byteArray | ) |
This function translates 24 bits information (3 bytes) from complement of 2 format into an integer value.
[in] | *byteArray | points to the array where store the values |
Measured Execution Time @80MHz: 13/07/2016 -> 0.2 us