├── devices ├── README.md ├── ads131a04 │ ├── .gitignore │ └── ccs │ │ └── MSP432E LaunchPad │ │ ├── ADS131A04EVM_MSP432E_SYSCONFIG │ │ ├── .gitignore │ │ ├── .settings │ │ │ ├── org.eclipse.cdt.codan.core.prefs │ │ │ ├── org.eclipse.cdt.debug.core.prefs │ │ │ └── org.eclipse.core.resources.prefs │ │ ├── targetConfigs │ │ │ ├── readme.txt │ │ │ └── MSP432E401Y.ccxml │ │ ├── .ccsproject │ │ ├── .project │ │ ├── main_nortos.c │ │ ├── README.md │ │ ├── MSP_EXP432E401Y_NoRTOS.cmd │ │ └── ADS131A04.syscfg │ │ └── ADS131A04_MSP432E_Driverlib │ │ ├── .gitignore │ │ ├── interrupts.h │ │ ├── interrupts.c │ │ ├── targetConfigs │ │ ├── readme.txt │ │ └── MSP432E401Y.ccxml │ │ ├── .ccsproject │ │ ├── settings.h │ │ ├── .project │ │ ├── main.c │ │ └── msp432e401y.cmd ├── ads1235 │ ├── hal.c │ ├── README.md │ └── hal.h ├── ads9327 │ ├── system_verilog │ │ ├── README.md │ │ └── ads9327_clock_divider.sv │ ├── mspm0 │ │ ├── .settings │ │ │ ├── org.eclipse.cdt.codan.core.prefs │ │ │ └── org.eclipse.core.resources.prefs │ │ ├── .project │ │ ├── targetConfigs │ │ │ ├── readme.txt │ │ │ └── MSPM0G3507.ccxml │ │ ├── .ccsproject │ │ └── README.md │ └── c2000 │ │ ├── f28p65x │ │ ├── debug │ │ │ └── setupdebugenv.js │ │ ├── targetConfigs │ │ │ └── TMS320F28P650DK9.ccxml │ │ ├── drivers │ │ │ └── driverlib.h │ │ └── ads9327_main.c │ │ ├── source │ │ ├── ads9327.h │ │ └── ads9327.c │ │ └── README.md ├── ads125h02 │ ├── hal.c │ ├── hal.h │ └── README.md ├── ads7028_38 │ ├── .settings │ │ └── org.eclipse.cdt.codan.core.prefs │ ├── .clangd │ ├── .project │ ├── targetConfigs │ │ ├── readme.txt │ │ └── MSPM0G3507.ccxml │ ├── .ccsproject │ ├── README.md │ └── mspm0g3507.syscfg ├── ads704x_5x │ ├── .settings │ │ └── org.eclipse.cdt.codan.core.prefs │ ├── .clangd │ ├── .project │ ├── targetConfigs │ │ ├── readme.txt │ │ └── MSPM0G3507.ccxml │ ├── .ccsproject │ └── mspm0g3507.syscfg ├── ads706x │ ├── .settings │ │ └── org.eclipse.cdt.codan.core.prefs │ ├── .clangd │ ├── .project │ ├── targetConfigs │ │ ├── readme.txt │ │ └── MSPM0G3507.ccxml │ ├── .ccsproject │ ├── README.md │ └── mspm0g3507.syscfg ├── ads7953 │ ├── .settings │ │ ├── org.eclipse.cdt.codan.core.prefs │ │ └── org.eclipse.core.resources.prefs │ ├── .clangd │ ├── .project │ ├── targetConfigs │ │ ├── readme.txt │ │ └── MSPM0G3507.ccxml │ ├── empty_mspm0g3507.syscfg │ ├── evm │ │ ├── hal.h │ │ └── hal.c │ ├── .ccsproject │ ├── ads7953_mspm0g3507.syscfg │ └── ads79xx-main.c ├── tla2518 │ ├── .settings │ │ └── org.eclipse.cdt.codan.core.prefs │ ├── .clangd │ ├── .project │ ├── targetConfigs │ │ ├── readme.txt │ │ └── MSPM0G3507.ccxml │ ├── .ccsproject │ ├── README.md │ └── mspm0g3507.syscfg ├── ads127l18 │ ├── MSPM0_example │ │ ├── .settings │ │ │ └── org.eclipse.cdt.codan.core.prefs │ │ ├── docs │ │ │ ├── image.png │ │ │ ├── image-1.png │ │ │ ├── image-10.png │ │ │ ├── image-11.png │ │ │ ├── image-12.png │ │ │ ├── image-13.png │ │ │ ├── image-14.png │ │ │ ├── image-15.png │ │ │ ├── image-16.png │ │ │ ├── image-17.png │ │ │ ├── image-18.png │ │ │ ├── image-19.png │ │ │ ├── image-2.png │ │ │ ├── image-20.png │ │ │ ├── image-21.png │ │ │ ├── image-22.png │ │ │ ├── image-23.png │ │ │ ├── image-24.png │ │ │ ├── image-25.png │ │ │ ├── image-26.JPG │ │ │ ├── image-3.png │ │ │ ├── image-4.png │ │ │ ├── image-5.png │ │ │ ├── image-6.png │ │ │ ├── image-7.png │ │ │ ├── image-8.png │ │ │ └── image-9.png │ │ ├── .clangd │ │ ├── .theia │ │ │ └── launch.json │ │ ├── .project │ │ ├── targetConfigs │ │ │ ├── readme.txt │ │ │ └── MSPM0G3507.ccxml │ │ ├── .ccsproject │ │ ├── hal.c │ │ └── hal.h │ └── verilog │ │ ├── block_diagram.png │ │ └── README.md ├── ads127l21 │ ├── README.md │ ├── crc8.h │ └── iir_coeff.h ├── ads1261 │ ├── README.md │ └── hal.h ├── ads127l11 │ └── crc8.h ├── ads1258 │ ├── unit_tests.h │ └── README.md ├── ads1282 │ └── README.md ├── ads124s08 │ ├── crc.h │ └── README.md ├── ads122c04 │ ├── crc.h │ └── README.md ├── ads122u04 │ ├── crc.h │ └── README.md ├── ads1118 │ └── README.md ├── ads1115 │ └── README.md ├── ads1262 │ └── README.md └── ads7066 │ └── README.md ├── docs └── media │ └── ADC.jpg ├── CONTRIBUTING.md └── LICENSE /devices/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /devices/ads131a04/.gitignore: -------------------------------------------------------------------------------- 1 | /doxygen/docsrc/old 2 | -------------------------------------------------------------------------------- /devices/ads131a04/ccs/MSP432E LaunchPad/ADS131A04EVM_MSP432E_SYSCONFIG/.gitignore: -------------------------------------------------------------------------------- 1 | /Debug/ 2 | -------------------------------------------------------------------------------- /docs/media/ADC.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/docs/media/ADC.jpg -------------------------------------------------------------------------------- /devices/ads1235/hal.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads1235/hal.c -------------------------------------------------------------------------------- /devices/ads9327/system_verilog/README.md: -------------------------------------------------------------------------------- 1 | # What am I? 2 | Example SystemVerilog code for interfacing with the ADS9327 -------------------------------------------------------------------------------- /devices/ads125h02/hal.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads125h02/hal.c -------------------------------------------------------------------------------- /devices/ads131a04/ccs/MSP432E LaunchPad/ADS131A04_MSP432E_Driverlib/.gitignore: -------------------------------------------------------------------------------- 1 | /Debug/ 2 | /.settings 3 | /.launches 4 | -------------------------------------------------------------------------------- /devices/ads7028_38/.settings/org.eclipse.cdt.codan.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | inEditor=false 3 | onBuild=false 4 | -------------------------------------------------------------------------------- /devices/ads704x_5x/.settings/org.eclipse.cdt.codan.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | inEditor=false 3 | onBuild=false 4 | -------------------------------------------------------------------------------- /devices/ads706x/.settings/org.eclipse.cdt.codan.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | inEditor=false 3 | onBuild=false 4 | -------------------------------------------------------------------------------- /devices/ads7953/.settings/org.eclipse.cdt.codan.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | inEditor=false 3 | onBuild=false 4 | -------------------------------------------------------------------------------- /devices/tla2518/.settings/org.eclipse.cdt.codan.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | inEditor=false 3 | onBuild=false 4 | -------------------------------------------------------------------------------- /devices/ads9327/mspm0/.settings/org.eclipse.cdt.codan.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | inEditor=false 3 | onBuild=false 4 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to this project 2 | 3 | This project is currently not accepting any contributions. 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/.settings/org.eclipse.cdt.codan.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | inEditor=false 3 | onBuild=false 4 | -------------------------------------------------------------------------------- /devices/ads127l18/verilog/block_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/verilog/block_diagram.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-1.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-10.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-11.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-12.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-13.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-14.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-15.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-16.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-17.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-18.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-19.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-2.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-20.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-21.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-22.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-23.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-23.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-24.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-25.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-26.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-26.JPG -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-3.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-4.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-5.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-6.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-7.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-8.png -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/docs/image-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TexasInstruments/precision-adc-examples/HEAD/devices/ads127l18/MSPM0_example/docs/image-9.png -------------------------------------------------------------------------------- /devices/ads131a04/ccs/MSP432E LaunchPad/ADS131A04EVM_MSP432E_SYSCONFIG/.settings/org.eclipse.cdt.codan.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | inEditor=false 3 | onBuild=false 4 | -------------------------------------------------------------------------------- /devices/ads9327/c2000/f28p65x/debug/setupdebugenv.js: -------------------------------------------------------------------------------- 1 | //Expressions Watch Window Variables for Lab 6 (All expressions) 2 | expRemoveAll() 3 | 4 | expAdd ("fifoADC_A[30]",getNatural()) 5 | expAdd ("fifoADC_B[30]",getNatural()) -------------------------------------------------------------------------------- /devices/ads131a04/ccs/MSP432E LaunchPad/ADS131A04EVM_MSP432E_SYSCONFIG/.settings/org.eclipse.cdt.debug.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker 3 | -------------------------------------------------------------------------------- /devices/ads7028_38/.clangd: -------------------------------------------------------------------------------- 1 | # This is an auto-generated file - do not add it to source-control 2 | 3 | CompileFlags: 4 | CompilationDatabase: Debug/.clangd 5 | 6 | Diagnostics: 7 | Suppress: '*' 8 | 9 | InlayHints: 10 | Enabled: No 11 | 12 | -------------------------------------------------------------------------------- /devices/ads704x_5x/.clangd: -------------------------------------------------------------------------------- 1 | # This is an auto-generated file - do not add it to source-control 2 | 3 | CompileFlags: 4 | CompilationDatabase: Debug/.clangd 5 | 6 | Diagnostics: 7 | Suppress: '*' 8 | 9 | InlayHints: 10 | Enabled: No 11 | 12 | -------------------------------------------------------------------------------- /devices/ads706x/.clangd: -------------------------------------------------------------------------------- 1 | # This is an auto-generated file - do not add it to source-control 2 | 3 | CompileFlags: 4 | CompilationDatabase: Debug/.clangd 5 | 6 | Diagnostics: 7 | Suppress: '*' 8 | 9 | InlayHints: 10 | Enabled: No 11 | 12 | -------------------------------------------------------------------------------- /devices/ads7953/.clangd: -------------------------------------------------------------------------------- 1 | # This is an auto-generated file - do not add it to source-control 2 | 3 | CompileFlags: 4 | CompilationDatabase: Debug/.clangd 5 | 6 | Diagnostics: 7 | Suppress: '*' 8 | 9 | InlayHints: 10 | Enabled: No 11 | 12 | -------------------------------------------------------------------------------- /devices/tla2518/.clangd: -------------------------------------------------------------------------------- 1 | # This is an auto-generated file - do not add it to source-control 2 | 3 | CompileFlags: 4 | CompilationDatabase: Debug/.clangd 5 | 6 | Diagnostics: 7 | Suppress: '*' 8 | 9 | InlayHints: 10 | Enabled: No 11 | 12 | -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/.clangd: -------------------------------------------------------------------------------- 1 | # This is an auto-generated file - do not add it to source-control 2 | 3 | CompileFlags: 4 | CompilationDatabase: Debug/.clangd 5 | 6 | Diagnostics: 7 | Suppress: '*' 8 | 9 | InlayHints: 10 | Enabled: No 11 | 12 | -------------------------------------------------------------------------------- /devices/ads9327/mspm0/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//Debug/makefile=UTF-8 3 | encoding//Debug/objects.mk=UTF-8 4 | encoding//Debug/sources.mk=UTF-8 5 | encoding//Debug/subdir_rules.mk=UTF-8 6 | encoding//Debug/subdir_vars.mk=UTF-8 7 | -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/.theia/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "H_M0_L18_code", 6 | "type": "ccs-debug", 7 | "request": "launch", 8 | "project": "H_M0_L18_code" 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /devices/ads131a04/ccs/MSP432E LaunchPad/ADS131A04EVM_MSP432E_SYSCONFIG/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//Debug/makefile=UTF-8 3 | encoding//Debug/objects.mk=UTF-8 4 | encoding//Debug/sources.mk=UTF-8 5 | encoding//Debug/subdir_rules.mk=UTF-8 6 | encoding//Debug/subdir_vars.mk=UTF-8 7 | -------------------------------------------------------------------------------- /devices/ads7953/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//Debug/evm/subdir_rules.mk=UTF-8 3 | encoding//Debug/evm/subdir_vars.mk=UTF-8 4 | encoding//Debug/makefile=UTF-8 5 | encoding//Debug/objects.mk=UTF-8 6 | encoding//Debug/sources.mk=UTF-8 7 | encoding//Debug/subdir_rules.mk=UTF-8 8 | encoding//Debug/subdir_vars.mk=UTF-8 9 | -------------------------------------------------------------------------------- /devices/ads131a04/ccs/MSP432E LaunchPad/ADS131A04_MSP432E_Driverlib/interrupts.h: -------------------------------------------------------------------------------- 1 | /* 2 | * interrupts.h 3 | * 4 | * Created on: Jan 17, 2019 5 | * Author: a0282860 6 | */ 7 | 8 | #ifndef INTERRUPTS_H_ 9 | #define INTERRUPTS_H_ 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #include "settings.h" 16 | 17 | 18 | 19 | 20 | #endif /* INTERRUPTS_H_ */ 21 | -------------------------------------------------------------------------------- /devices/ads131a04/ccs/MSP432E LaunchPad/ADS131A04_MSP432E_Driverlib/interrupts.c: -------------------------------------------------------------------------------- 1 | /* 2 | * interrupts.c 3 | * 4 | * Created on: Jan 17, 2019 5 | * Author: a0282860 6 | */ 7 | 8 | 9 | #include "interrupts.h" 10 | 11 | 12 | //**************************************************************************** 13 | // 14 | // Global variables 15 | // 16 | //**************************************************************************** 17 | volatile bool g_bUSBConfigured = false; // Configured or connected? 18 | volatile uint32_t g_ui32Flags = 0; 19 | 20 | uint32_t g_num_samples = 0; 21 | -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | H_M0_L18_code 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | 11 | 12 | 13 | 14 | 15 | com.ti.ccstudio.core.ccsNature 16 | org.eclipse.cdt.core.cnature 17 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 18 | org.eclipse.cdt.core.ccnature 19 | 20 | 21 | -------------------------------------------------------------------------------- /devices/ads127l21/README.md: -------------------------------------------------------------------------------- 1 | ADS127L21 Example C Code 2 | ======================== 3 | High-level functions and register map definitions for the [ADS127L21](https://www.ti.com/product/ADS127L21). 4 | 5 | 6 | Features 7 | ---------- 8 | - Device configuration 9 | - Register read & write operations 10 | - Example start-up initialization 11 | - Programmable filter coefficients 12 | - Data collection 13 | - SPI and register map CRC computations 14 | 15 | 16 | Release History 17 | --------------- 18 | 19 | | Version | Date | Description | 20 | |:-----------:| ----------- | ---------------------- | 21 | | 1.0.0 | 11/7/2024 | Initial release | 22 | -------------------------------------------------------------------------------- /devices/ads706x/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ads706x_lp-mspm0g3507_example_code 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | 11 | 12 | 13 | 14 | 15 | com.ti.ccstudio.core.ccsNature 16 | org.eclipse.cdt.core.cnature 17 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 18 | org.eclipse.cdt.core.ccnature 19 | 20 | 21 | -------------------------------------------------------------------------------- /devices/tla2518/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | tla2518_lp-mspm0g3507_example_code 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | 11 | 12 | 13 | 14 | 15 | com.ti.ccstudio.core.ccsNature 16 | org.eclipse.cdt.core.cnature 17 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 18 | org.eclipse.cdt.core.ccnature 19 | 20 | 21 | -------------------------------------------------------------------------------- /devices/ads704x_5x/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ads704x_5x_lp-mspm0g3507_example_code 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | 11 | 12 | 13 | 14 | 15 | com.ti.ccstudio.core.ccsNature 16 | org.eclipse.cdt.core.cnature 17 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 18 | org.eclipse.cdt.core.ccnature 19 | 20 | 21 | -------------------------------------------------------------------------------- /devices/ads9327/mspm0/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ads9327_lp-mspm0g3507_example_code 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | 11 | 12 | 13 | 14 | 15 | com.ti.ccstudio.core.ccsNature 16 | org.eclipse.cdt.core.cnature 17 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 18 | org.eclipse.cdt.core.ccnature 19 | 20 | 21 | -------------------------------------------------------------------------------- /devices/ads7028_38/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ads7028_ads7038_lp-mspm0g3507_example_code 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | 11 | 12 | 13 | 14 | 15 | com.ti.ccstudio.core.ccsNature 16 | org.eclipse.cdt.core.cnature 17 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 18 | org.eclipse.cdt.core.ccnature 19 | 20 | 21 | -------------------------------------------------------------------------------- /devices/ads7953/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | <<<<<<< HEAD 4 | ADS7953_MSPM0G3507 5 | ======= 6 | empty_mspm0g3507_nortos_ticlang 7 | >>>>>>> 68e8aa1 (Refactored .h file for configuration via preprocessor defines) 8 | 9 | 10 | 11 | 12 | 13 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 14 | 15 | 16 | 17 | 18 | 19 | com.ti.ccstudio.core.ccsNature 20 | org.eclipse.cdt.core.cnature 21 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 22 | org.eclipse.cdt.core.ccnature 23 | 24 | 25 | -------------------------------------------------------------------------------- /devices/ads7028_38/targetConfigs/readme.txt: -------------------------------------------------------------------------------- 1 | The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based 2 | on the device and connection settings specified in your project on the Properties > General page. 3 | 4 | Please note that in automatic target-configuration management, changes to the project's device and/or 5 | connection settings will either modify an existing or generate a new target-configuration file. Thus, 6 | if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively, 7 | you may create your own target-configuration file for this project and manage it manually. You can 8 | always switch back to automatic target-configuration management by checking the "Manage the project's 9 | target-configuration automatically" checkbox on the project's Properties > General page. -------------------------------------------------------------------------------- /devices/ads704x_5x/targetConfigs/readme.txt: -------------------------------------------------------------------------------- 1 | The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based 2 | on the device and connection settings specified in your project on the Properties > General page. 3 | 4 | Please note that in automatic target-configuration management, changes to the project's device and/or 5 | connection settings will either modify an existing or generate a new target-configuration file. Thus, 6 | if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively, 7 | you may create your own target-configuration file for this project and manage it manually. You can 8 | always switch back to automatic target-configuration management by checking the "Manage the project's 9 | target-configuration automatically" checkbox on the project's Properties > General page. -------------------------------------------------------------------------------- /devices/ads706x/targetConfigs/readme.txt: -------------------------------------------------------------------------------- 1 | The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based 2 | on the device and connection settings specified in your project on the Properties > General page. 3 | 4 | Please note that in automatic target-configuration management, changes to the project's device and/or 5 | connection settings will either modify an existing or generate a new target-configuration file. Thus, 6 | if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively, 7 | you may create your own target-configuration file for this project and manage it manually. You can 8 | always switch back to automatic target-configuration management by checking the "Manage the project's 9 | target-configuration automatically" checkbox on the project's Properties > General page. -------------------------------------------------------------------------------- /devices/ads7953/targetConfigs/readme.txt: -------------------------------------------------------------------------------- 1 | The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based 2 | on the device and connection settings specified in your project on the Properties > General page. 3 | 4 | Please note that in automatic target-configuration management, changes to the project's device and/or 5 | connection settings will either modify an existing or generate a new target-configuration file. Thus, 6 | if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively, 7 | you may create your own target-configuration file for this project and manage it manually. You can 8 | always switch back to automatic target-configuration management by checking the "Manage the project's 9 | target-configuration automatically" checkbox on the project's Properties > General page. -------------------------------------------------------------------------------- /devices/tla2518/targetConfigs/readme.txt: -------------------------------------------------------------------------------- 1 | The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based 2 | on the device and connection settings specified in your project on the Properties > General page. 3 | 4 | Please note that in automatic target-configuration management, changes to the project's device and/or 5 | connection settings will either modify an existing or generate a new target-configuration file. Thus, 6 | if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively, 7 | you may create your own target-configuration file for this project and manage it manually. You can 8 | always switch back to automatic target-configuration management by checking the "Manage the project's 9 | target-configuration automatically" checkbox on the project's Properties > General page. -------------------------------------------------------------------------------- /devices/ads9327/mspm0/targetConfigs/readme.txt: -------------------------------------------------------------------------------- 1 | The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based 2 | on the device and connection settings specified in your project on the Properties > General page. 3 | 4 | Please note that in automatic target-configuration management, changes to the project's device and/or 5 | connection settings will either modify an existing or generate a new target-configuration file. Thus, 6 | if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively, 7 | you may create your own target-configuration file for this project and manage it manually. You can 8 | always switch back to automatic target-configuration management by checking the "Manage the project's 9 | target-configuration automatically" checkbox on the project's Properties > General page. -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/targetConfigs/readme.txt: -------------------------------------------------------------------------------- 1 | The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based 2 | on the device and connection settings specified in your project on the Properties > General page. 3 | 4 | Please note that in automatic target-configuration management, changes to the project's device and/or 5 | connection settings will either modify an existing or generate a new target-configuration file. Thus, 6 | if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively, 7 | you may create your own target-configuration file for this project and manage it manually. You can 8 | always switch back to automatic target-configuration management by checking the "Manage the project's 9 | target-configuration automatically" checkbox on the project's Properties > General page. -------------------------------------------------------------------------------- /devices/ads7953/empty_mspm0g3507.syscfg: -------------------------------------------------------------------------------- 1 | /** 2 | * These arguments were used when this file was generated. They will be automatically applied on subsequent loads 3 | * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments. 4 | */ 5 | //@cliArgs --device "MSPM0G350X" --package "LQFP-64(PM)" --part "Default" 6 | //@v2CliArgs --device "MSPM0G3507" --package "LQFP-64(PM)" 7 | 8 | /** 9 | * Import the modules used in this configuration. 10 | */ 11 | const SYSCTL = scripting.addModule("/ti/driverlib/SYSCTL"); 12 | const ProjectConfig = scripting.addModule("/ti/project_config/ProjectConfig"); 13 | 14 | /** 15 | * Write custom configuration values to the imported modules. 16 | */ 17 | 18 | const Board = scripting.addModule("/ti/driverlib/Board", {}, false); 19 | 20 | ProjectConfig.deviceSpin = "MSPM0G3507"; 21 | -------------------------------------------------------------------------------- /devices/ads131a04/ccs/MSP432E LaunchPad/ADS131A04_MSP432E_Driverlib/targetConfigs/readme.txt: -------------------------------------------------------------------------------- 1 | The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based 2 | on the device and connection settings specified in your project on the Properties > General page. 3 | 4 | Please note that in automatic target-configuration management, changes to the project's device and/or 5 | connection settings will either modify an existing or generate a new target-configuration file. Thus, 6 | if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively, 7 | you may create your own target-configuration file for this project and manage it manually. You can 8 | always switch back to automatic target-configuration management by checking the "Manage the project's 9 | target-configuration automatically" checkbox on the project's Properties > General page. -------------------------------------------------------------------------------- /devices/ads131a04/ccs/MSP432E LaunchPad/ADS131A04EVM_MSP432E_SYSCONFIG/targetConfigs/readme.txt: -------------------------------------------------------------------------------- 1 | The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based 2 | on the device and connection settings specified in your project on the Properties > General page. 3 | 4 | Please note that in automatic target-configuration management, changes to the project's device and/or 5 | connection settings will either modify an existing or generate a new target-configuration file. Thus, 6 | if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively, 7 | you may create your own target-configuration file for this project and manage it manually. You can 8 | always switch back to automatic target-configuration management by checking the "Manage the project's 9 | target-configuration automatically" checkbox on the project's Properties > General page. -------------------------------------------------------------------------------- /devices/ads7953/evm/hal.h: -------------------------------------------------------------------------------- 1 | #ifndef EVM_HAL_H 2 | #define EVM_HAL_H 3 | 4 | #include "ti_msp_dl_config.h" 5 | #include 6 | 7 | /** 8 | * @brief Controller transmit function 9 | * 10 | * Transmits data from the controller to the peripheral 11 | * CS is automatically managed (set low before transmission, high after) 12 | * 13 | * @param data Pointer to data array to transmit 14 | * @param dataLength Number of bytes to transmit 15 | */ 16 | void SPI_Controller_transmitData(uint16_t *data, uint16_t dataLength); 17 | 18 | /** 19 | * @brief Send and receive data arrays via SPI 20 | * 21 | * CS is automatically managed (set low before transmission, high after) 22 | * 23 | * @param dataTx Array of bytes to transmit 24 | * @param dataRx Array to store received bytes 25 | * @param bufferLength Number of bytes to transfer 26 | */ 27 | void spiSendReceiveArrays(const uint16_t dataTx[], uint16_t dataRx[], const uint8_t bufferLength); 28 | 29 | #endif /* EVM_HAL_H */ -------------------------------------------------------------------------------- /devices/ads131a04/ccs/MSP432E LaunchPad/ADS131A04_MSP432E_Driverlib/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /devices/ads7953/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /devices/ads9327/mspm0/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /devices/ads131a04/ccs/MSP432E LaunchPad/ADS131A04EVM_MSP432E_SYSCONFIG/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /devices/ads1261/README.md: -------------------------------------------------------------------------------- 1 | # ADS1261 Example C Code 2 | Reference this code as an example to help to you get started writing your own ADS1261 code. 3 | 4 | ## Included modules 5 | 6 | **`ADS1261`** - Low-level functions and register map definitions for communicating with the ADS1261 and related devices. 7 | \ 8 | **`HAL`** - Processor specific functions required by the `ADS1261` module. 9 | 10 | **How to use this code...** 11 | \ 12 | The `ADS1261` and `HAL` modules can be copied into your project; however, you will have to edit all of the function contents inside the *hal.c* file and add all required library references to *hal.h* to ensure compatibility with your processor. Once that is complete, include *ads1261.h* in your application and you can begin calling `ADS1261` functions in your code. 13 | 14 | --- 15 | 16 | **IMPORTANT**: This code was tested on a TM4C1294NCPDT 32-bit ARM® Cortex®-M4F based MCU using TI Code Composer Studio's 16.9.1.LTS ARM compiler. This code is provided only as example to aid in the creation of your own software implementation and should not be considered to be fully verified and ready for use in your application. -------------------------------------------------------------------------------- /devices/ads127l18/verilog/README.md: -------------------------------------------------------------------------------- 1 | # Example FPGA code for ADS127L18 data port 2 | This is an example of how to latch data from the [ADS127L18](https://www.ti.com/product/ADS127L18) frame-sync data port that outputs the channel conversion data. The data port is a synchronous, read-only interface with synchronized output clock signals (FSYNC and DCLK) and channel data (DOUTn). This verilog module captures and splits the continuous 1/2/4/8 lane data (including STATUS and CRC bytes if enabled) into eight separate channels and latches the data between frames. 3 | 4 | #### Block Diagram 5 | ![Block diagram](block_diagram.png) 6 | 7 | #### Usage 8 | When instanciating this block you must specifiy the number of data lanes and the expected number of bits per channel packet, according to the data length (16- or 24-bit) and whether or not STATUS and CRC bytes will also be included in the data packet. 9 | 10 | ```Verilog 11 | ADS127L18_tdm_deserializer #( 12 | .LANE_COUNT (8), // [1|2|4|8] 13 | .BITS_PER_PACKET (24) // [16|24|32|40] 14 | ) 15 | ... 16 | ``` 17 | 18 | ## References 19 | [ADS127L18 product page](https://www.ti.com/product/ADS127L18) -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /devices/ads131a04/ccs/MSP432E LaunchPad/ADS131A04EVM_MSP432E_SYSCONFIG/targetConfigs/MSP432E401Y.ccxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /devices/ads1235/README.md: -------------------------------------------------------------------------------- 1 | # ADS1235 Example C Code 2 | 3 | Reference this code as an example to help to you get started writing your own ADS1235 code. 4 | 5 | ## Included modules 6 | 7 | **`ADS1235`** - Low-level functions and register map definitions for communicating with the ADS1235 and related devices. 8 | \ 9 | **`Hardware Abstraction Layer (HAL)`** - Processor specific functions required by the `ADS1235` module. 10 | 11 | **How to use this code...** 12 | \ 13 | The `ADS1235` and `HAL` modules can be copied into your project; however, you will have to edit all of the function contents inside the *hal.c* file and add all required library references to *hal.h* to ensure compatibility with your processor. Once that is complete, include *ads1235.h* in your application and you can begin calling `ADS1235` functions in your code. 14 | 15 | --- 16 | 17 | **IMPORTANT**: This code was tested on a TM4C1294NCPDT 32-bit ARM® Cortex®-M4F based MCU using TI Code Composer Studio's 16.9.1.LTS ARM compiler. This code is provided only as example to aid in the creation of your own software implementation and should not be considered to be fully verified and ready for use in your application. 18 | 19 | -------------------------------------------------------------------------------- /devices/ads706x/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /devices/tla2518/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /devices/ads7028_38/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /devices/ads704x_5x/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /devices/ads131a04/ccs/MSP432E LaunchPad/ADS131A04_MSP432E_Driverlib/settings.h: -------------------------------------------------------------------------------- 1 | #ifndef SETTINGS_H_ 2 | #define SETTINGS_H_ 3 | 4 | // Standard libraries 5 | #include 6 | 7 | // Custom libraries 8 | #include "ti/devices/msp432e4/driverlib/driverlib.h" 9 | 10 | 11 | 12 | //***************************************************************************** 13 | // 14 | // Pinouts 15 | // 16 | //***************************************************************************** 17 | 18 | #define LED1_PORT (GPIO_PORTN_BASE) 19 | #define LED1_PIN (GPIO_PIN_1) 20 | 21 | #define LED2_PORT (GPIO_PORTN_BASE) 22 | #define LED2_PIN (GPIO_PIN_0) 23 | 24 | #define LED3_PORT (GPIO_PORTF_BASE) 25 | #define LED3_PIN (GPIO_PIN_4) 26 | 27 | #define LED4_PORT (GPIO_PORTF_BASE) 28 | #define LED4_PIN (GPIO_PIN_0) 29 | 30 | 31 | 32 | //***************************************************************************** 33 | // 34 | // Function prototypes 35 | // 36 | //***************************************************************************** 37 | 38 | extern void INIT_LAUNCHPAD(void); 39 | extern uint32_t getSysClockHz(void); 40 | 41 | 42 | 43 | #endif /* SETTINGS_H_ */ 44 | -------------------------------------------------------------------------------- /devices/ads131a04/ccs/MSP432E LaunchPad/ADS131A04EVM_MSP432E_SYSCONFIG/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ADS131A04EVM_MSP432E_SYSCONFIG 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 15 | full,incremental, 16 | 17 | 18 | 19 | 20 | 21 | com.ti.ccstudio.core.ccsNature 22 | org.eclipse.cdt.core.cnature 23 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 24 | org.eclipse.cdt.core.ccnature 25 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 26 | 27 | 28 | 29 | Board.html 30 | 1 31 | COM_TI_SIMPLELINK_MSP432E4_SDK_INSTALL_DIR/source/ti/boards/MSP_EXP432E401Y/Board.html 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /devices/ads7953/evm/hal.c: -------------------------------------------------------------------------------- 1 | #include "evm/hal.h" 2 | #include "ti/devices/msp/peripherals/hw_spi.h" 3 | #include "ti_msp_dl_config.h" 4 | 5 | 6 | /* 7 | * Helper function to transmit data from the Controller to the Peripheral. 8 | * This function assumes that the command has already been transmitted, so 9 | * the CD line should already be set HIGH indicating that data is being 10 | * transmitted. 11 | * 12 | * data The data to send to the Peripheral. 13 | * Example: DATA_TYPE_0 14 | * dataLength The number of data bytes to send. 15 | * Example: DATA_TYPE_0_LENGTH 16 | */ 17 | void SPI_Controller_transmitData(uint16_t *data, uint16_t dataLength) 18 | { 19 | int i = 0; 20 | for (i = 0; i < dataLength; i++) { 21 | while (DL_SPI_isBusy(SPI_0_INST)); 22 | 23 | DL_SPI_transmitData16(SPI_0_INST, data[i]); 24 | } 25 | } 26 | 27 | void spiSendReceiveArrays(const uint16_t dataTx[], uint16_t dataRx[], const uint8_t bufferLength) 28 | { 29 | 30 | int i = 0; 31 | for (i = 0; i < bufferLength; i++) { 32 | 33 | DL_SPI_transmitData16(SPI_0_INST, dataTx[i]); 34 | } 35 | 36 | for (i = 0; i < bufferLength; i++) { 37 | 38 | dataRx[i] = DL_SPI_receiveDataBlocking16(SPI_0_INST); 39 | } 40 | } -------------------------------------------------------------------------------- /devices/ads131a04/ccs/MSP432E LaunchPad/ADS131A04_MSP432E_Driverlib/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ADS131A04EVM_MSP432E_LP 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 15 | full,incremental, 16 | 17 | 18 | 19 | 20 | 21 | com.ti.ccstudio.core.ccsNature 22 | org.eclipse.cdt.core.cnature 23 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 24 | org.eclipse.cdt.core.ccnature 25 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 26 | 27 | 28 | 29 | ads131a04.c 30 | 1 31 | PARENT-3-PROJECT_LOC/src/ads131a04.c 32 | 33 | 34 | ads131a04.h 35 | 1 36 | PARENT-3-PROJECT_LOC/src/ads131a04.h 37 | 38 | 39 | scripts 40 | 2 41 | PARENT-3-PROJECT_LOC/scripts 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /devices/ads131a04/ccs/MSP432E LaunchPad/ADS131A04_MSP432E_Driverlib/targetConfigs/MSP432E401Y.ccxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /devices/ads706x/targetConfigs/MSPM0G3507.ccxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /devices/ads7953/targetConfigs/MSPM0G3507.ccxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /devices/tla2518/targetConfigs/MSPM0G3507.ccxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /devices/ads7028_38/targetConfigs/MSPM0G3507.ccxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /devices/ads704x_5x/targetConfigs/MSPM0G3507.ccxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /devices/ads9327/mspm0/targetConfigs/MSPM0G3507.ccxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/targetConfigs/MSPM0G3507.ccxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | ***Please refer to docs/Precision-ADC Github_manifest.html for license information. 2 | 3 | Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com/ 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions 7 | are met: 8 | 9 | Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the 15 | distribution. 16 | 17 | Neither the name of Texas Instruments Incorporated nor the names of 18 | its contributors may be used to endorse or promote products derived 19 | from this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | -------------------------------------------------------------------------------- /devices/ads7028_38/README.md: -------------------------------------------------------------------------------- 1 | ## Example Summary 2 | 3 | The following example configures the MSPM0 SPI as a Controller to interface with ADS7028 and ADS7038 ADCs. 4 | This example is intended to be used with the with ADS7028 and ADS7038 ADCs. 5 | 6 | This example sets up the SPI to read and write registers using 24-bit SPI frames with manual CS control. ADC data is transmitted using 12-bit SPI frames. 7 | 8 | This example was built with the following tools: 9 | - Code Composer Studio Version 20.0.1.4__1.6.1 10 | - TI Clang compiler version 4.0.0 LTS 11 | - MSPM0 SDK version 2.2.0.05 12 | - SysConfig 1.21.1 13 | 14 | ## BoosterPacks, Board Resources & Jumper Settings 15 | 16 | Visit [LP_MSPM0G3507](https://www.ti.com/tool/LP-MSPM0G3507) for LaunchPad information, including user guide and hardware files. 17 | Visit [ADS7038EVM-PDK](https://www.ti.com/tool/ADS7038Q1EVM-PDK) for ADS7028 and ADS7038 booster pack information, including user guide. 18 | 19 | ## Hardware Connections 20 | 21 | This example uses the booster-pack from the ADS7066EVM-PDK mounted on the LP-MSPM03507. 22 | 23 | ![Booster Pack Image](https://www.ti.com/content/dam/ticom/images/products/ic/microcontrollers/msp/evm-board/lp-mspm0g3507-top.png:small) ![EVM image](https://www.ti.com/content/dam/ticom/images/products/ic/dataconverters/evm-board/ads7038q1evm-pdk-top.png:small) 24 | 25 | 1. On the ADS7038 booster pack, connect J2-13 to J2-19 for CS control. 26 | 2. On the ADS7038 booster pack, short AIN2 to AIN3 by installing a jumper between pins J5-5 and J5-6. 27 | 28 | 29 | 30 | ## Example Usage 31 | The code example resets the ADC and configures the following channels of the ADC: 32 | AIN2: digital output, push-pull 33 | AIN3: analog input 34 | AIN7: digital output to control LED onboard ADS7038EVM-PDK 35 | 36 | The LED on the booster pack is turned on by configuring AIN7 as a digital output and setting it to logic 0. 37 | 38 | Analog input channel 3 is configured as an analog input. For the purpose of this demo, the AIN3/GPIO3 drives logic 0 (close to 0V) and logic 1 (close to AVDD) that is measured by AIN3. -------------------------------------------------------------------------------- /devices/ads9327/mspm0/README.md: -------------------------------------------------------------------------------- 1 | # ADS93227 Example C Code for MSPM0 2 | The following example is a [Code Composer Studio (CCS)](https://www.ti.com/tool/CCSTUDIO) project that configures the MSPM0 SPI as a Controller to interface with the [ADS9327](https://www.ti.com/product/ADS9327). 3 | 4 | -------------------------------------------------------------------- 5 | ## BoosterPacks, Board Resources & Jumper Settings 6 | Visit [LP_MSPM0G3507](https://www.ti.com/tool/LP-MSPM0G3507) for LaunchPad information, including user guide and hardware files. 7 | Visit [ADS9327EVM](https://www.ti.com/tool/ADS9327EVM) for ADS9327 evm information, including user guide. 8 | 9 | -------------------------------------------------------------------- 10 | ## Hardware Connections 11 | This example uses the ADS9327 SPI port wired to the LP-MSPM02507. 12 | | Peripheral | Pin | Function | 13 | | ------------ | ------------ | ------------ | 14 | | SPI1 | PB9 | SPI SCLK (Clock) | 15 | | SPI1 | PB8 | SPI PICO (Peripheral In, Controller Out) | 16 | | SPI1 | PB7 | SPI POCI (Peripheral Out, Controller In) | 17 | | GPIO| PB1 | ADC CONVST signal | 18 | 19 | -------------------------------------------------------------------- 20 | ## Example Usage 21 | The code example provides the following functionality: 22 | 1. ADC register read and write on power-up using 24-bit SPI 23 | 2. ADC register read and write after enabling 1-SDO mode using 48-bit SPI 24 | 3. ADC data read in 1-SDO mode 25 | 26 | On power-up, the ADS9327 uses 24-bit SPI frames for register read and write and 4-SDO output. MSPM0 supports 1-SDO interface. This code configures the ADS9327 to use 1-SDO data interface using 24-bit register writes in the initialize_ads9327() function. Enabling 1-SDO mode switches all ADS9327 communication (data and register access) to 48-bit mode. Hence the MSPM0 SPI controller is reconfigured for 48-bit SPI. 27 | 28 | -------------------------------------------------------------------- 29 | ## Additional Resources 30 | - [Code Composer Studio (CCS)](https://www.ti.com/tool/CCSTUDIO) 31 | - [MSPM0-SDK](https://www.ti.com/tool/MSPM0-SDK) -------------------------------------------------------------------------------- /devices/ads9327/c2000/f28p65x/targetConfigs/TMS320F28P650DK9.ccxml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /devices/tla2518/README.md: -------------------------------------------------------------------------------- 1 | ## Example Summary 2 | 3 | The following example configures the MSPM0 SPI as a Controller to interface with TLA2518 ADC. 4 | This example is intended to be used with the with [TLA2518 ADC](https://www.ti.com/product/TLA2518). 5 | 6 | This example sets up the SPI to read and write registers using 24-bit SPI frames with manual CS control. ADC data is transmitted using 12-bit SPI frames. 7 | 8 | This example was built with the following tools: 9 | - Code Composer Studio Version 20.0.1.4__1.6.1 10 | - TI Clang compiler version 4.0.0 LTS 11 | - MSPM0 SDK version 2.2.0.05 12 | - SysConfig 1.21.1 13 | 14 | ## BoosterPacks, Board Resources & Jumper Settings 15 | 16 | Visit [LP_MSPM0G3507](https://www.ti.com/tool/LP-MSPM0G3507) for LaunchPad information, including user guide and hardware files. 17 | Visit [ADS7038EVM-PDK](https://www.ti.com/tool/ADS7038EVM-PDK) for TLA2518 booster pack information, including user guide. 18 | 19 | ## Hardware Connections 20 | 21 | This example uses the booster-pack from the ADS7038EVM-PDK mounted on the LP-MSPM03507. 22 | 23 | ![Booster Pack Image](https://www.ti.com/content/dam/ticom/images/products/ic/microcontrollers/msp/evm-board/lp-mspm0g3507-top.png:small) ![EVM image](https://www.ti.com/content/dam/ticom/images/products/ic/dataconverters/evm-board/ads7038q1evm-pdk-top.png:small) 24 | 25 | 1. On the ADS7038 booster pack, connect J2-13 to J2-19 for CS control. 26 | 2. On the ADS7038 booster pack, short AIN2 to AIN3 by installing a jumper between pins J5-5 and J5-6. 27 | 28 | 29 | 30 | ## Example Usage 31 | The code example resets the ADC and configures the following channels of the ADC: 32 | AIN2: digital output, push-pull 33 | AIN3: analog input 34 | AIN7: digital output to control LED onboard ADS7038EVM-PDK 35 | 36 | The LED on the booster pack is turned on by configuring AIN7 as a digital output and setting it to logic 0. 37 | 38 | Analog input channel 3 is configured as an analog input. For the purpose of this demo, the AIN3/GPIO3 drives logic 0 (close to 0V) and logic 1 (close to AVDD) that is measured by AIN3. 39 | 40 | After initialization, read the AIN3 signal in a loop forever. -------------------------------------------------------------------------------- /devices/ads706x/README.md: -------------------------------------------------------------------------------- 1 | ## Example Summary 2 | 3 | The following example configures the MSPM0 SPI as a Controller to interface with ADS7066 and ADS7067 ADCs. 4 | This example is intended to be used with the with [ADS7066](https://www.ti.com/product/ADS7066) and [ADS7067](https://www.ti.com/product/ADS7067) ADCs. 5 | 6 | This example sets up the SPI to read and write registers using 24-bit SPI frames with manual CS control. ADC data is transmitted using 16-bit SPI frames. 7 | 8 | This example was built with the following tools: 9 | - Code Composer Studio Version 20.0.1.4__1.6.1 10 | - TI Clang compiler version 4.0.0 LTS 11 | - MSPM0 SDK version 2.2.0.05 12 | - SysConfig 1.21.1 13 | 14 | ## BoosterPacks, Board Resources & Jumper Settings 15 | 16 | Visit [LP_MSPM0G3507](https://www.ti.com/tool/LP-MSPM0G3507) for LaunchPad information, including user guide and hardware files. 17 | Visit [ADS7066EVM-PDK](https://www.ti.com/tool/ADS7066EVM-PDK) for ADS7066 and ADS7067 booster pack information, including user guide. 18 | 19 | ## Hardware Connections 20 | 21 | This example uses the booster-pack from the ADS7066EVM-PDK mounted on the LP-MSPM02507. 22 | 23 | ![Booster Pack Image](https://www.ti.com/content/dam/ticom/images/products/ic/microcontrollers/msp/evm-board/lp-mspm0g3507-top.png:small) ![EVM image](https://www.ti.com/content/dam/ticom/images/products/ic/dataconverters/evm-board/ads7066evm-pdk-top.png:small) 24 | 25 | 1. On the ADS7066 booster pack, connect J2-13 to J2-19 for CS control. 26 | 2. On the ADS7066 booster pack, short AIN2 to AIN3 by installing a jumper between pins J5-5 and J5-6. 27 | 28 | 29 | 30 | ## Example Usage 31 | The code example resets the ADC and configures the following channels of the ADC: 32 | AIN2: digital output, push-pull 33 | AIN3: analog input 34 | AIN7: digital output to control LED onboard ADS7066EVM-PDK 35 | 36 | The LED on the booster pack is turned on by configuring AIN7 as a digital output and setting it to logic 0. 37 | 38 | Analog input channel 3 is configured as an analog input. For the purpose of this demo, the AIN3/GPIO3 drives logic 0 (close to 0V) and logic 1 (close to AVDD) that is measured by AIN3. 39 | 40 | After initialization, read the AIN3 signal in a loop forever. -------------------------------------------------------------------------------- /devices/ads127l11/crc8.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \copyright Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com/ 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Texas Instruments Incorporated nor the names of 17 | * its contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | * 32 | */ 33 | 34 | // APP NOTE: Communication Methods for Data Integrity Using Delta-Sigma Data Converters 35 | // URL: https://www.ti.com/lit/an/sbaa106/sbaa106.pdf 36 | 37 | #ifndef CRC8_H_ 38 | #define CRC8_H_ 39 | 40 | // Standard libraries 41 | #include 42 | #include 43 | #include 44 | 45 | // Select CRC calculation mode... 46 | // If not defines, CRC will be compute 47 | #define CRC8_LOOKUP 48 | 49 | // Function Prototypes 50 | void initCRC8(uint8_t polynomial); 51 | uint8_t getCRC8(const uint8_t dataBytes[], uint8_t numberBytes, uint8_t initialValue); 52 | 53 | #endif /* CRC8_H_ */ -------------------------------------------------------------------------------- /devices/ads127l21/crc8.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \copyright Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com/ 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Texas Instruments Incorporated nor the names of 17 | * its contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | * 32 | */ 33 | 34 | // APP NOTE: Communication Methods for Data Integrity Using Delta-Sigma Data Converters 35 | // URL: https://www.ti.com/lit/an/sbaa106/sbaa106.pdf 36 | 37 | #ifndef CRC8_H_ 38 | #define CRC8_H_ 39 | 40 | // Standard libraries 41 | #include 42 | #include 43 | #include 44 | 45 | // Select CRC calculation mode... 46 | // If not defines, CRC will be compute 47 | #define CRC8_LOOKUP 48 | 49 | // Function Prototypes 50 | void initCRC8(uint8_t polynomial); 51 | uint8_t getCRC8(const uint8_t dataBytes[], uint8_t numberBytes, uint8_t initialValue); 52 | 53 | #endif /* CRC8_H_ */ -------------------------------------------------------------------------------- /devices/ads131a04/ccs/MSP432E LaunchPad/ADS131A04EVM_MSP432E_SYSCONFIG/main_nortos.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2019, Texas Instruments Incorporated 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * * Neither the name of Texas Instruments Incorporated nor the names of 17 | * its contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 30 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | */ 33 | 34 | /* 35 | * ======== main_nortos.c ======== 36 | */ 37 | #include 38 | #include 39 | #include 40 | 41 | #include 42 | 43 | /* Example/Board Header files */ 44 | #include 45 | 46 | extern void *mainThread(void *arg0); 47 | 48 | 49 | /* 50 | * ======== main ======== 51 | */ 52 | int main(void) 53 | { 54 | /* Call driver init functions */ 55 | Board_init(); 56 | 57 | /* Start NoRTOS */ 58 | NoRTOS_start(); 59 | 60 | /* Call mainThread function */ 61 | mainThread(NULL); 62 | 63 | // Unreachable code 64 | while (1) { } 65 | } 66 | -------------------------------------------------------------------------------- /devices/ads1258/unit_tests.h: -------------------------------------------------------------------------------- 1 | /* --COPYRIGHT--,BSD 2 | * Copyright (c) 2018, Texas Instruments Incorporated 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * * Neither the name of Texas Instruments Incorporated nor the names of 17 | * its contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 29 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 30 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | * --/COPYRIGHT--*/ 32 | 33 | #ifndef UNIT_TESTS_H_ 34 | #define UNIT_TESTS_H_ 35 | 36 | // Includes 37 | #include 38 | #include 39 | #include "ads1258.h" 40 | #include "hal.h" 41 | 42 | 43 | 44 | // 45 | // Function prototypes 46 | // 47 | bool run_unit_tests(void); 48 | 49 | bool test_PWDN_pin(void); 50 | bool test_START_pin(void); 51 | bool test_RESET_pin(void); 52 | bool test_CS_pin(void); 53 | bool test_DRDY_interrupt(void); 54 | bool test_read_register(void); 55 | bool test_write_register(void); 56 | bool test_reset_command(void); 57 | bool test_multiple_read_write(void); 58 | bool test_read_data(void); 59 | bool test_noise(void); 60 | 61 | 62 | #endif /* ADS1258_UNIT_TESTS_H_ */ 63 | -------------------------------------------------------------------------------- /devices/ads9327/c2000/source/ads9327.h: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * \copyright Copyright (C) 2025 Texas Instruments Incorporated - http://www.ti.com/ 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the 15 | * distribution. 16 | * 17 | * Neither the name of Texas Instruments Incorporated nor the names of 18 | * its contributors may be used to endorse or promote products derived 19 | * from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | * 33 | */ 34 | 35 | #ifndef ads9327_H_ 36 | #define ads9327_H_ 37 | 38 | #ifdef __cplusplus 39 | 40 | extern "C" { 41 | #endif 42 | 43 | #include "driverlib.h" 44 | #include "device.h" 45 | #include 46 | #include 47 | 48 | //***************************************************************************** 49 | // 50 | // ADS9327 ADC Functions 51 | // 52 | //***************************************************************************** 53 | 54 | void ADS9327_unlockRegisterMap(); 55 | void ADS9327_lockRegisterMap(); 56 | void ADS9327_regBankSel(uint8_t bank); 57 | void ADS9327_resetAdcAndRegisters(); 58 | void ADS9327_initalization(); 59 | 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif /* ADS9327_H_ */ 66 | -------------------------------------------------------------------------------- /devices/ads1261/hal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ADS1261 Example Code 3 | * 4 | * Header and source file example for ADS1261 function calls and MCU interfacing 5 | * 6 | * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/ 7 | * 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * Neither the name of Texas Instruments Incorporated nor the names of 22 | * its contributors may be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | */ 38 | 39 | #ifndef HAL_H_ 40 | #define HAL_H_ 41 | 42 | #include 43 | 44 | /* Insert your own processor specific header file(s) here */ 45 | #include "" 46 | 47 | /* Function prototypes */ 48 | void delay_ms(uint32_t time_ms); 49 | bool pollForDRDY(uint32_t timeout); 50 | void setCS(bool state); 51 | void setPWDN(bool state); 52 | void setRESET(void); 53 | void setSTART(bool state); 54 | void enableExternalClock(bool state); 55 | void toggleRESET(void); 56 | void toggleSTART(void); 57 | void setFault(bool state); 58 | void SPI_SendReceive(uint8_t *ulDataTx, uint8_t *ulDataRx, uint8_t byteLength); 59 | void handleSPIerror(uint8_t *DataTx, uint8_t *DataRx, uint8_t byteLength, char *command); 60 | 61 | #endif /* HAL_H_ */ 62 | -------------------------------------------------------------------------------- /devices/ads1235/hal.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file hal.h 3 | * 4 | * @brief Example of a hardware abstraction layer 5 | * @warning This software utilizes TI Drivers 6 | * 7 | * @copyright Copyright (C) 2021 Texas Instruments Incorporated - http://www.ti.com/ 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * Neither the name of Texas Instruments Incorporated nor the names of 22 | * its contributors may be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | */ 38 | 39 | #ifndef HAL_H_ 40 | #define HAL_H_ 41 | 42 | #include 43 | 44 | /* Insert your own processor specific header file(s) here */ 45 | #include "" 46 | 47 | /* Function prototypes */ 48 | void delay_ms(uint32_t time_ms); 49 | bool pollForDRDY(uint32_t timeout); 50 | void setCS(bool state); 51 | void setPWDN(bool state); 52 | void setRESET(void); 53 | void setSTART(bool state); 54 | void enableExternalClock(bool state); 55 | void toggleRESET(void); 56 | void toggleSTART(void); 57 | void setFault(bool state); 58 | void SPI_SendReceive(uint8_t *ulDataTx, uint8_t *ulDataRx, uint8_t byteLength); 59 | void handleSPIerror(uint8_t *DataTx, uint8_t *DataRx, uint8_t byteLength, char *command); 60 | 61 | #endif /* HAL_H_ */ 62 | -------------------------------------------------------------------------------- /devices/ads131a04/ccs/MSP432E LaunchPad/ADS131A04EVM_MSP432E_SYSCONFIG/README.md: -------------------------------------------------------------------------------- 1 | ### SysConfig Notice 2 | 3 | All examples will soon be supported by SysConfig, a tool that will help you graphically configure your software components. A preview is available today in the examples/syscfg_preview directory. Starting in 3Q 2019, with SDK version 3.30, only SysConfig-enabled versions of examples will be provided. For more information, click [here](http://www.ti.com/sysconfignotice). 4 | 5 | --- 6 | # gpiointerrupt 7 | 8 | --- 9 | 10 | ## Example Summary 11 | 12 | Application that toggles an LED(s) using a GPIO pin interrupt. 13 | 14 | ## Peripherals Exercised 15 | 16 | * `Board_GPIO_LED0` - Indicates that the board was initialized within 17 | `mainThread()` also toggled by `Board_GPIO_BUTTON0` 18 | * `Board_GPIO_LED1` - Toggled by `Board_GPIO_BUTTON1` 19 | * `Board_GPIO_BUTTON0` - Toggles `Board_GPIO_LED0` 20 | * `Board_GPIO_BUTTON1` - Toggles `Board_GPIO_LED1` 21 | 22 | ## Resources & Jumper Settings 23 | 24 | > If you're using an IDE (such as CCS or IAR), please refer to Board.html in 25 | your project directory for resources used and board-specific jumper settings. 26 | Otherwise, you can find Board.html in the directory 27 | <SDK_INSTALL_DIR>/source/ti/boards/<BOARD>. 28 | 29 | 30 | ## Example Usage 31 | 32 | * Run the example. `Board_GPIO_LED0` turns ON to indicate driver 33 | initialization is complete. 34 | 35 | * `Board_GPIO_LED0` is toggled by pushing `Board_GPIO_BUTTON0`. 36 | * `Board_GPIO_LED1` is toggled by pushing `Board_GPIO_BUTTON1`. 37 | 38 | ## Application Design Details 39 | 40 | * The `gpioButtonFxn0/1` functions are configured in the *Board.c* file. These 41 | functions are called in the context of the GPIO interrupt. 42 | 43 | * Not all boards have more than one button, so `Board_GPIO_LED1` may not be 44 | toggled. 45 | 46 | * There is no button de-bounce logic in the example. 47 | 48 | TI-RTOS: 49 | 50 | * When building in Code Composer Studio, the configuration project will be 51 | imported along with the example. These projects can be found under 52 | \\/kernel/tirtos/builds/\/(release|debug)/(ccs|gcc). 53 | The configuration project is referenced by the example, so it 54 | will be built first. The "release" configuration has many debug features 55 | disabled. These features include assert checking, logging and runtime stack 56 | checks. For a detailed difference between the "release" and "debug" 57 | configurations, please refer to the TI-RTOS Kernel User's Guide. 58 | 59 | FreeRTOS: 60 | 61 | * Please view the `FreeRTOSConfig.h` header file for example configuration 62 | information. 63 | -------------------------------------------------------------------------------- /devices/ads127l21/iir_coeff.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \copyright Copyright (C) 2021 Texas Instruments Incorporated - http://www.ti.com/ 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Texas Instruments Incorporated nor the names of 17 | * its contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | * 32 | */ 33 | 34 | #ifndef IIR_COEFF_H_ 35 | #define IIR_COEFF_H_ 36 | 37 | #define IIR_COEFF_LENGTH (25) 38 | #define IIR_COEFF_CRC (0xA4) 39 | 40 | int32_t default_IIR[IIR_COEFF_LENGTH] = { 41 | 0x40000000, // g5 42 | 0x00000000, // a42 43 | 0x00000000, // a41 44 | 0x00000000, // b42 45 | 0x00000000, // b41 46 | 0x40000000, // b40 47 | 0x40000000, // g4 48 | 0x00000000, // a32 49 | 0x00000000, // a31 50 | 0x00000000, // b32 51 | 0x00000000, // b31 52 | 0x40000000, // b30 53 | 0x40000000, // g3 54 | 0x00000000, // a22 55 | 0x00000000, // a21 56 | 0x00000000, // b22 57 | 0x00000000, // b21 58 | 0x40000000, // b20 59 | 0x40000000, // g2 60 | 0x00000000, // a12 61 | 0x00000000, // a11 62 | 0x00000000, // b12 63 | 0x00000000, // b11 64 | 0x40000000, // b10 65 | 0x40000000 // g1 66 | }; 67 | 68 | #endif /* IIR_COEFF_H_ */ 69 | -------------------------------------------------------------------------------- /devices/ads9327/system_verilog/ads9327_clock_divider.sv: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024-2025 Texas Instruments Incorporated - http://www.ti.com/ 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Texas Instruments Incorporated nor the names of 17 | * its contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | module ads9327_clock_divider ( 34 | input logic clk, // Input clock 35 | output logic [6:0] Q 36 | ); 37 | 38 | // Counter register - 7 bits to count up to 128 39 | logic [6:0] counter; 40 | 41 | // Counter logic 42 | always_ff @(posedge clk or negedge rst_n) begin 43 | counter <= counter + 1'b1; 44 | end 45 | 46 | // Generate divided clocks using counter bits 47 | // Each bit of the counter represents a clock division 48 | assign Q[0] = counter[0]; // Toggles every 1 clock cycle (div by 2) 49 | assign Q[1] = counter[1]; // Toggles every 2 clock cycles (div by 4) 50 | assign Q[2] = counter[2]; // Toggles every 4 clock cycles (div by 8) 51 | assign Q[3] = counter[3]; // Toggles every 8 clock cycles (div by 16) 52 | assign Q[4] = counter[4]; // Toggles every 16 clock cycles (div by 32) 53 | assign Q[5] = counter[5]; // Toggles every 32 clock cycles (div by 64) 54 | assign Q[6] = counter[6]; // Toggles every 64 clock cycles (div by 128) 55 | 56 | endmodule -------------------------------------------------------------------------------- /devices/ads131a04/ccs/MSP432E LaunchPad/ADS131A04EVM_MSP432E_SYSCONFIG/MSP_EXP432E401Y_NoRTOS.cmd: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Texas Instruments Incorporated 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * * Neither the name of Texas Instruments Incorporated nor the names of 17 | * its contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 29 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 30 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | /* 33 | * ======== MSP_EXP432E401Y_NoRTOS.cmd ======== 34 | * Define the memory block start/length for the MSP_EXP432E401Y M4 35 | */ 36 | 37 | /* The starting address of the application. Normally the interrupt vectors */ 38 | /* must be located at the beginning of the application. */ 39 | #define RAM_BASE 0x20000000 40 | 41 | --stack_size=0x1000 42 | --heap_size=0x8000 43 | --entry_point=resetISR 44 | 45 | MEMORY 46 | { 47 | FLASH (RX) : origin = 0x00000000, length = 0x00100000 48 | SRAM (RWX) : origin = 0x20000000, length = 0x00040000 49 | } 50 | 51 | /* Section allocation in memory */ 52 | 53 | SECTIONS 54 | { 55 | .text : > FLASH 56 | .const : > FLASH 57 | .cinit : > FLASH 58 | .pinit : > FLASH 59 | .init_array : > FLASH 60 | 61 | .vtable : > RAM_BASE 62 | .TI.ramfunc : {} load=FLASH, run=SRAM, table(BINIT) 63 | .data : > SRAM 64 | .bss : > SRAM 65 | .sysmem : > SRAM 66 | .stack : > SRAM (HIGH) 67 | 68 | .intvecs : > 0x00000000 69 | } 70 | -------------------------------------------------------------------------------- /devices/ads7953/ads7953_mspm0g3507.syscfg: -------------------------------------------------------------------------------- 1 | /** 2 | * These arguments were used when this file was generated. They will be automatically applied on subsequent loads 3 | * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments. 4 | * @cliArgs --device "MSPM0G350X" --part "Default" --package "LQFP-64(PM)" --product "mspm0_sdk@2.02.00.05" 5 | * @v2CliArgs --device "MSPM0G3507" --package "LQFP-64(PM)" --product "mspm0_sdk@2.02.00.05" 6 | * @versions {"tool":"1.21.0+3721"} 7 | */ 8 | 9 | /** 10 | * Import the modules used in this configuration. 11 | */ 12 | const SPI = scripting.addModule("/ti/driverlib/SPI", {}, false); 13 | const SPI1 = SPI.addInstance(); 14 | const SYSCTL = scripting.addModule("/ti/driverlib/SYSCTL"); 15 | const ProjectConfig = scripting.addModule("/ti/project_config/ProjectConfig"); 16 | 17 | /** 18 | * Write custom configuration values to the imported modules. 19 | */ 20 | SPI1.$name = "SPI_1"; 21 | SPI1.peripheral.$assign = "SPI1"; 22 | SPI1.peripheral.sclkPin.$assign = "PA17"; 23 | SPI1.peripheral.mosiPin.$assign = "PA18"; 24 | SPI1.peripheral.misoPin.$assign = "PB7"; 25 | SPI1.peripheral.cs0Pin.$assign = "PA26"; 26 | SPI1.sclkPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric0"; 27 | SPI1.sclkPinConfig.direction = scripting.forceWrite("OUTPUT"); 28 | SPI1.sclkPinConfig.onlyInternalResistor = scripting.forceWrite(false); 29 | SPI1.sclkPinConfig.passedPeripheralType = scripting.forceWrite("Digital"); 30 | SPI1.mosiPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric1"; 31 | SPI1.mosiPinConfig.direction = scripting.forceWrite("OUTPUT"); 32 | SPI1.mosiPinConfig.hideOutputInversion = scripting.forceWrite(false); 33 | SPI1.mosiPinConfig.onlyInternalResistor = scripting.forceWrite(false); 34 | SPI1.mosiPinConfig.passedPeripheralType = scripting.forceWrite("Digital"); 35 | SPI1.misoPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric2"; 36 | SPI1.misoPinConfig.onlyInternalResistor = scripting.forceWrite(false); 37 | SPI1.misoPinConfig.passedPeripheralType = scripting.forceWrite("Digital"); 38 | SPI1.cs0PinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric3"; 39 | SPI1.cs0PinConfig.direction = scripting.forceWrite("OUTPUT"); 40 | SPI1.cs0PinConfig.hideOutputInversion = scripting.forceWrite(false); 41 | SPI1.cs0PinConfig.onlyInternalResistor = scripting.forceWrite(false); 42 | SPI1.cs0PinConfig.passedPeripheralType = scripting.forceWrite("Digital"); 43 | 44 | const Board = scripting.addModule("/ti/driverlib/Board", {}, false); 45 | Board.peripheral.$assign = "DEBUGSS"; 46 | Board.peripheral.swclkPin.$assign = "PA20"; 47 | Board.peripheral.swdioPin.$assign = "PA19"; 48 | 49 | SYSCTL.peripheral.$assign = "SYSCTL"; 50 | 51 | ProjectConfig.migrationCondition = true; 52 | -------------------------------------------------------------------------------- /devices/ads125h02/hal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ADS125H02 Example Code 3 | * 4 | * Header and source file example for common ADS125H02 function calls 5 | * 6 | * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com/ 7 | * 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * Neither the name of Texas Instruments Incorporated nor the names of 22 | * its contributors may be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | */ 38 | 39 | #ifndef HAL_H_ 40 | #define HAL_H_ 41 | 42 | #include 43 | 44 | /* Processor specific header file(s) */ 45 | #include "driverlib/sysctl.h" 46 | #include "driverlib/gpio.h" 47 | #include "driverlib/interrupt.h" 48 | #include "driverlib/pin_map.h" 49 | #include "driverlib/ssi.h" 50 | #include "driverlib/timer.h" 51 | #include "inc/hw_ints.h" 52 | #include "inc/hw_memmap.h" 53 | #include "inc/hw_ssi.h" 54 | #include "inc/hw_types.h" 55 | #error TODO: Insert your own processor specific header file(s) here... 56 | 57 | 58 | /* Function prototypes */ 59 | void delay_ms(uint32_t time_ms); 60 | bool pollForDRDY(uint32_t timeout); 61 | void setCS(bool cs1, bool cs2); 62 | void setRESET(void); 63 | void setSTART(bool state); 64 | void enableExternalClock(bool state); 65 | void toggleRESET(void); 66 | void toggleSTART(void); 67 | void setFault(bool state); 68 | void SPI_SendReceive(uint8_t *ulDataTx, uint8_t *ulDataRx, uint8_t byteLength); 69 | void handleSPIerror(uint8_t *DataTx, uint8_t *DataRx, uint8_t byteLength, char *command); 70 | 71 | #endif /* HAL_H_ */ 72 | -------------------------------------------------------------------------------- /devices/ads9327/c2000/f28p65x/drivers/driverlib.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \brief Device setup for examples. 3 | * 4 | * \copyright Copyright (C) 2025 Texas Instruments Incorporated - http://www.ti.com/ 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 13 | * Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the 16 | * distribution. 17 | * 18 | * Neither the name of Texas Instruments Incorporated nor the names of 19 | * its contributors may be used to endorse or promote products derived 20 | * from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 23 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 24 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 25 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 26 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 27 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 28 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 29 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 32 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | * 34 | */ 35 | 36 | #ifndef DRIVERLIB_H 37 | #define DRIVERLIB_H 38 | 39 | #include "inc/hw_memmap.h" 40 | 41 | #include "adc.h" 42 | #include "aes.h" 43 | #include "asysctl.h" 44 | #include "bgcrc.h" 45 | #include "can.h" 46 | #include "cla.h" 47 | #include "clb.h" 48 | #include "cmpss.h" 49 | #include "cpu.h" 50 | #include "cputimer.h" 51 | #include "dac.h" 52 | #include "dcc.h" 53 | #include "dcsm.h" 54 | #include "debug.h" 55 | #include "dma.h" 56 | #include "ecap.h" 57 | #include "emif.h" 58 | #include "epg.h" 59 | #include "epwm.h" 60 | #include "eqep.h" 61 | #include "erad.h" 62 | #include "escss.h" 63 | #include "flash.h" 64 | #include "fsi.h" 65 | #include "gpio.h" 66 | #include "hrcap.h" 67 | #include "hrpwm.h" 68 | #include "i2c.h" 69 | #include "interrupt.h" 70 | #include "ipc.h" 71 | #include "lin.h" 72 | #include "lcm.h" 73 | #include "mcan.h" 74 | #include "memcfg.h" 75 | #include "pin_map.h" 76 | #include "pmbus.h" 77 | #include "sci.h" 78 | #include "sdfm.h" 79 | #include "spi.h" 80 | #include "sysctl.h" 81 | #include "uart.h" 82 | #include "usb.h" 83 | #include "version.h" 84 | #include "xbar.h" 85 | 86 | #endif // end of DRIVERLIB_H definition 87 | -------------------------------------------------------------------------------- /devices/ads1282/README.md: -------------------------------------------------------------------------------- 1 | ADS1282 Example C Code 2 | ====================== 3 | 4 | Table of Contents 5 | ----------------- 6 | This file contains the following sections: 7 | * Hardware used 8 | * Software used 9 | * Links to Additional Information 10 | 11 | -------------------------------------------- 12 | **Hardware used:** 13 | -------------------------------------------- 14 | 15 | 1. [PAMB Controller](https://confluence.itg.ti.com/display/ASCSYSAPP/PAMB+Controller) 16 | 17 | 2. [EVM2LP](https://confluence.itg.ti.com/pages/viewpage.action?pageId=271629380) 18 | - JP1/JP2: "External" 19 | - JP3: "Internal" 20 | - JP4: If "External", then connect power supply to J6 21 | - JP5: Don't care

22 | 23 | 3. [ADS1282EVM](https://www.ti.com/tool/ADS1282EVM-PDK) 24 | - J1: (1-2, default) "REF" - REF5050 connected to U3 buffer 25 | - S1: "ON BRD" - U3/AVSS selected as referece source 26 | - J2: (1-2, default) "OBCLK" - Selects on board clock source 27 | - J3: (1-2) "DVDD" - Enables on board oscillator 28 | - J4/J9: (default) Not populated 29 | - J10: (1-2, default) "DIN" - SPI mode

30 | 31 | 4. XDS110 Debugger ([TMDSEMU110-U](https://www.ti.com/tool/TMDSEMU110-U) or [MSP432E LaunchPad](https://www.ti.com/tool/MSP-EXP432E401Y)) 32 | 33 | 5. JTAG Cable (See "[Mini JTAG Connector Info...](https://confluence.itg.ti.com/display/ASCSYSAPP/PAMB+Controller)") 34 | 35 | 6. External +/-10V power supply 36 | 37 | -------------------------------------------- 38 | **Software used:** 39 | -------------------------------------------- 40 | 41 | 1. [CCSTUDIO](https://www.ti.com/tool/CCSTUDIO) - Code Composer Studio™ integrated development environment (IDE) 42 | - CCS v11.0.0.00012 43 | - MSP432 tool-chain v8.2.4 44 | - Compiler version: TI v20.2.5.LTS

45 | 46 | 2. [SIMPLELINK-MSP432-SDK](https://www.ti.com/tool/SIMPLELINK-MSP432-SDK) - SimpleLink MSP432 Software Development Kit (SDK) - v4.20.00.12 47 | 48 | -------------------------------------------- 49 | Digital header (J5A) pin mapping: 50 | -------------------------------------------- 51 | 52 | /--------\ 53 | -|PQ1 PN2|- M0 54 | SCLK -|PQ0 GND|- GND 55 | -|PM2 PM6|- M1 56 | -|PM0 PD4|- MCLK 57 | nDRDY -|PM1 GND|- GND 58 | DIN -|PQ2 PH3|- AVDD polarity select 59 | DOUT -|PQ3 PH1|- nPWDN 60 | nDRDY -|PN3 PN5|- SCLK 61 | SYNC -|PM7 GND|- GND 62 | CLKSEL -|PK6 PN4|- SDA 63 | \--------/ 64 | 65 | ------------------------------- 66 | Links to Additional Information 67 | ------------------------------- 68 | 69 | - [ADS1282 Apps Knowledge Base](https://confluence.itg.ti.com/display/ASCSYSAPP/ADS128x+Family) 70 | - [PAMB Pin Mapping tool](https://sps16.itg.ti.com/sites/DataConverters/PADC/SysApps/Team%20Documents/EVMs/PAMB%20Pinmap%20Tool.xlsx?web=1) 71 | - [Other Example Code Projects](https://confluence.itg.ti.com/display/ASCSYSAPP/Device+Example+C+Code) 72 | -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/hal.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \copyright Copyright (C) 2021 Texas Instruments Incorporated - http://www.ti.com/ 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Texas Instruments Incorporated nor the names of 17 | * its contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | * 32 | */ 33 | 34 | #include "hal.h" 35 | #include "ti/driverlib/m0p/dl_core.h" 36 | #include "ads127l18.h" 37 | 38 | void BB_SPI_transmitData8(uint8_t value); 39 | 40 | volatile bool gDMARXDataTransferred1, gDMARXDataTransferred2; 41 | 42 | //***************************************************************************** 43 | // 44 | //! Sends SPI byte array on MOSI pin. 45 | //! 46 | //! \fn void spiSendReceiveArrays(const uint8_t dataTx[], uint8_t dataRx[], const uint8_t byteLength) 47 | //! 48 | //! \param uint8_t dataTx[] byte array of SPI data to send on MOSI. 49 | //! 50 | //! \param uint8_t dataRx[] byte array of SPI data captured on MISO. 51 | //! 52 | //! \param uint8_t byteLength number of bytes to send. 53 | //! 54 | //! NOTE: Make sure 'dataTx[]' and 'dataRx[]' contain at least as many bytes of data, 55 | //! as indicated by 'byteLength'. 56 | //! 57 | //! \return None. 58 | // 59 | //***************************************************************************** 60 | void spiSendReceiveArrays(uint8_t dataTx[], uint8_t dataRx[], const uint8_t byteLength) 61 | { 62 | // Require that dataTx and dataRx are not NULL pointers 63 | assert(dataTx && dataRx); 64 | 65 | // set CS low 66 | DL_GPIO_clearPins(GPIO_SPI_PORT, GPIO_SPI_CS_PIN); 67 | 68 | // Transmitting two bytes of data for the read/write command 69 | BB_SPI_transmitData8(dataTx[0]); 70 | BB_SPI_transmitData8(dataTx[1]); 71 | 72 | // set CS high 73 | DL_GPIO_setPins(GPIO_SPI_PORT, GPIO_SPI_CS_PIN); 74 | } 75 | 76 | -------------------------------------------------------------------------------- /devices/ads124s08/crc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file crc.h 3 | * 4 | * @brief Header definition for CRC implementations 5 | * 6 | * \copyright Copyright (C) 2022 Texas Instruments Incorporated - http://www.ti.com/ 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * Neither the name of Texas Instruments Incorporated nor the names of 21 | * its contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | */ 37 | 38 | // APP NOTE: Communication Methods for Data Integrity Using Delta-Sigma Data Converters 39 | // URL: https://www.ti.com/lit/an/sbaa106/sbaa106.pdf 40 | 41 | #ifndef CRC_H_ 42 | #define CRC_H_ 43 | 44 | // Standard libraries 45 | #include 46 | #include 47 | 48 | 49 | //**************************************************************************** 50 | // 51 | // Constants 52 | // 53 | //**************************************************************************** 54 | 55 | // 56 | // Select CRC calculation mode...either lookup or calculation 57 | // 58 | #define CRC_LOOKUP 59 | //#define CRC_CALCULATION 60 | 61 | // 62 | // Select CRC word length... 63 | // 64 | #define CRC8 // CRC word is 8-bits wide 65 | 66 | #define CRCWORD uint8_t 67 | 68 | // Initial seed value for CRC calculation 69 | #define CRC_INITIAL_SEED ((CRCWORD) 0x00) 70 | 71 | // Initial seed value for CRC calculation 72 | // ADS1x4S0x device family is based on the CRC-8-ATM (HEC) polynomial: X^8 + X^2 + X + 1 73 | #define CRC_POLYNOMIAL ((CRCWORD) 0x07) 74 | 75 | 76 | //***************************************************************************** 77 | // 78 | // Function Prototypes 79 | // 80 | //***************************************************************************** 81 | void initCRC(void); 82 | CRCWORD getCRC(const uint8_t dataBytes[], uint8_t numberBytes, CRCWORD initialValue); 83 | 84 | #endif /* CRC_H_ */ 85 | -------------------------------------------------------------------------------- /devices/ads9327/c2000/README.md: -------------------------------------------------------------------------------- 1 | ADS9327-C2000-EXAMPLE-CODE 2 | ============================ 3 | 4 | This is an SPI communication example for the [ADS9327](https://www.ti.com/product/ADS9327) and [C2000™ MCU (F28P65x)](https://www.ti.com/product/TMS320F28P650DK). The code loads the test pattern register for ADC-A with 0xABCD and the test pattern register for ADC-B with 0xEF12. The test pattern data is then output by the ADC in either 1-lane mode or 4-lane mode, depending on user configured macro. 5 | 6 | ## Setup Instructions 7 | - To use this code, make sure you have installed [Code Composer Studio™ (CCS)](https://www.ti.com/tool/CCSTUDIO) v20.0.0 or later and [C2000Ware](https://www.ti.com/tool/C2000WARE) (5.04) 8 | - Create a new directory in `C2000Ware_5_04_00_00\examples\demos\`, we'll name it `ADS9327_F28P65X` for referene. 9 | - Copy the `f28p65x` and `source` folders to the new directory. e.g. 10 | - `C2000Ware_5_04_00_00\examples\demos\ADS9327_F28P65X\f28p65x` 11 | - `C2000Ware_5_04_00_00\examples\demos\ADS9327_F28P65X\source` 12 | - Open CCS and click on Projects -> Import CCS Projects 13 | - Navigate to ADS9327 example 14 | 15 | ## C2000 Pins Used 16 | Pin numbers are for TMDSHSEDOCK board when used with [TMDSCNCD28P65X](https://www.ti.com/tool/TMDSCNCD28P65X). 17 | 18 | - SPID_CLK = GPIO93 = Pin 162 19 | - SPID_PTE = GPIO94 = Pin 163 20 | - SPID_PICO = GPIO91 = Pin 160 21 | - SPID_POCI = GPIO92 = Pin 161 22 | - CONVST = GPIO0 (EPWM1_A) = Pin 49 23 | - CLB_Input1 = GPIO10 = Pin 61 24 | - CLB_Input2 = GPIO11 = Pin 63 25 | - CLB_Input3 = GPIO8 = Pin 57 26 | - CLB_Input4 = GPIO9 = Pin 59 27 | 28 | ## Signal Connections 29 | Connections between ADS9327 ADC and C2000 30 | 31 | ### 1-Lane Mode Connections: 32 | - ADC SCLK connected to C2000 SPID_CLK 33 | - ADC /CS connected to C2000 SPID_PTE 34 | - ADC SDI connected to C2000 SPID_PICO 35 | - ADC D3 connected to C2000 SPID_POCI 36 | - ADC CONVST connected to C2000 CONVST 37 | 38 | ### 4-Lane Mode Connections: 39 | - ADC SCLK connected to C2000 SPID_CLK 40 | - ADC /CS connected to C2000 SPID_PTE 41 | - ADC SDI connected to C2000 SPID_PICO 42 | - ADC D3 connected to C2000 CLB_Input1 43 | - ADC D2 connected to C2000 CLB_Input2 44 | - ADC D1 connected to C2000 CLB_Input3 45 | - ADC D0 connected to C2000 CLB_Input4 46 | - ADC CONVST connected to C2000 CONVST 47 | 48 | ## Variables to Control 49 | Variables can be found in ADS9327_settings.h file 50 | - DATA_LANE_SELECT MACRO controls the output data lanes. It can be set to 1 or 4. 51 | - mySPI0_BITRATE controls the SPI interface speed. In Hz units. Can be set to max 50MHz. 52 | - ADS9327_EXT_ADC1_SAMPLING_FREQUENCY_KHZ controls CONVST frequency. In kHz units. 53 | - MAX_ENTRIES controls ADC output data array length. 54 | 55 | ## Code Testing 56 | - 1-lane mode has been tested upto mySPI0_BITRATE = 50MSPS and CONVST = 900KHz 57 | - 4-lane mode has been tested upto mySPI0_BITRATE = 33MSPS and CONVST = 2MHz 58 | - This code was tested using CCS Theia Version: 1.4.1.1 and C2000Ware Version 5.04 59 | 60 | ## License 61 | This project is licensed under the BSD-3-Clause License. 62 | 63 | ## Support 64 | - [Data converters forum](https://e2e.ti.com/support/data-converters-group/data-converters/f/data-converters-forum) 65 | - [C2000 microcontrollers forum](https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum) -------------------------------------------------------------------------------- /devices/ads131a04/ccs/MSP432E LaunchPad/ADS131A04_MSP432E_Driverlib/main.c: -------------------------------------------------------------------------------- 1 | /* --COPYRIGHT--,BSD 2 | * Copyright (c) 2017, Texas Instruments Incorporated 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * * Neither the name of Texas Instruments Incorporated nor the names of 17 | * its contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 29 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 30 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | * --/COPYRIGHT--*/ 32 | 33 | // NOTE: This CCS project was compiled in CCS 9.3.0.00012, 34 | // using the TI v18.12.4.LTS ARM Compiler, 35 | // the SimpleLink MSP432E4 SDK v3.20.0.10 library, 36 | // and targeting the MSP-EXP432E401Y hardware. 37 | 38 | 39 | // Standard Libraries 40 | #include 41 | #include 42 | #include 43 | 44 | // Custom Libraries 45 | #include "hal.h" // For ADC initialization 46 | #include "interrupts.h" // For state machine flags 47 | 48 | 49 | //**************************************************************************** 50 | // 51 | // This is the application entry point. 52 | // 53 | //**************************************************************************** 54 | int main(void) 55 | { 56 | // 57 | // MSP432E LaunchPad initializations 58 | // 59 | INIT_LAUNCHPAD(); 60 | 61 | 62 | // 63 | // Turn on LED1 64 | // 65 | ROM_GPIOPinWrite(LED1_PORT, LED1_PIN, LED1_PIN); 66 | 67 | 68 | // 69 | // Device initializations 70 | // 71 | InitADC(); 72 | 73 | 74 | // 75 | // Read data... Time from /CS low to /CS high is 22.12us -> allows for up to ~32 kSPS 76 | // 77 | adc_data_struct data; 78 | while(1) 79 | { 80 | waitForDRDYinterrupt(1000); 81 | bool crcError = readData(&data); 82 | if (crcError) { ROM_GPIOPinWrite(LED2_PORT, LED2_PIN, LED2_PIN); } 83 | 84 | // For debugging, read the ERROR_CNT register... 85 | //uint8_t val = readSingleRegister(ERROR_CNT_ADDRESS); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /devices/ads127l18/MSPM0_example/hal.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \copyright Copyright (C) 2021 Texas Instruments Incorporated - http://www.ti.com/ 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * Neither the name of Texas Instruments Incorporated nor the names of 17 | * its contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | * 32 | */ 33 | 34 | #ifndef INTERFACE_H_ 35 | #define INTERFACE_H_ 36 | 37 | #include "ads127l18.h" 38 | #include "ti_msp_dl_config.h" 39 | 40 | //**************************************************************************** 41 | // 42 | // Standard libraries 43 | // 44 | //**************************************************************************** 45 | 46 | #include 47 | #include 48 | 49 | //***************************************************************************** 50 | // 51 | // Pin definitions (MSP432E401Y) 52 | // 53 | //***************************************************************************** 54 | 55 | #define nCS_PORT (GPIO_SPI_0_CS0_PORT) 56 | #define nCS_PIN (GPIO_SPI_0_CS0_PIN) 57 | 58 | 59 | 60 | //***************************************************************************** 61 | // 62 | // Function Prototypes 63 | // 64 | //***************************************************************************** 65 | 66 | void setCS(const bool state); 67 | void spiSendReceiveArrays(/* const */ uint8_t DataTx[], uint8_t DataRx[], const uint8_t byteLength); 68 | uint8_t spiSendReceiveByte(const uint8_t dataTx); 69 | void SPI_receive(void); 70 | 71 | 72 | 73 | //***************************************************************************** 74 | // 75 | // Macros 76 | // 77 | //***************************************************************************** 78 | /** Alias used for setting GPIOs pins to the logic "high" state */ 79 | #define HIGH ((bool) true) 80 | 81 | /** Alias used for setting GPIOs pins to the logic "low" state */ 82 | #define LOW ((bool) false) 83 | 84 | 85 | #endif /* INTERFACE_H_ */ -------------------------------------------------------------------------------- /devices/ads122c04/crc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file crc.h 3 | * 4 | * @brief Example of calculating and verifying CRC 5 | * 6 | * @copyright Copyright (C) 2021 Texas Instruments Incorporated - http://www.ti.com/ 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * Neither the name of Texas Instruments Incorporated nor the names of 21 | * its contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | */ 37 | 38 | // APP NOTE: Communication Methods for Data Integrity Using Delta-Sigma Data Converters 39 | // URL: https://www.ti.com/lit/an/sbaa106/sbaa106.pdf 40 | 41 | #ifndef CRC_H_ 42 | #define CRC_H_ 43 | 44 | // Standard libraries 45 | #include 46 | #include 47 | 48 | 49 | /***************************************************************************** 50 | * 51 | * Constants 52 | * 53 | ****************************************************************************/ 54 | 55 | 56 | // 57 | // Select CRC calculation mode... 58 | // 59 | //#define CRC_LOOKUP 60 | #define CRC_CALCULATION 61 | 62 | // 63 | // Select CRC word length... 64 | // 65 | //#define CRC8 // CRC word is 8-bits wide 66 | #define CRC16 // CRC word is 16-bits wide 67 | 68 | // Adjust "CRCWORD" to CRC word length 69 | #ifdef CRC8 70 | #define CRCWORD uint8_t 71 | #endif 72 | #ifdef CRC16 73 | #define CRCWORD uint16_t 74 | #endif 75 | 76 | #define WIDTH (8 * sizeof(CRCWORD)) 77 | 78 | // 79 | // Initial seed value for CRC calculation 80 | // 81 | #define CRC_INITIAL_SEED ((CRCWORD) 0xFFFF) 82 | 83 | // 84 | // Initial seed value for CRC calculation 85 | // 86 | #define CRC_POLYNOMIAL ((CRCWORD) 0x1021) 87 | 88 | 89 | /***************************************************************************** 90 | * 91 | * Function Prototypes 92 | * 93 | ****************************************************************************/ 94 | void initCRC(); 95 | CRCWORD getCRC(const uint8_t dataBytes[], uint8_t numberBytes, CRCWORD initialValue); 96 | 97 | 98 | #endif /* CRC_H_ */ 99 | -------------------------------------------------------------------------------- /devices/ads131a04/ccs/MSP432E LaunchPad/ADS131A04_MSP432E_Driverlib/msp432e401y.cmd: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/ 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the 15 | * distribution. 16 | * 17 | * Neither the name of Texas Instruments Incorporated nor the names of 18 | * its contributors may be used to endorse or promote products derived 19 | * from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | * 33 | *****************************************************************************/ 34 | 35 | // Set appplication base address offset. If not using BSL, set to 0x00000000! 36 | // NOTE: This must match the APP_START_ADDRESS macro, as defined in bl_config.h 37 | #define APP_BASE 0x00000000 38 | #define RAM_BASE 0x20000000 39 | 40 | --retain=interruptVectors 41 | 42 | MEMORY 43 | { 44 | FLASH (RX) : origin = APP_BASE, length = (0x00100000 - APP_BASE)//, fill=0xFFFFFFFF 45 | SRAM (RWX) : origin = RAM_BASE, length = 0x00040000 46 | } 47 | 48 | /* The following command line options are set as part of the CCS project. */ 49 | /* If you are building using the command line, or for some reason want to */ 50 | /* define them here, you can uncomment and modify these lines as needed. */ 51 | /* If you are using CCS for building, it is probably better to make any such */ 52 | /* modifications in your CCS project and leave this file alone. */ 53 | /* */ 54 | /* --heap_size=0 */ 55 | /* --stack_size=256 */ 56 | /* --library=rtsv7M4_T_le_eabi.lib */ 57 | 58 | /* Section allocation in memory */ 59 | 60 | SECTIONS 61 | { 62 | .intvecs: > APP_BASE 63 | .text : > FLASH 64 | .const : > FLASH 65 | .cinit : > FLASH 66 | .pinit : > FLASH 67 | .init_array : > FLASH 68 | 69 | .vtable : > RAM_BASE 70 | .data : > SRAM 71 | .bss : > SRAM 72 | .sysmem : > SRAM 73 | .stack : > SRAM 74 | } 75 | 76 | __STACK_TOP = __stack + 512; 77 | -------------------------------------------------------------------------------- /devices/ads122u04/crc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file crc.h 3 | * 4 | * @brief Example of calculating and verifying CRC 5 | * 6 | * @copyright Copyright (C) 2021 Texas Instruments Incorporated - http://www.ti.com/ 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * Neither the name of Texas Instruments Incorporated nor the names of 21 | * its contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | */ 37 | 38 | // APP NOTE: Communication Methods for Data Integrity Using Delta-Sigma Data Converters 39 | // URL: https://www.ti.com/lit/an/sbaa106/sbaa106.pdf 40 | 41 | #ifndef CRC_H_ 42 | #define CRC_H_ 43 | 44 | // Standard libraries 45 | #include 46 | #include 47 | 48 | 49 | /***************************************************************************** 50 | * 51 | * Constants 52 | * 53 | ****************************************************************************/ 54 | 55 | 56 | // 57 | // Select CRC calculation mode... 58 | // 59 | //#define CRC_LOOKUP 60 | #define CRC_CALCULATION 61 | 62 | // 63 | // Select CRC word length... 64 | // 65 | //#define CRC8 // CRC word is 8-bits wide 66 | #define CRC16 // CRC word is 16-bits wide 67 | 68 | // Adjust "CRCWORD" to CRC word length 69 | #ifdef CRC8 70 | #define CRCWORD uint8_t 71 | #endif 72 | #ifdef CRC16 73 | #define CRCWORD uint16_t 74 | #endif 75 | 76 | #define WIDTH (8 * sizeof(CRCWORD)) 77 | // 78 | // Initial seed value for CRC calculation 79 | // 80 | #define CRC_INITIAL_SEED ((CRCWORD) 0xFFFF) 81 | 82 | // 83 | // Initial seed value for CRC calculation 84 | // 85 | #define CRC_POLYNOMIAL ((CRCWORD) 0x1021) 86 | 87 | 88 | /***************************************************************************** 89 | * 90 | * Function Prototypes 91 | * 92 | ****************************************************************************/ 93 | 94 | void initCRC(); 95 | CRCWORD getCRC(const uint8_t dataBytes[], uint8_t numberBytes, CRCWORD initialValue); 96 | uint8_t revByte(uint8_t u8Byte); 97 | 98 | #endif /* CRC_H_ */ 99 | -------------------------------------------------------------------------------- /devices/ads704x_5x/mspm0g3507.syscfg: -------------------------------------------------------------------------------- 1 | /** 2 | * These arguments were used when this file was generated. They will be automatically applied on subsequent loads 3 | * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments. 4 | */ 5 | //@cliArgs --device "MSPM0G350X" --package "LQFP-64(PM)" --part "Default" 6 | //@v2CliArgs --device "MSPM0G3507" --package "LQFP-64(PM)" 7 | // @cliArgs --board /ti/boards/LP_MSPM0G3507 --rtos nortos 8 | 9 | /** 10 | * Import the modules used in this configuration. 11 | */ 12 | const GPIO = scripting.addModule("/ti/driverlib/GPIO", {}, false); 13 | const GPIO1 = GPIO.addInstance(); 14 | const SPI = scripting.addModule("/ti/driverlib/SPI", {}, false); 15 | const SPI1 = SPI.addInstance(); 16 | const SYSCTL = scripting.addModule("/ti/driverlib/SYSCTL"); 17 | const TIMER = scripting.addModule("/ti/driverlib/TIMER", {}, false); 18 | const TIMER1 = TIMER.addInstance(); 19 | const Board = scripting.addModule("/ti/driverlib/Board", {}, false); 20 | 21 | /** 22 | * Write custom configuration values to the imported modules. 23 | */ 24 | GPIO1.$name = "GPIO_LEDS"; 25 | GPIO1.port = "PORTA"; 26 | GPIO1.associatedPins.create(2); 27 | GPIO1.associatedPins[0].$name = "USER_LED_1"; 28 | GPIO1.associatedPins[0].assignedPortSegment = "Lower"; 29 | GPIO1.associatedPins[0].assignedPin = "0"; 30 | GPIO1.associatedPins[0].initialValue = "SET"; 31 | GPIO1.associatedPins[1].$name = "USER_TEST"; 32 | GPIO1.associatedPins[1].assignedPortSegment = "Lower"; 33 | GPIO1.associatedPins[1].assignedPin = "15"; 34 | GPIO1.associatedPins[1].initialValue = "SET"; 35 | 36 | SPI1.$name = "SPI_0"; 37 | SPI1.targetBitRate = 500000; 38 | SPI1.rxFifoThreshold = "DL_SPI_RX_FIFO_LEVEL_ONE_FRAME"; 39 | SPI1.txFifoThreshold = "DL_SPI_TX_FIFO_LEVEL_ONE_FRAME"; 40 | SPI1.enabledInterrupts = ["DMA_DONE_RX","DMA_DONE_TX","TX_EMPTY"]; 41 | SPI1.enabledDMAEvent1Triggers = "DL_SPI_DMA_INTERRUPT_RX"; 42 | SPI1.enabledDMAEvent2Triggers = "DL_SPI_DMA_INTERRUPT_TX"; 43 | SPI1.peripheral.$assign = "SPI1"; 44 | SPI1.chipSelect = ["1"]; 45 | SPI1.peripheral.sclkPin.$assign = "PB9"; 46 | SPI1.peripheral.mosiPin.$assign = "PB8"; 47 | SPI1.peripheral.misoPin.$assign = "PB7"; 48 | SPI1.peripheral.cs1Pin.$assign = "PB17"; 49 | SPI1.cs1PinConfig.enableConfig = true; 50 | SPI1.cs1PinConfig.internalResistor = "PULL_UP"; 51 | 52 | SPI1.DMA_CHANNEL_EVENT2.$name = "DMA_CH0"; 53 | SPI1.DMA_CHANNEL_EVENT2.addressMode = "b2f"; 54 | SPI1.DMA_CHANNEL_EVENT2.srcLength = "BYTE"; 55 | SPI1.DMA_CHANNEL_EVENT2.dstLength = "BYTE"; 56 | SPI1.DMA_CHANNEL_EVENT2.peripheral.$assign = "DMA_CH0"; 57 | SPI1.DMA_CHANNEL_EVENT1.$name = "DMA_CH1"; 58 | SPI1.DMA_CHANNEL_EVENT1.peripheral.$assign = "DMA_CH1"; 59 | SPI1.DMA_CHANNEL_EVENT1.addressMode = "f2b"; 60 | SPI1.DMA_CHANNEL_EVENT1.srcLength = "BYTE"; 61 | SPI1.DMA_CHANNEL_EVENT1.dstLength = "BYTE"; 62 | SPI1.DMA_CHANNEL_EVENT2.$name = "DMA_CH0"; 63 | 64 | SYSCTL.validateClkStatus = true; 65 | SYSCTL.forceDefaultClkConfig = true; 66 | SYSCTL.clockTreeEn = true; 67 | 68 | TIMER1.$name = "TIMER_0"; 69 | TIMER1.timerClkDiv = 8; 70 | TIMER1.timerClkSrc = "LFCLK"; 71 | TIMER1.timerMode = "PERIODIC"; 72 | TIMER1.interrupts = ["ZERO"]; 73 | TIMER1.timerPeriod = "1000 ms"; 74 | TIMER1.timerStartTimer = true; 75 | TIMER1.peripheral.$assign = "TIMG0"; 76 | -------------------------------------------------------------------------------- /devices/ads124s08/README.md: -------------------------------------------------------------------------------- 1 | # ADS124S08 Example C Code {#mainpage} 2 | 3 | [TOC] 4 | 5 | ![](chip.jpg)
6 | The [ADS124S08](https://www.ti.com/product/ADS124S08) precision delta-sigma (ΔΣ) analog-to-digital converter (ADC) communicates using a serial peripheral interface (SPI) to allow for device configuration, control, and data retrieval. To interface the ADC with a microcontroller (MCU), the firmware or software engineer needs to know how to correctly configure their MCU's serial peripheral, sequence serial commands, and control the SPI timing of command bytes to the ADC. To assist in this process, this example code is intended to show how to initialize communication with the `ADS124S08` at a high-level. 7 | 8 | # Modules {#modules} 9 | 10 | There are three modules included in this example code: 11 | 12 | 1. **ADS124S08** 13 | *Files:* ads124S08.h, ads124S08.c
14 | *Description:* Contains header and source files with register map definitions and high-level functions for interfacing with this ADC. 15 |
16 | 17 | 2. **Hardware Abstraction Layer (HAL)** 18 | *Files:* hal.h, hal.c
19 | *Description:* The HAL provides processor specific functions called by the `ADS124S08` module. 20 | 21 | **IMPORTANT**: The HAL module MUST be modified to work with your hardware! 22 |
23 | 24 | 3. **Data Integrity Functions** 25 | *Files: crc.h, crc.c*
26 | *Description:* The Data Integrity Functions allow calculation and verification of any CRC data integrity modes enabled for register and conversion data reads. This module is only required if the CRC data integrity mode is enabled on the `ADS124S08`. 27 |
28 | 29 | 4. **Unit Test Functions** 30 | *Files: unit_tests.h, unit_tests.c*
31 | *Description:* The Unit Test Functions allow verification of hardware code as it relates to control functions of the ADC. This module is not required but is available to check hardware configuration for the processor being used. 32 |
33 | 34 | ## How to use this code 35 | 36 | Reference the *ads124s08.c* file while writing your own code for examples of how to perform typical ADC operations, such as register read/writes and reading data... 37 | 38 | OR 39 | 40 | Copy and paste the example code into your project, and update the files as needed to get access to the provided APIs... 41 | 42 | 1. Copy the `ADS124S08` and `HAL` module files into your firmware project. 43 | 44 | 2. Add library references in *hal.h* to your processor-specific library file(s). 45 | 46 | 3. Edit *ALL* of the function implementations inside of *hal.c* to provide the specified functionality with your processor and processor-specific library APIs. 47 | 48 | 4. Include a reference to *hal.h* somewhere in your program and call the **initADCperhiperhals()** function to initialize the MCU peripherals connected to the `ADS124S08`. 49 | 50 | 5. Include a reference to *ads124s08.h* in your application (from *main.c* or wherever ADC communication is handled) to call the `ADS124S08` module functions. 51 | 52 |
53 | 54 | > **IMPORTANT**: This code was tested on an MSP432E401Y 32-bit ARM® Cortex®-M4F based MCU using TI Code Composer Studio's 20.2.1.LTS ARM compiler. Example code is provided to aid in the creation of your own software implementation and should not be considered as fully verified and end-equipment ready. Example code is written for readability and therefore is typically not optimized for performance. 55 | 56 |
57 | 58 | # Support {#support} 59 | For questions or issues, visit the [TI E2E Forums](https://e2e.ti.com/). 60 | 61 | ![](e2e.jpg) 62 | 63 |
64 | 65 | # Release History {#history} 66 | `v1.0.0` - Initial release (4-04-2022) 67 | -------------------------------------------------------------------------------- /devices/ads9327/c2000/source/ads9327.c: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * \copyright Copyright (C) 2025 Texas Instruments Incorporated - http://www.ti.com/ 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the 15 | * distribution. 16 | * 17 | * Neither the name of Texas Instruments Incorporated nor the names of 18 | * its contributors may be used to endorse or promote products derived 19 | * from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | * 33 | */ 34 | 35 | #include 36 | 37 | void ADS9327_unlockRegisterMap() 38 | { 39 | // to unlock register map 40 | ADS9327_HAL_writeRegister(REGISTER_FEH_ADDRESS, REGISTER_FEH_REG_LOCK_UNLOCKKEY0); 41 | ADS9327_HAL_writeRegister(REGISTER_FEH_ADDRESS, REGISTER_FEH_REG_LOCK_UNLOCKKEY1); 42 | } 43 | 44 | void ADS9327_lockRegisterMap() 45 | { 46 | // to lock resgiter map, write any value to addr 0xFE that is different than 0xB38F and 0xABCD 47 | ADS9327_HAL_writeRegister(REGISTER_FEH_ADDRESS, REGISTER_FEH_REG_LOCK_LOCKKEY); 48 | } 49 | 50 | void ADS9327_regBankSel(uint8_t bank) 51 | { 52 | // select desired register bank 53 | if (bank == 1) 54 | { 55 | //select bank 1 56 | ADS9327_HAL_writeRegister(REGISTER_02H_ADDRESS, REGISTER_02H_REG_BANK_SEL_REGBANK1); 57 | } 58 | 59 | else if (bank == 0) 60 | { 61 | //select bank 0 62 | ADS9327_HAL_writeRegister(REGISTER_02H_ADDRESS, REGISTER_02H_REG_BANK_SEL_REGBANK0); 63 | } 64 | 65 | } 66 | 67 | void ADS9327_resetAdcAndRegisters() 68 | { 69 | ADS9327_unlockRegisterMap(); 70 | 71 | //reset ADC and all ADC registers 72 | ADS9327_HAL_writeRegister(REGISTER_01H_ADDRESS, REGISTER_01H_RESET_RESET); 73 | 74 | ADS9327_lockRegisterMap(); 75 | } 76 | 77 | 78 | 79 | // ADC initialization (must be done every time at powerup) 80 | void ADS9327_initalization() 81 | { 82 | ADS9327_HAL_writeRegister(REGISTER_FEH_ADDRESS, REGISTER_FEH_REG_LOCK_UNLOCKKEY0); //register map unlock sequence 1 83 | ADS9327_HAL_writeRegister(REGISTER_FEH_ADDRESS, REGISTER_FEH_REG_LOCK_UNLOCKKEY1); //register map unlock sequence 2 84 | ADS9327_HAL_writeRegister(REGISTER_02H_ADDRESS, REGISTER_02H_REG_BANK_SEL_REGBANK1); //select register bank 1 85 | ADS9327_HAL_writeRegister(REGISTER_0CH_ADDRESS,0x1001); 86 | ADS9327_HAL_writeRegister(REGISTER_FEH_ADDRESS, REGISTER_FEH_REG_LOCK_LOCKKEY); //lock register map 87 | } 88 | -------------------------------------------------------------------------------- /devices/ads1118/README.md: -------------------------------------------------------------------------------- 1 | ADS1118 Example C Code 2 | ===================== 3 | 4 | The ADS1118 code can be adapted for use with the ADS1018 (12-bit version). This example code is intended to show how to initialize and communicate with the ADS1118 at a high-level. 5 | 6 | Included modules 7 | ---------------- 8 | 9 | There are two modules included in this example code: 10 | 11 | 1. **`ADS1118`** 12 | 13 | *Description:* High-level functions and register map definitions for communicating with the ADS1118. 14 | 15 | *Files: ads1118.h, ads1118.c* 16 | 17 | 2. **`Hardware Abstraction Layer (HAL)`** 18 | 19 | *Description:* The HAL provides processor specific functions called by the `ADS1118` module. 20 | 21 | *Files: hal.h, hal.c* 22 | 23 | **IMPORTANT**: This module will need to be modified to work with your hardware! 24 | 25 | 26 | How to use this code 27 | -------------------- 28 | 29 | Reference the *ads1118.c* file while writing your own code for examples of how how to perform basic ADC operations, such as register read/writes and reading data... 30 | 31 | OR 32 | 33 | Copy and paste the example code into your project, and update the files as needed to get access to the provided APIs... 34 | 35 | 1. Copy the `ADS1118` and `HAL` module files into your firmware project. 36 | 37 | 2. Add library references in *hal.h* to your processor-specific library file(s). 38 | ```c 39 | //**************************************************************************** 40 | // 41 | // Insert processor specific header file(s) here 42 | // 43 | //****************************************************************************" 44 | 45 | /* --- TODO: INSERT YOUR CODE HERE --- */ 46 | #include "ti/devices/msp432e4/driverlib/driverlib.h" 47 | 48 | ``` 49 | 50 | 3. Edit all of the function implementations inside of *hal.c* to provide the specified functionality with your processor and processor-specific library APIs. 51 | ```c 52 | //***************************************************************************** 53 | // 54 | //! Configures the MCU's SPI peripheral, for interfacing with the ADC. 55 | //! 56 | //! \fn void InitSPI(void) 57 | //! 58 | //! \return None. 59 | // 60 | //***************************************************************************** 61 | void InitSPI(void) 62 | { 63 | /* --- INSERT YOUR CODE HERE --- 64 | * NOTE: The ADSxxxx operates in SPI mode 1 (CPOL = 0, CPHA = 1). 65 | */ 66 | ``` 67 | NOTE 1: The *hal.c* functions are called from within *ads1118.c* to interface with the hardware. The hardware functionality is kept in a separate module to allow the `ADS1118` module to remain portable. 68 | 69 | NOTE 2: Provided code examples in *hal.c* functions utilize the [TI SimpleLink SDK](http://www.ti.com/wireless-connectivity/simplelink-solutions/overview/software.html) and allow for quick integration with TI SimpleLink MCUs. 70 | 71 | 4. Include a reference to *hal.h* somewhere in your program and call the **InitADC()** function to initialize the MCU peripherals connected to the ADC. 72 | 73 | 5. Include a reference to *ads1118.h* in your application (from *main.c* or wherever ADC communication is handled). You should now be able to begin calling the `ADS1118` module functions in your code. 74 | 75 | > **DISCLAIMER**: This code was tested on an MSP432E401Y 32-bit ARM® Cortex®-M4F based MCU using TI Code Composer Studio's ARM compiler. This code is provided as example to aid in the creation of your own software implementation and should not be considered to be fully verified and production ready. This example code was written for readability and has not been optimized for performance. 76 | 77 | Support 78 | ------- 79 | 80 | For questions or issues, visit the [TI E2E Forums](https://e2e.ti.com/). 81 | 82 | 83 | Release History 84 | --------------- 85 | | Version | Date | Description | 86 | |:-----------:| ----------- | ---------------------- | 87 | | 1.0.0 | 04/28/2021 | Initial release | 88 | -------------------------------------------------------------------------------- /devices/ads1115/README.md: -------------------------------------------------------------------------------- 1 | ADS1115 Example C Code 2 | ===================== 3 | 4 | The ADS1115 example code can be used for all devices in the family including ADS1114, ADS1113, ADS1015, ADS1014, ADS1013, and TLA2024 variants. To assist in expediting the code development process, this example code is intended to show how to initialize and communicate with the ADS1115 at a high-level. 5 | 6 | Included modules 7 | ---------------- 8 | 9 | There are two modules included in this example code: 10 | 11 | 1. **`ADS1115`** 12 | 13 | *Description:* High-level functions and register map definitions for communicating with the ADS1115. 14 | 15 | *Files: ads1115.h, ads1115.c* 16 | 17 | 2. **`Hardware Abstraction Layer (HAL)`** 18 | 19 | *Description:* The HAL provides processor specific functions called by the `ADS1115` module. 20 | 21 | *Files: hal.h, hal.c* 22 | 23 | **IMPORTANT**: This module will need to be modified to work with your hardware! 24 | 25 | 26 | How to use this code 27 | -------------------- 28 | 29 | Reference the *ads1115.c* file while writing your own code for examples of how how to perform basic ADC operations, such as register read/writes and reading data... 30 | 31 | OR 32 | 33 | Copy and paste the example code into your project, and update the files as needed to get access to the provided APIs... 34 | 35 | 1. Copy the `ADS1115` and `HAL` module files into your firmware project. 36 | 2. Add library references in *hal.h* to your processor-specific library file(s). 37 | ```c 38 | //**************************************************************************** 39 | // 40 | // Insert processor specific header file(s) here 41 | // 42 | //****************************************************************************" 43 | 44 | /* --- TODO: INSERT YOUR CODE HERE --- */ 45 | #include "ti/devices/msp432e4/driverlib/driverlib.h" 46 | 47 | ``` 48 | 49 | 3. Edit all of the function implementations inside of *hal.c* to provide the specified functionality with your processor and processor-specific library APIs. 50 | ```c 51 | /** 52 | * 53 | * @brief InitI2C() 54 | * Configures the MCU's I2C peripheral, for interfacing with target devices. 55 | * 56 | * @return none 57 | */ 58 | void InitI2C(void) 59 | { 60 | /* --- INSERT YOUR CODE HERE --- */ 61 | 62 | // 63 | // Enabling I2C2 peripheral. 64 | // 65 | 66 | // 67 | // Configuring the pin muxing for I2C2 functions. 68 | // 69 | 70 | // 71 | // Enabling and initializing the I2C2 master module. 72 | // 73 | 74 | ``` 75 | NOTE 1: The *hal.c* functions are called from within *ads1115.c* to interface with the hardware. The hardware functionality is kept in a separate module to allow the `ADS1115` module to remain portable. 76 | 77 | NOTE 2: Provided code examples in *hal.c* functions utilize the [TI SimpleLink SDK](http://www.ti.com/wireless-connectivity/simplelink-solutions/overview/software.html) and allow for quick integration with TI SimpleLink MCUs. 78 | 79 | 4. Include a reference to *hal.h* somewhere in your program and call the **InitADC()** function to initialize the MCU peripherals connected to the ADC. 80 | 81 | 5. Include a reference to *ads1115.h* in your application (from *main.c* or wherever ADC communication is handled). You should now be able to begin calling the `ADS1115` module functions in your code. 82 | 83 | > **DISCLAIMER**: This code was tested on an MSP432E401Y 32-bit ARM® Cortex®-M4F based MCU using TI Code Composer Studio's ARM compiler. This code is provided as example to aid in the creation of your own software implementation and should not be considered to be fully verified and production ready. This example code was written for readability and has not been optimized for performance. 84 | 85 | Support 86 | ------- 87 | 88 | For questions or issues, visit the [TI E2E Forums](https://e2e.ti.com/). 89 | 90 | 91 | 92 | Release History 93 | --------------- 94 | | Version | Date | Description | 95 | |:-----------:| ----------- | ---------------------- | 96 | | 1.0.0 | 04/26/2021 | Initial release | 97 | -------------------------------------------------------------------------------- /devices/ads7028_38/mspm0g3507.syscfg: -------------------------------------------------------------------------------- 1 | /** 2 | * These arguments were used when this file was generated. They will be automatically applied on subsequent loads 3 | * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments. 4 | * @cliArgs --device "MSPM0G350X" --part "Default" --package "LQFP-64(PM)" --product "mspm0_sdk@2.02.00.05" 5 | * @v2CliArgs --device "MSPM0G3507" --package "LQFP-64(PM)" --product "mspm0_sdk@2.02.00.05" 6 | * @versions {"tool":"1.21.1+3772"} 7 | */ 8 | 9 | /** 10 | * Import the modules used in this configuration. 11 | */ 12 | const GPIO = scripting.addModule("/ti/driverlib/GPIO", {}, false); 13 | const GPIO1 = GPIO.addInstance(); 14 | const SPI = scripting.addModule("/ti/driverlib/SPI", {}, false); 15 | const SPI1 = SPI.addInstance(); 16 | const SYSCTL = scripting.addModule("/ti/driverlib/SYSCTL"); 17 | const TIMER = scripting.addModule("/ti/driverlib/TIMER", {}, false); 18 | const TIMER1 = TIMER.addInstance(); 19 | 20 | /** 21 | * Write custom configuration values to the imported modules. 22 | */ 23 | GPIO1.$name = "GPIO_LEDS"; 24 | GPIO1.port = "PORTA"; 25 | GPIO1.associatedPins[0].$name = "USER_LED_1"; 26 | GPIO1.associatedPins[0].assignedPortSegment = "Lower"; 27 | GPIO1.associatedPins[0].assignedPin = "0"; 28 | GPIO1.associatedPins[0].initialValue = "SET"; 29 | 30 | const Board = scripting.addModule("/ti/driverlib/Board", {}, false); 31 | 32 | SPI1.$name = "SPI_0"; 33 | SPI1.targetBitRate = 500000; 34 | SPI1.rxFifoThreshold = "DL_SPI_RX_FIFO_LEVEL_ONE_FRAME"; 35 | SPI1.txFifoThreshold = "DL_SPI_TX_FIFO_LEVEL_ONE_FRAME"; 36 | SPI1.enabledInterrupts = ["DMA_DONE_RX","DMA_DONE_TX","TX_EMPTY"]; 37 | SPI1.enabledDMAEvent1Triggers = "DL_SPI_DMA_INTERRUPT_RX"; 38 | SPI1.enabledDMAEvent2Triggers = "DL_SPI_DMA_INTERRUPT_TX"; 39 | SPI1.peripheral.sclkPin.$assign = "PB9"; 40 | SPI1.peripheral.mosiPin.$assign = "PB8"; 41 | SPI1.peripheral.misoPin.$assign = "PB7"; 42 | SPI1.peripheral.cs0Pin.$assign = "PB6"; 43 | SPI1.sclkPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric0"; 44 | SPI1.mosiPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric1"; 45 | SPI1.misoPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric2"; 46 | SPI1.cs0PinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric3"; 47 | SPI1.DMA_CHANNEL_EVENT1.$name = "DMA_CH1"; 48 | SPI1.DMA_CHANNEL_EVENT1.addressMode = "f2b"; 49 | SPI1.DMA_CHANNEL_EVENT1.srcLength = "BYTE"; 50 | SPI1.DMA_CHANNEL_EVENT1.dstLength = "BYTE"; 51 | SPI1.DMA_CHANNEL_EVENT1.peripheral.$assign = "DMA_CH1"; 52 | SPI1.DMA_CHANNEL_EVENT2.$name = "DMA_CH0"; 53 | SPI1.DMA_CHANNEL_EVENT2.addressMode = "b2f"; 54 | SPI1.DMA_CHANNEL_EVENT2.srcLength = "BYTE"; 55 | SPI1.DMA_CHANNEL_EVENT2.dstLength = "BYTE"; 56 | SPI1.DMA_CHANNEL_EVENT2.peripheral.$assign = "DMA_CH0"; 57 | 58 | SYSCTL.validateClkStatus = true; 59 | SYSCTL.forceDefaultClkConfig = true; 60 | SYSCTL.clockTreeEn = true; 61 | 62 | TIMER1.$name = "TIMER_0"; 63 | TIMER1.timerMode = "PERIODIC"; 64 | TIMER1.interrupts = ["ZERO"]; 65 | TIMER1.timerClkSrc = "LFCLK"; 66 | TIMER1.timerClkDiv = 8; 67 | TIMER1.timerClkPrescale = 1; 68 | TIMER1.timerPeriod = "1000 ms"; 69 | TIMER1.timerStartTimer = true; 70 | TIMER1.peripheral.$assign = "TIMG0"; 71 | 72 | /** 73 | * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future 74 | * version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to 75 | * re-solve from scratch. 76 | */ 77 | GPIO1.associatedPins[0].pin.$suggestSolution = "PA0"; 78 | Board.peripheral.$suggestSolution = "DEBUGSS"; 79 | Board.peripheral.swclkPin.$suggestSolution = "PA20"; 80 | Board.peripheral.swdioPin.$suggestSolution = "PA19"; 81 | SPI1.peripheral.$suggestSolution = "SPI1"; 82 | -------------------------------------------------------------------------------- /devices/ads706x/mspm0g3507.syscfg: -------------------------------------------------------------------------------- 1 | /** 2 | * These arguments were used when this file was generated. They will be automatically applied on subsequent loads 3 | * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments. 4 | * @cliArgs --device "MSPM0G350X" --part "Default" --package "LQFP-64(PM)" --product "mspm0_sdk@2.02.00.05" 5 | * @v2CliArgs --device "MSPM0G3507" --package "LQFP-64(PM)" --product "mspm0_sdk@2.02.00.05" 6 | * @versions {"tool":"1.21.1+3772"} 7 | */ 8 | 9 | /** 10 | * Import the modules used in this configuration. 11 | */ 12 | const GPIO = scripting.addModule("/ti/driverlib/GPIO", {}, false); 13 | const GPIO1 = GPIO.addInstance(); 14 | const SPI = scripting.addModule("/ti/driverlib/SPI", {}, false); 15 | const SPI1 = SPI.addInstance(); 16 | const SYSCTL = scripting.addModule("/ti/driverlib/SYSCTL"); 17 | const TIMER = scripting.addModule("/ti/driverlib/TIMER", {}, false); 18 | const TIMER1 = TIMER.addInstance(); 19 | 20 | /** 21 | * Write custom configuration values to the imported modules. 22 | */ 23 | GPIO1.$name = "GPIO_LEDS"; 24 | GPIO1.port = "PORTA"; 25 | GPIO1.associatedPins[0].$name = "USER_LED_1"; 26 | GPIO1.associatedPins[0].assignedPortSegment = "Lower"; 27 | GPIO1.associatedPins[0].assignedPin = "0"; 28 | GPIO1.associatedPins[0].initialValue = "SET"; 29 | 30 | const Board = scripting.addModule("/ti/driverlib/Board", {}, false); 31 | 32 | SPI1.$name = "SPI_0"; 33 | SPI1.targetBitRate = 500000; 34 | SPI1.rxFifoThreshold = "DL_SPI_RX_FIFO_LEVEL_ONE_FRAME"; 35 | SPI1.txFifoThreshold = "DL_SPI_TX_FIFO_LEVEL_ONE_FRAME"; 36 | SPI1.enabledInterrupts = ["DMA_DONE_RX","DMA_DONE_TX","TX_EMPTY"]; 37 | SPI1.enabledDMAEvent1Triggers = "DL_SPI_DMA_INTERRUPT_RX"; 38 | SPI1.enabledDMAEvent2Triggers = "DL_SPI_DMA_INTERRUPT_TX"; 39 | SPI1.peripheral.sclkPin.$assign = "PB9"; 40 | SPI1.peripheral.mosiPin.$assign = "PB8"; 41 | SPI1.peripheral.misoPin.$assign = "PB7"; 42 | SPI1.peripheral.cs0Pin.$assign = "PB6"; 43 | SPI1.sclkPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric0"; 44 | SPI1.mosiPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric1"; 45 | SPI1.misoPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric2"; 46 | SPI1.cs0PinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric3"; 47 | SPI1.DMA_CHANNEL_EVENT1.$name = "DMA_CH1"; 48 | SPI1.DMA_CHANNEL_EVENT1.addressMode = "f2b"; 49 | SPI1.DMA_CHANNEL_EVENT1.srcLength = "BYTE"; 50 | SPI1.DMA_CHANNEL_EVENT1.dstLength = "BYTE"; 51 | SPI1.DMA_CHANNEL_EVENT1.peripheral.$assign = "DMA_CH1"; 52 | SPI1.DMA_CHANNEL_EVENT2.$name = "DMA_CH0"; 53 | SPI1.DMA_CHANNEL_EVENT2.addressMode = "b2f"; 54 | SPI1.DMA_CHANNEL_EVENT2.srcLength = "BYTE"; 55 | SPI1.DMA_CHANNEL_EVENT2.dstLength = "BYTE"; 56 | SPI1.DMA_CHANNEL_EVENT2.peripheral.$assign = "DMA_CH0"; 57 | 58 | SYSCTL.validateClkStatus = true; 59 | SYSCTL.forceDefaultClkConfig = true; 60 | SYSCTL.clockTreeEn = true; 61 | 62 | TIMER1.$name = "TIMER_0"; 63 | TIMER1.timerMode = "PERIODIC"; 64 | TIMER1.interrupts = ["ZERO"]; 65 | TIMER1.timerClkSrc = "LFCLK"; 66 | TIMER1.timerClkDiv = 8; 67 | TIMER1.timerClkPrescale = 1; 68 | TIMER1.timerPeriod = "1000 ms"; 69 | TIMER1.timerStartTimer = true; 70 | TIMER1.peripheral.$assign = "TIMG0"; 71 | 72 | /** 73 | * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future 74 | * version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to 75 | * re-solve from scratch. 76 | */ 77 | GPIO1.associatedPins[0].pin.$suggestSolution = "PA0"; 78 | Board.peripheral.$suggestSolution = "DEBUGSS"; 79 | Board.peripheral.swclkPin.$suggestSolution = "PA20"; 80 | Board.peripheral.swdioPin.$suggestSolution = "PA19"; 81 | SPI1.peripheral.$suggestSolution = "SPI1"; 82 | -------------------------------------------------------------------------------- /devices/tla2518/mspm0g3507.syscfg: -------------------------------------------------------------------------------- 1 | /** 2 | * These arguments were used when this file was generated. They will be automatically applied on subsequent loads 3 | * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments. 4 | * @cliArgs --device "MSPM0G350X" --part "Default" --package "LQFP-64(PM)" --product "mspm0_sdk@2.02.00.05" 5 | * @v2CliArgs --device "MSPM0G3507" --package "LQFP-64(PM)" --product "mspm0_sdk@2.02.00.05" 6 | * @versions {"tool":"1.21.1+3772"} 7 | */ 8 | 9 | /** 10 | * Import the modules used in this configuration. 11 | */ 12 | const GPIO = scripting.addModule("/ti/driverlib/GPIO", {}, false); 13 | const GPIO1 = GPIO.addInstance(); 14 | const SPI = scripting.addModule("/ti/driverlib/SPI", {}, false); 15 | const SPI1 = SPI.addInstance(); 16 | const SYSCTL = scripting.addModule("/ti/driverlib/SYSCTL"); 17 | const TIMER = scripting.addModule("/ti/driverlib/TIMER", {}, false); 18 | const TIMER1 = TIMER.addInstance(); 19 | 20 | /** 21 | * Write custom configuration values to the imported modules. 22 | */ 23 | GPIO1.$name = "GPIO_LEDS"; 24 | GPIO1.port = "PORTA"; 25 | GPIO1.associatedPins[0].$name = "USER_LED_1"; 26 | GPIO1.associatedPins[0].assignedPortSegment = "Lower"; 27 | GPIO1.associatedPins[0].assignedPin = "0"; 28 | GPIO1.associatedPins[0].initialValue = "SET"; 29 | 30 | const Board = scripting.addModule("/ti/driverlib/Board", {}, false); 31 | 32 | SPI1.$name = "SPI_0"; 33 | SPI1.targetBitRate = 500000; 34 | SPI1.rxFifoThreshold = "DL_SPI_RX_FIFO_LEVEL_ONE_FRAME"; 35 | SPI1.txFifoThreshold = "DL_SPI_TX_FIFO_LEVEL_ONE_FRAME"; 36 | SPI1.enabledInterrupts = ["DMA_DONE_RX","DMA_DONE_TX","TX_EMPTY"]; 37 | SPI1.enabledDMAEvent1Triggers = "DL_SPI_DMA_INTERRUPT_RX"; 38 | SPI1.enabledDMAEvent2Triggers = "DL_SPI_DMA_INTERRUPT_TX"; 39 | SPI1.peripheral.sclkPin.$assign = "PB9"; 40 | SPI1.peripheral.mosiPin.$assign = "PB8"; 41 | SPI1.peripheral.misoPin.$assign = "PB7"; 42 | SPI1.peripheral.cs0Pin.$assign = "PB6"; 43 | SPI1.sclkPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric0"; 44 | SPI1.mosiPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric1"; 45 | SPI1.misoPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric2"; 46 | SPI1.cs0PinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric3"; 47 | SPI1.DMA_CHANNEL_EVENT1.$name = "DMA_CH1"; 48 | SPI1.DMA_CHANNEL_EVENT1.addressMode = "f2b"; 49 | SPI1.DMA_CHANNEL_EVENT1.srcLength = "BYTE"; 50 | SPI1.DMA_CHANNEL_EVENT1.dstLength = "BYTE"; 51 | SPI1.DMA_CHANNEL_EVENT1.peripheral.$assign = "DMA_CH1"; 52 | SPI1.DMA_CHANNEL_EVENT2.$name = "DMA_CH0"; 53 | SPI1.DMA_CHANNEL_EVENT2.addressMode = "b2f"; 54 | SPI1.DMA_CHANNEL_EVENT2.srcLength = "BYTE"; 55 | SPI1.DMA_CHANNEL_EVENT2.dstLength = "BYTE"; 56 | SPI1.DMA_CHANNEL_EVENT2.peripheral.$assign = "DMA_CH0"; 57 | 58 | SYSCTL.validateClkStatus = true; 59 | SYSCTL.forceDefaultClkConfig = true; 60 | SYSCTL.clockTreeEn = true; 61 | 62 | TIMER1.$name = "TIMER_0"; 63 | TIMER1.timerMode = "PERIODIC"; 64 | TIMER1.interrupts = ["ZERO"]; 65 | TIMER1.timerClkSrc = "LFCLK"; 66 | TIMER1.timerClkDiv = 8; 67 | TIMER1.timerClkPrescale = 1; 68 | TIMER1.timerPeriod = "1000 ms"; 69 | TIMER1.timerStartTimer = true; 70 | TIMER1.peripheral.$assign = "TIMG0"; 71 | 72 | /** 73 | * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future 74 | * version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to 75 | * re-solve from scratch. 76 | */ 77 | GPIO1.associatedPins[0].pin.$suggestSolution = "PA0"; 78 | Board.peripheral.$suggestSolution = "DEBUGSS"; 79 | Board.peripheral.swclkPin.$suggestSolution = "PA20"; 80 | Board.peripheral.swdioPin.$suggestSolution = "PA19"; 81 | SPI1.peripheral.$suggestSolution = "SPI1"; 82 | -------------------------------------------------------------------------------- /devices/ads131a04/ccs/MSP432E LaunchPad/ADS131A04EVM_MSP432E_SYSCONFIG/ADS131A04.syscfg: -------------------------------------------------------------------------------- 1 | // These arguments were used when this file was generated. They will be automatically applied on subsequent loads 2 | // via the GUI or CLI invocations. Run CLI with '--help' for additional information on how to override these arguments. 3 | // @cliArgs --board "/ti/boards/MSP_EXP432E401Y" --product "simplelink_msp432e4_sdk@3.20.00.10" 4 | // @versions {"data":"2020022712","timestamp":"2020022712","tool":"1.3.1030","templates":"2020022712"} 5 | 6 | var RTOS = scripting.addModule("/ti/drivers/RTOS"); 7 | var GPIO = scripting.addModule("/ti/drivers/GPIO"); 8 | var GPIO1 = GPIO.addInstance(); 9 | var GPIO2 = GPIO.addInstance(); 10 | var SPI = scripting.addModule("/ti/drivers/SPI", {}, false); 11 | var SPI1 = SPI.addInstance(); 12 | var GPIO3 = GPIO.addInstance(); 13 | var GPIO4 = GPIO.addInstance(); 14 | var UART = scripting.addModule("/ti/drivers/UART", {}, false); 15 | var UART1 = UART.addInstance(); 16 | // name - Select the RTOS being used 17 | RTOS.name = "NoRTOS"; 18 | var Power = scripting.addModule("/ti/drivers/Power", {}, false); 19 | var Board = scripting.addModule("/ti/drivers/Board", {}, false); 20 | // Name - The C/C++ identifier used in applications as the index parameter passed to GPIO runtime APIs 21 | GPIO1.$name = "ADC_nRESET"; 22 | // Mode - Select the GPIO mode 23 | GPIO1.mode = "Output"; 24 | // Assign pin 25 | GPIO1.gpioPin.$assign = "boosterpack2.39"; // PK4 26 | // Name - The C/C++ identifier used in applications as the index parameter passed to GPIO runtime APIs 27 | GPIO2.$name = "ADC_nDRDY"; 28 | // Interrupt Trigger - Specifies when or if interrupts are triggered 29 | GPIO2.interruptTrigger = "Falling Edge"; 30 | // Callback Function - The name of the callback function called when this GPIO pin triggers an interrupt, or 'NULL' if it's specified at runtime 31 | GPIO2.callbackFunction = "SPI_readData"; 32 | // Assign pin 33 | GPIO2.gpioPin.$assign = "boosterpack2.37"; // PM0 34 | // Name - The C/C++ identifier used in applications as the index parameter passed to SPI runtime APIs 35 | SPI1.$name = "ADC_SPI3"; 36 | // Min DMA Transfer Size - Specifies the minimum transfer size in bytes for which the DMA will be used. Otherwise a polling transfer will occur with some exceptions. 37 | SPI1.minDmaTransferSize = 2; 38 | // Mode - In three pin mode the SS signal is not used. 39 | SPI1.mode = "Four Pin SS Active Low"; 40 | var DMA = scripting.addModule("/ti/drivers/DMA", {}, false); 41 | // Name 42 | SPI1.spi.$name = "MySSI1"; 43 | // Use Peripheral 44 | SPI1.spi.$assign = "SSI3"; 45 | // Assign pin 46 | SPI1.spi.sclkPin.$assign = "boosterpack2.7"; // PQ0 47 | // Assign pin 48 | SPI1.spi.misoPin.$assign = "boosterpack2.14"; // PQ3 49 | // Assign pin 50 | SPI1.spi.mosiPin.$assign = "boosterpack2.15"; // PQ2 51 | // Assign pin 52 | SPI1.spi.ssPin.$assign = "boosterpack2.12"; // PQ1 53 | // Use Hardware - Select the hardware to use, or 'None' to use available header pins 54 | GPIO3.$hardware = system.deviceData.board.components.D1; 55 | // Name - The C/C++ identifier used in applications as the index parameter passed to GPIO runtime APIs 56 | GPIO3.$name = "GPIO_LED0"; 57 | // Assign pin 58 | GPIO3.gpioPin.$assign = "expansion.87"; // PN1 59 | // Name - The C/C++ identifier used in applications as the index parameter passed to GPIO runtime APIs 60 | GPIO4.$name = "GPIO_LED1_ERROR"; 61 | // Use Hardware - Select the hardware to use, or 'None' to use available header pins 62 | GPIO4.$hardware = system.deviceData.board.components.D2; 63 | // Assign pin 64 | GPIO4.gpioPin.$assign = "expansion.85"; // PN0 65 | // Name - The C/C++ identifier used in applications as the index parameter passed to UART runtime APIs 66 | UART1.$name = "Board_UART0"; 67 | // Use Hardware - Select the hardware to use, or 'None' to use available header pins 68 | UART1.$hardware = system.deviceData.board.components.xds110Uart; 69 | // Name 70 | UART1.uart.$name = "MyUART1"; 71 | // Suggest solution 72 | SPI1.spi.dmaRxChannel.$suggestSolution = "UDMA_CH14"; 73 | // Suggest solution 74 | SPI1.spi.dmaTxChannel.$suggestSolution = "UDMA_CH15"; 75 | // Suggest solution 76 | UART1.uart.$suggestSolution = "UART0"; 77 | // Suggest solution 78 | UART1.uart.txPin.$suggestSolution = "34"; 79 | // Suggest solution 80 | UART1.uart.rxPin.$suggestSolution = "33"; 81 | -------------------------------------------------------------------------------- /devices/ads1262/README.md: -------------------------------------------------------------------------------- 1 | ADS1258 Example C Code 2 | ===================== 3 | 4 | The [ADS1258](http://www.ti.com/product/ADS1258) precision delta-sigma (ΔΣ) analog-to-digital converter (ADC) communicates using a serial peripheral interface (SPI) to allow for device configuration, control, and data retrieval. To interface with the ADS1258 with a microcontroller (MCU), the firmware or software engineer needs to know how to correctly configure their MCU's serial peripheral, sequence serial commands, and control the SPI timing of command bytes to the ADC. To assist in this process, this example code is intended to show how to initialize communication with the ADS1258 at a high-level. 5 | 6 | Included modules 7 | ---------------- 8 | 9 | There are three modules included in this example code: 10 | 11 | 1. **`ADS1258`** 12 | 13 | *Description:* Low-level functions and register map definitions for communicating with the ADS1258. 14 | 15 | *Files: ads1258.h, ads1258.c* 16 | 17 | 2. **`Hardware Abstraction Layer (HAL)`** 18 | 19 | *Description:* The HAL provides processor specific functions called by the `ADS1258` module. 20 | 21 | *Files: hal.h, hal.c* 22 | 23 | ***IMPORTANT**: This module will need to be modified to work with your hardware!* 24 | 25 | 3. **`Unit Tests`** 26 | 27 | *Description:* This is an optional module that you may include in your project during development to test example code functionality. 28 | 29 | *Files: unit_tests.h, unit_tests.c* 30 | 31 | How to use this code 32 | -------------------- 33 | 34 | Reference the *ads1258.c* file while writing your own code for examples of how how to perform basic ADC operations, such as register read/writes and reading data... 35 | 36 | OR 37 | 38 | Copy and paste the example code into your project, and update the files as needed to get access to the provided APIs... 39 | 40 | 1. Copy the `ADS1258` and `HAL` module files into your firmware project. Optionally, copy the `Unit Tests` module into your project as well. 41 | 42 | 2. Add library references in *hal.h* to your processor-specific library file(s). 43 | ```c 44 | //**************************************************************************** 45 | // 46 | // Insert processor specific header file(s) here 47 | // 48 | //****************************************************************************" 49 | 50 | /* --- TODO: INSERT YOUR CODE HERE --- */ 51 | #include "ti/devices/msp432e4/driverlib/driverlib.h" 52 | 53 | ``` 54 | 55 | 3. Edit all of the function implementations inside of *hal.c* to provide the specified functionality with your processor and processor-specific library APIs. 56 | ```c 57 | /** 58 | * \fn void InitSPI(void) 59 | * \brief Configures the MCU's SPI peripheral for interfacing with the ADS1258 60 | */ 61 | void InitSPI(void) 62 | { 63 | /* TODO: INSERT YOUR CODE HERE */ 64 | } 65 | ``` 66 | NOTE 1: The *hal.c* functions are called from within *ads1258.c* to interface with the hardware. The hardware functionality is kept in a separate module to allow the `ADS1258` module to remain portable. 67 | 68 | NOTE 2: Provided code examples in *hal.c* functions utilize the [TI SimpleLink SDK](http://www.ti.com/wireless-connectivity/simplelink-solutions/overview/software.html). 69 | 70 | 4. Include a reference to *hal.h* somewhere in your program and call the **InitADCPeripherals()** function to initialize the MCU peripherals connected to the ADS1258. 71 | 72 | 5. Include a reference to *ads1261.h* in your application (from *main.c* or wherever ADC communication is handled). You should now be able to begin calling the `ADS1258` module functions in your code. 73 | 74 | > **IMPORTANT**: This code was tested on an MSP432E401Y 32-bit ARM® Cortex®-M4F based MCU using TI Code Composer Studio's 18.1.3.LTS ARM compiler (using the provided `Unit Tests` functions). This code is provided as example to aid in the creation of your own software implementation and should not be considered to be fully verified and end-equipment ready. This example code was written for readability and has not been optimized for performance. 75 | 76 | Support 77 | ------- 78 | 79 | For questions or issues, visit the [TI E2E Forums](https://e2e.ti.com/). 80 | 81 | ![E2E Logo](http://e2e.ti.com/resized-image/__size/75x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-01-27/2234.ti_2D00_e2e_2D00_Pos_2D00_no_2D00_text_2D00_150.jpg) 82 | 83 | 84 | Release History 85 | --------------- 86 | `v1.0.0` [11-7-2018] - Initial release 87 | -------------------------------------------------------------------------------- /devices/ads122c04/README.md: -------------------------------------------------------------------------------- 1 | ADS122C04 Example C Code 2 | ===================== 3 | 4 | The [ADS122C04](http://www.ti.com/product/ADS122C04) precision delta-sigma (ΔΣ) analog-to-digital converter (ADC) communicates using an I2C peripheral interface to allow for device configuration, control, and data retrieval. To interface with the ADS122C04 with a microcontroller (MCU), the firmware or software engineer needs to know how to correctly configure their MCU's serial peripheral, sequence commands, and control the I2C timing of command bytes to the ADC. To assist in this process, this example code is intended to show how to initialize communication with the ADS122C04 at a high-level. 5 | 6 | Included modules 7 | ---------------- 8 | 9 | There are three modules included in this example code: 10 | 11 | 1. **`ADS122C04`** 12 | 13 | *Description:* Low-level functions and register map definitions for communicating with the ADS122C04. The functions also apply to the ADS112C04 if the define for ADS122C04 is removed in `ads122c04.h`. 14 | 15 | *Files: ads122c04.h, ads122c04.c* 16 | 17 | 2. **`Hardware Abstraction Layer (HAL)`** 18 | 19 | *Description:* The HAL provides processor specific functions called by the `ADS122C04` module. 20 | 21 | *Files: hal.h, hal.c* 22 | 23 | ***IMPORTANT**: This module will need to be modified to work with your hardware!* 24 | 25 | 3. **`Data Integrity Functions`** 26 | 27 | *Description:* The Data Integrity Functions allow calculation and verification of any CRC data integrity modes enabled for register and conversion data reads. This module is only required if the CRC data integrity mode is enabled on the `ADS122C04`. 28 | 29 | *Files: crc.h, crc.c* 30 | 31 | 32 | How to use this code 33 | -------------------- 34 | 35 | Reference the *ads122c04.c* file while writing your own code for examples of how how to perform basic ADC operations, such as register read/writes and reading data... 36 | 37 | OR 38 | 39 | Copy and paste the example code into your project, and update the files as needed to get access to the provided APIs... 40 | 41 | 1. Copy the `ADS122C04`, `HAL` and `Data Integrity` module files into your firmware project. 42 | 43 | 2. Add library references in *hal.h* to your processor-specific library file(s). 44 | ```c 45 | //**************************************************************************** 46 | // 47 | // Insert processor specific header file(s) here 48 | // 49 | //****************************************************************************" 50 | 51 | /* --- TODO: INSERT YOUR CODE HERE --- */ 52 | #include "ti/devices/msp432e4/driverlib/driverlib.h" 53 | 54 | ``` 55 | 56 | 3. Edit all of the function implementations inside of *hal.c* to provide the specified functionality with your processor and processor-specific library APIs. 57 | ```c 58 | /** 59 | * \fn void InitSPI(void) 60 | * \brief Configures the MCU's SPI peripheral for interfacing with the ADS122C04 61 | */ 62 | void InitI2C(void) 63 | { 64 | /* TODO: INSERT YOUR CODE HERE */ 65 | } 66 | ``` 67 | NOTE 1: The *hal.c* and *crc.c* functions are called from within *ads122C04.c* to interface with the hardware. The hardware functionality is kept in a separate module to allow the `ADS122C04` module to remain portable. 68 | 69 | NOTE 2: Provided code examples in *hal.c* functions utilize the [TI SimpleLink SDK](http://www.ti.com/wireless-connectivity/simplelink-solutions/overview/software.html). 70 | 71 | 4. Include a reference to *hal.h* somewhere in your program and call the **InitADCPeripherals()** function to initialize the MCU peripherals connected to the `ADS122C04`. 72 | 73 | 5. Include a reference to *ads122c04.h* in your application (from *main.c* or wherever ADC communication is handled). You should now be able to begin calling the `ADS122C04` module functions in your code. 74 | 75 | > **IMPORTANT**: This code was tested on an MSP432E401Y 32-bit ARM® Cortex®-M4F based MCU using TI Code Composer Studio's 20.2.1.LTS ARM compiler. This code is provided as example to aid in the creation of your own software implementation and should not be considered to be fully verified and end-equipment ready. This example code was written for readability and has not been optimized for performance. 76 | 77 | Support 78 | ------- 79 | 80 | For questions or issues, visit the [TI E2E Forums](https://e2e.ti.com/). 81 | 82 | 83 | 84 | Release History 85 | --------------- 86 | 87 | `v1.0.0` [10-15-2021] - Initial release 88 | -------------------------------------------------------------------------------- /devices/ads122u04/README.md: -------------------------------------------------------------------------------- 1 | ADS122U04 Example C Code 2 | ===================== 3 | 4 | The [ADS122U04](http://www.ti.com/product/ADS122U04) precision delta-sigma (ΔΣ) analog-to-digital converter (ADC) communicates using an UART peripheral interface to allow for device configuration, control, and data retrieval. To interface the ADS122U04 with a microcontroller (MCU), the firmware or software engineer needs to know how to correctly configure their MCU's serial peripheral, sequence commands, and control the UART timing of command bytes to the ADC. To assist in this process, this example code is intended to show how to initialize communication with the ADS122U04 at a high-level. 5 | 6 | Included modules 7 | ---------------- 8 | 9 | There are three modules included in this example code: 10 | 11 | 1. **`ADS122U04`** 12 | 13 | *Description:* Low-level functions and register map definitions for communicating with the ADS122U04. The functions also apply to the ADS112U04 if the define for ADS122U04 is removed in `ads122U04.h`. 14 | 15 | *Files: ads122u04.h, ads122u04.c* 16 | 17 | 2. **`Hardware Abstraction Layer (HAL)`** 18 | 19 | *Description:* The HAL provides processor specific functions called by the `ADS122U04` module. 20 | 21 | *Files: hal.h, hal.c* 22 | 23 | ***IMPORTANT**: This module will need to be modified to work with your hardware!* 24 | 25 | 3. **`Data Integrity Functions`** 26 | 27 | *Description:* The Data Integrity Functions allow calculation and verification of any CRC data integrity modes enabled for register and conversion data reads. This module is only required if the CRC data integrity mode is enabled on the `ADS122U04`. 28 | 29 | *Files: crc.h, crc.c* 30 | 31 | 32 | How to use this code 33 | -------------------- 34 | 35 | Reference the *ads122u04.c* file while writing your own code for examples of how how to perform basic ADC operations, such as register read/writes and reading data... 36 | 37 | OR 38 | 39 | Copy and paste the example code into your project, and update the files as needed to get access to the provided APIs... 40 | 41 | 1. Copy the `ADS122U04`, `HAL` and 'Data Integrity' module files into your firmware project. 42 | 43 | 2. Add library references in *hal.h* to your processor-specific library file(s). 44 | ```c 45 | //**************************************************************************** 46 | // 47 | // Insert processor specific header file(s) here 48 | // 49 | //****************************************************************************" 50 | 51 | /* --- TODO: INSERT YOUR CODE HERE --- */ 52 | #include "ti/devices/msp432e4/driverlib/driverlib.h" 53 | 54 | ``` 55 | 56 | 3. Edit all of the function implementations inside of *hal.c* to provide the specified functionality with your processor and processor-specific library APIs. 57 | ```c 58 | /** 59 | * \fn void InitUART(void) 60 | * \brief Configures the MCU's UART peripheral for interfacing with the ADS122U04 61 | */ 62 | void InitUART(void) 63 | { 64 | /* TODO: INSERT YOUR CODE HERE */ 65 | } 66 | ``` 67 | NOTE 1: The *hal.c* and *crc.c* functions are called from within *ads122u04.c* to interface with the hardware. The hardware functionality is kept in a separate module to allow the `ADS122U04` module to remain portable. 68 | 69 | NOTE 2: Provided code examples in *hal.c* functions utilize the [TI SimpleLink SDK](http://www.ti.com/wireless-connectivity/simplelink-solutions/overview/software.html). 70 | 71 | 4. Include a reference to *hal.h* somewhere in your program and call the **InitADCPeripherals()** function to initialize the MCU peripherals connected to the `ADS122U04`. 72 | 73 | 5. Include a reference to *ads122u04.h* in your application (from *main.c* or wherever ADC communication is handled). You should now be able to begin calling the `ADS122U04` module functions in your code. 74 | 75 | > **IMPORTANT**: This code was tested on an MSP432E401Y 32-bit ARM® Cortex®-M4F based MCU using TI Code Composer Studio's 20.2.1.LTS ARM compiler. This code is provided as example to aid in the creation of your own software implementation and should not be considered to be fully verified and end-equipment ready. This example code was written for readability and has not been optimized for performance. 76 | 77 | Support 78 | ------- 79 | 80 | For questions or issues, visit the [TI E2E Forums](https://e2e.ti.com/). 81 | 82 | 83 | 84 | Release History 85 | --------------- 86 | `v1.0.0` [11-15-2021] - Initial release 87 | 88 | -------------------------------------------------------------------------------- /devices/ads7953/ads79xx-main.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ads79xx-main.c 3 | * @brief Example application using the ADS79xx ADC driver 4 | */ 5 | 6 | #include 7 | #include 8 | #include "ti/driverlib/m0p/dl_core.h" 9 | #include "ti_msp_dl_config.h" 10 | #include "evm/ads79xx.h" 11 | 12 | int main(void) { 13 | ConversionResult_t results[10]; 14 | uint16_t count; 15 | uint8_t gpio_value; 16 | 17 | /* System initialization */ 18 | SYSCFG_DL_init(); 19 | 20 | /* ----- DEVICE CONFIGURATION ----- */ 21 | 22 | /* Start with setting the device mode and range */ 23 | SetMode(MODE_MANUAL, true); // Manual mode with channel reset 24 | SetRange(RANGE_VREF); // 0-VREF input range 25 | 26 | /* Configure GPIO0 as high alarm output */ 27 | GPIOConfig_t gpio_config; 28 | 29 | /* Initialize with default values */ 30 | gpio_config.gpio0 = GPIO0_HIGH_ALARM; 31 | #if GPIO_COUNT > 1 32 | gpio_config.gpio1 = GPIO1_INPUT; 33 | gpio_config.gpio2 = GPIO2_INPUT; 34 | gpio_config.gpio3 = GPIO3_INPUT; 35 | #endif 36 | gpio_config.device_reset = false; 37 | 38 | /* Apply GPIO configuration */ 39 | ConfigureGPIOs(&gpio_config); 40 | 41 | /* Configure alarm for channel 0 */ 42 | AlarmConfig_t alarm; 43 | alarm.channel = 0; 44 | alarm.alarm_level = HIGH_ALARM_SEL; 45 | alarm.threshold = 2000; // Adjust based on expected signals 46 | 47 | ConfigureAlarm(&alarm); 48 | 49 | /* Clear any previous results */ 50 | ClearConversionBuffer(); 51 | 52 | /* ----- MANUAL MODE OPERATION ----- */ 53 | 54 | /* Select channel 0 for conversion */ 55 | SelectChannel(0); 56 | 57 | /* Capture 5 conversions in manual mode */ 58 | CaptureConversions(5); 59 | 60 | /* Retrieve conversion results */ 61 | count = GetResults(results, 5); 62 | 63 | /* ----- AUTO-1 MODE OPERATION ----- */ 64 | 65 | /* Configure Auto-1 to scan channels 0, 2, and 4 only */ 66 | ChannelSeq_t seq; 67 | seq.enabled_channels = (1 << 0) | (1 << 2) | (1 << 4); 68 | 69 | ConfigureAuto1Sequence(&seq); 70 | 71 | /* Switch to Auto-1 mode with channel reset */ 72 | SetMode(MODE_AUTO1, true); 73 | 74 | /* Clear previous results and capture new conversions */ 75 | ClearConversionBuffer(); 76 | CaptureConversions(10); 77 | 78 | /* Get Auto-1 results */ 79 | count = GetResults(results, 10); 80 | 81 | /* ----- AUTO-2 MODE OPERATION ----- */ 82 | 83 | /* Configure Auto-2 to scan channels 0-3 */ 84 | ConfigureAuto2LastChannel(3); 85 | 86 | /* Switch to Auto-2 mode with channel reset */ 87 | SetMode(MODE_AUTO2, true); 88 | 89 | /* Clear buffer and capture new conversions */ 90 | ClearConversionBuffer(); 91 | CaptureConversions(10); 92 | 93 | /* Get Auto-2 results */ 94 | count = GetResults(results, 10); 95 | 96 | /* ----- RANGE SWITCHING ----- */ 97 | 98 | /* Switch back to manual mode on channel 0 */ 99 | SetMode(MODE_MANUAL, true); 100 | SelectChannel(0); 101 | 102 | /* Change to extended input range (0-2VREF) */ 103 | SetRange(RANGE_2VREF); 104 | 105 | /* Capture samples with new range */ 106 | ClearConversionBuffer(); 107 | CaptureConversions(5); 108 | 109 | /* Get results with new range */ 110 | count = GetResults(results, 5); 111 | 112 | /* ----- GPIO OPERATIONS ----- */ 113 | 114 | /* Reconfigure GPIO0 as output */ 115 | gpio_config.gpio0 = GPIO0_OUTPUT; 116 | ConfigureGPIOs(&gpio_config); 117 | 118 | /* Toggle GPIO output */ 119 | WriteGPIO(0, 1); // Set high 120 | 121 | /* Use the built-in millisecond delay function */ 122 | //DL_Common_delayMilliseconds(500); 123 | 124 | WriteGPIO(0, 0); // Set low 125 | 126 | /* Read GPIO value */ 127 | ReadGPIO(0, &gpio_value); 128 | 129 | /* ----- POWER MANAGEMENT ----- */ 130 | 131 | /* Put device in power-down mode to save power */ 132 | PowerDown(true); 133 | 134 | /* Wake up device when needed again */ 135 | PowerDown(false); 136 | 137 | /* Main application loop */ 138 | while (1) { 139 | /* Application code here */ 140 | //delay_cycles(cycles); 141 | } 142 | 143 | return 0; 144 | } -------------------------------------------------------------------------------- /devices/ads125h02/README.md: -------------------------------------------------------------------------------- 1 | ADS125H02 Example C Code 2 | ===================== 3 | 4 | The [ADS125H02](http://www.ti.com/product/ADS125H02) precision delta-sigma (ΔΣ) analog-to-digital converter (ADC) communicates using a serial peripheral interface (SPI) to allow for device configuration, control, and data retrieval. To interface with the ADS125H02 with a microcontroller (MCU), the firmware or software engineer needs to know how to correctly configure their MCU's serial peripheral, sequence serial commands, and control the SPI timing of command bytes to the ADC. To assist in this process, this example code is intended to show how to initialize communication with the ADS125H02 at a high-level. 5 | 6 | Included modules 7 | ---------------- 8 | 9 | There are two modules included in this example code: 10 | 11 | 1. **`ADS125H02`** 12 | 13 | *Description:* Low-level functions and register map definitions for communicating with the ADS125H02. 14 | 15 | *Files: ads125h02.h, ads125h02.c* 16 | 17 | 2. **`Hardware Abstraction Layer (HAL)`** 18 | 19 | *Description:* The HAL provides processor specific functions called by the `ADS125H02` module. 20 | 21 | *Files: hal.h, hal.c* 22 | 23 | ***IMPORTANT**: This module will need to be modified to work with your hardware!* 24 | 25 | 26 | How to use this code 27 | -------------------- 28 | 29 | Reference the *ads125h02.c* file while writing your own code for examples of how how to perform basic ADC operations, such as register read/writes and reading data... 30 | 31 | OR 32 | 33 | Copy and paste the example code into your project, and update the files as needed to get access to the provided APIs... 34 | 35 | 1. Copy the `ADS125H02` and `HAL` module files into your firmware project. 36 | 37 | 2. Add library references in *hal.h* to your processor-specific library file(s). 38 | ```c 39 | //**************************************************************************** 40 | // 41 | // Insert processor specific header file(s) here 42 | // 43 | //****************************************************************************" 44 | 45 | /* --- TODO: INSERT YOUR CODE HERE --- */ 46 | #include "driverlib/sysctl.h" 47 | #include "driverlib/gpio.h" 48 | #include "driverlib/ssi.h" 49 | ``` 50 | 51 | 3. Edit all of the function implementations inside of *hal.c* to provide the specified functionality with your processor and processor-specific library APIs. 52 | ```c 53 | /** 54 | * \fn void delay_ms(uint32_t time_ms) 55 | * \brief Delays for a number of milliseconds, specified by argument 56 | * \param time_ms number of milliseconds to delay 57 | */ 58 | void delay_ms(uint32_t time_ms) 59 | { 60 | /* --- INSERT YOUR CODE HERE --- 61 | * Delay for a number of milliseconds, as specified by "time_ms". 62 | * 63 | * The following code shows an example using TivaWare™... 64 | * NOTE: In this example 40,000 system ticks is 1 ms. 65 | */ 66 | 67 | uint32_t ticks = 40000 * time_ms; 68 | SysCtlDelay(ticks); 69 | } 70 | ``` 71 | NOTE 1: The *hal.c* functions are called from within *ads125h02.c* to interface with the hardware. The hardware functionality is kept in a separate module to allow the `ADS125H02` module to remain portable. 72 | 73 | NOTE 2: Provided code examples in *hal.c* functions utilize the [TI TivaWare™ for C Series](http://www.ti.com/tool/SW-TM4C) code library. 74 | 75 | 4. Configure an initialize the MCU peripherals connected to the ADS125H02. 76 | 77 | 5. Include a reference to *ads125h02.h* in your application (from *main.c* or wherever ADC communication is handled). You should now be able to begin calling the `ADS125H02` module functions in your code. 78 | 79 | > **IMPORTANT**: This code was tested on an TM4C1294NCPDT 32-bit ARM® Cortex®-M4F based MCU using TI Code Composer Studio's 18.9.0.LTS ARM compiler. This code is provided as example to aid in the creation of your own software implementation and should not be considered to be fully verified and end-equipment ready. This example code was written for readability and has not been optimized for performance. 80 | 81 | Support 82 | ------- 83 | 84 | For questions or issues, visit the [TI E2E Forums](https://e2e.ti.com/). 85 | 86 | ![E2E Logo](http://e2e.ti.com/resized-image/__size/75x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-01-27/2234.ti_2D00_e2e_2D00_Pos_2D00_no_2D00_text_2D00_150.jpg) 87 | 88 | Release History 89 | --------------- 90 | 91 | `v1.0.0` [1-11-2019] - Initial release 92 | `v1.1.0` [1-11-2019] - Bug fix in calculateCRC() function. 93 | -------------------------------------------------------------------------------- /devices/ads7066/README.md: -------------------------------------------------------------------------------- 1 | ADS7066 Example C Code 2 | ===================== 3 | 4 | The ADS7066 is a small, 16-bit, 8-channel, highprecision successive-approximation register (SAR) analog-to-digital converter (ADC) that communicates using a serial peripheral interface (SPI) to allow for device configuration, control, and data retrieval. To interface the ADS7066 with a microcontroller (MCU), the firmware or software engineer needs to know how to correctly configure their MCU's serial peripheral, sequence the serial commands, and control the SPI timing of command bytes to the ADC. To assist in expediting this process, this example code is intended to show how to initialize and communicate with the ADC at a high-level. 5 | 6 | Included modules 7 | ---------------- 8 | 9 | There are three modules included in this example code: 10 | 11 | 1. **`ADS7066`** 12 | 13 | *Description:* High-level functions and register map definitions for communicating with the ADS7066. 14 | 15 | *Files: ads7066.h, ads7066.c* 16 | 17 | 2. **`Hardware Abstraction Layer (HAL)`** 18 | 19 | *Description:* The HAL provides processor specific functions called by the `ADS7066` module. 20 | 21 | *Files: hal.h, hal.c* 22 | 23 | **IMPORTANT**: This module will need to be modified to work with your hardware! 24 | 25 | 26 | How to use this code 27 | -------------------- 28 | 29 | Reference the *ads7066.c* file while writing your own code for examples of how how to perform basic ADC operations, such as register read/writes and reading data... 30 | 31 | OR 32 | 33 | Copy and paste the example code into your project, and update the files as needed to get access to the provided APIs... 34 | 35 | 1. Copy the `ADS7066` and `HAL` module files into your firmware project. 36 | 2. Add library references in *hal.h* to your processor-specific library file(s). 37 | ```c 38 | //**************************************************************************** 39 | // 40 | // Insert processor specific header file(s) here 41 | // 42 | //****************************************************************************" 43 | 44 | /* --- TODO: INSERT YOUR CODE HERE --- */ 45 | #include "ti/devices/msp432e4/driverlib/driverlib.h" 46 | 47 | ``` 48 | 49 | 3. Edit all of the function implementations inside of *hal.c* to provide the specified functionality with your processor and processor-specific library APIs. 50 | ```c 51 | //***************************************************************************** 52 | // 53 | //! Configures the MCU's SPI peripheral for interfacing with the ADC. 54 | //! 55 | //! \fn void InitSPI(void) 56 | //! 57 | //! \return None. 58 | // 59 | //***************************************************************************** 60 | void initSPI(void) 61 | { 62 | /* --- INSERT YOUR CODE HERE --- */ 63 | ``` 64 | NOTE 1: The *hal.c* functions are called from within *ads7066.c* to interface with the hardware. The hardware functionality is kept in a separate module to allow the `ADS7066` module to remain portable. 65 | 66 | NOTE 2: Provided code examples in *hal.c* functions utilize the [TI SimpleLink SDK](http://www.ti.com/wireless-connectivity/simplelink-solutions/overview/software.html) and allow for quick integration with TI SimpleLink MCUs. 67 | 68 | 4. Include a reference to *hal.h* somewhere in your program and call the **initAdcPeripherals()** function to initialize the MCU peripherals connected to the ADC. 69 | 70 | 5. Include a reference to *ads7066.h* in your application (from *main.c* or wherever ADC communication is handled). You should now be able to begin calling the `ADS7066` module functions in your code. 71 | 72 | > **DISCLAIMER**: This code was tested on an MSP432E401Y 32-bit ARM® Cortex®-M4F based MCU using TI Code Composer Studio's 20.2.2.LTS ARM compiler. This code is provided as example to aid in the creation of your own software implementation and should not be considered to be fully verified and production ready. This example code was written for readability and has not been optimized for performance. 73 | 74 | Support 75 | ------- 76 | 77 | For questions or issues, visit the [TI E2E Forums](https://e2e.ti.com/). 78 | 79 | ![E2E Logo](http://e2e.ti.com/resized-image/__size/75x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-01-27/2234.ti_2D00_e2e_2D00_Pos_2D00_no_2D00_text_2D00_150.jpg) 80 | 81 | Release History 82 | --------------- 83 | | Version | Date | Description | 84 | |:-----------:| ----------- | ---------------------- | 85 | | 1.0.0 | 10/23/2020 | Initial release | -------------------------------------------------------------------------------- /devices/ads9327/c2000/f28p65x/ads9327_main.c: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * \copyright Copyright (C) 2025 Texas Instruments Incorporated - http://www.ti.com/ 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the 15 | * distribution. 16 | * 17 | * Neither the name of Texas Instruments Incorporated nor the names of 18 | * its contributors may be used to endorse or promote products derived 19 | * from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | * 33 | */ 34 | 35 | #include 36 | 37 | void main(void) 38 | { 39 | 40 | ADS9327_HAL_DeviceInit(); 41 | 42 | // Board initialization 43 | ADS9327_HAL_Board_init(); 44 | 45 | 46 | ADS9327_HAL_setupGpioExtAdcStart(); 47 | 48 | // Clock for External ADC- ePWM setup 49 | ADS9327_HAL_disableEpwmCounting(); 50 | ADS9327_HAL_setupEpwmExtAdcStart(); 51 | ADS9327_HAL_enableEpwmCounting(); 52 | 53 | ADS9327_initalization(); // ADC initialization sequence, needed at power-up 54 | 55 | // USER ADC CONFIGURATION CODE STARTS HERE 56 | 57 | ADS9327_unlockRegisterMap(); // unlock register map 58 | 59 | ADS9327_regBankSel(1); // bank 1 60 | 61 | ADS9327_HAL_writeRegister(REGISTER_10H_ADDRESS,0xABCD); // write ABCD to test pattern 1 reg 62 | 63 | ADS9327_HAL_writeRegister(REGISTER_01H_ADDRESS,0x1001); // read back reg 0x10 64 | 65 | ADS9327_HAL_writeRegister(REGISTER_11H_ADDRESS,0xEF12); // write EF12 to test pattern 2 reg 66 | 67 | ADS9327_HAL_writeRegister(REGISTER_01H_ADDRESS,0x1101); // read back reg 0x11 68 | 69 | ADS9327_HAL_writeRegister(REGISTER_0FH_ADDRESS,REGISTER_0FH_TEST_PATT_EN_TRUE); // enable test pattern output 70 | 71 | ADS9327_HAL_writeRegister(REGISTER_01H_ADDRESS,REGISTER_01H_DATA_SEL_ADCOUTPUT); // enable output 72 | 73 | #if DATA_LANES_SELECT == 1 74 | 75 | ADS9327_HAL_writeRegister(REGISTER_09H_ADDRESS,REGISTER_09H_NUM_DATA_LANES_1_LANES); 76 | 77 | #endif 78 | 79 | ADS9327_lockRegisterMap(); // lock register map 80 | 81 | 82 | // configure SPI for different modes 83 | ADS9327_HAL_configSpiExtAdcDataRead(); 84 | 85 | // setup interrupt handlers 86 | ADS9327_HAL_setupInterrupts(); 87 | 88 | 89 | EALLOW; 90 | // Enable Global interrupt INTM 91 | EINT; 92 | 93 | 94 | // Enable Global real-time interrupt DBGM 95 | ERTM; 96 | EDIS; 97 | 98 | 99 | // Loop forever. Suspend or place breakpoints to observe the buffers. 100 | while(1) {} 101 | } 102 | 103 | 104 | 105 | // ISR1() interrupt function 106 | __interrupt void ISR1(void) 107 | { 108 | // ISR is triggered by the EPWM 109 | #if DATA_LANES_SELECT == 1 110 | 111 | ADS9327_HAL_1LaneModeISR1(); 112 | 113 | #elif DATA_LANES_SELECT == 4 114 | 115 | ADS9327_HAL_4LaneModeISR1(); 116 | 117 | #endif 118 | 119 | ADS9327_HAL_clearAckISR1(); 120 | 121 | } 122 | 123 | // ISR2() interrupt function 124 | __interrupt void ISR2(void) 125 | { 126 | // ISR is triggered by the SPIx_RX 127 | 128 | #if DATA_LANES_SELECT == 1 129 | 130 | ADS9327_HAL_1LaneModeISR2(); 131 | 132 | #endif 133 | 134 | ADS9327_HAL_clearAckISR2(); 135 | 136 | } -------------------------------------------------------------------------------- /devices/ads1258/README.md: -------------------------------------------------------------------------------- 1 | ADS1258 Example C Code 2 | ===================== 3 | 4 | The [ADS1258](http://www.ti.com/product/ADS1258) precision delta-sigma (ΔΣ) analog-to-digital converter (ADC) communicates using a serial peripheral interface (SPI) to allow for device configuration, control, and data retrieval. To interface with the ADS1258 with a microcontroller (MCU), the firmware or software engineer needs to know how to correctly configure their MCU's serial peripheral, sequence serial commands, and control the SPI timing of command bytes to the ADC. To assist in this process, this example code is intended to show how to initialize communication with the ADS1258 at a high-level. 5 | 6 | Included modules 7 | ---------------- 8 | 9 | There are three modules included in this example code: 10 | 11 | 1. **`ADS1258`** 12 | 13 | *Description:* Low-level functions and register map definitions for communicating with the ADS1258. 14 | 15 | *Files: ads1258.h, ads1258.c* 16 | 17 | 2. **`Hardware Abstraction Layer (HAL)`** 18 | 19 | *Description:* The HAL provides processor specific functions called by the `ADS1258` module. 20 | 21 | *Files: hal.h, hal.c* 22 | 23 | ***IMPORTANT**: This module will need to be modified to work with your hardware!* 24 | 25 | 3. **`Unit Tests`** 26 | 27 | *Description:* This is an optional module that you may include in your project during development to test example code functionality. 28 | 29 | *Files: unit_tests.h, unit_tests.c* 30 | 31 | How to use this code 32 | -------------------- 33 | 34 | Reference the *ads1258.c* file while writing your own code for examples of how how to perform basic ADC operations, such as register read/writes and reading data... 35 | 36 | OR 37 | 38 | Copy and paste the example code into your project, and update the files as needed to get access to the provided APIs... 39 | 40 | 1. Copy the `ADS1258` and `HAL` module files into your firmware project. Optionally, copy the `Unit Tests` module into your project as well. 41 | 42 | 2. Add library references in *hal.h* to your processor-specific library file(s). 43 | ```c 44 | //**************************************************************************** 45 | // 46 | // Insert processor specific header file(s) here 47 | // 48 | //****************************************************************************" 49 | 50 | /* --- TODO: INSERT YOUR CODE HERE --- */ 51 | #include "ti/devices/msp432e4/driverlib/driverlib.h" 52 | 53 | ``` 54 | 55 | 3. Edit all of the function implementations inside of *hal.c* to provide the specified functionality with your processor and processor-specific library APIs. 56 | ```c 57 | /** 58 | * \fn void InitSPI(void) 59 | * \brief Configures the MCU's SPI peripheral for interfacing with the ADS1258 60 | */ 61 | void InitSPI(void) 62 | { 63 | /* TODO: INSERT YOUR CODE HERE */ 64 | } 65 | ``` 66 | NOTE 1: The *hal.c* functions are called from within *ads1258.c* to interface with the hardware. The hardware functionality is kept in a separate module to allow the `ADS1258` module to remain portable. 67 | 68 | NOTE 2: Provided code examples in *hal.c* functions utilize the [TI SimpleLink SDK](http://www.ti.com/wireless-connectivity/simplelink-solutions/overview/software.html). 69 | 70 | 4. Include a reference to *hal.h* somewhere in your program and call the **InitADCPeripherals()** function to initialize the MCU peripherals connected to the ADS1258. 71 | 72 | 5. Include a reference to *ads1261.h* in your application (from *main.c* or wherever ADC communication is handled). You should now be able to begin calling the `ADS1258` module functions in your code. 73 | 74 | > **IMPORTANT**: This code was tested on an MSP432E401Y 32-bit ARM® Cortex®-M4F based MCU using TI Code Composer Studio's 18.1.3.LTS ARM compiler (using the provided `Unit Tests` functions). This code is provided as example to aid in the creation of your own software implementation and should not be considered to be fully verified and end-equipment ready. This example code was written for readability and has not been optimized for performance. 75 | 76 | Support 77 | ------- 78 | 79 | For questions or issues, visit the [TI E2E Forums](https://e2e.ti.com/). 80 | 81 | ![E2E Logo](http://e2e.ti.com/resized-image/__size/75x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-01-27/2234.ti_2D00_e2e_2D00_Pos_2D00_no_2D00_text_2D00_150.jpg) 82 | 83 | 84 | Release History 85 | --------------- 86 | 87 | `v1.0.0` [11-7-2018] - Initial release 88 | `v1.0.1` [12-21-2018] - Updated comments and fixed bug in unit_tests.c where "=" was used in place of "&=" when checking multiple test conditions. 89 | --------------------------------------------------------------------------------