ADS_BP
Macros | Functions
ADS1299.h File Reference
#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_memmap.h"
#include "driverlib/gpio.h"
#include "driverlib/sysctl.h"
#include "driverlib/ssi.h"
Include dependency graph for ADS1299.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ADS_NPWDN_PORT   0
 
#define ADS_NPWDN_PIN   0
 
#define ADS_NRST_PORT   GPIO_PORTD_BASE
 
#define ADS_NRST_PIN   GPIO_PIN_2
 
#define ADS_START_PORT   GPIO_PORTD_BASE
 
#define ADS_START_PIN   GPIO_PIN_1
 
#define ADS_NCS_PORT   GPIO_PORTA_BASE
 
#define ADS_NCS_PIN   GPIO_PIN_0
 
#define ADS_SSI_PHERIPH   SYSCTL_PERIPH_SSI0
 
#define ADS_SSI_BASE   SSI0_BASE
 
#define ADS_SSI_PORT   GPIO_PORTA_BASE
 
#define ADS_SSIRX_PIN   GPIO_PA4_SSI0RX
 
#define ADS_SSITX_PIN   GPIO_PA5_SSI0TX
 
#define ADS_SSISCLK_PIN   GPIO_PA2_SSI0CLK
 
#define ADS_NDRDY_PORT   GPIO_PORTC_BASE
 
#define ADS_NDRDY_PIN   GPIO_INT_PIN_5
 
#define ADS_NDRDY_INT   INT_GPIOA_TM4C123
 
#define ADSregID   0x00
 
#define ADSregCONFIG1   0x01
 
#define ADSregCONFIG2   0x02
 
#define ADSregCONFIG3   0x03
 
#define ADSregCH1SET   0x05
 
#define WREG   0x40
 
#define RREG   0x20
 
#define SDATAC   0x11
 
#define RDATAC   0x10
 
#define RDATA   0x12
 
#define ADS_CMD_DELAY   (clockFreq/(3*300000))
 

Functions

void ADS1299Init (void)
 This function executes the ADS1299 power-on procedure and initializes all needed config registers. More...
 
void ADS1299ReadContinuousMode (void)
 Routine to start the continuous acquisition mode. More...
 
void ADS1299StopContinuousMode (void)
 Routine to stop the continuous acquisition mode. 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 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...
 
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...
 
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...
 

Detailed Description

Source file for the ADS1299 device.

 ----------------— Function Description ---------------—
This h file includes all functions and defines relative
to the ADS1299 Analog Front-End that are supposed to be
called from external modules.
 ----------------------— Updates ----------------------—
 2015-05-29     /   Enzo Mastinu        / Creation

Function Documentation

§ ADS1299AcquireSample()

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.

Parameters
[in]nChspecifies the number of channels
[out]*chValuespoints to the array where store the values
Returns
none.

Measured Execution Time @80MHz: 14/07/2016 -> 22 us

§ ADS1299Init()

void ADS1299Init ( void  )

This function executes the ADS1299 power-on procedure and initializes all needed config registers.

Parameters
[in]none
Returns
none.

Measured Execution Time @80MHz: 13/07/2016 -> 1.22 s

§ ADS1299ReadAllReg()

void ADS1299ReadAllReg ( unsigned char *  registers)

Routine to read all values from ADS1299 registers. It receives a pointer to a 25 bytes chars array.

Parameters
[out]registerspoints to an array where store the values
Returns
none.
Here is the call graph for this function:

§ ADS1299ReadContinuousMode()

void ADS1299ReadContinuousMode ( void  )

Routine to start the continuous acquisition mode.

Parameters
[in]none
Returns
none.

Measured Execution Time @80MHz: 13/07/2016 -> 145 us

§ ADS1299SetDataRate()

void ADS1299SetDataRate ( unsigned char  mode)

This function writes the ADS1299 CONFIG1 register in way to set the output data rate.

Parameters
[in]modespecifies the output data rate mode
Returns
none.

There are in total 7 possible values for the mode parameter:

  • 0000 0110, DR = f / 4096 –> 250 SPS (BW = 65Hz)
  • 0000 0101, DR = f / 2048 –> 500 SPS (BW = 131Hz)
  • 0000 0100, DR = f / 1024 –> 1000 SPS (BW = 262Hz)
  • 0000 0011, DR = f / 512 –> 2000 SPS (BW = 524Hz)
  • 0000 0010, DR = f / 256 –> 4000 SPS (BW = 1048Hz)
  • 0000 0001, DR = f / 128 –> 8000 SPS (BW = 2096Hz)
  • 0000 0000, DR = f / 64 –> 16000 SPS (BW = 4193Hz)
Here is the call graph for this function:

§ ADS1299SetInputModeSetGain()

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.

Parameters
[in]modeis the output mode
[in]gainis the gain
Returns
none.

Each acquisition channel can be independently configured with its gain and input mode. There are in total 7 possible configuration for the gain parameter:

  • 1 –> x1
  • 2 –> x2
  • 3 –> x4
  • 4 –> x6
  • 5 –> x8
  • 6 –> x12
  • 7 –> x24

There are in total 8 possible configuration for the mode parameter:

  • 0 –> 0000 0000 Normal electrode input
  • 1 –> 0000 0000 Normal electrode input
  • 2 –> 0000 0010 Used in conjunction with BIAS_MEAS bit for BIAS measurements
  • 3 –> 0000 0011, MVDD for supply measurement
  • 4 –> 0000 0100, Temperature sensor
  • 5 –> 0000 0101, Test signal
  • 6 –> 0000 0110, BIAS_DRP (positive electrode is the driver)
  • 7 –> 0000 0111, BIAS_DRN (negative electrode is the driver)
Here is the caller graph for this function:

§ ADS1299StopContinuousMode()

void ADS1299StopContinuousMode ( void  )

Routine to stop the continuous acquisition mode.

Parameters
[in]none
Returns
none.

§ ADS1299TestSignal()

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.

Parameters
[in]enablecan be either 0 (disable) or 1 (enable)
Returns
echo of the enable parameter.
Here is the call graph for this function: