├── DSP_and_Math.c
├── DSP_and_Math.h
├── Examples
├── Arduino
│ ├── DSP_Math_lib_-_Test_Arduino_-_Goertzel_DFT
│ │ ├── DSP_Math_lib_-_Test_Arduino_-_Goertzel_DFT.ino
│ │ ├── DSP_and_Math.c
│ │ └── DSP_and_Math.h
│ ├── DSP_Math_lib_-_Test_Arduino_-_High_Pass
│ │ ├── DSP_Math_lib_-_Test_Arduino_-_High_Pass.ino
│ │ ├── DSP_and_Math.c
│ │ └── DSP_and_Math.h
│ ├── DSP_Math_lib_-_Test_Arduino_-_Low_Pass
│ │ ├── DSP_Math_lib_-_Test_Arduino_-_Low_Pass.ino
│ │ ├── DSP_and_Math.c
│ │ └── DSP_and_Math.h
│ └── DSP_Math_lib_-_Test_Arduino_-_RMS_Value
│ │ ├── DSP_Math_lib_-_Test_Arduino_-_RMS_Value.ino
│ │ ├── DSP_and_Math.c
│ │ └── DSP_and_Math.h
└── MSP430
│ ├── DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT
│ ├── .ccsproject
│ ├── .cproject
│ ├── .launches
│ │ ├── DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT.launch
│ │ ├── DSP_Math_lib - v01_01 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v01_01 - FR6989 - driverlib 2.801.launch
│ │ ├── DSP_Math_lib - v01_02 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v01_03 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v01_04 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v02_01 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v02_02 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v03_01 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v03_02 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v03_03 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v03_04 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v04_01 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v04_02 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v04_03 - FR6989 - driverlib 2.80.launch
│ │ ├── FR6989 - ADC12- ex2_sharedRef.launch
│ │ ├── FR6989 - TLV - CRC ref and adc12 correction - v01.launch
│ │ ├── FR6989 - TLV - CRC ref and adc12 correction - v02.launch
│ │ └── FR6989 - TLV - ref and adc12 correction - v01.launch
│ ├── .project
│ ├── .settings
│ │ ├── org.eclipse.cdt.codan.core.prefs
│ │ ├── org.eclipse.cdt.debug.core.prefs
│ │ └── org.eclipse.core.resources.prefs
│ ├── DSP_and_Math.c
│ ├── DSP_and_Math.h
│ ├── Debug
│ │ ├── DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT.map
│ │ ├── DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT_linkInfo.xml
│ │ ├── ccsObjs.opt
│ │ ├── driverlib
│ │ │ └── MSP430FR5xx_6xx
│ │ │ │ ├── subdir_rules.mk
│ │ │ │ └── subdir_vars.mk
│ │ ├── makefile
│ │ ├── objects.mk
│ │ ├── sources.mk
│ │ ├── subdir_rules.mk
│ │ └── subdir_vars.mk
│ ├── driverlib
│ │ └── MSP430FR5xx_6xx
│ │ │ ├── adc12_b.c
│ │ │ ├── adc12_b.h
│ │ │ ├── aes256.c
│ │ │ ├── aes256.h
│ │ │ ├── comp_e.c
│ │ │ ├── comp_e.h
│ │ │ ├── crc.c
│ │ │ ├── crc.h
│ │ │ ├── crc32.c
│ │ │ ├── crc32.h
│ │ │ ├── cs.c
│ │ │ ├── cs.h
│ │ │ ├── dma.c
│ │ │ ├── dma.h
│ │ │ ├── driverlib.h
│ │ │ ├── esi.c
│ │ │ ├── esi.h
│ │ │ ├── eusci_a_spi.c
│ │ │ ├── eusci_a_spi.h
│ │ │ ├── eusci_a_uart.c
│ │ │ ├── eusci_a_uart.h
│ │ │ ├── eusci_b_i2c.c
│ │ │ ├── eusci_b_i2c.h
│ │ │ ├── eusci_b_spi.c
│ │ │ ├── eusci_b_spi.h
│ │ │ ├── framctl.c
│ │ │ ├── framctl.h
│ │ │ ├── framctl_a.c
│ │ │ ├── framctl_a.h
│ │ │ ├── gpio.c
│ │ │ ├── gpio.h
│ │ │ ├── inc
│ │ │ ├── hw_memmap.h
│ │ │ └── version.h
│ │ │ ├── lcd_c.c
│ │ │ ├── lcd_c.h
│ │ │ ├── mpu.c
│ │ │ ├── mpu.h
│ │ │ ├── mpy32.c
│ │ │ ├── mpy32.h
│ │ │ ├── pmm.c
│ │ │ ├── pmm.h
│ │ │ ├── ram.c
│ │ │ ├── ram.h
│ │ │ ├── ref_a.c
│ │ │ ├── ref_a.h
│ │ │ ├── rtc_b.c
│ │ │ ├── rtc_b.h
│ │ │ ├── rtc_c.c
│ │ │ ├── rtc_c.h
│ │ │ ├── sfr.c
│ │ │ ├── sfr.h
│ │ │ ├── sysctl.c
│ │ │ ├── sysctl.h
│ │ │ ├── timer_a.c
│ │ │ ├── timer_a.h
│ │ │ ├── timer_b.c
│ │ │ ├── timer_b.h
│ │ │ ├── tlv.c
│ │ │ ├── tlv.h
│ │ │ ├── wdt_a.c
│ │ │ └── wdt_a.h
│ ├── embedded_printf.c
│ ├── embedded_printf.h
│ ├── lnk_msp430fr6989.cmd
│ ├── main.c
│ ├── serial_conf.c
│ ├── serial_conf.h
│ └── targetConfigs
│ │ ├── MSP430FR6989.ccxml
│ │ └── readme.txt
│ ├── DSP_Math_lib - Test EXP430FR6989 - High Pass
│ ├── .ccsproject
│ ├── .cproject
│ ├── .launches
│ │ ├── DSP_Math_lib - Test EXP430FR6989 - High Pass.launch
│ │ ├── DSP_Math_lib - v01_01 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v01_01 - FR6989 - driverlib 2.801.launch
│ │ ├── DSP_Math_lib - v01_02 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v01_03 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v01_04 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v02_01 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v02_02 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v03_01 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v03_02 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v03_03 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v03_04 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v04_01 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v04_02 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v04_03 - FR6989 - driverlib 2.80.launch
│ │ ├── FR6989 - ADC12- ex2_sharedRef.launch
│ │ ├── FR6989 - TLV - CRC ref and adc12 correction - v01.launch
│ │ ├── FR6989 - TLV - CRC ref and adc12 correction - v02.launch
│ │ └── FR6989 - TLV - ref and adc12 correction - v01.launch
│ ├── .project
│ ├── .settings
│ │ ├── org.eclipse.cdt.codan.core.prefs
│ │ ├── org.eclipse.cdt.debug.core.prefs
│ │ └── org.eclipse.core.resources.prefs
│ ├── DSP_and_Math.c
│ ├── DSP_and_Math.h
│ ├── Debug
│ │ ├── DSP_Math_lib - Test EXP430FR6989 - High Pass.map
│ │ ├── DSP_Math_lib - Test EXP430FR6989 - High Pass_linkInfo.xml
│ │ ├── ccsObjs.opt
│ │ ├── driverlib
│ │ │ └── MSP430FR5xx_6xx
│ │ │ │ ├── subdir_rules.mk
│ │ │ │ └── subdir_vars.mk
│ │ ├── makefile
│ │ ├── objects.mk
│ │ ├── sources.mk
│ │ ├── subdir_rules.mk
│ │ └── subdir_vars.mk
│ ├── driverlib
│ │ └── MSP430FR5xx_6xx
│ │ │ ├── adc12_b.c
│ │ │ ├── adc12_b.h
│ │ │ ├── aes256.c
│ │ │ ├── aes256.h
│ │ │ ├── comp_e.c
│ │ │ ├── comp_e.h
│ │ │ ├── crc.c
│ │ │ ├── crc.h
│ │ │ ├── crc32.c
│ │ │ ├── crc32.h
│ │ │ ├── cs.c
│ │ │ ├── cs.h
│ │ │ ├── dma.c
│ │ │ ├── dma.h
│ │ │ ├── driverlib.h
│ │ │ ├── esi.c
│ │ │ ├── esi.h
│ │ │ ├── eusci_a_spi.c
│ │ │ ├── eusci_a_spi.h
│ │ │ ├── eusci_a_uart.c
│ │ │ ├── eusci_a_uart.h
│ │ │ ├── eusci_b_i2c.c
│ │ │ ├── eusci_b_i2c.h
│ │ │ ├── eusci_b_spi.c
│ │ │ ├── eusci_b_spi.h
│ │ │ ├── framctl.c
│ │ │ ├── framctl.h
│ │ │ ├── framctl_a.c
│ │ │ ├── framctl_a.h
│ │ │ ├── gpio.c
│ │ │ ├── gpio.h
│ │ │ ├── inc
│ │ │ ├── hw_memmap.h
│ │ │ └── version.h
│ │ │ ├── lcd_c.c
│ │ │ ├── lcd_c.h
│ │ │ ├── mpu.c
│ │ │ ├── mpu.h
│ │ │ ├── mpy32.c
│ │ │ ├── mpy32.h
│ │ │ ├── pmm.c
│ │ │ ├── pmm.h
│ │ │ ├── ram.c
│ │ │ ├── ram.h
│ │ │ ├── ref_a.c
│ │ │ ├── ref_a.h
│ │ │ ├── rtc_b.c
│ │ │ ├── rtc_b.h
│ │ │ ├── rtc_c.c
│ │ │ ├── rtc_c.h
│ │ │ ├── sfr.c
│ │ │ ├── sfr.h
│ │ │ ├── sysctl.c
│ │ │ ├── sysctl.h
│ │ │ ├── timer_a.c
│ │ │ ├── timer_a.h
│ │ │ ├── timer_b.c
│ │ │ ├── timer_b.h
│ │ │ ├── tlv.c
│ │ │ ├── tlv.h
│ │ │ ├── wdt_a.c
│ │ │ └── wdt_a.h
│ ├── embedded_printf.c
│ ├── embedded_printf.h
│ ├── lnk_msp430fr6989.cmd
│ ├── main.c
│ ├── serial_conf.c
│ ├── serial_conf.h
│ └── targetConfigs
│ │ ├── MSP430FR6989.ccxml
│ │ └── readme.txt
│ ├── DSP_Math_lib - Test EXP430FR6989 - Low Pass
│ ├── .ccsproject
│ ├── .cproject
│ ├── .launches
│ │ ├── DSP_Math_lib - Test EXP430FR6989 - Low Pass.launch
│ │ ├── DSP_Math_lib - v01_01 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v01_01 - FR6989 - driverlib 2.801.launch
│ │ ├── DSP_Math_lib - v01_02 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v01_03 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v01_04 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v02_01 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v02_02 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v03_01 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v03_02 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v03_03 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v03_04 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v04_01 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v04_02 - FR6989 - driverlib 2.80.launch
│ │ ├── DSP_Math_lib - v04_03 - FR6989 - driverlib 2.80.launch
│ │ ├── FR6989 - ADC12- ex2_sharedRef.launch
│ │ ├── FR6989 - TLV - CRC ref and adc12 correction - v01.launch
│ │ ├── FR6989 - TLV - CRC ref and adc12 correction - v02.launch
│ │ └── FR6989 - TLV - ref and adc12 correction - v01.launch
│ ├── .project
│ ├── .settings
│ │ ├── org.eclipse.cdt.codan.core.prefs
│ │ ├── org.eclipse.cdt.debug.core.prefs
│ │ └── org.eclipse.core.resources.prefs
│ ├── DSP_and_Math.c
│ ├── DSP_and_Math.h
│ ├── Debug
│ │ ├── DSP_Math_lib - Test EXP430FR6989 - Low Pass.map
│ │ ├── DSP_Math_lib - Test EXP430FR6989 - Low Pass_linkInfo.xml
│ │ ├── ccsObjs.opt
│ │ ├── driverlib
│ │ │ └── MSP430FR5xx_6xx
│ │ │ │ ├── subdir_rules.mk
│ │ │ │ └── subdir_vars.mk
│ │ ├── makefile
│ │ ├── objects.mk
│ │ ├── sources.mk
│ │ ├── subdir_rules.mk
│ │ └── subdir_vars.mk
│ ├── driverlib
│ │ └── MSP430FR5xx_6xx
│ │ │ ├── adc12_b.c
│ │ │ ├── adc12_b.h
│ │ │ ├── aes256.c
│ │ │ ├── aes256.h
│ │ │ ├── comp_e.c
│ │ │ ├── comp_e.h
│ │ │ ├── crc.c
│ │ │ ├── crc.h
│ │ │ ├── crc32.c
│ │ │ ├── crc32.h
│ │ │ ├── cs.c
│ │ │ ├── cs.h
│ │ │ ├── dma.c
│ │ │ ├── dma.h
│ │ │ ├── driverlib.h
│ │ │ ├── esi.c
│ │ │ ├── esi.h
│ │ │ ├── eusci_a_spi.c
│ │ │ ├── eusci_a_spi.h
│ │ │ ├── eusci_a_uart.c
│ │ │ ├── eusci_a_uart.h
│ │ │ ├── eusci_b_i2c.c
│ │ │ ├── eusci_b_i2c.h
│ │ │ ├── eusci_b_spi.c
│ │ │ ├── eusci_b_spi.h
│ │ │ ├── framctl.c
│ │ │ ├── framctl.h
│ │ │ ├── framctl_a.c
│ │ │ ├── framctl_a.h
│ │ │ ├── gpio.c
│ │ │ ├── gpio.h
│ │ │ ├── inc
│ │ │ ├── hw_memmap.h
│ │ │ └── version.h
│ │ │ ├── lcd_c.c
│ │ │ ├── lcd_c.h
│ │ │ ├── mpu.c
│ │ │ ├── mpu.h
│ │ │ ├── mpy32.c
│ │ │ ├── mpy32.h
│ │ │ ├── pmm.c
│ │ │ ├── pmm.h
│ │ │ ├── ram.c
│ │ │ ├── ram.h
│ │ │ ├── ref_a.c
│ │ │ ├── ref_a.h
│ │ │ ├── rtc_b.c
│ │ │ ├── rtc_b.h
│ │ │ ├── rtc_c.c
│ │ │ ├── rtc_c.h
│ │ │ ├── sfr.c
│ │ │ ├── sfr.h
│ │ │ ├── sysctl.c
│ │ │ ├── sysctl.h
│ │ │ ├── timer_a.c
│ │ │ ├── timer_a.h
│ │ │ ├── timer_b.c
│ │ │ ├── timer_b.h
│ │ │ ├── tlv.c
│ │ │ ├── tlv.h
│ │ │ ├── wdt_a.c
│ │ │ └── wdt_a.h
│ ├── embedded_printf.c
│ ├── embedded_printf.h
│ ├── lnk_msp430fr6989.cmd
│ ├── main.c
│ ├── serial_conf.c
│ ├── serial_conf.h
│ └── targetConfigs
│ │ ├── MSP430FR6989.ccxml
│ │ └── readme.txt
│ └── DSP_Math_lib - Test EXP430FR6989 - RMS Value
│ ├── .ccsproject
│ ├── .cproject
│ ├── .launches
│ ├── DSP_Math_lib - Test EXP430FR6989 - RMS Value.launch
│ ├── DSP_Math_lib - v01_01 - FR6989 - driverlib 2.80.launch
│ ├── DSP_Math_lib - v01_01 - FR6989 - driverlib 2.801.launch
│ ├── DSP_Math_lib - v01_02 - FR6989 - driverlib 2.80.launch
│ ├── DSP_Math_lib - v01_03 - FR6989 - driverlib 2.80.launch
│ ├── DSP_Math_lib - v01_04 - FR6989 - driverlib 2.80.launch
│ ├── DSP_Math_lib - v02_01 - FR6989 - driverlib 2.80.launch
│ ├── DSP_Math_lib - v02_02 - FR6989 - driverlib 2.80.launch
│ ├── DSP_Math_lib - v03_01 - FR6989 - driverlib 2.80.launch
│ ├── DSP_Math_lib - v03_02 - FR6989 - driverlib 2.80.launch
│ ├── DSP_Math_lib - v03_03 - FR6989 - driverlib 2.80.launch
│ ├── DSP_Math_lib - v03_04 - FR6989 - driverlib 2.80.launch
│ ├── DSP_Math_lib - v04_01 - FR6989 - driverlib 2.80.launch
│ ├── DSP_Math_lib - v04_02 - FR6989 - driverlib 2.80.launch
│ ├── DSP_Math_lib - v04_03 - FR6989 - driverlib 2.80.launch
│ ├── FR6989 - ADC12- ex2_sharedRef.launch
│ ├── FR6989 - TLV - CRC ref and adc12 correction - v01.launch
│ ├── FR6989 - TLV - CRC ref and adc12 correction - v02.launch
│ └── FR6989 - TLV - ref and adc12 correction - v01.launch
│ ├── .project
│ ├── .settings
│ ├── org.eclipse.cdt.codan.core.prefs
│ ├── org.eclipse.cdt.debug.core.prefs
│ └── org.eclipse.core.resources.prefs
│ ├── DSP_and_Math.c
│ ├── DSP_and_Math.h
│ ├── Debug
│ ├── DSP_Math_lib - Test EXP430FR6989 - RMS Value.map
│ ├── DSP_Math_lib - Test EXP430FR6989 - RMS Value_linkInfo.xml
│ ├── ccsObjs.opt
│ ├── driverlib
│ │ └── MSP430FR5xx_6xx
│ │ │ ├── subdir_rules.mk
│ │ │ └── subdir_vars.mk
│ ├── makefile
│ ├── objects.mk
│ ├── sources.mk
│ ├── subdir_rules.mk
│ └── subdir_vars.mk
│ ├── driverlib
│ └── MSP430FR5xx_6xx
│ │ ├── adc12_b.c
│ │ ├── adc12_b.h
│ │ ├── aes256.c
│ │ ├── aes256.h
│ │ ├── comp_e.c
│ │ ├── comp_e.h
│ │ ├── crc.c
│ │ ├── crc.h
│ │ ├── crc32.c
│ │ ├── crc32.h
│ │ ├── cs.c
│ │ ├── cs.h
│ │ ├── dma.c
│ │ ├── dma.h
│ │ ├── driverlib.h
│ │ ├── esi.c
│ │ ├── esi.h
│ │ ├── eusci_a_spi.c
│ │ ├── eusci_a_spi.h
│ │ ├── eusci_a_uart.c
│ │ ├── eusci_a_uart.h
│ │ ├── eusci_b_i2c.c
│ │ ├── eusci_b_i2c.h
│ │ ├── eusci_b_spi.c
│ │ ├── eusci_b_spi.h
│ │ ├── framctl.c
│ │ ├── framctl.h
│ │ ├── framctl_a.c
│ │ ├── framctl_a.h
│ │ ├── gpio.c
│ │ ├── gpio.h
│ │ ├── inc
│ │ ├── hw_memmap.h
│ │ └── version.h
│ │ ├── lcd_c.c
│ │ ├── lcd_c.h
│ │ ├── mpu.c
│ │ ├── mpu.h
│ │ ├── mpy32.c
│ │ ├── mpy32.h
│ │ ├── pmm.c
│ │ ├── pmm.h
│ │ ├── ram.c
│ │ ├── ram.h
│ │ ├── ref_a.c
│ │ ├── ref_a.h
│ │ ├── rtc_b.c
│ │ ├── rtc_b.h
│ │ ├── rtc_c.c
│ │ ├── rtc_c.h
│ │ ├── sfr.c
│ │ ├── sfr.h
│ │ ├── sysctl.c
│ │ ├── sysctl.h
│ │ ├── timer_a.c
│ │ ├── timer_a.h
│ │ ├── timer_b.c
│ │ ├── timer_b.h
│ │ ├── tlv.c
│ │ ├── tlv.h
│ │ ├── wdt_a.c
│ │ └── wdt_a.h
│ ├── embedded_printf.c
│ ├── embedded_printf.h
│ ├── lnk_msp430fr6989.cmd
│ ├── main.c
│ ├── serial_conf.c
│ ├── serial_conf.h
│ └── targetConfigs
│ ├── MSP430FR6989.ccxml
│ └── readme.txt
├── LICENSE
├── README.md
├── highpass_plot.jpg
└── lowpass_plot.jpg
/DSP_and_Math.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/agaelema/DSP_and_Math/d6c0a8531e11e4ba48ea6e0db764a71e5722e07c/DSP_and_Math.h
--------------------------------------------------------------------------------
/Examples/Arduino/DSP_Math_lib_-_Test_Arduino_-_Goertzel_DFT/DSP_Math_lib_-_Test_Arduino_-_Goertzel_DFT.ino:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Arduino (UNO) - Goertzel DFT
3 | * - Generate a sine wave and use Goertzel algorithm to calculate harmonics
4 | *
5 | * Author: Haroldo Amaral - agaelema@gmail.com
6 | * 2017/09/19
7 | ******************************************************************************/
8 | #include "DSP_and_Math.h"
9 |
10 | /******************************************************************************
11 | * Serial plotter separator
12 | ******************************************************************************/
13 | #define SEPARATOR (' ') // used to separate plotted values - Arduino Serial plotter
14 | //#define SEPARATOR (',') // used to separate plotted values - Other Serial plotter
15 |
16 | #define PI 3.141592653589793f
17 |
18 | /******************************************************************************
19 | * Define parameters of simulated wave
20 | ******************************************************************************/
21 | #define WAVE_DC_LEVEL 0.0f // DC offset
22 | #define WAVE_AMPLITUDE 100.0f // Peak voltage
23 | #define WAVE_POINTS 64 // points peer cycles
24 |
25 | float sample_original = 0;
26 | float array_sample_original[WAVE_POINTS];
27 |
28 | uint16_t counter = 0;
29 |
30 | /******************************************************************************
31 | * Initialize structures to waveform
32 | ******************************************************************************/
33 | sine_wave_parameters sine1th = {0};
34 | sine_wave_parameters sine8th = {0};
35 |
36 | /******************************************************************************
37 | * Initialize structures to save goertzel parameters
38 | ******************************************************************************/
39 | goertzel_array_float_t goertzel_01_01th;
40 | goertzel_array_float_t goertzel_01_08th;
41 |
42 |
43 | void setup()
44 | {
45 | Serial.begin(9600);
46 |
47 | /*
48 | * Create and initialize wave struct parameters
49 | */
50 | sineWaveGen_bySample_Init(&sine1th, 1.0f, 0, WAVE_AMPLITUDE, WAVE_DC_LEVEL, WAVE_POINTS, WAVEGEN_CLEAN);
51 | sineWaveGen_bySample_Init(&sine8th, 8.0f, 0, WAVE_AMPLITUDE/16, 0, WAVE_POINTS, WAVEGEN_CLEAN);
52 |
53 | /*************************************
54 | * Initialize Goertzel structures
55 | *************************************/
56 | goertzelArrayInit_Float(&goertzel_01_01th, 1, 64);
57 | goertzelArrayInit_Float(&goertzel_01_08th, 8, 64);
58 | }
59 |
60 | void loop()
61 | {
62 | if(counter < WAVE_POINTS)
63 | {
64 |
65 | /*************************************
66 | * Generate a test signal - sine wave
67 | *************************************/
68 | /* fundamental sine wave */
69 | sample_original = sineWaveGen_GetSample(&sine1th);
70 | /* 8th harmonic sine wave - sum with original wave */
71 | sample_original += sineWaveGen_GetSample(&sine8th);
72 |
73 |
74 | array_sample_original[counter] = (float)sample_original;
75 |
76 | counter++;
77 | }
78 | else /* after the last point reset variables */
79 | {
80 | counter = 0; // reset counter
81 |
82 | /* Goertzel DFT of an array */
83 | goertzelArrayFloat_Float(&goertzel_01_01th, array_sample_original);
84 | goertzelArrayFloat_Float(&goertzel_01_08th, array_sample_original);
85 |
86 | Serial.print(" Goertzel Array -");
87 | Serial.print(" 1th: "); Serial.print(goertzel_01_01th.result, 2);
88 | Serial.print(" 8th: "); Serial.print(goertzel_01_08th.result, 2);
89 |
90 | Serial.print("\r\n");
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/Examples/Arduino/DSP_Math_lib_-_Test_Arduino_-_Goertzel_DFT/DSP_and_Math.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/agaelema/DSP_and_Math/d6c0a8531e11e4ba48ea6e0db764a71e5722e07c/Examples/Arduino/DSP_Math_lib_-_Test_Arduino_-_Goertzel_DFT/DSP_and_Math.h
--------------------------------------------------------------------------------
/Examples/Arduino/DSP_Math_lib_-_Test_Arduino_-_High_Pass/DSP_and_Math.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/agaelema/DSP_and_Math/d6c0a8531e11e4ba48ea6e0db764a71e5722e07c/Examples/Arduino/DSP_Math_lib_-_Test_Arduino_-_High_Pass/DSP_and_Math.h
--------------------------------------------------------------------------------
/Examples/Arduino/DSP_Math_lib_-_Test_Arduino_-_Low_Pass/DSP_and_Math.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/agaelema/DSP_and_Math/d6c0a8531e11e4ba48ea6e0db764a71e5722e07c/Examples/Arduino/DSP_Math_lib_-_Test_Arduino_-_Low_Pass/DSP_and_Math.h
--------------------------------------------------------------------------------
/Examples/Arduino/DSP_Math_lib_-_Test_Arduino_-_RMS_Value/DSP_Math_lib_-_Test_Arduino_-_RMS_Value.ino:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Arduino (UNO) - RMS value
3 | * - Generate a sine wave with (or withoud) DC level and calculate the RMS value
4 | * - test of versions
5 | * Array based, sample by sample
6 | *
7 | * Author: Haroldo Amaral - agaelema@gmail.com
8 | * 2017/09/19
9 | ******************************************************************************/
10 | #include "DSP_and_Math.h"
11 |
12 | /******************************************************************************
13 | * Serial plotter separator
14 | ******************************************************************************/
15 | #define SEPARATOR (' ') // used to separate plotted values - Arduino Serial plotter
16 | //#define SEPARATOR (',') // used to separate plotted values - Other Serial plotter
17 |
18 | #define PI 3.141592653589793f
19 |
20 | /******************************************************************************
21 | * Define parameters of simulated wave
22 | ******************************************************************************/
23 | #define WAVE_DC_LEVEL 0.0f // DC offset
24 | #define WAVE_AMPLITUDE 100.0f // Peak voltage
25 | #define WAVE_POINTS 64 // points peer cycles
26 |
27 | float sample_original = 0;
28 | int16_t sample_original_int16 = 0;
29 | float array_sample_original[WAVE_POINTS];
30 |
31 | volatile float sample_no_DC = 0;
32 |
33 | uint16_t counter = 0;
34 |
35 | /******************************************************************************
36 | * Initialize structures to waveform
37 | ******************************************************************************/
38 | sine_wave_parameters sine1th = {0};
39 | sine_wave_parameters sine8th = {0};
40 |
41 | /******************************************************************************
42 | * Initialize structures to save filter parameters
43 | ******************************************************************************/
44 | rms_float_t rms_teste_float = {0};
45 | rms_int16_t rms_teste_int16 = {0};
46 |
47 | void setup()
48 | {
49 | Serial.begin(9600);
50 |
51 | /*
52 | * Create and initialize wave struct parameters
53 | */
54 | sineWaveGen_bySample_Init(&sine1th, 1.0f, 0, WAVE_AMPLITUDE, WAVE_DC_LEVEL, WAVE_POINTS, WAVEGEN_CLEAN);
55 | sineWaveGen_bySample_Init(&sine8th, 8.0f, 0, WAVE_AMPLITUDE/16, 0, WAVE_POINTS, WAVEGEN_CLEAN);
56 | }
57 |
58 | void loop()
59 | {
60 | if(counter < WAVE_POINTS)
61 | {
62 | /*************************************
63 | * Generate a test signal - sine wave
64 | *************************************/
65 | /* fundamental sine wave */
66 | sample_original = sineWaveGen_GetSample(&sine1th);
67 | // /* 8th harmonic sine wave - sum with original wave */
68 | // sample_original += sineWaveGen_GetSample(&sine8th);
69 |
70 |
71 | array_sample_original[counter] = (float)sample_original;
72 | sample_original_int16 = (int16_t)sample_original;
73 |
74 | /* add new sample to RMS struct */
75 | rmsValueAddSample_Float(&rms_teste_float, sample_original);
76 |
77 | counter++;
78 | }
79 | else /* after the last point reset variables */
80 | {
81 | counter = 0; // reset counter
82 |
83 | volatile float rms_test_float = 0;
84 | /************************************************
85 | * test both methods to calculate RMS value
86 | * - by an entire array
87 | * - sample by sample (separate finalization
88 | ************************************************/
89 |
90 | /* finalize the math by sample */
91 | rmsValueCalcRmsStdMath_Float(&rms_teste_float);
92 | rms_test_float = rms_teste_float.rmsValue;
93 | Serial.print("RMS sample by sample: "); Serial.print(rms_test_float, 4); Serial.print(" ");
94 |
95 | /* calculate rms - version array input */
96 | rms_test_float = rmsValueArray_Float_StdMath(array_sample_original, WAVE_POINTS, 0);
97 | Serial.print("RMS of Array: "); Serial.println(rms_test_float, 4);
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/Examples/Arduino/DSP_Math_lib_-_Test_Arduino_-_RMS_Value/DSP_and_Math.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/agaelema/DSP_and_Math/d6c0a8531e11e4ba48ea6e0db764a71e5722e07c/Examples/Arduino/DSP_Math_lib_-_Test_Arduino_-_RMS_Value/DSP_and_Math.h
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/.ccsproject:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT
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 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/.settings/org.eclipse.cdt.codan.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | inEditor=false
3 | onBuild=false
4 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/.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 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/.settings/org.eclipse.core.resources.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | encoding//Debug/driverlib/MSP430FR5xx_6xx/subdir_rules.mk=UTF-8
3 | encoding//Debug/driverlib/MSP430FR5xx_6xx/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 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/DSP_and_Math.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/agaelema/DSP_and_Math/d6c0a8531e11e4ba48ea6e0db764a71e5722e07c/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/DSP_and_Math.h
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/Debug/ccsObjs.opt:
--------------------------------------------------------------------------------
1 | "./DSP_and_Math.obj" "./embedded_printf.obj" "./main.obj" "./serial_conf.obj" "./driverlib/MSP430FR5xx_6xx/adc12_b.obj" "./driverlib/MSP430FR5xx_6xx/aes256.obj" "./driverlib/MSP430FR5xx_6xx/comp_e.obj" "./driverlib/MSP430FR5xx_6xx/crc.obj" "./driverlib/MSP430FR5xx_6xx/crc32.obj" "./driverlib/MSP430FR5xx_6xx/cs.obj" "./driverlib/MSP430FR5xx_6xx/dma.obj" "./driverlib/MSP430FR5xx_6xx/esi.obj" "./driverlib/MSP430FR5xx_6xx/eusci_a_spi.obj" "./driverlib/MSP430FR5xx_6xx/eusci_a_uart.obj" "./driverlib/MSP430FR5xx_6xx/eusci_b_i2c.obj" "./driverlib/MSP430FR5xx_6xx/eusci_b_spi.obj" "./driverlib/MSP430FR5xx_6xx/framctl.obj" "./driverlib/MSP430FR5xx_6xx/framctl_a.obj" "./driverlib/MSP430FR5xx_6xx/gpio.obj" "./driverlib/MSP430FR5xx_6xx/lcd_c.obj" "./driverlib/MSP430FR5xx_6xx/mpu.obj" "./driverlib/MSP430FR5xx_6xx/mpy32.obj" "./driverlib/MSP430FR5xx_6xx/pmm.obj" "./driverlib/MSP430FR5xx_6xx/ram.obj" "./driverlib/MSP430FR5xx_6xx/ref_a.obj" "./driverlib/MSP430FR5xx_6xx/rtc_b.obj" "./driverlib/MSP430FR5xx_6xx/rtc_c.obj" "./driverlib/MSP430FR5xx_6xx/sfr.obj" "./driverlib/MSP430FR5xx_6xx/sysctl.obj" "./driverlib/MSP430FR5xx_6xx/timer_a.obj" "./driverlib/MSP430FR5xx_6xx/timer_b.obj" "./driverlib/MSP430FR5xx_6xx/tlv.obj" "./driverlib/MSP430FR5xx_6xx/wdt_a.obj" "../lnk_msp430fr6989.cmd" -llibmpu_init.a -llibmath.a -llibc.a
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/Debug/objects.mk:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | # Automatically-generated file. Do not edit!
3 | ################################################################################
4 |
5 | USER_OBJS :=
6 |
7 | LIBS := -llibmpu_init.a -llibmath.a -llibc.a
8 |
9 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/Debug/sources.mk:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | # Automatically-generated file. Do not edit!
3 | ################################################################################
4 |
5 | C55_SRCS :=
6 | A_SRCS :=
7 | ASM_UPPER_SRCS :=
8 | EXE_SRCS :=
9 | LDS_UPPER_SRCS :=
10 | CPP_SRCS :=
11 | CMD_SRCS :=
12 | O_SRCS :=
13 | ELF_SRCS :=
14 | C??_SRCS :=
15 | C64_SRCS :=
16 | C67_SRCS :=
17 | SA_SRCS :=
18 | S64_SRCS :=
19 | OPT_SRCS :=
20 | CXX_SRCS :=
21 | S67_SRCS :=
22 | S??_SRCS :=
23 | PDE_SRCS :=
24 | SV7A_SRCS :=
25 | K_SRCS :=
26 | CLA_SRCS :=
27 | S55_SRCS :=
28 | LD_UPPER_SRCS :=
29 | OUT_SRCS :=
30 | INO_SRCS :=
31 | LIB_SRCS :=
32 | ASM_SRCS :=
33 | S_UPPER_SRCS :=
34 | S43_SRCS :=
35 | LD_SRCS :=
36 | CMD_UPPER_SRCS :=
37 | C_UPPER_SRCS :=
38 | C++_SRCS :=
39 | C43_SRCS :=
40 | OBJ_SRCS :=
41 | LDS_SRCS :=
42 | S_SRCS :=
43 | CC_SRCS :=
44 | S62_SRCS :=
45 | C62_SRCS :=
46 | C_SRCS :=
47 | C55_DEPS :=
48 | C_UPPER_DEPS :=
49 | S67_DEPS :=
50 | S62_DEPS :=
51 | S_DEPS :=
52 | OPT_DEPS :=
53 | C??_DEPS :=
54 | ASM_UPPER_DEPS :=
55 | S??_DEPS :=
56 | C64_DEPS :=
57 | CXX_DEPS :=
58 | S64_DEPS :=
59 | INO_DEPS :=
60 | CLA_DEPS :=
61 | S55_DEPS :=
62 | SV7A_DEPS :=
63 | EXE_OUTPUTS :=
64 | C62_DEPS :=
65 | C67_DEPS :=
66 | PDE_DEPS :=
67 | K_DEPS :=
68 | C_DEPS :=
69 | CC_DEPS :=
70 | BIN_OUTPUTS :=
71 | C++_DEPS :=
72 | C43_DEPS :=
73 | S43_DEPS :=
74 | OBJS :=
75 | ASM_DEPS :=
76 | S_UPPER_DEPS :=
77 | CPP_DEPS :=
78 | SA_DEPS :=
79 | C++_DEPS__QUOTED :=
80 | OPT_DEPS__QUOTED :=
81 | S_UPPER_DEPS__QUOTED :=
82 | SA_DEPS__QUOTED :=
83 | C??_DEPS__QUOTED :=
84 | S67_DEPS__QUOTED :=
85 | C55_DEPS__QUOTED :=
86 | CC_DEPS__QUOTED :=
87 | ASM_UPPER_DEPS__QUOTED :=
88 | SV7A_DEPS__QUOTED :=
89 | S??_DEPS__QUOTED :=
90 | OBJS__QUOTED :=
91 | C67_DEPS__QUOTED :=
92 | K_DEPS__QUOTED :=
93 | S55_DEPS__QUOTED :=
94 | INO_DEPS__QUOTED :=
95 | C62_DEPS__QUOTED :=
96 | C_DEPS__QUOTED :=
97 | C_UPPER_DEPS__QUOTED :=
98 | C43_DEPS__QUOTED :=
99 | CPP_DEPS__QUOTED :=
100 | BIN_OUTPUTS__QUOTED :=
101 | C64_DEPS__QUOTED :=
102 | CXX_DEPS__QUOTED :=
103 | CLA_DEPS__QUOTED :=
104 | S_DEPS__QUOTED :=
105 | ASM_DEPS__QUOTED :=
106 | S43_DEPS__QUOTED :=
107 | EXE_OUTPUTS__QUOTED :=
108 | S64_DEPS__QUOTED :=
109 | S62_DEPS__QUOTED :=
110 | PDE_DEPS__QUOTED :=
111 |
112 | # Every subdirectory with source files must be described here
113 | SUBDIRS := \
114 | . \
115 | driverlib/MSP430FR5xx_6xx \
116 |
117 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/Debug/subdir_rules.mk:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | # Automatically-generated file. Do not edit!
3 | ################################################################################
4 |
5 | SHELL = cmd.exe
6 |
7 | # Each subdirectory must supply rules for building sources it contributes
8 | DSP_and_Math.obj: ../DSP_and_Math.c $(GEN_OPTS) | $(GEN_HDRS)
9 | @echo 'Building file: $<'
10 | @echo 'Invoking: MSP430 Compiler'
11 | "C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/bin/cl430" -vmspx --data_model=restricted -O0 --opt_for_speed=1 --use_hw_mpy=F5 --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/driverlib/MSP430FR5xx_6xx" --include_path="C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include" --advice:power="none" --advice:hw_config=all --define=DEPRECATED --define=__MSP430FR6989__ --define=_MPU_ENABLE -g --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --preproc_with_compile --preproc_dependency="DSP_and_Math.d_raw" $(GEN_OPTS__FLAG) "$<"
12 | @echo 'Finished building: $<'
13 | @echo ' '
14 |
15 | embedded_printf.obj: ../embedded_printf.c $(GEN_OPTS) | $(GEN_HDRS)
16 | @echo 'Building file: $<'
17 | @echo 'Invoking: MSP430 Compiler'
18 | "C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/bin/cl430" -vmspx --data_model=restricted -O0 --opt_for_speed=1 --use_hw_mpy=F5 --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/driverlib/MSP430FR5xx_6xx" --include_path="C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include" --advice:power="none" --advice:hw_config=all --define=DEPRECATED --define=__MSP430FR6989__ --define=_MPU_ENABLE -g --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --preproc_with_compile --preproc_dependency="embedded_printf.d_raw" $(GEN_OPTS__FLAG) "$<"
19 | @echo 'Finished building: $<'
20 | @echo ' '
21 |
22 | main.obj: ../main.c $(GEN_OPTS) | $(GEN_HDRS)
23 | @echo 'Building file: $<'
24 | @echo 'Invoking: MSP430 Compiler'
25 | "C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/bin/cl430" -vmspx --data_model=restricted -O0 --opt_for_speed=1 --use_hw_mpy=F5 --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/driverlib/MSP430FR5xx_6xx" --include_path="C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include" --advice:power="none" --advice:hw_config=all --define=DEPRECATED --define=__MSP430FR6989__ --define=_MPU_ENABLE -g --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --preproc_with_compile --preproc_dependency="main.d_raw" $(GEN_OPTS__FLAG) "$<"
26 | @echo 'Finished building: $<'
27 | @echo ' '
28 |
29 | serial_conf.obj: ../serial_conf.c $(GEN_OPTS) | $(GEN_HDRS)
30 | @echo 'Building file: $<'
31 | @echo 'Invoking: MSP430 Compiler'
32 | "C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/bin/cl430" -vmspx --data_model=restricted -O0 --opt_for_speed=1 --use_hw_mpy=F5 --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/driverlib/MSP430FR5xx_6xx" --include_path="C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include" --advice:power="none" --advice:hw_config=all --define=DEPRECATED --define=__MSP430FR6989__ --define=_MPU_ENABLE -g --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --preproc_with_compile --preproc_dependency="serial_conf.d_raw" $(GEN_OPTS__FLAG) "$<"
33 | @echo 'Finished building: $<'
34 | @echo ' '
35 |
36 |
37 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/Debug/subdir_vars.mk:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | # Automatically-generated file. Do not edit!
3 | ################################################################################
4 |
5 | SHELL = cmd.exe
6 |
7 | # Add inputs and outputs from these tool invocations to the build variables
8 | CMD_SRCS += \
9 | ../lnk_msp430fr6989.cmd
10 |
11 | C_SRCS += \
12 | ../DSP_and_Math.c \
13 | ../embedded_printf.c \
14 | ../main.c \
15 | ../serial_conf.c
16 |
17 | C_DEPS += \
18 | ./DSP_and_Math.d \
19 | ./embedded_printf.d \
20 | ./main.d \
21 | ./serial_conf.d
22 |
23 | OBJS += \
24 | ./DSP_and_Math.obj \
25 | ./embedded_printf.obj \
26 | ./main.obj \
27 | ./serial_conf.obj
28 |
29 | OBJS__QUOTED += \
30 | "DSP_and_Math.obj" \
31 | "embedded_printf.obj" \
32 | "main.obj" \
33 | "serial_conf.obj"
34 |
35 | C_DEPS__QUOTED += \
36 | "DSP_and_Math.d" \
37 | "embedded_printf.d" \
38 | "main.d" \
39 | "serial_conf.d"
40 |
41 | C_SRCS__QUOTED += \
42 | "../DSP_and_Math.c" \
43 | "../embedded_printf.c" \
44 | "../main.c" \
45 | "../serial_conf.c"
46 |
47 |
48 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/driverlib/MSP430FR5xx_6xx/crc.c:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | //
34 | // crc.c - Driver for the crc Module.
35 | //
36 | //*****************************************************************************
37 |
38 | //*****************************************************************************
39 | //
40 | //! \addtogroup crc_api crc
41 | //! @{
42 | //
43 | //*****************************************************************************
44 |
45 | #include "inc/hw_memmap.h"
46 |
47 | #ifdef __MSP430_HAS_CRC__
48 | #include "crc.h"
49 |
50 | #include
51 |
52 | void CRC_setSeed(uint16_t baseAddress,
53 | uint16_t seed)
54 | {
55 | HWREG16(baseAddress + OFS_CRCINIRES) = seed;
56 | }
57 |
58 | void CRC_set16BitData(uint16_t baseAddress,
59 | uint16_t dataIn)
60 | {
61 | HWREG16(baseAddress + OFS_CRCDI) = dataIn;
62 | }
63 |
64 | void CRC_set8BitData(uint16_t baseAddress,
65 | uint8_t dataIn)
66 | {
67 | HWREG8(baseAddress + OFS_CRCDI_L) = dataIn;
68 | }
69 |
70 | void CRC_set16BitDataReversed(uint16_t baseAddress,
71 | uint16_t dataIn)
72 | {
73 | HWREG16(baseAddress + OFS_CRCDIRB) = dataIn;
74 | }
75 |
76 | void CRC_set8BitDataReversed(uint16_t baseAddress,
77 | uint8_t dataIn)
78 | {
79 | HWREG8(baseAddress + OFS_CRCDIRB_L) = dataIn;
80 | }
81 |
82 | uint16_t CRC_getData(uint16_t baseAddress)
83 | {
84 | return (HWREG16(baseAddress + OFS_CRCDI));
85 | }
86 |
87 | uint16_t CRC_getResult(uint16_t baseAddress)
88 | {
89 | return (HWREG16(baseAddress + OFS_CRCINIRES));
90 | }
91 |
92 | uint16_t CRC_getResultBitsReversed(uint16_t baseAddress)
93 | {
94 | return (HWREG16(baseAddress + OFS_CRCRESR));
95 | }
96 |
97 | #endif
98 | //*****************************************************************************
99 | //
100 | //! Close the doxygen group for crc_api
101 | //! @}
102 | //
103 | //*****************************************************************************
104 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/driverlib/MSP430FR5xx_6xx/driverlib.h:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | #include "inc/hw_memmap.h"
33 |
34 | #include "adc12_b.h"
35 | #include "aes256.h"
36 | #include "comp_e.h"
37 | #include "crc.h"
38 | #include "crc32.h"
39 | #include "cs.h"
40 | #include "dma.h"
41 | #include "esi.h"
42 | #include "eusci_a_spi.h"
43 | #include "eusci_a_uart.h"
44 | #include "eusci_b_i2c.h"
45 | #include "eusci_b_spi.h"
46 | #include "framctl.h"
47 | #include "framctl_a.h"
48 | #include "gpio.h"
49 | #include "lcd_c.h"
50 | #include "mpu.h"
51 | #include "mpy32.h"
52 | #include "pmm.h"
53 | #include "ram.h"
54 | #include "ref_a.h"
55 | #include "rtc_b.h"
56 | #include "rtc_c.h"
57 | #include "sfr.h"
58 | #include "sysctl.h"
59 | #include "timer_a.h"
60 | #include "timer_b.h"
61 | #include "tlv.h"
62 | #include "wdt_a.h"
63 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/driverlib/MSP430FR5xx_6xx/inc/hw_memmap.h:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | #ifndef __HW_MEMMAP__
33 | #define __HW_MEMMAP__
34 |
35 | #define __DRIVERLIB_MSP430FR5XX_6XX_FAMILY__
36 | //*****************************************************************************
37 | //
38 | // Include device specific header file
39 | //
40 | //*****************************************************************************
41 | #include
42 |
43 | #ifndef __AUTOGENERATED__
44 | #include "msp430fr5xx_6xxgeneric.h"
45 | #endif
46 |
47 | #include "stdint.h"
48 | #include "stdbool.h"
49 |
50 | //*****************************************************************************
51 | //
52 | // SUCCESS and FAILURE for API return value
53 | //
54 | //*****************************************************************************
55 | #define STATUS_SUCCESS 0x01
56 | #define STATUS_FAIL 0x00
57 |
58 | //*****************************************************************************
59 | //
60 | // Macro for enabling assert statements for debugging
61 | //
62 | //*****************************************************************************
63 | #define NDEBUG
64 |
65 | //*****************************************************************************
66 | //
67 | // Macros for hardware access
68 | //
69 | //*****************************************************************************
70 | #define HWREG32(x) \
71 | (*((volatile uint32_t *)((uint16_t)x)))
72 | #define HWREG16(x) \
73 | (*((volatile uint16_t *)((uint16_t)x)))
74 | #define HWREG8(x) \
75 | (*((volatile uint8_t *)((uint16_t)x)))
76 |
77 | #endif // #ifndef __HW_MEMMAP__
78 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/driverlib/MSP430FR5xx_6xx/inc/version.h:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | #ifndef __DRIVERLIB_VERSION__
33 | #define DRIVERLIB_VER_MAJOR 2
34 | #define DRIVERLIB_VER_MINOR 80
35 | #define DRIVERLIB_VER_PATCH 00
36 | #define DRIVERLIB_VER_BUILD 01
37 | #endif
38 |
39 | #define getVersion() ((uint32_t)DRIVERLIB_VER_MAJOR << 24 | \
40 | (uint32_t)DRIVERLIB_VER_MINOR << 16 | \
41 | (uint32_t)DRIVERLIB_VER_PATCH << 8 | \
42 | (uint32_t)DRIVERLIB_VER_BUILD)
43 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/driverlib/MSP430FR5xx_6xx/pmm.c:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | //
34 | // pmm.c - Driver for the pmm Module.
35 | //
36 | //*****************************************************************************
37 |
38 | //*****************************************************************************
39 | //
40 | //! \addtogroup pmm_api pmm
41 | //! @{
42 | //
43 | //*****************************************************************************
44 |
45 | #include "inc/hw_memmap.h"
46 |
47 | #ifdef __MSP430_HAS_PMM_FRAM__
48 | #include "pmm.h"
49 |
50 | #include
51 |
52 | void PMM_enableSVSH(void)
53 | {
54 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
55 | HWREG8(PMM_BASE + OFS_PMMCTL0_L) |= SVSHE;
56 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
57 | }
58 |
59 | void PMM_disableSVSH(void)
60 | {
61 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
62 | HWREG8(PMM_BASE + OFS_PMMCTL0_L) &= ~SVSHE;
63 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
64 | }
65 |
66 | void PMM_turnOnRegulator(void)
67 | {
68 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
69 | HWREG8(PMM_BASE + OFS_PMMCTL0) &= ~PMMREGOFF;
70 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
71 | }
72 |
73 | void PMM_turnOffRegulator(void)
74 | {
75 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
76 | HWREG8(PMM_BASE + OFS_PMMCTL0) |= PMMREGOFF;
77 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
78 | }
79 |
80 | void PMM_trigPOR(void)
81 | {
82 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
83 | HWREG8(PMM_BASE + OFS_PMMCTL0) |= PMMSWPOR;
84 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
85 | }
86 |
87 | void PMM_trigBOR(void)
88 | {
89 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
90 | HWREG8(PMM_BASE + OFS_PMMCTL0) |= PMMSWBOR;
91 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
92 | }
93 |
94 | void PMM_clearInterrupt(uint16_t mask)
95 | {
96 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
97 | HWREG16(PMM_BASE + OFS_PMMIFG) &= ~mask;
98 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
99 | }
100 |
101 | uint16_t PMM_getInterruptStatus(uint16_t mask)
102 | {
103 | return ((HWREG16(PMM_BASE + OFS_PMMIFG)) & mask);
104 | }
105 |
106 | void PMM_unlockLPM5(void)
107 | {
108 | //Direct register access to avoid compiler warining - #10420-D
109 | //For FRAM devices, at start up, the GPO power-on default
110 | //high-impedance mode needs to be disabled to activate previously
111 | //configured port settings. This can be done by clearing the LOCKLPM5
112 | //bit in PM5CTL0 registe
113 |
114 | PM5CTL0 &= ~LOCKLPM5;
115 | }
116 |
117 | #endif
118 | //*****************************************************************************
119 | //
120 | //! Close the doxygen group for pmm_api
121 | //! @}
122 | //
123 | //*****************************************************************************
124 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/driverlib/MSP430FR5xx_6xx/ram.c:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | //
34 | // ram.c - Driver for the ram Module.
35 | //
36 | //*****************************************************************************
37 |
38 | //*****************************************************************************
39 | //
40 | //! \addtogroup ram_api ram
41 | //! @{
42 | //
43 | //*****************************************************************************
44 |
45 | #include "inc/hw_memmap.h"
46 |
47 | #ifdef __MSP430_HAS_RC_FRAM__
48 | #include "ram.h"
49 |
50 | #include
51 |
52 | void RAM_setSectorOff(uint8_t sector,
53 | uint8_t mode)
54 | {
55 | uint8_t sectorPos = sector << 1;
56 | uint8_t val = HWREG8(RAM_BASE + OFS_RCCTL0_L) & ~(0x3 << sectorPos);
57 |
58 | HWREG16(RAM_BASE + OFS_RCCTL0) = (RCKEY | val | (mode << sectorPos));
59 | }
60 |
61 | uint8_t RAM_getSectorState(uint8_t sector)
62 | {
63 | uint8_t sectorPos = sector << 1;
64 | return((HWREG8(RAM_BASE + OFS_RCCTL0_L) & (0x3 << sectorPos)) >> sectorPos);
65 | }
66 |
67 | #endif
68 | //*****************************************************************************
69 | //
70 | //! Close the doxygen group for ram_api
71 | //! @}
72 | //
73 | //*****************************************************************************
74 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/driverlib/MSP430FR5xx_6xx/sfr.c:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | //
34 | // sfr.c - Driver for the sfr Module.
35 | //
36 | //*****************************************************************************
37 |
38 | //*****************************************************************************
39 | //
40 | //! \addtogroup sfr_api sfr
41 | //! @{
42 | //
43 | //*****************************************************************************
44 |
45 | #include "inc/hw_memmap.h"
46 |
47 | #ifdef __MSP430_HAS_SFR__
48 | #include "sfr.h"
49 |
50 | #include
51 |
52 | void SFR_enableInterrupt(uint8_t interruptMask)
53 | {
54 | HWREG8(SFR_BASE + OFS_SFRIE1_L) |= interruptMask;
55 | }
56 |
57 | void SFR_disableInterrupt(uint8_t interruptMask)
58 | {
59 | HWREG8(SFR_BASE + OFS_SFRIE1_L) &= ~(interruptMask);
60 | }
61 |
62 | uint8_t SFR_getInterruptStatus(uint8_t interruptFlagMask)
63 | {
64 | return (HWREG8(SFR_BASE + OFS_SFRIFG1_L) & interruptFlagMask);
65 | }
66 |
67 | void SFR_clearInterrupt(uint8_t interruptFlagMask)
68 | {
69 | HWREG8(SFR_BASE + OFS_SFRIFG1_L) &= ~(interruptFlagMask);
70 | }
71 |
72 | void SFR_setResetPinPullResistor(uint16_t pullResistorSetup)
73 | {
74 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) &= ~(SYSRSTRE + SYSRSTUP);
75 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) |= pullResistorSetup;
76 | }
77 |
78 | void SFR_setNMIEdge(uint16_t edgeDirection)
79 | {
80 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) &= ~(SYSNMIIES);
81 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) |= edgeDirection;
82 | }
83 |
84 | void SFR_setResetNMIPinFunction(uint8_t resetPinFunction)
85 | {
86 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) &= ~(SYSNMI);
87 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) |= resetPinFunction;
88 | }
89 |
90 | #endif
91 | //*****************************************************************************
92 | //
93 | //! Close the doxygen group for sfr_api
94 | //! @}
95 | //
96 | //*****************************************************************************
97 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/driverlib/MSP430FR5xx_6xx/wdt_a.c:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | //
34 | // wdt_a.c - Driver for the wdt_a Module.
35 | //
36 | //*****************************************************************************
37 |
38 | //*****************************************************************************
39 | //
40 | //! \addtogroup wdt_a_api wdt_a
41 | //! @{
42 | //
43 | //*****************************************************************************
44 |
45 | #include "inc/hw_memmap.h"
46 |
47 | #ifdef __MSP430_HAS_WDT_A__
48 | #include "wdt_a.h"
49 |
50 | #include
51 |
52 | void WDT_A_hold(uint16_t baseAddress)
53 | {
54 | // Set Hold bit
55 | uint8_t newWDTStatus =
56 | ((HWREG16(baseAddress + OFS_WDTCTL) & 0x00FF) | WDTHOLD);
57 |
58 | HWREG16(baseAddress + OFS_WDTCTL) = WDTPW + newWDTStatus;
59 | }
60 |
61 | void WDT_A_start(uint16_t baseAddress)
62 | {
63 | // Reset Hold bit
64 | uint8_t newWDTStatus =
65 | ((HWREG16(baseAddress + OFS_WDTCTL) & 0x00FF) & ~(WDTHOLD));
66 |
67 | HWREG16(baseAddress + OFS_WDTCTL) = WDTPW + newWDTStatus;
68 | }
69 |
70 | void WDT_A_resetTimer(uint16_t baseAddress)
71 | {
72 | // Set Counter Clear bit
73 | uint8_t newWDTStatus =
74 | ((HWREG16(baseAddress + OFS_WDTCTL) & 0x00FF) | WDTCNTCL);
75 |
76 | HWREG16(baseAddress + OFS_WDTCTL) = WDTPW + newWDTStatus;
77 | }
78 |
79 | void WDT_A_initWatchdogTimer(uint16_t baseAddress,
80 | uint8_t clockSelect,
81 | uint8_t clockDivider)
82 | {
83 | HWREG16(baseAddress + OFS_WDTCTL) =
84 | WDTPW + WDTCNTCL + WDTHOLD + clockSelect + clockDivider;
85 | }
86 |
87 | void WDT_A_initIntervalTimer(uint16_t baseAddress,
88 | uint8_t clockSelect,
89 | uint8_t clockDivider)
90 | {
91 | HWREG16(baseAddress + OFS_WDTCTL) =
92 | WDTPW + WDTCNTCL + WDTHOLD + WDTTMSEL + clockSelect + clockDivider;
93 | }
94 |
95 | #endif
96 | //*****************************************************************************
97 | //
98 | //! Close the doxygen group for wdt_a_api
99 | //! @}
100 | //
101 | //*****************************************************************************
102 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/embedded_printf.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Embedded version of "printf( )" function
3 | * - with similar functions but more efficient
4 | *
5 | * author: Haroldo Amaral - agaelema@globo.com
6 | * v0.5 - 2017/08/20
7 | *
8 | * Based in this link:
9 | * http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/30479/107146
10 | ******************************************************************************
11 | * log: . change some "#ifdef" to "#if defined ( )"
12 | ******************************************************************************/
13 |
14 | #ifndef _EMBEDDED_PRINTF_
15 | #define _EMBEDDED_PRINTF_
16 |
17 | #include
18 | #include "serial_conf.h"
19 |
20 | /******************************************************************************
21 | * CONFIGURATIONS OF EMBEDDED_PRINTF
22 | * - select/uncomment desired options
23 | ******************************************************************************/
24 | #define ENABLE_PAD // enable padding in functions
25 | #define ENABLE_FLOAT // enable print float/double
26 | //#define PRECISION_FLOAT // select precision version - use double variable
27 | //#define ENABLE_EXTRA_DECIMAL_PLACE // enabled = 9 dp, disabled = 4 dp - depends of PRECISION_FLOAT
28 | #define ENABLE_BINARY // enable binary notation
29 |
30 |
31 | /******************************************************************************
32 | * PROTOTYPE OF FUNCTIONS
33 | ******************************************************************************/
34 | void putChar(uint8_t byte);
35 | void linesUp(unsigned int lines);
36 |
37 | unsigned int embedded_prints(char *string, unsigned int width, unsigned int pad);
38 | unsigned int embedded_ltoa(char *print_buf, int32_t input, unsigned int base, unsigned int sg, unsigned int width, unsigned int pad, unsigned char letbase);
39 |
40 | //#ifdef ENABLE_PAD
41 | //#define ENABLE_PAD_
42 | //#endif
43 |
44 | #if defined (ENABLE_PAD)
45 | #define ENABLE_PAD_
46 | #endif
47 |
48 |
49 | //#ifdef ENABLE_EXTRA_DECIMAL_PLACE
50 | //#define ENABLE_EXTRA_DECIMAL_PLACE_
51 | //#endif
52 |
53 | #if defined (ENABLE_EXTRA_DECIMAL_PLACE)
54 | #define ENABLE_EXTRA_DECIMAL_PLACE_
55 | #endif
56 |
57 | //#ifdef ENABLE_FLOAT
58 |
59 | #if defined (ENABLE_FLOAT)
60 |
61 | //#ifdef PRECISION_FLOAT
62 | #if defined (PRECISION_FLOAT)
63 | #define PRECISION_FLOAT_
64 | unsigned int embedded_ftoa(char *print_buf, double input, signed int dp, unsigned int sci);
65 | #else
66 | unsigned int embedded_ftoa(char *print_buf, float input, signed int dp, unsigned int sci);
67 | #endif
68 | #endif
69 |
70 | unsigned int embedded_printf(char *format, ...);
71 |
72 | unsigned int print_string(char *string);
73 | unsigned int print_long(long number);
74 | unsigned int print_ulong(unsigned long number);
75 | unsigned int print_hexa(long number);
76 |
77 | //#ifdef ENABLE_BINARY
78 | #if defined (ENABLE_BINARY)
79 | #define ENABLE_BINARY_
80 | unsigned int print_binary(long number, unsigned int bits);
81 | #endif
82 |
83 | //#ifdef ENABLE_FLOAT
84 | #if defined (ENABLE_FLOAT)
85 | #define ENABLE_FLOAT_
86 |
87 | //#ifdef PRECISION_FLOAT
88 | #if defined (PRECISION_FLOAT)
89 | #define PRECISION_FLOAT_
90 | unsigned int print_float(double number, int dp);
91 | unsigned int print_scientific(double number, int dp);
92 | #else
93 | unsigned int print_float(float number, int dp);
94 | unsigned int print_scientific(float number, int dp);
95 | #endif
96 | #endif
97 |
98 |
99 | #ifdef PRECISION_FLOAT_
100 | void embedded_string2number(unsigned char *string, double *number);
101 | #else
102 | void embedded_string2number(unsigned char *string, float *number);
103 | #endif
104 |
105 |
106 | /******************************************************************************
107 | * IMPORTANT DEFINITION
108 | ******************************************************************************/
109 | #define BINARY 2 // number identifier
110 | #define DECIMAL 10
111 | #define HEXADEC 16
112 |
113 | #define SIGNED 1 // if signed (+/-)
114 | #define NON_SIGNED 0 // just (+)
115 | #define NON_PAD 0 // without padding
116 | #define UPPER_CASE 'A'
117 | #define LOWER_CASE 'a'
118 |
119 | #define SCI 1 // scientific notation "xx.yyezz"
120 | #define NON_SCI 0 // standard notation "xx.yy"
121 |
122 | #define PAD_RIGHT 0x01 // right justified
123 | #define PAD_ZERO 0x02 // padding with zero "0"
124 |
125 | #define PRINT_BUF_LEN 36 // size of internal buffer to the conversion
126 |
127 | //#define WITH_LABEL 1
128 | //#define WITHOUT_LABEL 0
129 |
130 | #endif // end of _EMBEDDED_PRINTF_
131 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/serial_conf.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * "serial_conf.h" used in the embedded version of "printf" function
3 | *
4 | * author: Haroldo Amaral - agaelema@globo.com
5 | * v0.4 - 2017/09/04
6 | ******************************************************************************
7 | * log: . Modify initial version
8 | * + more defines to facilitate the configuration between devices
9 | * + change function "sendbyte" to "serial_sendbyte"
10 | * + add function to configure UART
11 | * + add exp430fr6989 uart back-channel (USCI_UCA1) - P3.4/P3.5
12 | * . change some "#ifdef" to "#if defined ( )"
13 | * + add 9600bps and 115200 at 8MHZ
14 | *
15 | ******************************************************************************/
16 |
17 | #ifndef _SERIAL_CONF_
18 | #define _SERIAL_CONF_
19 |
20 | /******************************************************************************
21 | * list of supported Microcontrollers and their serial USCI
22 | * - uncomment desired device/serial
23 | ******************************************************************************/
24 | //#define MSP430G2553_USCI_A0 // P1.1 and P1.2
25 | //#define MSP430FR6989_USCI_A0 // P2.0 and P2.1
26 | #define MSP430FR6989_USCI_A1 // onboard serial - P3.4 and P3.5
27 |
28 | /******************************************************************************
29 | * UART source of clock
30 | * - uncomment desired device/serial
31 | ******************************************************************************/
32 | //#define LFXT32K
33 | //#define SMCLK_DCO_1MHZ
34 | #define SMCLK_DCO_8MHZ
35 |
36 | /******************************************************************************
37 | * list of supported baudrates
38 | * - uncomment desired baudrate
39 | ******************************************************************************/
40 | //#define BAUD_9600
41 | #define BAUD_115200
42 |
43 | /******************************************************************************
44 | * Register version or Driverlib version
45 | * - select just one
46 | ******************************************************************************/
47 | #define REGISTER_VERSION
48 | //#define DRIVERLIB_VERSION
49 |
50 |
51 | /******************************************************************************
52 | * Supported microcontrollers
53 | * If you add a new device, do a pull request and help other users
54 | ******************************************************************************/
55 | #if defined (MSP430G2553_USCI_A0)
56 | #define MSP430
57 | #define G2553
58 | #define USCI_UCA0
59 |
60 | #elif defined (MSP430FR6989_USCI_A0)
61 | #define MSP430
62 | #define FR6989
63 | #define USCI_UCA0
64 |
65 | #elif defined (MSP430FR6989_USCI_A1)
66 | #define MSP430
67 | #define FR6989
68 | #define USCI_UCA1
69 |
70 | #else
71 | #error "Incorrect or invalid combination"
72 | #endif
73 |
74 |
75 |
76 |
77 | /******************************************************************************
78 | * Prototype of functions
79 | ******************************************************************************/
80 | void serial_configure(void);
81 | void serial_sendbyte(char byte);
82 |
83 | #endif // end of _SERIAL_CONF_
84 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/targetConfigs/MSP430FR6989.ccxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Goertzel_DFT/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.
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/.ccsproject:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/.launches/FR6989 - ADC12- ex2_sharedRef.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | DSP_Math_lib - Test EXP430FR6989 - High Pass
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 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/.settings/org.eclipse.cdt.codan.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | inEditor=false
3 | onBuild=false
4 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/.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 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/.settings/org.eclipse.core.resources.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | encoding//Debug/driverlib/MSP430FR5xx_6xx/subdir_rules.mk=UTF-8
3 | encoding//Debug/driverlib/MSP430FR5xx_6xx/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 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/DSP_and_Math.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/agaelema/DSP_and_Math/d6c0a8531e11e4ba48ea6e0db764a71e5722e07c/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/DSP_and_Math.h
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/Debug/ccsObjs.opt:
--------------------------------------------------------------------------------
1 | "./DSP_and_Math.obj" "./embedded_printf.obj" "./main.obj" "./serial_conf.obj" "./driverlib/MSP430FR5xx_6xx/adc12_b.obj" "./driverlib/MSP430FR5xx_6xx/aes256.obj" "./driverlib/MSP430FR5xx_6xx/comp_e.obj" "./driverlib/MSP430FR5xx_6xx/crc.obj" "./driverlib/MSP430FR5xx_6xx/crc32.obj" "./driverlib/MSP430FR5xx_6xx/cs.obj" "./driverlib/MSP430FR5xx_6xx/dma.obj" "./driverlib/MSP430FR5xx_6xx/esi.obj" "./driverlib/MSP430FR5xx_6xx/eusci_a_spi.obj" "./driverlib/MSP430FR5xx_6xx/eusci_a_uart.obj" "./driverlib/MSP430FR5xx_6xx/eusci_b_i2c.obj" "./driverlib/MSP430FR5xx_6xx/eusci_b_spi.obj" "./driverlib/MSP430FR5xx_6xx/framctl.obj" "./driverlib/MSP430FR5xx_6xx/framctl_a.obj" "./driverlib/MSP430FR5xx_6xx/gpio.obj" "./driverlib/MSP430FR5xx_6xx/lcd_c.obj" "./driverlib/MSP430FR5xx_6xx/mpu.obj" "./driverlib/MSP430FR5xx_6xx/mpy32.obj" "./driverlib/MSP430FR5xx_6xx/pmm.obj" "./driverlib/MSP430FR5xx_6xx/ram.obj" "./driverlib/MSP430FR5xx_6xx/ref_a.obj" "./driverlib/MSP430FR5xx_6xx/rtc_b.obj" "./driverlib/MSP430FR5xx_6xx/rtc_c.obj" "./driverlib/MSP430FR5xx_6xx/sfr.obj" "./driverlib/MSP430FR5xx_6xx/sysctl.obj" "./driverlib/MSP430FR5xx_6xx/timer_a.obj" "./driverlib/MSP430FR5xx_6xx/timer_b.obj" "./driverlib/MSP430FR5xx_6xx/tlv.obj" "./driverlib/MSP430FR5xx_6xx/wdt_a.obj" "../lnk_msp430fr6989.cmd" -llibmpu_init.a -llibmath.a -llibc.a
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/Debug/objects.mk:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | # Automatically-generated file. Do not edit!
3 | ################################################################################
4 |
5 | USER_OBJS :=
6 |
7 | LIBS := -llibmpu_init.a -llibmath.a -llibc.a
8 |
9 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/Debug/sources.mk:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | # Automatically-generated file. Do not edit!
3 | ################################################################################
4 |
5 | C55_SRCS :=
6 | A_SRCS :=
7 | ASM_UPPER_SRCS :=
8 | EXE_SRCS :=
9 | LDS_UPPER_SRCS :=
10 | CPP_SRCS :=
11 | CMD_SRCS :=
12 | O_SRCS :=
13 | ELF_SRCS :=
14 | C??_SRCS :=
15 | C64_SRCS :=
16 | C67_SRCS :=
17 | SA_SRCS :=
18 | S64_SRCS :=
19 | OPT_SRCS :=
20 | CXX_SRCS :=
21 | S67_SRCS :=
22 | S??_SRCS :=
23 | PDE_SRCS :=
24 | SV7A_SRCS :=
25 | K_SRCS :=
26 | CLA_SRCS :=
27 | S55_SRCS :=
28 | LD_UPPER_SRCS :=
29 | OUT_SRCS :=
30 | INO_SRCS :=
31 | LIB_SRCS :=
32 | ASM_SRCS :=
33 | S_UPPER_SRCS :=
34 | S43_SRCS :=
35 | LD_SRCS :=
36 | CMD_UPPER_SRCS :=
37 | C_UPPER_SRCS :=
38 | C++_SRCS :=
39 | C43_SRCS :=
40 | OBJ_SRCS :=
41 | LDS_SRCS :=
42 | S_SRCS :=
43 | CC_SRCS :=
44 | S62_SRCS :=
45 | C62_SRCS :=
46 | C_SRCS :=
47 | C55_DEPS :=
48 | C_UPPER_DEPS :=
49 | S67_DEPS :=
50 | S62_DEPS :=
51 | S_DEPS :=
52 | OPT_DEPS :=
53 | C??_DEPS :=
54 | ASM_UPPER_DEPS :=
55 | S??_DEPS :=
56 | C64_DEPS :=
57 | CXX_DEPS :=
58 | S64_DEPS :=
59 | INO_DEPS :=
60 | CLA_DEPS :=
61 | S55_DEPS :=
62 | SV7A_DEPS :=
63 | EXE_OUTPUTS :=
64 | C62_DEPS :=
65 | C67_DEPS :=
66 | PDE_DEPS :=
67 | K_DEPS :=
68 | C_DEPS :=
69 | CC_DEPS :=
70 | BIN_OUTPUTS :=
71 | C++_DEPS :=
72 | C43_DEPS :=
73 | S43_DEPS :=
74 | OBJS :=
75 | ASM_DEPS :=
76 | S_UPPER_DEPS :=
77 | CPP_DEPS :=
78 | SA_DEPS :=
79 | C++_DEPS__QUOTED :=
80 | OPT_DEPS__QUOTED :=
81 | S_UPPER_DEPS__QUOTED :=
82 | SA_DEPS__QUOTED :=
83 | C??_DEPS__QUOTED :=
84 | S67_DEPS__QUOTED :=
85 | C55_DEPS__QUOTED :=
86 | CC_DEPS__QUOTED :=
87 | ASM_UPPER_DEPS__QUOTED :=
88 | SV7A_DEPS__QUOTED :=
89 | S??_DEPS__QUOTED :=
90 | OBJS__QUOTED :=
91 | C67_DEPS__QUOTED :=
92 | K_DEPS__QUOTED :=
93 | S55_DEPS__QUOTED :=
94 | INO_DEPS__QUOTED :=
95 | C62_DEPS__QUOTED :=
96 | C_DEPS__QUOTED :=
97 | C_UPPER_DEPS__QUOTED :=
98 | C43_DEPS__QUOTED :=
99 | CPP_DEPS__QUOTED :=
100 | BIN_OUTPUTS__QUOTED :=
101 | C64_DEPS__QUOTED :=
102 | CXX_DEPS__QUOTED :=
103 | CLA_DEPS__QUOTED :=
104 | S_DEPS__QUOTED :=
105 | ASM_DEPS__QUOTED :=
106 | S43_DEPS__QUOTED :=
107 | EXE_OUTPUTS__QUOTED :=
108 | S64_DEPS__QUOTED :=
109 | S62_DEPS__QUOTED :=
110 | PDE_DEPS__QUOTED :=
111 |
112 | # Every subdirectory with source files must be described here
113 | SUBDIRS := \
114 | . \
115 | driverlib/MSP430FR5xx_6xx \
116 |
117 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/Debug/subdir_rules.mk:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | # Automatically-generated file. Do not edit!
3 | ################################################################################
4 |
5 | SHELL = cmd.exe
6 |
7 | # Each subdirectory must supply rules for building sources it contributes
8 | DSP_and_Math.obj: ../DSP_and_Math.c $(GEN_OPTS) | $(GEN_HDRS)
9 | @echo 'Building file: $<'
10 | @echo 'Invoking: MSP430 Compiler'
11 | "C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/bin/cl430" -vmspx --data_model=restricted -O0 --opt_for_speed=1 --use_hw_mpy=F5 --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - High Pass" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - High Pass/driverlib/MSP430FR5xx_6xx" --include_path="C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include" --advice:power="none" --advice:hw_config=all --define=DEPRECATED --define=__MSP430FR6989__ --define=_MPU_ENABLE -g --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --preproc_with_compile --preproc_dependency="DSP_and_Math.d_raw" $(GEN_OPTS__FLAG) "$<"
12 | @echo 'Finished building: $<'
13 | @echo ' '
14 |
15 | embedded_printf.obj: ../embedded_printf.c $(GEN_OPTS) | $(GEN_HDRS)
16 | @echo 'Building file: $<'
17 | @echo 'Invoking: MSP430 Compiler'
18 | "C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/bin/cl430" -vmspx --data_model=restricted -O0 --opt_for_speed=1 --use_hw_mpy=F5 --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - High Pass" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - High Pass/driverlib/MSP430FR5xx_6xx" --include_path="C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include" --advice:power="none" --advice:hw_config=all --define=DEPRECATED --define=__MSP430FR6989__ --define=_MPU_ENABLE -g --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --preproc_with_compile --preproc_dependency="embedded_printf.d_raw" $(GEN_OPTS__FLAG) "$<"
19 | @echo 'Finished building: $<'
20 | @echo ' '
21 |
22 | main.obj: ../main.c $(GEN_OPTS) | $(GEN_HDRS)
23 | @echo 'Building file: $<'
24 | @echo 'Invoking: MSP430 Compiler'
25 | "C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/bin/cl430" -vmspx --data_model=restricted -O0 --opt_for_speed=1 --use_hw_mpy=F5 --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - High Pass" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - High Pass/driverlib/MSP430FR5xx_6xx" --include_path="C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include" --advice:power="none" --advice:hw_config=all --define=DEPRECATED --define=__MSP430FR6989__ --define=_MPU_ENABLE -g --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --preproc_with_compile --preproc_dependency="main.d_raw" $(GEN_OPTS__FLAG) "$<"
26 | @echo 'Finished building: $<'
27 | @echo ' '
28 |
29 | serial_conf.obj: ../serial_conf.c $(GEN_OPTS) | $(GEN_HDRS)
30 | @echo 'Building file: $<'
31 | @echo 'Invoking: MSP430 Compiler'
32 | "C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/bin/cl430" -vmspx --data_model=restricted -O0 --opt_for_speed=1 --use_hw_mpy=F5 --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - High Pass" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - High Pass/driverlib/MSP430FR5xx_6xx" --include_path="C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include" --advice:power="none" --advice:hw_config=all --define=DEPRECATED --define=__MSP430FR6989__ --define=_MPU_ENABLE -g --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --preproc_with_compile --preproc_dependency="serial_conf.d_raw" $(GEN_OPTS__FLAG) "$<"
33 | @echo 'Finished building: $<'
34 | @echo ' '
35 |
36 |
37 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/Debug/subdir_vars.mk:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | # Automatically-generated file. Do not edit!
3 | ################################################################################
4 |
5 | SHELL = cmd.exe
6 |
7 | # Add inputs and outputs from these tool invocations to the build variables
8 | CMD_SRCS += \
9 | ../lnk_msp430fr6989.cmd
10 |
11 | C_SRCS += \
12 | ../DSP_and_Math.c \
13 | ../embedded_printf.c \
14 | ../main.c \
15 | ../serial_conf.c
16 |
17 | C_DEPS += \
18 | ./DSP_and_Math.d \
19 | ./embedded_printf.d \
20 | ./main.d \
21 | ./serial_conf.d
22 |
23 | OBJS += \
24 | ./DSP_and_Math.obj \
25 | ./embedded_printf.obj \
26 | ./main.obj \
27 | ./serial_conf.obj
28 |
29 | OBJS__QUOTED += \
30 | "DSP_and_Math.obj" \
31 | "embedded_printf.obj" \
32 | "main.obj" \
33 | "serial_conf.obj"
34 |
35 | C_DEPS__QUOTED += \
36 | "DSP_and_Math.d" \
37 | "embedded_printf.d" \
38 | "main.d" \
39 | "serial_conf.d"
40 |
41 | C_SRCS__QUOTED += \
42 | "../DSP_and_Math.c" \
43 | "../embedded_printf.c" \
44 | "../main.c" \
45 | "../serial_conf.c"
46 |
47 |
48 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/driverlib/MSP430FR5xx_6xx/crc.c:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | //
34 | // crc.c - Driver for the crc Module.
35 | //
36 | //*****************************************************************************
37 |
38 | //*****************************************************************************
39 | //
40 | //! \addtogroup crc_api crc
41 | //! @{
42 | //
43 | //*****************************************************************************
44 |
45 | #include "inc/hw_memmap.h"
46 |
47 | #ifdef __MSP430_HAS_CRC__
48 | #include "crc.h"
49 |
50 | #include
51 |
52 | void CRC_setSeed(uint16_t baseAddress,
53 | uint16_t seed)
54 | {
55 | HWREG16(baseAddress + OFS_CRCINIRES) = seed;
56 | }
57 |
58 | void CRC_set16BitData(uint16_t baseAddress,
59 | uint16_t dataIn)
60 | {
61 | HWREG16(baseAddress + OFS_CRCDI) = dataIn;
62 | }
63 |
64 | void CRC_set8BitData(uint16_t baseAddress,
65 | uint8_t dataIn)
66 | {
67 | HWREG8(baseAddress + OFS_CRCDI_L) = dataIn;
68 | }
69 |
70 | void CRC_set16BitDataReversed(uint16_t baseAddress,
71 | uint16_t dataIn)
72 | {
73 | HWREG16(baseAddress + OFS_CRCDIRB) = dataIn;
74 | }
75 |
76 | void CRC_set8BitDataReversed(uint16_t baseAddress,
77 | uint8_t dataIn)
78 | {
79 | HWREG8(baseAddress + OFS_CRCDIRB_L) = dataIn;
80 | }
81 |
82 | uint16_t CRC_getData(uint16_t baseAddress)
83 | {
84 | return (HWREG16(baseAddress + OFS_CRCDI));
85 | }
86 |
87 | uint16_t CRC_getResult(uint16_t baseAddress)
88 | {
89 | return (HWREG16(baseAddress + OFS_CRCINIRES));
90 | }
91 |
92 | uint16_t CRC_getResultBitsReversed(uint16_t baseAddress)
93 | {
94 | return (HWREG16(baseAddress + OFS_CRCRESR));
95 | }
96 |
97 | #endif
98 | //*****************************************************************************
99 | //
100 | //! Close the doxygen group for crc_api
101 | //! @}
102 | //
103 | //*****************************************************************************
104 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/driverlib/MSP430FR5xx_6xx/driverlib.h:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | #include "inc/hw_memmap.h"
33 |
34 | #include "adc12_b.h"
35 | #include "aes256.h"
36 | #include "comp_e.h"
37 | #include "crc.h"
38 | #include "crc32.h"
39 | #include "cs.h"
40 | #include "dma.h"
41 | #include "esi.h"
42 | #include "eusci_a_spi.h"
43 | #include "eusci_a_uart.h"
44 | #include "eusci_b_i2c.h"
45 | #include "eusci_b_spi.h"
46 | #include "framctl.h"
47 | #include "framctl_a.h"
48 | #include "gpio.h"
49 | #include "lcd_c.h"
50 | #include "mpu.h"
51 | #include "mpy32.h"
52 | #include "pmm.h"
53 | #include "ram.h"
54 | #include "ref_a.h"
55 | #include "rtc_b.h"
56 | #include "rtc_c.h"
57 | #include "sfr.h"
58 | #include "sysctl.h"
59 | #include "timer_a.h"
60 | #include "timer_b.h"
61 | #include "tlv.h"
62 | #include "wdt_a.h"
63 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/driverlib/MSP430FR5xx_6xx/inc/hw_memmap.h:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | #ifndef __HW_MEMMAP__
33 | #define __HW_MEMMAP__
34 |
35 | #define __DRIVERLIB_MSP430FR5XX_6XX_FAMILY__
36 | //*****************************************************************************
37 | //
38 | // Include device specific header file
39 | //
40 | //*****************************************************************************
41 | #include
42 |
43 | #ifndef __AUTOGENERATED__
44 | #include "msp430fr5xx_6xxgeneric.h"
45 | #endif
46 |
47 | #include "stdint.h"
48 | #include "stdbool.h"
49 |
50 | //*****************************************************************************
51 | //
52 | // SUCCESS and FAILURE for API return value
53 | //
54 | //*****************************************************************************
55 | #define STATUS_SUCCESS 0x01
56 | #define STATUS_FAIL 0x00
57 |
58 | //*****************************************************************************
59 | //
60 | // Macro for enabling assert statements for debugging
61 | //
62 | //*****************************************************************************
63 | #define NDEBUG
64 |
65 | //*****************************************************************************
66 | //
67 | // Macros for hardware access
68 | //
69 | //*****************************************************************************
70 | #define HWREG32(x) \
71 | (*((volatile uint32_t *)((uint16_t)x)))
72 | #define HWREG16(x) \
73 | (*((volatile uint16_t *)((uint16_t)x)))
74 | #define HWREG8(x) \
75 | (*((volatile uint8_t *)((uint16_t)x)))
76 |
77 | #endif // #ifndef __HW_MEMMAP__
78 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/driverlib/MSP430FR5xx_6xx/inc/version.h:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | #ifndef __DRIVERLIB_VERSION__
33 | #define DRIVERLIB_VER_MAJOR 2
34 | #define DRIVERLIB_VER_MINOR 80
35 | #define DRIVERLIB_VER_PATCH 00
36 | #define DRIVERLIB_VER_BUILD 01
37 | #endif
38 |
39 | #define getVersion() ((uint32_t)DRIVERLIB_VER_MAJOR << 24 | \
40 | (uint32_t)DRIVERLIB_VER_MINOR << 16 | \
41 | (uint32_t)DRIVERLIB_VER_PATCH << 8 | \
42 | (uint32_t)DRIVERLIB_VER_BUILD)
43 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/driverlib/MSP430FR5xx_6xx/pmm.c:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | //
34 | // pmm.c - Driver for the pmm Module.
35 | //
36 | //*****************************************************************************
37 |
38 | //*****************************************************************************
39 | //
40 | //! \addtogroup pmm_api pmm
41 | //! @{
42 | //
43 | //*****************************************************************************
44 |
45 | #include "inc/hw_memmap.h"
46 |
47 | #ifdef __MSP430_HAS_PMM_FRAM__
48 | #include "pmm.h"
49 |
50 | #include
51 |
52 | void PMM_enableSVSH(void)
53 | {
54 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
55 | HWREG8(PMM_BASE + OFS_PMMCTL0_L) |= SVSHE;
56 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
57 | }
58 |
59 | void PMM_disableSVSH(void)
60 | {
61 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
62 | HWREG8(PMM_BASE + OFS_PMMCTL0_L) &= ~SVSHE;
63 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
64 | }
65 |
66 | void PMM_turnOnRegulator(void)
67 | {
68 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
69 | HWREG8(PMM_BASE + OFS_PMMCTL0) &= ~PMMREGOFF;
70 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
71 | }
72 |
73 | void PMM_turnOffRegulator(void)
74 | {
75 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
76 | HWREG8(PMM_BASE + OFS_PMMCTL0) |= PMMREGOFF;
77 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
78 | }
79 |
80 | void PMM_trigPOR(void)
81 | {
82 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
83 | HWREG8(PMM_BASE + OFS_PMMCTL0) |= PMMSWPOR;
84 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
85 | }
86 |
87 | void PMM_trigBOR(void)
88 | {
89 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
90 | HWREG8(PMM_BASE + OFS_PMMCTL0) |= PMMSWBOR;
91 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
92 | }
93 |
94 | void PMM_clearInterrupt(uint16_t mask)
95 | {
96 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
97 | HWREG16(PMM_BASE + OFS_PMMIFG) &= ~mask;
98 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
99 | }
100 |
101 | uint16_t PMM_getInterruptStatus(uint16_t mask)
102 | {
103 | return ((HWREG16(PMM_BASE + OFS_PMMIFG)) & mask);
104 | }
105 |
106 | void PMM_unlockLPM5(void)
107 | {
108 | //Direct register access to avoid compiler warining - #10420-D
109 | //For FRAM devices, at start up, the GPO power-on default
110 | //high-impedance mode needs to be disabled to activate previously
111 | //configured port settings. This can be done by clearing the LOCKLPM5
112 | //bit in PM5CTL0 registe
113 |
114 | PM5CTL0 &= ~LOCKLPM5;
115 | }
116 |
117 | #endif
118 | //*****************************************************************************
119 | //
120 | //! Close the doxygen group for pmm_api
121 | //! @}
122 | //
123 | //*****************************************************************************
124 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/driverlib/MSP430FR5xx_6xx/ram.c:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | //
34 | // ram.c - Driver for the ram Module.
35 | //
36 | //*****************************************************************************
37 |
38 | //*****************************************************************************
39 | //
40 | //! \addtogroup ram_api ram
41 | //! @{
42 | //
43 | //*****************************************************************************
44 |
45 | #include "inc/hw_memmap.h"
46 |
47 | #ifdef __MSP430_HAS_RC_FRAM__
48 | #include "ram.h"
49 |
50 | #include
51 |
52 | void RAM_setSectorOff(uint8_t sector,
53 | uint8_t mode)
54 | {
55 | uint8_t sectorPos = sector << 1;
56 | uint8_t val = HWREG8(RAM_BASE + OFS_RCCTL0_L) & ~(0x3 << sectorPos);
57 |
58 | HWREG16(RAM_BASE + OFS_RCCTL0) = (RCKEY | val | (mode << sectorPos));
59 | }
60 |
61 | uint8_t RAM_getSectorState(uint8_t sector)
62 | {
63 | uint8_t sectorPos = sector << 1;
64 | return((HWREG8(RAM_BASE + OFS_RCCTL0_L) & (0x3 << sectorPos)) >> sectorPos);
65 | }
66 |
67 | #endif
68 | //*****************************************************************************
69 | //
70 | //! Close the doxygen group for ram_api
71 | //! @}
72 | //
73 | //*****************************************************************************
74 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/driverlib/MSP430FR5xx_6xx/sfr.c:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | //
34 | // sfr.c - Driver for the sfr Module.
35 | //
36 | //*****************************************************************************
37 |
38 | //*****************************************************************************
39 | //
40 | //! \addtogroup sfr_api sfr
41 | //! @{
42 | //
43 | //*****************************************************************************
44 |
45 | #include "inc/hw_memmap.h"
46 |
47 | #ifdef __MSP430_HAS_SFR__
48 | #include "sfr.h"
49 |
50 | #include
51 |
52 | void SFR_enableInterrupt(uint8_t interruptMask)
53 | {
54 | HWREG8(SFR_BASE + OFS_SFRIE1_L) |= interruptMask;
55 | }
56 |
57 | void SFR_disableInterrupt(uint8_t interruptMask)
58 | {
59 | HWREG8(SFR_BASE + OFS_SFRIE1_L) &= ~(interruptMask);
60 | }
61 |
62 | uint8_t SFR_getInterruptStatus(uint8_t interruptFlagMask)
63 | {
64 | return (HWREG8(SFR_BASE + OFS_SFRIFG1_L) & interruptFlagMask);
65 | }
66 |
67 | void SFR_clearInterrupt(uint8_t interruptFlagMask)
68 | {
69 | HWREG8(SFR_BASE + OFS_SFRIFG1_L) &= ~(interruptFlagMask);
70 | }
71 |
72 | void SFR_setResetPinPullResistor(uint16_t pullResistorSetup)
73 | {
74 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) &= ~(SYSRSTRE + SYSRSTUP);
75 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) |= pullResistorSetup;
76 | }
77 |
78 | void SFR_setNMIEdge(uint16_t edgeDirection)
79 | {
80 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) &= ~(SYSNMIIES);
81 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) |= edgeDirection;
82 | }
83 |
84 | void SFR_setResetNMIPinFunction(uint8_t resetPinFunction)
85 | {
86 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) &= ~(SYSNMI);
87 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) |= resetPinFunction;
88 | }
89 |
90 | #endif
91 | //*****************************************************************************
92 | //
93 | //! Close the doxygen group for sfr_api
94 | //! @}
95 | //
96 | //*****************************************************************************
97 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/driverlib/MSP430FR5xx_6xx/wdt_a.c:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | //
34 | // wdt_a.c - Driver for the wdt_a Module.
35 | //
36 | //*****************************************************************************
37 |
38 | //*****************************************************************************
39 | //
40 | //! \addtogroup wdt_a_api wdt_a
41 | //! @{
42 | //
43 | //*****************************************************************************
44 |
45 | #include "inc/hw_memmap.h"
46 |
47 | #ifdef __MSP430_HAS_WDT_A__
48 | #include "wdt_a.h"
49 |
50 | #include
51 |
52 | void WDT_A_hold(uint16_t baseAddress)
53 | {
54 | // Set Hold bit
55 | uint8_t newWDTStatus =
56 | ((HWREG16(baseAddress + OFS_WDTCTL) & 0x00FF) | WDTHOLD);
57 |
58 | HWREG16(baseAddress + OFS_WDTCTL) = WDTPW + newWDTStatus;
59 | }
60 |
61 | void WDT_A_start(uint16_t baseAddress)
62 | {
63 | // Reset Hold bit
64 | uint8_t newWDTStatus =
65 | ((HWREG16(baseAddress + OFS_WDTCTL) & 0x00FF) & ~(WDTHOLD));
66 |
67 | HWREG16(baseAddress + OFS_WDTCTL) = WDTPW + newWDTStatus;
68 | }
69 |
70 | void WDT_A_resetTimer(uint16_t baseAddress)
71 | {
72 | // Set Counter Clear bit
73 | uint8_t newWDTStatus =
74 | ((HWREG16(baseAddress + OFS_WDTCTL) & 0x00FF) | WDTCNTCL);
75 |
76 | HWREG16(baseAddress + OFS_WDTCTL) = WDTPW + newWDTStatus;
77 | }
78 |
79 | void WDT_A_initWatchdogTimer(uint16_t baseAddress,
80 | uint8_t clockSelect,
81 | uint8_t clockDivider)
82 | {
83 | HWREG16(baseAddress + OFS_WDTCTL) =
84 | WDTPW + WDTCNTCL + WDTHOLD + clockSelect + clockDivider;
85 | }
86 |
87 | void WDT_A_initIntervalTimer(uint16_t baseAddress,
88 | uint8_t clockSelect,
89 | uint8_t clockDivider)
90 | {
91 | HWREG16(baseAddress + OFS_WDTCTL) =
92 | WDTPW + WDTCNTCL + WDTHOLD + WDTTMSEL + clockSelect + clockDivider;
93 | }
94 |
95 | #endif
96 | //*****************************************************************************
97 | //
98 | //! Close the doxygen group for wdt_a_api
99 | //! @}
100 | //
101 | //*****************************************************************************
102 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/embedded_printf.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Embedded version of "printf( )" function
3 | * - with similar functions but more efficient
4 | *
5 | * author: Haroldo Amaral - agaelema@globo.com
6 | * v0.5 - 2017/08/20
7 | *
8 | * Based in this link:
9 | * http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/30479/107146
10 | ******************************************************************************
11 | * log: . change some "#ifdef" to "#if defined ( )"
12 | ******************************************************************************/
13 |
14 | #ifndef _EMBEDDED_PRINTF_
15 | #define _EMBEDDED_PRINTF_
16 |
17 | #include
18 | #include "serial_conf.h"
19 |
20 | /******************************************************************************
21 | * CONFIGURATIONS OF EMBEDDED_PRINTF
22 | * - select/uncomment desired options
23 | ******************************************************************************/
24 | #define ENABLE_PAD // enable padding in functions
25 | #define ENABLE_FLOAT // enable print float/double
26 | //#define PRECISION_FLOAT // select precision version - use double variable
27 | //#define ENABLE_EXTRA_DECIMAL_PLACE // enabled = 9 dp, disabled = 4 dp - depends of PRECISION_FLOAT
28 | #define ENABLE_BINARY // enable binary notation
29 |
30 |
31 | /******************************************************************************
32 | * PROTOTYPE OF FUNCTIONS
33 | ******************************************************************************/
34 | void putChar(uint8_t byte);
35 | void linesUp(unsigned int lines);
36 |
37 | unsigned int embedded_prints(char *string, unsigned int width, unsigned int pad);
38 | unsigned int embedded_ltoa(char *print_buf, int32_t input, unsigned int base, unsigned int sg, unsigned int width, unsigned int pad, unsigned char letbase);
39 |
40 | //#ifdef ENABLE_PAD
41 | //#define ENABLE_PAD_
42 | //#endif
43 |
44 | #if defined (ENABLE_PAD)
45 | #define ENABLE_PAD_
46 | #endif
47 |
48 |
49 | //#ifdef ENABLE_EXTRA_DECIMAL_PLACE
50 | //#define ENABLE_EXTRA_DECIMAL_PLACE_
51 | //#endif
52 |
53 | #if defined (ENABLE_EXTRA_DECIMAL_PLACE)
54 | #define ENABLE_EXTRA_DECIMAL_PLACE_
55 | #endif
56 |
57 | //#ifdef ENABLE_FLOAT
58 |
59 | #if defined (ENABLE_FLOAT)
60 |
61 | //#ifdef PRECISION_FLOAT
62 | #if defined (PRECISION_FLOAT)
63 | #define PRECISION_FLOAT_
64 | unsigned int embedded_ftoa(char *print_buf, double input, signed int dp, unsigned int sci);
65 | #else
66 | unsigned int embedded_ftoa(char *print_buf, float input, signed int dp, unsigned int sci);
67 | #endif
68 | #endif
69 |
70 | unsigned int embedded_printf(char *format, ...);
71 |
72 | unsigned int print_string(char *string);
73 | unsigned int print_long(long number);
74 | unsigned int print_ulong(unsigned long number);
75 | unsigned int print_hexa(long number);
76 |
77 | //#ifdef ENABLE_BINARY
78 | #if defined (ENABLE_BINARY)
79 | #define ENABLE_BINARY_
80 | unsigned int print_binary(long number, unsigned int bits);
81 | #endif
82 |
83 | //#ifdef ENABLE_FLOAT
84 | #if defined (ENABLE_FLOAT)
85 | #define ENABLE_FLOAT_
86 |
87 | //#ifdef PRECISION_FLOAT
88 | #if defined (PRECISION_FLOAT)
89 | #define PRECISION_FLOAT_
90 | unsigned int print_float(double number, int dp);
91 | unsigned int print_scientific(double number, int dp);
92 | #else
93 | unsigned int print_float(float number, int dp);
94 | unsigned int print_scientific(float number, int dp);
95 | #endif
96 | #endif
97 |
98 |
99 | #ifdef PRECISION_FLOAT_
100 | void embedded_string2number(unsigned char *string, double *number);
101 | #else
102 | void embedded_string2number(unsigned char *string, float *number);
103 | #endif
104 |
105 |
106 | /******************************************************************************
107 | * IMPORTANT DEFINITION
108 | ******************************************************************************/
109 | #define BINARY 2 // number identifier
110 | #define DECIMAL 10
111 | #define HEXADEC 16
112 |
113 | #define SIGNED 1 // if signed (+/-)
114 | #define NON_SIGNED 0 // just (+)
115 | #define NON_PAD 0 // without padding
116 | #define UPPER_CASE 'A'
117 | #define LOWER_CASE 'a'
118 |
119 | #define SCI 1 // scientific notation "xx.yyezz"
120 | #define NON_SCI 0 // standard notation "xx.yy"
121 |
122 | #define PAD_RIGHT 0x01 // right justified
123 | #define PAD_ZERO 0x02 // padding with zero "0"
124 |
125 | #define PRINT_BUF_LEN 36 // size of internal buffer to the conversion
126 |
127 | //#define WITH_LABEL 1
128 | //#define WITHOUT_LABEL 0
129 |
130 | #endif // end of _EMBEDDED_PRINTF_
131 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/serial_conf.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * "serial_conf.h" used in the embedded version of "printf" function
3 | *
4 | * author: Haroldo Amaral - agaelema@globo.com
5 | * v0.4 - 2017/09/04
6 | ******************************************************************************
7 | * log: . Modify initial version
8 | * + more defines to facilitate the configuration between devices
9 | * + change function "sendbyte" to "serial_sendbyte"
10 | * + add function to configure UART
11 | * + add exp430fr6989 uart back-channel (USCI_UCA1) - P3.4/P3.5
12 | * . change some "#ifdef" to "#if defined ( )"
13 | * + add 9600bps and 115200 at 8MHZ
14 | *
15 | ******************************************************************************/
16 |
17 | #ifndef _SERIAL_CONF_
18 | #define _SERIAL_CONF_
19 |
20 | /******************************************************************************
21 | * list of supported Microcontrollers and their serial USCI
22 | * - uncomment desired device/serial
23 | ******************************************************************************/
24 | //#define MSP430G2553_USCI_A0 // P1.1 and P1.2
25 | //#define MSP430FR6989_USCI_A0 // P2.0 and P2.1
26 | #define MSP430FR6989_USCI_A1 // onboard serial - P3.4 and P3.5
27 |
28 | /******************************************************************************
29 | * UART source of clock
30 | * - uncomment desired device/serial
31 | ******************************************************************************/
32 | //#define LFXT32K
33 | //#define SMCLK_DCO_1MHZ
34 | #define SMCLK_DCO_8MHZ
35 |
36 | /******************************************************************************
37 | * list of supported baudrates
38 | * - uncomment desired baudrate
39 | ******************************************************************************/
40 | //#define BAUD_9600
41 | #define BAUD_115200
42 |
43 | /******************************************************************************
44 | * Register version or Driverlib version
45 | * - select just one
46 | ******************************************************************************/
47 | #define REGISTER_VERSION
48 | //#define DRIVERLIB_VERSION
49 |
50 |
51 | /******************************************************************************
52 | * Supported microcontrollers
53 | * If you add a new device, do a pull request and help other users
54 | ******************************************************************************/
55 | #if defined (MSP430G2553_USCI_A0)
56 | #define MSP430
57 | #define G2553
58 | #define USCI_UCA0
59 |
60 | #elif defined (MSP430FR6989_USCI_A0)
61 | #define MSP430
62 | #define FR6989
63 | #define USCI_UCA0
64 |
65 | #elif defined (MSP430FR6989_USCI_A1)
66 | #define MSP430
67 | #define FR6989
68 | #define USCI_UCA1
69 |
70 | #else
71 | #error "Incorrect or invalid combination"
72 | #endif
73 |
74 |
75 |
76 |
77 | /******************************************************************************
78 | * Prototype of functions
79 | ******************************************************************************/
80 | void serial_configure(void);
81 | void serial_sendbyte(char byte);
82 |
83 | #endif // end of _SERIAL_CONF_
84 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/targetConfigs/MSP430FR6989.ccxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - High Pass/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.
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/.ccsproject:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | DSP_Math_lib - Test EXP430FR6989 - Low Pass
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 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/.settings/org.eclipse.cdt.codan.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | inEditor=false
3 | onBuild=false
4 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/.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 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/.settings/org.eclipse.core.resources.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | encoding//Debug/driverlib/MSP430FR5xx_6xx/subdir_rules.mk=UTF-8
3 | encoding//Debug/driverlib/MSP430FR5xx_6xx/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 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/DSP_and_Math.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/agaelema/DSP_and_Math/d6c0a8531e11e4ba48ea6e0db764a71e5722e07c/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/DSP_and_Math.h
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/Debug/ccsObjs.opt:
--------------------------------------------------------------------------------
1 | "./DSP_and_Math.obj" "./embedded_printf.obj" "./main.obj" "./serial_conf.obj" "./driverlib/MSP430FR5xx_6xx/adc12_b.obj" "./driverlib/MSP430FR5xx_6xx/aes256.obj" "./driverlib/MSP430FR5xx_6xx/comp_e.obj" "./driverlib/MSP430FR5xx_6xx/crc.obj" "./driverlib/MSP430FR5xx_6xx/crc32.obj" "./driverlib/MSP430FR5xx_6xx/cs.obj" "./driverlib/MSP430FR5xx_6xx/dma.obj" "./driverlib/MSP430FR5xx_6xx/esi.obj" "./driverlib/MSP430FR5xx_6xx/eusci_a_spi.obj" "./driverlib/MSP430FR5xx_6xx/eusci_a_uart.obj" "./driverlib/MSP430FR5xx_6xx/eusci_b_i2c.obj" "./driverlib/MSP430FR5xx_6xx/eusci_b_spi.obj" "./driverlib/MSP430FR5xx_6xx/framctl.obj" "./driverlib/MSP430FR5xx_6xx/framctl_a.obj" "./driverlib/MSP430FR5xx_6xx/gpio.obj" "./driverlib/MSP430FR5xx_6xx/lcd_c.obj" "./driverlib/MSP430FR5xx_6xx/mpu.obj" "./driverlib/MSP430FR5xx_6xx/mpy32.obj" "./driverlib/MSP430FR5xx_6xx/pmm.obj" "./driverlib/MSP430FR5xx_6xx/ram.obj" "./driverlib/MSP430FR5xx_6xx/ref_a.obj" "./driverlib/MSP430FR5xx_6xx/rtc_b.obj" "./driverlib/MSP430FR5xx_6xx/rtc_c.obj" "./driverlib/MSP430FR5xx_6xx/sfr.obj" "./driverlib/MSP430FR5xx_6xx/sysctl.obj" "./driverlib/MSP430FR5xx_6xx/timer_a.obj" "./driverlib/MSP430FR5xx_6xx/timer_b.obj" "./driverlib/MSP430FR5xx_6xx/tlv.obj" "./driverlib/MSP430FR5xx_6xx/wdt_a.obj" "../lnk_msp430fr6989.cmd" -llibmpu_init.a -llibmath.a -llibc.a
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/Debug/objects.mk:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | # Automatically-generated file. Do not edit!
3 | ################################################################################
4 |
5 | USER_OBJS :=
6 |
7 | LIBS := -llibmpu_init.a -llibmath.a -llibc.a
8 |
9 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/Debug/sources.mk:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | # Automatically-generated file. Do not edit!
3 | ################################################################################
4 |
5 | C55_SRCS :=
6 | A_SRCS :=
7 | ASM_UPPER_SRCS :=
8 | EXE_SRCS :=
9 | LDS_UPPER_SRCS :=
10 | CPP_SRCS :=
11 | CMD_SRCS :=
12 | O_SRCS :=
13 | ELF_SRCS :=
14 | C??_SRCS :=
15 | C64_SRCS :=
16 | C67_SRCS :=
17 | SA_SRCS :=
18 | S64_SRCS :=
19 | OPT_SRCS :=
20 | CXX_SRCS :=
21 | S67_SRCS :=
22 | S??_SRCS :=
23 | PDE_SRCS :=
24 | SV7A_SRCS :=
25 | K_SRCS :=
26 | CLA_SRCS :=
27 | S55_SRCS :=
28 | LD_UPPER_SRCS :=
29 | OUT_SRCS :=
30 | INO_SRCS :=
31 | LIB_SRCS :=
32 | ASM_SRCS :=
33 | S_UPPER_SRCS :=
34 | S43_SRCS :=
35 | LD_SRCS :=
36 | CMD_UPPER_SRCS :=
37 | C_UPPER_SRCS :=
38 | C++_SRCS :=
39 | C43_SRCS :=
40 | OBJ_SRCS :=
41 | LDS_SRCS :=
42 | S_SRCS :=
43 | CC_SRCS :=
44 | S62_SRCS :=
45 | C62_SRCS :=
46 | C_SRCS :=
47 | C55_DEPS :=
48 | C_UPPER_DEPS :=
49 | S67_DEPS :=
50 | S62_DEPS :=
51 | S_DEPS :=
52 | OPT_DEPS :=
53 | C??_DEPS :=
54 | ASM_UPPER_DEPS :=
55 | S??_DEPS :=
56 | C64_DEPS :=
57 | CXX_DEPS :=
58 | S64_DEPS :=
59 | INO_DEPS :=
60 | CLA_DEPS :=
61 | S55_DEPS :=
62 | SV7A_DEPS :=
63 | EXE_OUTPUTS :=
64 | C62_DEPS :=
65 | C67_DEPS :=
66 | PDE_DEPS :=
67 | K_DEPS :=
68 | C_DEPS :=
69 | CC_DEPS :=
70 | BIN_OUTPUTS :=
71 | C++_DEPS :=
72 | C43_DEPS :=
73 | S43_DEPS :=
74 | OBJS :=
75 | ASM_DEPS :=
76 | S_UPPER_DEPS :=
77 | CPP_DEPS :=
78 | SA_DEPS :=
79 | C++_DEPS__QUOTED :=
80 | OPT_DEPS__QUOTED :=
81 | S_UPPER_DEPS__QUOTED :=
82 | SA_DEPS__QUOTED :=
83 | C??_DEPS__QUOTED :=
84 | S67_DEPS__QUOTED :=
85 | C55_DEPS__QUOTED :=
86 | CC_DEPS__QUOTED :=
87 | ASM_UPPER_DEPS__QUOTED :=
88 | SV7A_DEPS__QUOTED :=
89 | S??_DEPS__QUOTED :=
90 | OBJS__QUOTED :=
91 | C67_DEPS__QUOTED :=
92 | K_DEPS__QUOTED :=
93 | S55_DEPS__QUOTED :=
94 | INO_DEPS__QUOTED :=
95 | C62_DEPS__QUOTED :=
96 | C_DEPS__QUOTED :=
97 | C_UPPER_DEPS__QUOTED :=
98 | C43_DEPS__QUOTED :=
99 | CPP_DEPS__QUOTED :=
100 | BIN_OUTPUTS__QUOTED :=
101 | C64_DEPS__QUOTED :=
102 | CXX_DEPS__QUOTED :=
103 | CLA_DEPS__QUOTED :=
104 | S_DEPS__QUOTED :=
105 | ASM_DEPS__QUOTED :=
106 | S43_DEPS__QUOTED :=
107 | EXE_OUTPUTS__QUOTED :=
108 | S64_DEPS__QUOTED :=
109 | S62_DEPS__QUOTED :=
110 | PDE_DEPS__QUOTED :=
111 |
112 | # Every subdirectory with source files must be described here
113 | SUBDIRS := \
114 | . \
115 | driverlib/MSP430FR5xx_6xx \
116 |
117 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/Debug/subdir_rules.mk:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | # Automatically-generated file. Do not edit!
3 | ################################################################################
4 |
5 | SHELL = cmd.exe
6 |
7 | # Each subdirectory must supply rules for building sources it contributes
8 | DSP_and_Math.obj: ../DSP_and_Math.c $(GEN_OPTS) | $(GEN_HDRS)
9 | @echo 'Building file: $<'
10 | @echo 'Invoking: MSP430 Compiler'
11 | "C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/bin/cl430" -vmspx --data_model=restricted -O0 --opt_for_speed=1 --use_hw_mpy=F5 --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - Low Pass" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - Low Pass/driverlib/MSP430FR5xx_6xx" --include_path="C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include" --advice:power="none" --advice:hw_config=all --define=DEPRECATED --define=__MSP430FR6989__ --define=_MPU_ENABLE -g --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --preproc_with_compile --preproc_dependency="DSP_and_Math.d_raw" $(GEN_OPTS__FLAG) "$<"
12 | @echo 'Finished building: $<'
13 | @echo ' '
14 |
15 | embedded_printf.obj: ../embedded_printf.c $(GEN_OPTS) | $(GEN_HDRS)
16 | @echo 'Building file: $<'
17 | @echo 'Invoking: MSP430 Compiler'
18 | "C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/bin/cl430" -vmspx --data_model=restricted -O0 --opt_for_speed=1 --use_hw_mpy=F5 --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - Low Pass" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - Low Pass/driverlib/MSP430FR5xx_6xx" --include_path="C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include" --advice:power="none" --advice:hw_config=all --define=DEPRECATED --define=__MSP430FR6989__ --define=_MPU_ENABLE -g --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --preproc_with_compile --preproc_dependency="embedded_printf.d_raw" $(GEN_OPTS__FLAG) "$<"
19 | @echo 'Finished building: $<'
20 | @echo ' '
21 |
22 | main.obj: ../main.c $(GEN_OPTS) | $(GEN_HDRS)
23 | @echo 'Building file: $<'
24 | @echo 'Invoking: MSP430 Compiler'
25 | "C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/bin/cl430" -vmspx --data_model=restricted -O0 --opt_for_speed=1 --use_hw_mpy=F5 --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - Low Pass" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - Low Pass/driverlib/MSP430FR5xx_6xx" --include_path="C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include" --advice:power="none" --advice:hw_config=all --define=DEPRECATED --define=__MSP430FR6989__ --define=_MPU_ENABLE -g --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --preproc_with_compile --preproc_dependency="main.d_raw" $(GEN_OPTS__FLAG) "$<"
26 | @echo 'Finished building: $<'
27 | @echo ' '
28 |
29 | serial_conf.obj: ../serial_conf.c $(GEN_OPTS) | $(GEN_HDRS)
30 | @echo 'Building file: $<'
31 | @echo 'Invoking: MSP430 Compiler'
32 | "C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/bin/cl430" -vmspx --data_model=restricted -O0 --opt_for_speed=1 --use_hw_mpy=F5 --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - Low Pass" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - Low Pass/driverlib/MSP430FR5xx_6xx" --include_path="C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include" --advice:power="none" --advice:hw_config=all --define=DEPRECATED --define=__MSP430FR6989__ --define=_MPU_ENABLE -g --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --preproc_with_compile --preproc_dependency="serial_conf.d_raw" $(GEN_OPTS__FLAG) "$<"
33 | @echo 'Finished building: $<'
34 | @echo ' '
35 |
36 |
37 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/Debug/subdir_vars.mk:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | # Automatically-generated file. Do not edit!
3 | ################################################################################
4 |
5 | SHELL = cmd.exe
6 |
7 | # Add inputs and outputs from these tool invocations to the build variables
8 | CMD_SRCS += \
9 | ../lnk_msp430fr6989.cmd
10 |
11 | C_SRCS += \
12 | ../DSP_and_Math.c \
13 | ../embedded_printf.c \
14 | ../main.c \
15 | ../serial_conf.c
16 |
17 | C_DEPS += \
18 | ./DSP_and_Math.d \
19 | ./embedded_printf.d \
20 | ./main.d \
21 | ./serial_conf.d
22 |
23 | OBJS += \
24 | ./DSP_and_Math.obj \
25 | ./embedded_printf.obj \
26 | ./main.obj \
27 | ./serial_conf.obj
28 |
29 | OBJS__QUOTED += \
30 | "DSP_and_Math.obj" \
31 | "embedded_printf.obj" \
32 | "main.obj" \
33 | "serial_conf.obj"
34 |
35 | C_DEPS__QUOTED += \
36 | "DSP_and_Math.d" \
37 | "embedded_printf.d" \
38 | "main.d" \
39 | "serial_conf.d"
40 |
41 | C_SRCS__QUOTED += \
42 | "../DSP_and_Math.c" \
43 | "../embedded_printf.c" \
44 | "../main.c" \
45 | "../serial_conf.c"
46 |
47 |
48 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/driverlib/MSP430FR5xx_6xx/crc.c:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | //
34 | // crc.c - Driver for the crc Module.
35 | //
36 | //*****************************************************************************
37 |
38 | //*****************************************************************************
39 | //
40 | //! \addtogroup crc_api crc
41 | //! @{
42 | //
43 | //*****************************************************************************
44 |
45 | #include "inc/hw_memmap.h"
46 |
47 | #ifdef __MSP430_HAS_CRC__
48 | #include "crc.h"
49 |
50 | #include
51 |
52 | void CRC_setSeed(uint16_t baseAddress,
53 | uint16_t seed)
54 | {
55 | HWREG16(baseAddress + OFS_CRCINIRES) = seed;
56 | }
57 |
58 | void CRC_set16BitData(uint16_t baseAddress,
59 | uint16_t dataIn)
60 | {
61 | HWREG16(baseAddress + OFS_CRCDI) = dataIn;
62 | }
63 |
64 | void CRC_set8BitData(uint16_t baseAddress,
65 | uint8_t dataIn)
66 | {
67 | HWREG8(baseAddress + OFS_CRCDI_L) = dataIn;
68 | }
69 |
70 | void CRC_set16BitDataReversed(uint16_t baseAddress,
71 | uint16_t dataIn)
72 | {
73 | HWREG16(baseAddress + OFS_CRCDIRB) = dataIn;
74 | }
75 |
76 | void CRC_set8BitDataReversed(uint16_t baseAddress,
77 | uint8_t dataIn)
78 | {
79 | HWREG8(baseAddress + OFS_CRCDIRB_L) = dataIn;
80 | }
81 |
82 | uint16_t CRC_getData(uint16_t baseAddress)
83 | {
84 | return (HWREG16(baseAddress + OFS_CRCDI));
85 | }
86 |
87 | uint16_t CRC_getResult(uint16_t baseAddress)
88 | {
89 | return (HWREG16(baseAddress + OFS_CRCINIRES));
90 | }
91 |
92 | uint16_t CRC_getResultBitsReversed(uint16_t baseAddress)
93 | {
94 | return (HWREG16(baseAddress + OFS_CRCRESR));
95 | }
96 |
97 | #endif
98 | //*****************************************************************************
99 | //
100 | //! Close the doxygen group for crc_api
101 | //! @}
102 | //
103 | //*****************************************************************************
104 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/driverlib/MSP430FR5xx_6xx/driverlib.h:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | #include "inc/hw_memmap.h"
33 |
34 | #include "adc12_b.h"
35 | #include "aes256.h"
36 | #include "comp_e.h"
37 | #include "crc.h"
38 | #include "crc32.h"
39 | #include "cs.h"
40 | #include "dma.h"
41 | #include "esi.h"
42 | #include "eusci_a_spi.h"
43 | #include "eusci_a_uart.h"
44 | #include "eusci_b_i2c.h"
45 | #include "eusci_b_spi.h"
46 | #include "framctl.h"
47 | #include "framctl_a.h"
48 | #include "gpio.h"
49 | #include "lcd_c.h"
50 | #include "mpu.h"
51 | #include "mpy32.h"
52 | #include "pmm.h"
53 | #include "ram.h"
54 | #include "ref_a.h"
55 | #include "rtc_b.h"
56 | #include "rtc_c.h"
57 | #include "sfr.h"
58 | #include "sysctl.h"
59 | #include "timer_a.h"
60 | #include "timer_b.h"
61 | #include "tlv.h"
62 | #include "wdt_a.h"
63 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/driverlib/MSP430FR5xx_6xx/inc/hw_memmap.h:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | #ifndef __HW_MEMMAP__
33 | #define __HW_MEMMAP__
34 |
35 | #define __DRIVERLIB_MSP430FR5XX_6XX_FAMILY__
36 | //*****************************************************************************
37 | //
38 | // Include device specific header file
39 | //
40 | //*****************************************************************************
41 | #include
42 |
43 | #ifndef __AUTOGENERATED__
44 | #include "msp430fr5xx_6xxgeneric.h"
45 | #endif
46 |
47 | #include "stdint.h"
48 | #include "stdbool.h"
49 |
50 | //*****************************************************************************
51 | //
52 | // SUCCESS and FAILURE for API return value
53 | //
54 | //*****************************************************************************
55 | #define STATUS_SUCCESS 0x01
56 | #define STATUS_FAIL 0x00
57 |
58 | //*****************************************************************************
59 | //
60 | // Macro for enabling assert statements for debugging
61 | //
62 | //*****************************************************************************
63 | #define NDEBUG
64 |
65 | //*****************************************************************************
66 | //
67 | // Macros for hardware access
68 | //
69 | //*****************************************************************************
70 | #define HWREG32(x) \
71 | (*((volatile uint32_t *)((uint16_t)x)))
72 | #define HWREG16(x) \
73 | (*((volatile uint16_t *)((uint16_t)x)))
74 | #define HWREG8(x) \
75 | (*((volatile uint8_t *)((uint16_t)x)))
76 |
77 | #endif // #ifndef __HW_MEMMAP__
78 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/driverlib/MSP430FR5xx_6xx/inc/version.h:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | #ifndef __DRIVERLIB_VERSION__
33 | #define DRIVERLIB_VER_MAJOR 2
34 | #define DRIVERLIB_VER_MINOR 80
35 | #define DRIVERLIB_VER_PATCH 00
36 | #define DRIVERLIB_VER_BUILD 01
37 | #endif
38 |
39 | #define getVersion() ((uint32_t)DRIVERLIB_VER_MAJOR << 24 | \
40 | (uint32_t)DRIVERLIB_VER_MINOR << 16 | \
41 | (uint32_t)DRIVERLIB_VER_PATCH << 8 | \
42 | (uint32_t)DRIVERLIB_VER_BUILD)
43 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/driverlib/MSP430FR5xx_6xx/pmm.c:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | //
34 | // pmm.c - Driver for the pmm Module.
35 | //
36 | //*****************************************************************************
37 |
38 | //*****************************************************************************
39 | //
40 | //! \addtogroup pmm_api pmm
41 | //! @{
42 | //
43 | //*****************************************************************************
44 |
45 | #include "inc/hw_memmap.h"
46 |
47 | #ifdef __MSP430_HAS_PMM_FRAM__
48 | #include "pmm.h"
49 |
50 | #include
51 |
52 | void PMM_enableSVSH(void)
53 | {
54 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
55 | HWREG8(PMM_BASE + OFS_PMMCTL0_L) |= SVSHE;
56 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
57 | }
58 |
59 | void PMM_disableSVSH(void)
60 | {
61 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
62 | HWREG8(PMM_BASE + OFS_PMMCTL0_L) &= ~SVSHE;
63 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
64 | }
65 |
66 | void PMM_turnOnRegulator(void)
67 | {
68 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
69 | HWREG8(PMM_BASE + OFS_PMMCTL0) &= ~PMMREGOFF;
70 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
71 | }
72 |
73 | void PMM_turnOffRegulator(void)
74 | {
75 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
76 | HWREG8(PMM_BASE + OFS_PMMCTL0) |= PMMREGOFF;
77 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
78 | }
79 |
80 | void PMM_trigPOR(void)
81 | {
82 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
83 | HWREG8(PMM_BASE + OFS_PMMCTL0) |= PMMSWPOR;
84 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
85 | }
86 |
87 | void PMM_trigBOR(void)
88 | {
89 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
90 | HWREG8(PMM_BASE + OFS_PMMCTL0) |= PMMSWBOR;
91 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
92 | }
93 |
94 | void PMM_clearInterrupt(uint16_t mask)
95 | {
96 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
97 | HWREG16(PMM_BASE + OFS_PMMIFG) &= ~mask;
98 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
99 | }
100 |
101 | uint16_t PMM_getInterruptStatus(uint16_t mask)
102 | {
103 | return ((HWREG16(PMM_BASE + OFS_PMMIFG)) & mask);
104 | }
105 |
106 | void PMM_unlockLPM5(void)
107 | {
108 | //Direct register access to avoid compiler warining - #10420-D
109 | //For FRAM devices, at start up, the GPO power-on default
110 | //high-impedance mode needs to be disabled to activate previously
111 | //configured port settings. This can be done by clearing the LOCKLPM5
112 | //bit in PM5CTL0 registe
113 |
114 | PM5CTL0 &= ~LOCKLPM5;
115 | }
116 |
117 | #endif
118 | //*****************************************************************************
119 | //
120 | //! Close the doxygen group for pmm_api
121 | //! @}
122 | //
123 | //*****************************************************************************
124 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/driverlib/MSP430FR5xx_6xx/ram.c:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | //
34 | // ram.c - Driver for the ram Module.
35 | //
36 | //*****************************************************************************
37 |
38 | //*****************************************************************************
39 | //
40 | //! \addtogroup ram_api ram
41 | //! @{
42 | //
43 | //*****************************************************************************
44 |
45 | #include "inc/hw_memmap.h"
46 |
47 | #ifdef __MSP430_HAS_RC_FRAM__
48 | #include "ram.h"
49 |
50 | #include
51 |
52 | void RAM_setSectorOff(uint8_t sector,
53 | uint8_t mode)
54 | {
55 | uint8_t sectorPos = sector << 1;
56 | uint8_t val = HWREG8(RAM_BASE + OFS_RCCTL0_L) & ~(0x3 << sectorPos);
57 |
58 | HWREG16(RAM_BASE + OFS_RCCTL0) = (RCKEY | val | (mode << sectorPos));
59 | }
60 |
61 | uint8_t RAM_getSectorState(uint8_t sector)
62 | {
63 | uint8_t sectorPos = sector << 1;
64 | return((HWREG8(RAM_BASE + OFS_RCCTL0_L) & (0x3 << sectorPos)) >> sectorPos);
65 | }
66 |
67 | #endif
68 | //*****************************************************************************
69 | //
70 | //! Close the doxygen group for ram_api
71 | //! @}
72 | //
73 | //*****************************************************************************
74 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/driverlib/MSP430FR5xx_6xx/sfr.c:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | //
34 | // sfr.c - Driver for the sfr Module.
35 | //
36 | //*****************************************************************************
37 |
38 | //*****************************************************************************
39 | //
40 | //! \addtogroup sfr_api sfr
41 | //! @{
42 | //
43 | //*****************************************************************************
44 |
45 | #include "inc/hw_memmap.h"
46 |
47 | #ifdef __MSP430_HAS_SFR__
48 | #include "sfr.h"
49 |
50 | #include
51 |
52 | void SFR_enableInterrupt(uint8_t interruptMask)
53 | {
54 | HWREG8(SFR_BASE + OFS_SFRIE1_L) |= interruptMask;
55 | }
56 |
57 | void SFR_disableInterrupt(uint8_t interruptMask)
58 | {
59 | HWREG8(SFR_BASE + OFS_SFRIE1_L) &= ~(interruptMask);
60 | }
61 |
62 | uint8_t SFR_getInterruptStatus(uint8_t interruptFlagMask)
63 | {
64 | return (HWREG8(SFR_BASE + OFS_SFRIFG1_L) & interruptFlagMask);
65 | }
66 |
67 | void SFR_clearInterrupt(uint8_t interruptFlagMask)
68 | {
69 | HWREG8(SFR_BASE + OFS_SFRIFG1_L) &= ~(interruptFlagMask);
70 | }
71 |
72 | void SFR_setResetPinPullResistor(uint16_t pullResistorSetup)
73 | {
74 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) &= ~(SYSRSTRE + SYSRSTUP);
75 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) |= pullResistorSetup;
76 | }
77 |
78 | void SFR_setNMIEdge(uint16_t edgeDirection)
79 | {
80 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) &= ~(SYSNMIIES);
81 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) |= edgeDirection;
82 | }
83 |
84 | void SFR_setResetNMIPinFunction(uint8_t resetPinFunction)
85 | {
86 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) &= ~(SYSNMI);
87 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) |= resetPinFunction;
88 | }
89 |
90 | #endif
91 | //*****************************************************************************
92 | //
93 | //! Close the doxygen group for sfr_api
94 | //! @}
95 | //
96 | //*****************************************************************************
97 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/driverlib/MSP430FR5xx_6xx/wdt_a.c:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | //
34 | // wdt_a.c - Driver for the wdt_a Module.
35 | //
36 | //*****************************************************************************
37 |
38 | //*****************************************************************************
39 | //
40 | //! \addtogroup wdt_a_api wdt_a
41 | //! @{
42 | //
43 | //*****************************************************************************
44 |
45 | #include "inc/hw_memmap.h"
46 |
47 | #ifdef __MSP430_HAS_WDT_A__
48 | #include "wdt_a.h"
49 |
50 | #include
51 |
52 | void WDT_A_hold(uint16_t baseAddress)
53 | {
54 | // Set Hold bit
55 | uint8_t newWDTStatus =
56 | ((HWREG16(baseAddress + OFS_WDTCTL) & 0x00FF) | WDTHOLD);
57 |
58 | HWREG16(baseAddress + OFS_WDTCTL) = WDTPW + newWDTStatus;
59 | }
60 |
61 | void WDT_A_start(uint16_t baseAddress)
62 | {
63 | // Reset Hold bit
64 | uint8_t newWDTStatus =
65 | ((HWREG16(baseAddress + OFS_WDTCTL) & 0x00FF) & ~(WDTHOLD));
66 |
67 | HWREG16(baseAddress + OFS_WDTCTL) = WDTPW + newWDTStatus;
68 | }
69 |
70 | void WDT_A_resetTimer(uint16_t baseAddress)
71 | {
72 | // Set Counter Clear bit
73 | uint8_t newWDTStatus =
74 | ((HWREG16(baseAddress + OFS_WDTCTL) & 0x00FF) | WDTCNTCL);
75 |
76 | HWREG16(baseAddress + OFS_WDTCTL) = WDTPW + newWDTStatus;
77 | }
78 |
79 | void WDT_A_initWatchdogTimer(uint16_t baseAddress,
80 | uint8_t clockSelect,
81 | uint8_t clockDivider)
82 | {
83 | HWREG16(baseAddress + OFS_WDTCTL) =
84 | WDTPW + WDTCNTCL + WDTHOLD + clockSelect + clockDivider;
85 | }
86 |
87 | void WDT_A_initIntervalTimer(uint16_t baseAddress,
88 | uint8_t clockSelect,
89 | uint8_t clockDivider)
90 | {
91 | HWREG16(baseAddress + OFS_WDTCTL) =
92 | WDTPW + WDTCNTCL + WDTHOLD + WDTTMSEL + clockSelect + clockDivider;
93 | }
94 |
95 | #endif
96 | //*****************************************************************************
97 | //
98 | //! Close the doxygen group for wdt_a_api
99 | //! @}
100 | //
101 | //*****************************************************************************
102 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/embedded_printf.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Embedded version of "printf( )" function
3 | * - with similar functions but more efficient
4 | *
5 | * author: Haroldo Amaral - agaelema@globo.com
6 | * v0.5 - 2017/08/20
7 | *
8 | * Based in this link:
9 | * http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/30479/107146
10 | ******************************************************************************
11 | * log: . change some "#ifdef" to "#if defined ( )"
12 | ******************************************************************************/
13 |
14 | #ifndef _EMBEDDED_PRINTF_
15 | #define _EMBEDDED_PRINTF_
16 |
17 | #include
18 | #include "serial_conf.h"
19 |
20 | /******************************************************************************
21 | * CONFIGURATIONS OF EMBEDDED_PRINTF
22 | * - select/uncomment desired options
23 | ******************************************************************************/
24 | #define ENABLE_PAD // enable padding in functions
25 | #define ENABLE_FLOAT // enable print float/double
26 | //#define PRECISION_FLOAT // select precision version - use double variable
27 | //#define ENABLE_EXTRA_DECIMAL_PLACE // enabled = 9 dp, disabled = 4 dp - depends of PRECISION_FLOAT
28 | #define ENABLE_BINARY // enable binary notation
29 |
30 |
31 | /******************************************************************************
32 | * PROTOTYPE OF FUNCTIONS
33 | ******************************************************************************/
34 | void putChar(uint8_t byte);
35 | void linesUp(unsigned int lines);
36 |
37 | unsigned int embedded_prints(char *string, unsigned int width, unsigned int pad);
38 | unsigned int embedded_ltoa(char *print_buf, int32_t input, unsigned int base, unsigned int sg, unsigned int width, unsigned int pad, unsigned char letbase);
39 |
40 | //#ifdef ENABLE_PAD
41 | //#define ENABLE_PAD_
42 | //#endif
43 |
44 | #if defined (ENABLE_PAD)
45 | #define ENABLE_PAD_
46 | #endif
47 |
48 |
49 | //#ifdef ENABLE_EXTRA_DECIMAL_PLACE
50 | //#define ENABLE_EXTRA_DECIMAL_PLACE_
51 | //#endif
52 |
53 | #if defined (ENABLE_EXTRA_DECIMAL_PLACE)
54 | #define ENABLE_EXTRA_DECIMAL_PLACE_
55 | #endif
56 |
57 | //#ifdef ENABLE_FLOAT
58 |
59 | #if defined (ENABLE_FLOAT)
60 |
61 | //#ifdef PRECISION_FLOAT
62 | #if defined (PRECISION_FLOAT)
63 | #define PRECISION_FLOAT_
64 | unsigned int embedded_ftoa(char *print_buf, double input, signed int dp, unsigned int sci);
65 | #else
66 | unsigned int embedded_ftoa(char *print_buf, float input, signed int dp, unsigned int sci);
67 | #endif
68 | #endif
69 |
70 | unsigned int embedded_printf(char *format, ...);
71 |
72 | unsigned int print_string(char *string);
73 | unsigned int print_long(long number);
74 | unsigned int print_ulong(unsigned long number);
75 | unsigned int print_hexa(long number);
76 |
77 | //#ifdef ENABLE_BINARY
78 | #if defined (ENABLE_BINARY)
79 | #define ENABLE_BINARY_
80 | unsigned int print_binary(long number, unsigned int bits);
81 | #endif
82 |
83 | //#ifdef ENABLE_FLOAT
84 | #if defined (ENABLE_FLOAT)
85 | #define ENABLE_FLOAT_
86 |
87 | //#ifdef PRECISION_FLOAT
88 | #if defined (PRECISION_FLOAT)
89 | #define PRECISION_FLOAT_
90 | unsigned int print_float(double number, int dp);
91 | unsigned int print_scientific(double number, int dp);
92 | #else
93 | unsigned int print_float(float number, int dp);
94 | unsigned int print_scientific(float number, int dp);
95 | #endif
96 | #endif
97 |
98 |
99 | #ifdef PRECISION_FLOAT_
100 | void embedded_string2number(unsigned char *string, double *number);
101 | #else
102 | void embedded_string2number(unsigned char *string, float *number);
103 | #endif
104 |
105 |
106 | /******************************************************************************
107 | * IMPORTANT DEFINITION
108 | ******************************************************************************/
109 | #define BINARY 2 // number identifier
110 | #define DECIMAL 10
111 | #define HEXADEC 16
112 |
113 | #define SIGNED 1 // if signed (+/-)
114 | #define NON_SIGNED 0 // just (+)
115 | #define NON_PAD 0 // without padding
116 | #define UPPER_CASE 'A'
117 | #define LOWER_CASE 'a'
118 |
119 | #define SCI 1 // scientific notation "xx.yyezz"
120 | #define NON_SCI 0 // standard notation "xx.yy"
121 |
122 | #define PAD_RIGHT 0x01 // right justified
123 | #define PAD_ZERO 0x02 // padding with zero "0"
124 |
125 | #define PRINT_BUF_LEN 36 // size of internal buffer to the conversion
126 |
127 | //#define WITH_LABEL 1
128 | //#define WITHOUT_LABEL 0
129 |
130 | #endif // end of _EMBEDDED_PRINTF_
131 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/serial_conf.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * "serial_conf.h" used in the embedded version of "printf" function
3 | *
4 | * author: Haroldo Amaral - agaelema@globo.com
5 | * v0.4 - 2017/09/04
6 | ******************************************************************************
7 | * log: . Modify initial version
8 | * + more defines to facilitate the configuration between devices
9 | * + change function "sendbyte" to "serial_sendbyte"
10 | * + add function to configure UART
11 | * + add exp430fr6989 uart back-channel (USCI_UCA1) - P3.4/P3.5
12 | * . change some "#ifdef" to "#if defined ( )"
13 | * + add 9600bps and 115200 at 8MHZ
14 | *
15 | ******************************************************************************/
16 |
17 | #ifndef _SERIAL_CONF_
18 | #define _SERIAL_CONF_
19 |
20 | /******************************************************************************
21 | * list of supported Microcontrollers and their serial USCI
22 | * - uncomment desired device/serial
23 | ******************************************************************************/
24 | //#define MSP430G2553_USCI_A0 // P1.1 and P1.2
25 | //#define MSP430FR6989_USCI_A0 // P2.0 and P2.1
26 | #define MSP430FR6989_USCI_A1 // onboard serial - P3.4 and P3.5
27 |
28 | /******************************************************************************
29 | * UART source of clock
30 | * - uncomment desired device/serial
31 | ******************************************************************************/
32 | //#define LFXT32K
33 | //#define SMCLK_DCO_1MHZ
34 | #define SMCLK_DCO_8MHZ
35 |
36 | /******************************************************************************
37 | * list of supported baudrates
38 | * - uncomment desired baudrate
39 | ******************************************************************************/
40 | //#define BAUD_9600
41 | #define BAUD_115200
42 |
43 | /******************************************************************************
44 | * Register version or Driverlib version
45 | * - select just one
46 | ******************************************************************************/
47 | #define REGISTER_VERSION
48 | //#define DRIVERLIB_VERSION
49 |
50 |
51 | /******************************************************************************
52 | * Supported microcontrollers
53 | * If you add a new device, do a pull request and help other users
54 | ******************************************************************************/
55 | #if defined (MSP430G2553_USCI_A0)
56 | #define MSP430
57 | #define G2553
58 | #define USCI_UCA0
59 |
60 | #elif defined (MSP430FR6989_USCI_A0)
61 | #define MSP430
62 | #define FR6989
63 | #define USCI_UCA0
64 |
65 | #elif defined (MSP430FR6989_USCI_A1)
66 | #define MSP430
67 | #define FR6989
68 | #define USCI_UCA1
69 |
70 | #else
71 | #error "Incorrect or invalid combination"
72 | #endif
73 |
74 |
75 |
76 |
77 | /******************************************************************************
78 | * Prototype of functions
79 | ******************************************************************************/
80 | void serial_configure(void);
81 | void serial_sendbyte(char byte);
82 |
83 | #endif // end of _SERIAL_CONF_
84 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/targetConfigs/MSP430FR6989.ccxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - Low Pass/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.
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/.ccsproject:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | DSP_Math_lib - Test EXP430FR6989 - RMS Value
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 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/.settings/org.eclipse.cdt.codan.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | inEditor=false
3 | onBuild=false
4 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/.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 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/.settings/org.eclipse.core.resources.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | encoding//Debug/driverlib/MSP430FR5xx_6xx/subdir_rules.mk=UTF-8
3 | encoding//Debug/driverlib/MSP430FR5xx_6xx/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 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/DSP_and_Math.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/agaelema/DSP_and_Math/d6c0a8531e11e4ba48ea6e0db764a71e5722e07c/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/DSP_and_Math.h
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/Debug/ccsObjs.opt:
--------------------------------------------------------------------------------
1 | "./DSP_and_Math.obj" "./embedded_printf.obj" "./main.obj" "./serial_conf.obj" "./driverlib/MSP430FR5xx_6xx/adc12_b.obj" "./driverlib/MSP430FR5xx_6xx/aes256.obj" "./driverlib/MSP430FR5xx_6xx/comp_e.obj" "./driverlib/MSP430FR5xx_6xx/crc.obj" "./driverlib/MSP430FR5xx_6xx/crc32.obj" "./driverlib/MSP430FR5xx_6xx/cs.obj" "./driverlib/MSP430FR5xx_6xx/dma.obj" "./driverlib/MSP430FR5xx_6xx/esi.obj" "./driverlib/MSP430FR5xx_6xx/eusci_a_spi.obj" "./driverlib/MSP430FR5xx_6xx/eusci_a_uart.obj" "./driverlib/MSP430FR5xx_6xx/eusci_b_i2c.obj" "./driverlib/MSP430FR5xx_6xx/eusci_b_spi.obj" "./driverlib/MSP430FR5xx_6xx/framctl.obj" "./driverlib/MSP430FR5xx_6xx/framctl_a.obj" "./driverlib/MSP430FR5xx_6xx/gpio.obj" "./driverlib/MSP430FR5xx_6xx/lcd_c.obj" "./driverlib/MSP430FR5xx_6xx/mpu.obj" "./driverlib/MSP430FR5xx_6xx/mpy32.obj" "./driverlib/MSP430FR5xx_6xx/pmm.obj" "./driverlib/MSP430FR5xx_6xx/ram.obj" "./driverlib/MSP430FR5xx_6xx/ref_a.obj" "./driverlib/MSP430FR5xx_6xx/rtc_b.obj" "./driverlib/MSP430FR5xx_6xx/rtc_c.obj" "./driverlib/MSP430FR5xx_6xx/sfr.obj" "./driverlib/MSP430FR5xx_6xx/sysctl.obj" "./driverlib/MSP430FR5xx_6xx/timer_a.obj" "./driverlib/MSP430FR5xx_6xx/timer_b.obj" "./driverlib/MSP430FR5xx_6xx/tlv.obj" "./driverlib/MSP430FR5xx_6xx/wdt_a.obj" "../lnk_msp430fr6989.cmd" -llibmpu_init.a -llibmath.a -llibc.a
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/Debug/objects.mk:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | # Automatically-generated file. Do not edit!
3 | ################################################################################
4 |
5 | USER_OBJS :=
6 |
7 | LIBS := -llibmpu_init.a -llibmath.a -llibc.a
8 |
9 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/Debug/sources.mk:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | # Automatically-generated file. Do not edit!
3 | ################################################################################
4 |
5 | C55_SRCS :=
6 | A_SRCS :=
7 | ASM_UPPER_SRCS :=
8 | EXE_SRCS :=
9 | LDS_UPPER_SRCS :=
10 | CPP_SRCS :=
11 | CMD_SRCS :=
12 | O_SRCS :=
13 | ELF_SRCS :=
14 | C??_SRCS :=
15 | C64_SRCS :=
16 | C67_SRCS :=
17 | SA_SRCS :=
18 | S64_SRCS :=
19 | OPT_SRCS :=
20 | CXX_SRCS :=
21 | S67_SRCS :=
22 | S??_SRCS :=
23 | PDE_SRCS :=
24 | SV7A_SRCS :=
25 | K_SRCS :=
26 | CLA_SRCS :=
27 | S55_SRCS :=
28 | LD_UPPER_SRCS :=
29 | OUT_SRCS :=
30 | INO_SRCS :=
31 | LIB_SRCS :=
32 | ASM_SRCS :=
33 | S_UPPER_SRCS :=
34 | S43_SRCS :=
35 | LD_SRCS :=
36 | CMD_UPPER_SRCS :=
37 | C_UPPER_SRCS :=
38 | C++_SRCS :=
39 | C43_SRCS :=
40 | OBJ_SRCS :=
41 | LDS_SRCS :=
42 | S_SRCS :=
43 | CC_SRCS :=
44 | S62_SRCS :=
45 | C62_SRCS :=
46 | C_SRCS :=
47 | C55_DEPS :=
48 | C_UPPER_DEPS :=
49 | S67_DEPS :=
50 | S62_DEPS :=
51 | S_DEPS :=
52 | OPT_DEPS :=
53 | C??_DEPS :=
54 | ASM_UPPER_DEPS :=
55 | S??_DEPS :=
56 | C64_DEPS :=
57 | CXX_DEPS :=
58 | S64_DEPS :=
59 | INO_DEPS :=
60 | CLA_DEPS :=
61 | S55_DEPS :=
62 | SV7A_DEPS :=
63 | EXE_OUTPUTS :=
64 | C62_DEPS :=
65 | C67_DEPS :=
66 | PDE_DEPS :=
67 | K_DEPS :=
68 | C_DEPS :=
69 | CC_DEPS :=
70 | BIN_OUTPUTS :=
71 | C++_DEPS :=
72 | C43_DEPS :=
73 | S43_DEPS :=
74 | OBJS :=
75 | ASM_DEPS :=
76 | S_UPPER_DEPS :=
77 | CPP_DEPS :=
78 | SA_DEPS :=
79 | C++_DEPS__QUOTED :=
80 | OPT_DEPS__QUOTED :=
81 | S_UPPER_DEPS__QUOTED :=
82 | SA_DEPS__QUOTED :=
83 | C??_DEPS__QUOTED :=
84 | S67_DEPS__QUOTED :=
85 | C55_DEPS__QUOTED :=
86 | CC_DEPS__QUOTED :=
87 | ASM_UPPER_DEPS__QUOTED :=
88 | SV7A_DEPS__QUOTED :=
89 | S??_DEPS__QUOTED :=
90 | OBJS__QUOTED :=
91 | C67_DEPS__QUOTED :=
92 | K_DEPS__QUOTED :=
93 | S55_DEPS__QUOTED :=
94 | INO_DEPS__QUOTED :=
95 | C62_DEPS__QUOTED :=
96 | C_DEPS__QUOTED :=
97 | C_UPPER_DEPS__QUOTED :=
98 | C43_DEPS__QUOTED :=
99 | CPP_DEPS__QUOTED :=
100 | BIN_OUTPUTS__QUOTED :=
101 | C64_DEPS__QUOTED :=
102 | CXX_DEPS__QUOTED :=
103 | CLA_DEPS__QUOTED :=
104 | S_DEPS__QUOTED :=
105 | ASM_DEPS__QUOTED :=
106 | S43_DEPS__QUOTED :=
107 | EXE_OUTPUTS__QUOTED :=
108 | S64_DEPS__QUOTED :=
109 | S62_DEPS__QUOTED :=
110 | PDE_DEPS__QUOTED :=
111 |
112 | # Every subdirectory with source files must be described here
113 | SUBDIRS := \
114 | . \
115 | driverlib/MSP430FR5xx_6xx \
116 |
117 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/Debug/subdir_rules.mk:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | # Automatically-generated file. Do not edit!
3 | ################################################################################
4 |
5 | SHELL = cmd.exe
6 |
7 | # Each subdirectory must supply rules for building sources it contributes
8 | DSP_and_Math.obj: ../DSP_and_Math.c $(GEN_OPTS) | $(GEN_HDRS)
9 | @echo 'Building file: $<'
10 | @echo 'Invoking: MSP430 Compiler'
11 | "C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/bin/cl430" -vmspx --data_model=restricted -O0 --opt_for_speed=1 --use_hw_mpy=F5 --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - RMS Value" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - RMS Value/driverlib/MSP430FR5xx_6xx" --include_path="C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include" --advice:power="none" --advice:hw_config=all --define=DEPRECATED --define=__MSP430FR6989__ --define=_MPU_ENABLE -g --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --preproc_with_compile --preproc_dependency="DSP_and_Math.d_raw" $(GEN_OPTS__FLAG) "$<"
12 | @echo 'Finished building: $<'
13 | @echo ' '
14 |
15 | embedded_printf.obj: ../embedded_printf.c $(GEN_OPTS) | $(GEN_HDRS)
16 | @echo 'Building file: $<'
17 | @echo 'Invoking: MSP430 Compiler'
18 | "C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/bin/cl430" -vmspx --data_model=restricted -O0 --opt_for_speed=1 --use_hw_mpy=F5 --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - RMS Value" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - RMS Value/driverlib/MSP430FR5xx_6xx" --include_path="C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include" --advice:power="none" --advice:hw_config=all --define=DEPRECATED --define=__MSP430FR6989__ --define=_MPU_ENABLE -g --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --preproc_with_compile --preproc_dependency="embedded_printf.d_raw" $(GEN_OPTS__FLAG) "$<"
19 | @echo 'Finished building: $<'
20 | @echo ' '
21 |
22 | main.obj: ../main.c $(GEN_OPTS) | $(GEN_HDRS)
23 | @echo 'Building file: $<'
24 | @echo 'Invoking: MSP430 Compiler'
25 | "C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/bin/cl430" -vmspx --data_model=restricted -O0 --opt_for_speed=1 --use_hw_mpy=F5 --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - RMS Value" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - RMS Value/driverlib/MSP430FR5xx_6xx" --include_path="C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include" --advice:power="none" --advice:hw_config=all --define=DEPRECATED --define=__MSP430FR6989__ --define=_MPU_ENABLE -g --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --preproc_with_compile --preproc_dependency="main.d_raw" $(GEN_OPTS__FLAG) "$<"
26 | @echo 'Finished building: $<'
27 | @echo ' '
28 |
29 | serial_conf.obj: ../serial_conf.c $(GEN_OPTS) | $(GEN_HDRS)
30 | @echo 'Building file: $<'
31 | @echo 'Invoking: MSP430 Compiler'
32 | "C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/bin/cl430" -vmspx --data_model=restricted -O0 --opt_for_speed=1 --use_hw_mpy=F5 --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - RMS Value" --include_path="C:/Users/Embedded/Dropbox/- uC/MSP430/Workspace CCS 7.2/DSP_Math_lib - Test EXP430FR6989 - RMS Value/driverlib/MSP430FR5xx_6xx" --include_path="C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_16.9.4.LTS/include" --advice:power="none" --advice:hw_config=all --define=DEPRECATED --define=__MSP430FR6989__ --define=_MPU_ENABLE -g --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --preproc_with_compile --preproc_dependency="serial_conf.d_raw" $(GEN_OPTS__FLAG) "$<"
33 | @echo 'Finished building: $<'
34 | @echo ' '
35 |
36 |
37 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/Debug/subdir_vars.mk:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | # Automatically-generated file. Do not edit!
3 | ################################################################################
4 |
5 | SHELL = cmd.exe
6 |
7 | # Add inputs and outputs from these tool invocations to the build variables
8 | CMD_SRCS += \
9 | ../lnk_msp430fr6989.cmd
10 |
11 | C_SRCS += \
12 | ../DSP_and_Math.c \
13 | ../embedded_printf.c \
14 | ../main.c \
15 | ../serial_conf.c
16 |
17 | C_DEPS += \
18 | ./DSP_and_Math.d \
19 | ./embedded_printf.d \
20 | ./main.d \
21 | ./serial_conf.d
22 |
23 | OBJS += \
24 | ./DSP_and_Math.obj \
25 | ./embedded_printf.obj \
26 | ./main.obj \
27 | ./serial_conf.obj
28 |
29 | OBJS__QUOTED += \
30 | "DSP_and_Math.obj" \
31 | "embedded_printf.obj" \
32 | "main.obj" \
33 | "serial_conf.obj"
34 |
35 | C_DEPS__QUOTED += \
36 | "DSP_and_Math.d" \
37 | "embedded_printf.d" \
38 | "main.d" \
39 | "serial_conf.d"
40 |
41 | C_SRCS__QUOTED += \
42 | "../DSP_and_Math.c" \
43 | "../embedded_printf.c" \
44 | "../main.c" \
45 | "../serial_conf.c"
46 |
47 |
48 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/driverlib/MSP430FR5xx_6xx/crc.c:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | //
34 | // crc.c - Driver for the crc Module.
35 | //
36 | //*****************************************************************************
37 |
38 | //*****************************************************************************
39 | //
40 | //! \addtogroup crc_api crc
41 | //! @{
42 | //
43 | //*****************************************************************************
44 |
45 | #include "inc/hw_memmap.h"
46 |
47 | #ifdef __MSP430_HAS_CRC__
48 | #include "crc.h"
49 |
50 | #include
51 |
52 | void CRC_setSeed(uint16_t baseAddress,
53 | uint16_t seed)
54 | {
55 | HWREG16(baseAddress + OFS_CRCINIRES) = seed;
56 | }
57 |
58 | void CRC_set16BitData(uint16_t baseAddress,
59 | uint16_t dataIn)
60 | {
61 | HWREG16(baseAddress + OFS_CRCDI) = dataIn;
62 | }
63 |
64 | void CRC_set8BitData(uint16_t baseAddress,
65 | uint8_t dataIn)
66 | {
67 | HWREG8(baseAddress + OFS_CRCDI_L) = dataIn;
68 | }
69 |
70 | void CRC_set16BitDataReversed(uint16_t baseAddress,
71 | uint16_t dataIn)
72 | {
73 | HWREG16(baseAddress + OFS_CRCDIRB) = dataIn;
74 | }
75 |
76 | void CRC_set8BitDataReversed(uint16_t baseAddress,
77 | uint8_t dataIn)
78 | {
79 | HWREG8(baseAddress + OFS_CRCDIRB_L) = dataIn;
80 | }
81 |
82 | uint16_t CRC_getData(uint16_t baseAddress)
83 | {
84 | return (HWREG16(baseAddress + OFS_CRCDI));
85 | }
86 |
87 | uint16_t CRC_getResult(uint16_t baseAddress)
88 | {
89 | return (HWREG16(baseAddress + OFS_CRCINIRES));
90 | }
91 |
92 | uint16_t CRC_getResultBitsReversed(uint16_t baseAddress)
93 | {
94 | return (HWREG16(baseAddress + OFS_CRCRESR));
95 | }
96 |
97 | #endif
98 | //*****************************************************************************
99 | //
100 | //! Close the doxygen group for crc_api
101 | //! @}
102 | //
103 | //*****************************************************************************
104 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/driverlib/MSP430FR5xx_6xx/driverlib.h:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | #include "inc/hw_memmap.h"
33 |
34 | #include "adc12_b.h"
35 | #include "aes256.h"
36 | #include "comp_e.h"
37 | #include "crc.h"
38 | #include "crc32.h"
39 | #include "cs.h"
40 | #include "dma.h"
41 | #include "esi.h"
42 | #include "eusci_a_spi.h"
43 | #include "eusci_a_uart.h"
44 | #include "eusci_b_i2c.h"
45 | #include "eusci_b_spi.h"
46 | #include "framctl.h"
47 | #include "framctl_a.h"
48 | #include "gpio.h"
49 | #include "lcd_c.h"
50 | #include "mpu.h"
51 | #include "mpy32.h"
52 | #include "pmm.h"
53 | #include "ram.h"
54 | #include "ref_a.h"
55 | #include "rtc_b.h"
56 | #include "rtc_c.h"
57 | #include "sfr.h"
58 | #include "sysctl.h"
59 | #include "timer_a.h"
60 | #include "timer_b.h"
61 | #include "tlv.h"
62 | #include "wdt_a.h"
63 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/driverlib/MSP430FR5xx_6xx/inc/hw_memmap.h:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | #ifndef __HW_MEMMAP__
33 | #define __HW_MEMMAP__
34 |
35 | #define __DRIVERLIB_MSP430FR5XX_6XX_FAMILY__
36 | //*****************************************************************************
37 | //
38 | // Include device specific header file
39 | //
40 | //*****************************************************************************
41 | #include
42 |
43 | #ifndef __AUTOGENERATED__
44 | #include "msp430fr5xx_6xxgeneric.h"
45 | #endif
46 |
47 | #include "stdint.h"
48 | #include "stdbool.h"
49 |
50 | //*****************************************************************************
51 | //
52 | // SUCCESS and FAILURE for API return value
53 | //
54 | //*****************************************************************************
55 | #define STATUS_SUCCESS 0x01
56 | #define STATUS_FAIL 0x00
57 |
58 | //*****************************************************************************
59 | //
60 | // Macro for enabling assert statements for debugging
61 | //
62 | //*****************************************************************************
63 | #define NDEBUG
64 |
65 | //*****************************************************************************
66 | //
67 | // Macros for hardware access
68 | //
69 | //*****************************************************************************
70 | #define HWREG32(x) \
71 | (*((volatile uint32_t *)((uint16_t)x)))
72 | #define HWREG16(x) \
73 | (*((volatile uint16_t *)((uint16_t)x)))
74 | #define HWREG8(x) \
75 | (*((volatile uint8_t *)((uint16_t)x)))
76 |
77 | #endif // #ifndef __HW_MEMMAP__
78 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/driverlib/MSP430FR5xx_6xx/inc/version.h:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | #ifndef __DRIVERLIB_VERSION__
33 | #define DRIVERLIB_VER_MAJOR 2
34 | #define DRIVERLIB_VER_MINOR 80
35 | #define DRIVERLIB_VER_PATCH 00
36 | #define DRIVERLIB_VER_BUILD 01
37 | #endif
38 |
39 | #define getVersion() ((uint32_t)DRIVERLIB_VER_MAJOR << 24 | \
40 | (uint32_t)DRIVERLIB_VER_MINOR << 16 | \
41 | (uint32_t)DRIVERLIB_VER_PATCH << 8 | \
42 | (uint32_t)DRIVERLIB_VER_BUILD)
43 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/driverlib/MSP430FR5xx_6xx/pmm.c:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | //
34 | // pmm.c - Driver for the pmm Module.
35 | //
36 | //*****************************************************************************
37 |
38 | //*****************************************************************************
39 | //
40 | //! \addtogroup pmm_api pmm
41 | //! @{
42 | //
43 | //*****************************************************************************
44 |
45 | #include "inc/hw_memmap.h"
46 |
47 | #ifdef __MSP430_HAS_PMM_FRAM__
48 | #include "pmm.h"
49 |
50 | #include
51 |
52 | void PMM_enableSVSH(void)
53 | {
54 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
55 | HWREG8(PMM_BASE + OFS_PMMCTL0_L) |= SVSHE;
56 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
57 | }
58 |
59 | void PMM_disableSVSH(void)
60 | {
61 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
62 | HWREG8(PMM_BASE + OFS_PMMCTL0_L) &= ~SVSHE;
63 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
64 | }
65 |
66 | void PMM_turnOnRegulator(void)
67 | {
68 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
69 | HWREG8(PMM_BASE + OFS_PMMCTL0) &= ~PMMREGOFF;
70 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
71 | }
72 |
73 | void PMM_turnOffRegulator(void)
74 | {
75 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
76 | HWREG8(PMM_BASE + OFS_PMMCTL0) |= PMMREGOFF;
77 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
78 | }
79 |
80 | void PMM_trigPOR(void)
81 | {
82 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
83 | HWREG8(PMM_BASE + OFS_PMMCTL0) |= PMMSWPOR;
84 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
85 | }
86 |
87 | void PMM_trigBOR(void)
88 | {
89 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
90 | HWREG8(PMM_BASE + OFS_PMMCTL0) |= PMMSWBOR;
91 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
92 | }
93 |
94 | void PMM_clearInterrupt(uint16_t mask)
95 | {
96 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = PMMPW_H;
97 | HWREG16(PMM_BASE + OFS_PMMIFG) &= ~mask;
98 | HWREG8(PMM_BASE + OFS_PMMCTL0_H) = 0x00;
99 | }
100 |
101 | uint16_t PMM_getInterruptStatus(uint16_t mask)
102 | {
103 | return ((HWREG16(PMM_BASE + OFS_PMMIFG)) & mask);
104 | }
105 |
106 | void PMM_unlockLPM5(void)
107 | {
108 | //Direct register access to avoid compiler warining - #10420-D
109 | //For FRAM devices, at start up, the GPO power-on default
110 | //high-impedance mode needs to be disabled to activate previously
111 | //configured port settings. This can be done by clearing the LOCKLPM5
112 | //bit in PM5CTL0 registe
113 |
114 | PM5CTL0 &= ~LOCKLPM5;
115 | }
116 |
117 | #endif
118 | //*****************************************************************************
119 | //
120 | //! Close the doxygen group for pmm_api
121 | //! @}
122 | //
123 | //*****************************************************************************
124 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/driverlib/MSP430FR5xx_6xx/ram.c:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | //
34 | // ram.c - Driver for the ram Module.
35 | //
36 | //*****************************************************************************
37 |
38 | //*****************************************************************************
39 | //
40 | //! \addtogroup ram_api ram
41 | //! @{
42 | //
43 | //*****************************************************************************
44 |
45 | #include "inc/hw_memmap.h"
46 |
47 | #ifdef __MSP430_HAS_RC_FRAM__
48 | #include "ram.h"
49 |
50 | #include
51 |
52 | void RAM_setSectorOff(uint8_t sector,
53 | uint8_t mode)
54 | {
55 | uint8_t sectorPos = sector << 1;
56 | uint8_t val = HWREG8(RAM_BASE + OFS_RCCTL0_L) & ~(0x3 << sectorPos);
57 |
58 | HWREG16(RAM_BASE + OFS_RCCTL0) = (RCKEY | val | (mode << sectorPos));
59 | }
60 |
61 | uint8_t RAM_getSectorState(uint8_t sector)
62 | {
63 | uint8_t sectorPos = sector << 1;
64 | return((HWREG8(RAM_BASE + OFS_RCCTL0_L) & (0x3 << sectorPos)) >> sectorPos);
65 | }
66 |
67 | #endif
68 | //*****************************************************************************
69 | //
70 | //! Close the doxygen group for ram_api
71 | //! @}
72 | //
73 | //*****************************************************************************
74 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/driverlib/MSP430FR5xx_6xx/sfr.c:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | //
34 | // sfr.c - Driver for the sfr Module.
35 | //
36 | //*****************************************************************************
37 |
38 | //*****************************************************************************
39 | //
40 | //! \addtogroup sfr_api sfr
41 | //! @{
42 | //
43 | //*****************************************************************************
44 |
45 | #include "inc/hw_memmap.h"
46 |
47 | #ifdef __MSP430_HAS_SFR__
48 | #include "sfr.h"
49 |
50 | #include
51 |
52 | void SFR_enableInterrupt(uint8_t interruptMask)
53 | {
54 | HWREG8(SFR_BASE + OFS_SFRIE1_L) |= interruptMask;
55 | }
56 |
57 | void SFR_disableInterrupt(uint8_t interruptMask)
58 | {
59 | HWREG8(SFR_BASE + OFS_SFRIE1_L) &= ~(interruptMask);
60 | }
61 |
62 | uint8_t SFR_getInterruptStatus(uint8_t interruptFlagMask)
63 | {
64 | return (HWREG8(SFR_BASE + OFS_SFRIFG1_L) & interruptFlagMask);
65 | }
66 |
67 | void SFR_clearInterrupt(uint8_t interruptFlagMask)
68 | {
69 | HWREG8(SFR_BASE + OFS_SFRIFG1_L) &= ~(interruptFlagMask);
70 | }
71 |
72 | void SFR_setResetPinPullResistor(uint16_t pullResistorSetup)
73 | {
74 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) &= ~(SYSRSTRE + SYSRSTUP);
75 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) |= pullResistorSetup;
76 | }
77 |
78 | void SFR_setNMIEdge(uint16_t edgeDirection)
79 | {
80 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) &= ~(SYSNMIIES);
81 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) |= edgeDirection;
82 | }
83 |
84 | void SFR_setResetNMIPinFunction(uint8_t resetPinFunction)
85 | {
86 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) &= ~(SYSNMI);
87 | HWREG8(SFR_BASE + OFS_SFRRPCR_L) |= resetPinFunction;
88 | }
89 |
90 | #endif
91 | //*****************************************************************************
92 | //
93 | //! Close the doxygen group for sfr_api
94 | //! @}
95 | //
96 | //*****************************************************************************
97 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/driverlib/MSP430FR5xx_6xx/wdt_a.c:
--------------------------------------------------------------------------------
1 | /* --COPYRIGHT--,BSD
2 | * Copyright (c) 2016, 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 | //
34 | // wdt_a.c - Driver for the wdt_a Module.
35 | //
36 | //*****************************************************************************
37 |
38 | //*****************************************************************************
39 | //
40 | //! \addtogroup wdt_a_api wdt_a
41 | //! @{
42 | //
43 | //*****************************************************************************
44 |
45 | #include "inc/hw_memmap.h"
46 |
47 | #ifdef __MSP430_HAS_WDT_A__
48 | #include "wdt_a.h"
49 |
50 | #include
51 |
52 | void WDT_A_hold(uint16_t baseAddress)
53 | {
54 | // Set Hold bit
55 | uint8_t newWDTStatus =
56 | ((HWREG16(baseAddress + OFS_WDTCTL) & 0x00FF) | WDTHOLD);
57 |
58 | HWREG16(baseAddress + OFS_WDTCTL) = WDTPW + newWDTStatus;
59 | }
60 |
61 | void WDT_A_start(uint16_t baseAddress)
62 | {
63 | // Reset Hold bit
64 | uint8_t newWDTStatus =
65 | ((HWREG16(baseAddress + OFS_WDTCTL) & 0x00FF) & ~(WDTHOLD));
66 |
67 | HWREG16(baseAddress + OFS_WDTCTL) = WDTPW + newWDTStatus;
68 | }
69 |
70 | void WDT_A_resetTimer(uint16_t baseAddress)
71 | {
72 | // Set Counter Clear bit
73 | uint8_t newWDTStatus =
74 | ((HWREG16(baseAddress + OFS_WDTCTL) & 0x00FF) | WDTCNTCL);
75 |
76 | HWREG16(baseAddress + OFS_WDTCTL) = WDTPW + newWDTStatus;
77 | }
78 |
79 | void WDT_A_initWatchdogTimer(uint16_t baseAddress,
80 | uint8_t clockSelect,
81 | uint8_t clockDivider)
82 | {
83 | HWREG16(baseAddress + OFS_WDTCTL) =
84 | WDTPW + WDTCNTCL + WDTHOLD + clockSelect + clockDivider;
85 | }
86 |
87 | void WDT_A_initIntervalTimer(uint16_t baseAddress,
88 | uint8_t clockSelect,
89 | uint8_t clockDivider)
90 | {
91 | HWREG16(baseAddress + OFS_WDTCTL) =
92 | WDTPW + WDTCNTCL + WDTHOLD + WDTTMSEL + clockSelect + clockDivider;
93 | }
94 |
95 | #endif
96 | //*****************************************************************************
97 | //
98 | //! Close the doxygen group for wdt_a_api
99 | //! @}
100 | //
101 | //*****************************************************************************
102 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/embedded_printf.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Embedded version of "printf( )" function
3 | * - with similar functions but more efficient
4 | *
5 | * author: Haroldo Amaral - agaelema@globo.com
6 | * v0.5 - 2017/08/20
7 | *
8 | * Based in this link:
9 | * http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/30479/107146
10 | ******************************************************************************
11 | * log: . change some "#ifdef" to "#if defined ( )"
12 | ******************************************************************************/
13 |
14 | #ifndef _EMBEDDED_PRINTF_
15 | #define _EMBEDDED_PRINTF_
16 |
17 | #include
18 | #include "serial_conf.h"
19 |
20 | /******************************************************************************
21 | * CONFIGURATIONS OF EMBEDDED_PRINTF
22 | * - select/uncomment desired options
23 | ******************************************************************************/
24 | #define ENABLE_PAD // enable padding in functions
25 | #define ENABLE_FLOAT // enable print float/double
26 | //#define PRECISION_FLOAT // select precision version - use double variable
27 | //#define ENABLE_EXTRA_DECIMAL_PLACE // enabled = 9 dp, disabled = 4 dp - depends of PRECISION_FLOAT
28 | #define ENABLE_BINARY // enable binary notation
29 |
30 |
31 | /******************************************************************************
32 | * PROTOTYPE OF FUNCTIONS
33 | ******************************************************************************/
34 | void putChar(uint8_t byte);
35 | void linesUp(unsigned int lines);
36 |
37 | unsigned int embedded_prints(char *string, unsigned int width, unsigned int pad);
38 | unsigned int embedded_ltoa(char *print_buf, int32_t input, unsigned int base, unsigned int sg, unsigned int width, unsigned int pad, unsigned char letbase);
39 |
40 | //#ifdef ENABLE_PAD
41 | //#define ENABLE_PAD_
42 | //#endif
43 |
44 | #if defined (ENABLE_PAD)
45 | #define ENABLE_PAD_
46 | #endif
47 |
48 |
49 | //#ifdef ENABLE_EXTRA_DECIMAL_PLACE
50 | //#define ENABLE_EXTRA_DECIMAL_PLACE_
51 | //#endif
52 |
53 | #if defined (ENABLE_EXTRA_DECIMAL_PLACE)
54 | #define ENABLE_EXTRA_DECIMAL_PLACE_
55 | #endif
56 |
57 | //#ifdef ENABLE_FLOAT
58 |
59 | #if defined (ENABLE_FLOAT)
60 |
61 | //#ifdef PRECISION_FLOAT
62 | #if defined (PRECISION_FLOAT)
63 | #define PRECISION_FLOAT_
64 | unsigned int embedded_ftoa(char *print_buf, double input, signed int dp, unsigned int sci);
65 | #else
66 | unsigned int embedded_ftoa(char *print_buf, float input, signed int dp, unsigned int sci);
67 | #endif
68 | #endif
69 |
70 | unsigned int embedded_printf(char *format, ...);
71 |
72 | unsigned int print_string(char *string);
73 | unsigned int print_long(long number);
74 | unsigned int print_ulong(unsigned long number);
75 | unsigned int print_hexa(long number);
76 |
77 | //#ifdef ENABLE_BINARY
78 | #if defined (ENABLE_BINARY)
79 | #define ENABLE_BINARY_
80 | unsigned int print_binary(long number, unsigned int bits);
81 | #endif
82 |
83 | //#ifdef ENABLE_FLOAT
84 | #if defined (ENABLE_FLOAT)
85 | #define ENABLE_FLOAT_
86 |
87 | //#ifdef PRECISION_FLOAT
88 | #if defined (PRECISION_FLOAT)
89 | #define PRECISION_FLOAT_
90 | unsigned int print_float(double number, int dp);
91 | unsigned int print_scientific(double number, int dp);
92 | #else
93 | unsigned int print_float(float number, int dp);
94 | unsigned int print_scientific(float number, int dp);
95 | #endif
96 | #endif
97 |
98 |
99 | #ifdef PRECISION_FLOAT_
100 | void embedded_string2number(unsigned char *string, double *number);
101 | #else
102 | void embedded_string2number(unsigned char *string, float *number);
103 | #endif
104 |
105 |
106 | /******************************************************************************
107 | * IMPORTANT DEFINITION
108 | ******************************************************************************/
109 | #define BINARY 2 // number identifier
110 | #define DECIMAL 10
111 | #define HEXADEC 16
112 |
113 | #define SIGNED 1 // if signed (+/-)
114 | #define NON_SIGNED 0 // just (+)
115 | #define NON_PAD 0 // without padding
116 | #define UPPER_CASE 'A'
117 | #define LOWER_CASE 'a'
118 |
119 | #define SCI 1 // scientific notation "xx.yyezz"
120 | #define NON_SCI 0 // standard notation "xx.yy"
121 |
122 | #define PAD_RIGHT 0x01 // right justified
123 | #define PAD_ZERO 0x02 // padding with zero "0"
124 |
125 | #define PRINT_BUF_LEN 36 // size of internal buffer to the conversion
126 |
127 | //#define WITH_LABEL 1
128 | //#define WITHOUT_LABEL 0
129 |
130 | #endif // end of _EMBEDDED_PRINTF_
131 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/serial_conf.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * "serial_conf.h" used in the embedded version of "printf" function
3 | *
4 | * author: Haroldo Amaral - agaelema@globo.com
5 | * v0.4 - 2017/09/04
6 | ******************************************************************************
7 | * log: . Modify initial version
8 | * + more defines to facilitate the configuration between devices
9 | * + change function "sendbyte" to "serial_sendbyte"
10 | * + add function to configure UART
11 | * + add exp430fr6989 uart back-channel (USCI_UCA1) - P3.4/P3.5
12 | * . change some "#ifdef" to "#if defined ( )"
13 | * + add 9600bps and 115200 at 8MHZ
14 | *
15 | ******************************************************************************/
16 |
17 | #ifndef _SERIAL_CONF_
18 | #define _SERIAL_CONF_
19 |
20 | /******************************************************************************
21 | * list of supported Microcontrollers and their serial USCI
22 | * - uncomment desired device/serial
23 | ******************************************************************************/
24 | //#define MSP430G2553_USCI_A0 // P1.1 and P1.2
25 | //#define MSP430FR6989_USCI_A0 // P2.0 and P2.1
26 | #define MSP430FR6989_USCI_A1 // onboard serial - P3.4 and P3.5
27 |
28 | /******************************************************************************
29 | * UART source of clock
30 | * - uncomment desired device/serial
31 | ******************************************************************************/
32 | //#define LFXT32K
33 | //#define SMCLK_DCO_1MHZ
34 | #define SMCLK_DCO_8MHZ
35 |
36 | /******************************************************************************
37 | * list of supported baudrates
38 | * - uncomment desired baudrate
39 | ******************************************************************************/
40 | //#define BAUD_9600
41 | #define BAUD_115200
42 |
43 | /******************************************************************************
44 | * Register version or Driverlib version
45 | * - select just one
46 | ******************************************************************************/
47 | #define REGISTER_VERSION
48 | //#define DRIVERLIB_VERSION
49 |
50 |
51 | /******************************************************************************
52 | * Supported microcontrollers
53 | * If you add a new device, do a pull request and help other users
54 | ******************************************************************************/
55 | #if defined (MSP430G2553_USCI_A0)
56 | #define MSP430
57 | #define G2553
58 | #define USCI_UCA0
59 |
60 | #elif defined (MSP430FR6989_USCI_A0)
61 | #define MSP430
62 | #define FR6989
63 | #define USCI_UCA0
64 |
65 | #elif defined (MSP430FR6989_USCI_A1)
66 | #define MSP430
67 | #define FR6989
68 | #define USCI_UCA1
69 |
70 | #else
71 | #error "Incorrect or invalid combination"
72 | #endif
73 |
74 |
75 |
76 |
77 | /******************************************************************************
78 | * Prototype of functions
79 | ******************************************************************************/
80 | void serial_configure(void);
81 | void serial_sendbyte(char byte);
82 |
83 | #endif // end of _SERIAL_CONF_
84 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/targetConfigs/MSP430FR6989.ccxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Examples/MSP430/DSP_Math_lib - Test EXP430FR6989 - RMS Value/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.
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Haroldo Amaral
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/highpass_plot.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/agaelema/DSP_and_Math/d6c0a8531e11e4ba48ea6e0db764a71e5722e07c/highpass_plot.jpg
--------------------------------------------------------------------------------
/lowpass_plot.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/agaelema/DSP_and_Math/d6c0a8531e11e4ba48ea6e0db764a71e5722e07c/lowpass_plot.jpg
--------------------------------------------------------------------------------