//MSP430 Projects/MSP430_Audio_Cube/.launches/MSP430_Audio_Project.launch |
---|
0,0 → 1,32 |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
<launchConfiguration type="com.ti.ccstudio.debug.launchType.device.debugging"> |
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_CPUS_WITH_PROJECT" value="<?xml version="1.0" encoding="UTF-8"?> <cpus_with_project> <id id="TI MSP430 USB1/MSP430" isa="MSP430"/> </cpus_with_project>"/> |
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_DEBUGGER_PROPERTIES.TI MSP430 USB1/MSP430" value="<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <PropertyValues> <property id="ConnectOnStartup"> <curValue>1</curValue> </property> <property id="EnableInstalledBreakpoint"> <curValue>1</curValue> </property> </PropertyValues> "/> |
<setAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_HIDE_CONFIG_ELEMENT_TYPES"> |
<setEntry value="BOARD"/> |
<setEntry value="BYPASSED_CPU"/> |
<setEntry value="CONNECTION"/> |
<setEntry value="DEVICE"/> |
<setEntry value="NON_DEBUG_CPU"/> |
<setEntry value="NO_DRIVER"/> |
<setEntry value="ROUTER"/> |
<setEntry value="SUBPATH"/> |
<setEntry value="SYSTEM"/> |
</setAttribute> |
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROGRAM.TI MSP430 USB1/MSP430" value="${build_artifact:MSP430_Audio_Project}"/> |
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROJECT.TI MSP430 USB1/MSP430" value="MSP430_Audio_Project"/> |
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_TARGET_CONFIG" value="${target_config_active_default:MSP430_Audio_Project}"/> |
<stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.TI MSP430 USB1/MSP430" value="C:/Users\Kevin\Documents\Code\MSP430_Audio_Project\Release\MSP430_Audio_Project.out"/> |
<mapAttribute key="com.ti.ccstudio.debug.ui.displayFormats"> |
<mapEntry key="TI MSP430 USB1/MSP430@##separator##@0" value="16-Bit Hex - TI Style"/> |
</mapAttribute> |
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> |
<listEntry value="/MSP430_Audio_Project"/> |
</listAttribute> |
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> |
<listEntry value="4"/> |
</listAttribute> |
<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="com.ti.ccstudio.debug.sourceLocator"/> |
<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <sourceLookupDirector> <sourceContainers duplicates="false"> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;default/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.default"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;cpuSpecificContainer cpuName=&quot;TI MSP430 USB1/MSP430&quot;&gt;&#13;&#10;&lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;default/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;org.eclipse.debug.core.containerType.default&quot;/&gt;&#13;&#10;&lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;project name=&amp;quot;MSP430_Audio_Project&amp;quot; referencedProjects=&amp;quot;true&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;org.eclipse.debug.core.containerType.project&quot;/&gt;&#13;&#10;&lt;/cpuSpecificContainer&gt;&#13;&#10;" typeId="com.ti.ccstudio.debug.containerType.cpu.specific"/> </sourceContainers> </sourceLookupDirector> "/> |
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList context="reserved-for-future-use"/> "/> |
</launchConfiguration> |
//MSP430 Projects/MSP430_Audio_Cube/main.c |
---|
0,0 → 1,235 |
#include <msp430.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include "hal_SPI.h" |
#include "mmc.h" |
#include "diskio.h" |
#include "pff.h" |
#include "player.h" |
#include "adxl345.h" |
/** |
* Takes an initialized DIR and returns the number of sub-dir and files |
*/ |
FRESULT directory_info(char *path, int *dir_count, int *file_count) { |
FILINFO finfo; |
FRESULT result; |
DIR dir; |
*dir_count = 0; |
*file_count = 0; |
result = pf_opendir(&dir, path); |
if (result == FR_OK) { |
for (;;) { |
result = pf_readdir(&dir, &finfo); |
// Break upon end of list |
if (result != FR_OK || finfo.fname[0] == 0) break; |
// Increment the directory or file count |
if (finfo.fattrib & AM_DIR) { |
*dir_count = *dir_count + 1; |
} else { |
*file_count = *file_count + 1; |
} |
} |
} |
return result; |
} |
static int file_count, dir_count; |
static char filename[16]; |
int main(void) { |
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer |
/* --- Set Oscillator Settings (8Mhz) --------------- */ |
// Set DCO to 5, MOD to 0 |
DCOCTL = CALDCO_16MHZ; |
// Set RSEL to 13 |
BCSCTL1 = CALBC1_16MHZ; |
// MCLK = DCO/1, SMCLK = MCLK/1 |
BCSCTL2 = SELM_0 | DIVM_0 | DIVS_0; |
// LFXT1 = VLOCLK, 1pF termination |
BCSCTL3 = LFXT1S_2 | XCAP_0; |
// Disable oscillator fault interrupt |
IE1 &= ~OFIE; |
/* -------------------------------------------------- */ |
/* --- Initialize I/O Ports ------------------------- */ |
P2SEL = 0x0; // P2SEL resets to 0xC0 |
// SPI Pins (idle low) |
SPI_PxOUT &= ~(SPI_SIMO + SPI_SOMI + SPI_UCLK); |
SPI_PxDIR |= SPI_SIMO + SPI_UCLK; |
SPI_PxDIR &= ~SPI_SOMI; |
SPI_PxREN |= SPI_SOMI; |
// SD Chip Select (idle high) |
MMC_CS_PxOUT |= MMC_CS; |
MMC_CS_PxDIR |= MMC_CS; |
// SD Card Detect (input) |
MMC_CD_PxDIR &= ~MMC_CD; |
// VS1053 Chip Select (idle high) |
VS10XX_CS_PxOUT |= VS10XX_CS; |
VS10XX_CS_PxDIR |= VS10XX_CS; |
// VS1053 Data/Command Select (idle high) |
VS10XX_DC_PxOUT |= VS10XX_DC; |
VS10XX_DC_PxDIR |= VS10XX_DC; |
// VS1053 DREQ Line (input) |
VS10XX_DREQ_PxDIR &= ~VS10XX_DREQ; |
// Accelerometer Chip Select (idle high) |
ADXL_CS_PxOUT |= ADXL_CS; |
ADXL_CS_PxDIR |= ADXL_CS; |
// Accelerometer Interrupt 1 (input) |
ADXL_INT1_PxDIR &= ~ADXL_INT1; |
ADXL_INT1_PxIES |= ADXL_INT1; // Interrupt on High -> Low |
ADXL_INT1_PxIFG &= ~ADXL_INT1; // Clear interrupt flag |
// Accelerometer Interrupt 2 (input) |
ADXL_INT2_PxDIR &= ~ADXL_INT2; |
// ADXL_INT2_PxIES |= ADXL_INT2; // Interrupt on High -> Low |
// ADXL_INT2_PxIFG &= ~ADXL_INT2; // Clear interrupt flag |
// ADXL_INT2_PxIE |= ADXL_INT2; // Enable interrupt |
// Reset (idle low) |
CHIP_RESET_PxOUT &= ~CHIP_RESET; |
CHIP_RESET_PxDIR |= CHIP_RESET; |
// Red LED (idle low) |
LED_RED_PxOUT &= ~LED_RED; |
LED_RED_PxDIR |= LED_RED; |
// Green LED (idle low) |
LED_GREEN_PxOUT &= ~LED_GREEN; |
LED_GREEN_PxDIR |= LED_GREEN; |
// Initialize port 3 even though it doesnt exist on the device |
P3DIR = 0xFF; |
P3OUT = 0x00; |
/* -------------------------------------------------- */ |
unsigned char status = 1; |
int acc_x, acc_y, acc_z; |
FATFS fs; |
FRESULT result = FR_NOT_READY; |
// Delay for a bit to ensure that SD card powers up |
__delay_cycles(16000); |
// Init SPI Module |
halSPISetup(); |
// Attempt the startup procedure four times |
int i; |
for (i = 0; i < 4; i++) { |
// Initialize the accelerometer |
if (ADXLInit() == 0) { |
// Sum the accelerometer values to seed the randomizer |
ADXLRead(&acc_x, &acc_y, &acc_z); |
srand(acc_x + acc_y + acc_z); |
// Mount the SD card |
result = pf_mount(&fs); |
if (result == FR_OK) { |
// Acquire the number of subdirectories and files in the root directory |
result = directory_info("/", &dir_count, &file_count); |
if (result == FR_OK && file_count > 0) { |
CHIP_RESET_HIGH(); |
if (VS1053Init() == 0) { |
LED_GREEN_HIGH(); |
__delay_cycles(1000000); |
LED_GREEN_LOW(); |
// If everything went well, play the first track |
status = 0; |
VS1053PlayFile("track1.mp3"); |
break; |
} else { // VS1053Init() |
continue; |
} |
} else { // directory_info |
continue; |
} |
} else { // pf_mount() |
continue; |
} |
} else { // ADXLInit() |
continue; |
} |
} |
// If everything is ok, enable accelerometer interrupts |
if (status != 0) { |
// Otherwise turn off everything |
LED_RED_HIGH(); |
void ADXLStandbyOn(void); |
} else { |
ADXL_INT1_PxIE |= ADXL_INT1; // Enable interrupt |
ADXLInitInterrupts(); |
} |
// LED_RED_HIGH(); |
// Turn off all chips except the accelerometer |
CHIP_RESET_LOW(); |
_BIS_SR(LPM4_bits + GIE); |
while(1); |
} |
#pragma vector=PORT1_VECTOR |
__interrupt void Port1_Interrupt(void) { |
if (ADXL_INT1_PxIFG & ADXL_INT1) { |
LED_GREEN_HIGH(); |
__delay_cycles(1000000); |
LED_GREEN_LOW(); |
// Bring chips out of low-power state |
CHIP_RESET_HIGH(); |
VSInitSoftware(); |
// Play a random file |
int i = (rand() % file_count) + 1; |
snprintf(filename, 16, "track%d.mp3", i); |
VS1053PlayFile(filename); |
// Return chips to low-power state |
CHIP_RESET_LOW(); |
// Clear the interrupts on the ADXL chip |
ADXLClearInterrupts(); |
// Clear the interrupt flag |
ADXL_INT1_PxIFG &= ~ADXL_INT1; |
} |
// if (ADXL_INT2_PxIFG & ADXL_INT2) { |
// LED_RED_HIGH(); |
// __delay_cycles(2000000); |
// LED_RED_LOW(); |
// |
// // Clear the interrupt flag |
// ADXL_INT2_PxIFG &= ~ADXL_INT2; |
// } |
} |
//MSP430 Projects/MSP430_Audio_Cube/adxl345.c |
---|
0,0 → 1,157 |
#include "adxl345.h" |
#include "hal_hardware_board.h" |
#include "hal_SPI.h" |
/* |
* Writes the given byte to the register at the address |
*/ |
void WriteSPI(unsigned char addr, unsigned char data) { |
halSPISetPolarityPhase(1,1); // ADXL345 operates in SPI(1,1) |
ADXL_CS_LOW(); |
spiSendByte(addr & ~ADXL_BYTE_WRITE); |
spiSendByte(data); |
ADXL_CS_HIGH(); |
halSPISetPolarityPhase(0,0); // Revert back to SPI(0,0) |
} |
/* |
* Reads the value of the register at the address |
*/ |
unsigned char ReadSPI(unsigned char addr) { |
unsigned char ret; |
halSPISetPolarityPhase(1,1); // ADXL345 operates in SPI(1,1) |
ADXL_CS_LOW(); |
spiSendByte(addr | ADXL_BYTE_READ); |
spiReadFrame(&ret, 1); |
ADXL_CS_HIGH(); |
halSPISetPolarityPhase(0,0); // Revert back to SPI(0,0) |
return ret; |
} |
/* |
* Reads a 16-bit value of the register at the address |
*/ |
int Read16SPI(unsigned char addr) { |
unsigned char recv[2]; |
int ret; |
halSPISetPolarityPhase(1,1); // ADXL345 operates in SPI(1,1) |
ADXL_CS_LOW(); |
spiSendByte(addr | ADXL_MULTI_BYTE_READ); |
spiReadFrame(recv, 2); |
ADXL_CS_HIGH(); |
halSPISetPolarityPhase(0,0); // Revert back to SPI(0,0) |
ret = recv[0]; |
ret |= recv[1] << 8; |
return ret; |
} |
/* |
* ADXL345 Initialization Function |
*/ |
unsigned char ADXLInit(void) { |
unsigned char deviceID; |
// Check if device exists |
deviceID = ReadSPI(ADXL345_REG_DEVID); |
if (deviceID != 0xE5) |
return 1; |
// Set FIFO to bypass mode |
WriteSPI(ADXL345_REG_FIFO_CTL, 0x00); |
// // Set the INT_INVERT bit in DATA_FORMAT register |
WriteSPI(ADXL345_REG_DATA_FORMAT, 0x20); |
ADXLSetRange(ADXL345_RANGE_16_G); |
ADXLSetDataRate(ADXL345_DATARATE_12_5_HZ); |
ADXLClearInterrupts(); |
ADXLStandbyOff(); |
return 0; |
} |
void ADXLStandbyOn(void) { |
// Turn off measurements |
WriteSPI(ADXL345_REG_POWER_CTL, 0x00); |
} |
void ADXLStandbyOff(void) { |
// Turn on measurements |
WriteSPI(ADXL345_REG_POWER_CTL, 0x08); |
} |
/* |
* Sets up and enables the tap interrupt |
*/ |
void ADXLInitInterrupts(void) { |
// Set tap acceleration threshold (62.5mg/LSB, 0xFF=16g) |
WriteSPI(ADXL345_REG_THRESH_TAP, 0x18); |
// Set maximum tap duration (625us/LSB) |
WriteSPI(ADXL345_REG_DUR, 0xFF); |
// Set minimum time for second tap (1.25ms/LSB) |
WriteSPI(ADXL345_REG_LATENT, 0xFF); |
// Set maximum time for second tap (1.25ms/LSB) |
WriteSPI(ADXL345_REG_WINDOW, 0xFF); |
// Bind single tap to INT1 and double tap to INT2 |
WriteSPI(ADXL345_REG_INT_MAP, 0x20); |
// Enable all three axis for tap detection |
WriteSPI(ADXL345_REG_TAP_AXES, 0x07); |
// Enable single tap interrupts |
WriteSPI(ADXL345_REG_INT_ENABLE, 0x40); |
} |
/* |
* Clears any active interrupt flags |
*/ |
void ADXLClearInterrupts(void) { |
ReadSPI(ADXL345_REG_ACT_TAP_STATUS); |
ReadSPI(ADXL345_REG_INT_SOURCE); |
} |
/* |
* Returns sensor data |
*/ |
void ADXLRead(int *x, int *y, int *z) { |
*x = Read16SPI(ADXL345_REG_DATAX0); |
*y = Read16SPI(ADXL345_REG_DATAY0); |
*z = Read16SPI(ADXL345_REG_DATAZ0); |
} |
/* |
* Sets the sensitivity range (2/4/8/16g) |
*/ |
void ADXLSetRange(range_t range) { |
unsigned char data = ReadSPI(ADXL345_REG_DATA_FORMAT); |
// Set the new sensitivity range |
data &= ~0x0F; |
data |= range; |
// Set the FULL_RES bit |
data |= 0x08; |
WriteSPI(ADXL345_REG_DATA_FORMAT, data); |
} |
/* |
* Sets the data rate |
*/ |
void ADXLSetDataRate(dataRate_t rate) { |
unsigned char data = rate; |
#ifdef ADXL345_LOW_POWER_MODE |
// Set the low power mode bit |
data |= 0x10; |
#endif |
WriteSPI(ADXL345_REG_BW_RATE, data); |
} |
//MSP430 Projects/MSP430_Audio_Cube/hal_SPI.c |
---|
0,0 → 1,474 |
//---------------------------------------------------------------------------- |
// This file contains functions that allow the MSP430 device to access the |
// SPI interface. There are multiple instances of each function; |
// the one to be compiled is selected by the system variable |
// SPI_SER_INTF, defined in "hal_hardware_board.h". |
//---------------------------------------------------------------------------- |
//---------------------------------------------------------------------------- |
// void halSPISetup(void) |
// |
// DESCRIPTION: |
// Configures the assigned interface to function as a SPI port and |
// initializes it. |
//---------------------------------------------------------------------------- |
// void halSPIWriteReg(char addr, char value) |
// |
// DESCRIPTION: |
// Writes "value" to a single configuration register at address "addr". |
//---------------------------------------------------------------------------- |
// void halSPIWriteBurstReg(char addr, char *buffer, char count) |
// |
// DESCRIPTION: |
// Writes values to multiple configuration registers, the first register being |
// at address "addr". First data byte is at "buffer", and both addr and |
// buffer are incremented sequentially (within the CCxxxx and MSP430, |
// respectively) until "count" writes have been performed. |
//---------------------------------------------------------------------------- |
// char halSPIReadReg(char addr) |
// |
// DESCRIPTION: |
// Reads a single configuration register at address "addr" and returns the |
// value read. |
//---------------------------------------------------------------------------- |
// void halSPIReadBurstReg(char addr, char *buffer, char count) |
// |
// DESCRIPTION: |
// Reads multiple configuration registers, the first register being at address |
// "addr". Values read are deposited sequentially starting at address |
// "buffer", until "count" registers have been read. |
//---------------------------------------------------------------------------- |
// char halSPIReadStatus(char addr) |
// |
// DESCRIPTION: |
// Special read function for reading status registers. Reads status register |
// at register "addr" and returns the value read. |
//---------------------------------------------------------------------------- |
// void halSPIStrobe(char strobe) |
// |
// DESCRIPTION: |
// Special write function for writing to command strobe registers. Writes |
// to the strobe at address "addr". |
//---------------------------------------------------------------------------- |
/* *********************************************************** |
* THIS PROGRAM IS PROVIDED "AS IS". TI MAKES NO WARRANTIES OR |
* REPRESENTATIONS, EITHER EXPRESS, IMPLIED OR STATUTORY, |
* INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS |
* FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR |
* COMPLETENESS OF RESPONSES, RESULTS AND LACK OF NEGLIGENCE. |
* TI DISCLAIMS ANY WARRANTY OF TITLE, QUIET ENJOYMENT, QUIET |
* POSSESSION, AND NON-INFRINGEMENT OF ANY THIRD PARTY |
* INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO THE PROGRAM OR |
* YOUR USE OF THE PROGRAM. |
* |
* IN NO EVENT SHALL TI BE LIABLE FOR ANY SPECIAL, INCIDENTAL, |
* CONSEQUENTIAL OR INDIRECT DAMAGES, HOWEVER CAUSED, ON ANY |
* THEORY OF LIABILITY AND WHETHER OR NOT TI HAS BEEN ADVISED |
* OF THE POSSIBILITY OF SUCH DAMAGES, ARISING IN ANY WAY OUT |
* OF THIS AGREEMENT, THE PROGRAM, OR YOUR USE OF THE PROGRAM. |
* EXCLUDED DAMAGES INCLUDE, BUT ARE NOT LIMITED TO, COST OF |
* REMOVAL OR REINSTALLATION, COMPUTER TIME, LABOR COSTS, LOSS |
* OF GOODWILL, LOSS OF PROFITS, LOSS OF SAVINGS, OR LOSS OF |
* USE OR INTERRUPTION OF BUSINESS. IN NO EVENT WILL TI'S |
* AGGREGATE LIABILITY UNDER THIS AGREEMENT OR ARISING OUT OF |
* YOUR USE OF THE PROGRAM EXCEED FIVE HUNDRED DOLLARS |
* (U.S.$500). |
* |
* Unless otherwise stated, the Program written and copyrighted |
* by Texas Instruments is distributed as "freeware". You may, |
* only under TI's copyright in the Program, use and modify the |
* Program without any charge or restriction. You may |
* distribute to third parties, provided that you transfer a |
* copy of this license to the third party and the third party |
* agrees to these terms by its first use of the Program. You |
* must reproduce the copyright notice and any other legend of |
* ownership on each copy or partial copy, of the Program. |
* |
* You acknowledge and agree that the Program contains |
* copyrighted material, trade secrets and other TI proprietary |
* information and is protected by copyright laws, |
* international copyright treaties, and trade secret laws, as |
* well as other intellectual property laws. To protect TI's |
* rights in the Program, you agree not to decompile, reverse |
* engineer, disassemble or otherwise translate any object code |
* versions of the Program to a human-readable form. You agree |
* that in no event will you alter, remove or destroy any |
* copyright notice included in the Program. TI reserves all |
* rights not specifically granted under this license. Except |
* as specifically provided herein, nothing in this agreement |
* shall be construed as conferring by implication, estoppel, |
* or otherwise, upon you, any license or other right under any |
* TI patents, copyrights or trade secrets. |
* |
* You may not use the Program in non-TI devices. |
* ********************************************************* */ |
#ifndef _SPILIB_C |
#define _SPILIB_C |
// |
//--------------------------------------------------------------- |
#include "hal_SPI.h" |
#include "hal_hardware_board.h" |
//#define withDMA |
// SPI port functions |
#if SPI_SER_INTF == SER_INTF_USART0 |
void halSPISetup(void) |
{ |
UCTL0 = CHAR + SYNC + MM + SWRST; // 8-bit SPI Master **SWRST** |
UTCTL0 = CKPL + SSEL1 + SSEL0 + STC; // SMCLK, 3-pin mode |
UBR00 = 0x02; // UCLK/2 |
UBR10 = 0x00; // 0 |
UMCTL0 = 0x00; // No modulation |
ME1 |= USPIE0; // Enable USART0 SPI mode |
UCTL0 &= ~SWRST; // Initialize USART state machine |
} |
#elif SPI_SER_INTF == SER_INTF_USART1 |
void halSPISetup(void) |
{ |
UCTL1 = CHAR + SYNC + MM + SWRST; // 8-bit SPI Master **SWRST** |
UTCTL1 = CKPL + SSEL1 + SSEL0 + STC; // SMCLK, 3-pin mode |
UBR01 = 0x02; // UCLK/2 |
UBR11 = 0x00; // 0 |
UMCTL1 = 0x00; // No modulation |
ME2 |= USPIE1; // Enable USART1 SPI mode |
UCTL1 &= ~SWRST; // Initialize USART state machine |
} |
#elif SPI_SER_INTF == SER_INTF_USCIA0 |
void halSPISetup(void) |
{ |
UCA0CTL0 = UCMST+UCCKPL+UCMSB+UCSYNC; // 3-pin, 8-bit SPI master |
UCA0CTL1 = UCSSEL_2 + UCSWRST; // SMCLK |
halSPISetSpeedLow(); |
UCA0MCTL = 0; |
SPI_PxSEL |= SPI_UCLK+SPI_SOMI+SPI_SIMO; |
SPI_PxSEL2 |= SPI_UCLK+SPI_SOMI+SPI_SIMO; |
SPI_PxOUT |= SPI_SIMO + SPI_SOMI + SPI_UCLK; |
SPI_PxDIR |= SPI_SIMO + SPI_UCLK; |
SPI_PxDIR &= ~SPI_SOMI; |
UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine** |
} |
void halSPISetSpeedHigh(void) { |
UCA0BR0 = 4; // CLK_FREQ = BRCLK / 4 |
UCA0BR1 = 0; |
} |
void halSPISetSpeedLow(void) { |
UCA0BR0 = 32; // CLK_FREQ = BRCLK / 32 |
UCA0BR1 = 0; |
} |
#elif SPI_SER_INTF == SER_INTF_USCIA1 |
void halSPISetup(void) |
{ |
UCA1CTL0 = UCMST+UCCKPL+UCMSB+UCSYNC; // 3-pin, 8-bit SPI master |
UCA1CTL1 = UCSSEL_2 + UCSWRST; // SMCLK |
halSPISetSpeedLow(); |
UCA1MCTL = 0; |
UCA1CTL1 &= ~UCSWRST; // **Initialize USCI state machine** |
} |
void halSPISetSpeedHigh(void) { |
UCA1BR0 = 4; // CLK_FREQ = BRCLK / 4 |
UCA1BR1 = 0; |
} |
void halSPISetSpeedLow(void) { |
UCA1BR0 = 32; // CLK_FREQ = BRCLK / 32 |
UCA1BR1 = 0; |
} |
#elif SPI_SER_INTF == SER_INTF_USCIB0 |
void halSPISetup(void) |
{ |
UCB0CTL0 = UCMSB+UCMST+UCMODE_0; // 3-pin, 8-bit SPI master |
halSPISetPolarityPhase(0, 0); |
UCB0CTL1 = UCSSEL_2+UCSWRST; // SMCLK |
halSPISetSpeedLow(); |
//UCB0MCTL = 0; |
SPI_PxSEL |= SPI_UCLK+SPI_SOMI+SPI_SIMO; |
SPI_PxSEL2 |= SPI_UCLK+SPI_SOMI+SPI_SIMO; |
UCB0CTL1 &= ~UCSWRST; // **Initialize USCI state machine** |
} |
void halSPISetSpeedHigh(void) { |
UCB0BR0 = 4; // CLK_FREQ = BRCLK / 4 |
UCB0BR1 = 0; |
} |
void halSPISetSpeedLow(void) { |
UCB0BR0 = 32; // CLK_FREQ = BRCLK / 32 |
UCB0BR1 = 0; |
} |
void halSPISetPolarityPhase(char polarity, char phase) { |
// Polarity 0 = inactive low, Polarity 1 = inactive high |
// Phase 0 = Capture on first edge, change on following edge |
// Phase 1 = Change on first edge, capture on following edge |
// Note: Phase is inverted on MSP430! |
UCB0CTL0 &= ~(UCCKPH + UCCKPL); |
if (polarity == 0 && phase == 0) { |
UCB0CTL0 |= UCCKPH; |
} else if (polarity == 1 && phase == 0) { |
UCB0CTL0 |= UCCKPH + UCCKPL; |
} else if (polarity == 1 && phase == 1) { |
UCB0CTL0 |= UCCKPL; |
} |
} |
#elif SPI_SER_INTF == SER_INTF_USCIB1 |
void halSPISetup(void) |
{ |
UCB1CTL0 = UCMST+UCCKPL+UCMSB+UCSYNC; // 3-pin, 8-bit SPI master |
UCB1CTL1 = UCSSEL_2+UCSWRST; // SMCLK |
halSPISetSpeedLow(); |
UCB1MCTL = 0; |
UCB1CTL1 &= ~UCSWRST; // **Initialize USCI state machine** |
} |
void halSPISetSpeedHigh(void) { |
UCB1BR0 = 4; // CLK_FREQ = BRCLK / 4 |
UCB1BR1 = 0; |
} |
void halSPISetSpeedLow(void) { |
UCB1BR0 = 32; // CLK_FREQ = BRCLK / 32 |
UCB1BR1 = 0; |
} |
#elif SPI_SER_INTF == SER_INTF_USI |
void halSPISetup(void) |
{ |
USICTL0 = USIPE7+USIPE6+USIPE5+USIMST+USIGE+USIOE+USISWRST; // Port, SPI master |
USICKCTL = USISSEL_2; // SCLK = SMCLK |
USICTL0 &= ~USISWRST; // USI released for operation |
// USISRL = 0x00; // Ensure SDO low instead of high, |
// USICNT = 1; // to avoid conflict with CCxxxx |
} |
void halSPISetSpeedHigh(void) { |
USICKCTL = (USICKCTL & 0x1F) | USIDIV_2; // CLK_FREQ = BRCLK / 4 |
} |
void halSPISetSpeedLow(void) { |
USICKCTL = (USICKCTL & 0x1F) | USIDIV_5; // CLK_FREQ = BRCLK / 32 |
} |
#elif SPI_SER_INTF == SER_INTF_BITBANG |
void spi_bitbang_out(unsigned char); |
unsigned char spi_bitbang_in(); |
unsigned char spi_bitbang_in_data; |
void halSPISetup(void) |
{ |
} |
// Output eight-bit value using selected bit-bang pins |
void spi_bitbang_out(unsigned char value) |
{ |
char x; |
for(x=8;x>0;x--) |
{ |
if(value & 0x80) // If bit is high... |
MMC_PxOUT |= MMC_SIMO;// Set SIMO high... |
else |
MMC_PxOUT &= ~MMC_SIMO;//Set SIMO low... |
value = value << 1; // Rotate bits |
MMC_PxOUT &= ~MMC_UCLK; // Set clock low |
MMC_PxOUT |= MMC_UCLK; // Set clock high |
} |
} |
// Input eight-bit value using selected bit-bang pins |
unsigned char spi_bitbang_in() |
{ |
char x=0; |
int y; |
for(y=8;y>0;y--) |
{ |
MMC_PxOUT &= ~MMC_UCLK; // Set clock low |
MMC_PxOUT |= MMC_UCLK; // Set clock high |
x = x << 1; // Rotate bits |
if(MMC_PxIN & MMC_SOMI) // If bit is high... |
x |= 0x01; // input bit high |
} |
spi_bitbang_in_data = x; |
return(x); |
} |
// Input eight-bit value using selected bit-bang pins |
unsigned char spi_bitbang_inout(unsigned char value) |
{ |
char x=0; |
int y; |
for(y=8;y>0;y--) |
{ |
if(value & 0x80) // If bit is high... |
MMC_PxOUT |= MMC_SIMO;// Set SIMO high... |
else |
MMC_PxOUT &= ~MMC_SIMO;//Set SIMO low... |
value = value << 1; // Rotate bits |
MMC_PxOUT &= ~MMC_UCLK; // Set clock low |
MMC_PxOUT |= MMC_UCLK; // Set clock high |
x = x << 1; // Rotate bits |
if(MMC_PxIN & MMC_SOMI) // If bit is high... |
x |= 0x01; // input bit high |
} |
spi_bitbang_in_data = x; |
return(x); |
} |
#endif |
//Send one byte via SPI |
unsigned char spiSendByte(const unsigned char data) |
{ |
while (halSPITXREADY == 0); // wait while not ready for TX |
halSPI_SEND(data); // write |
while (halSPIRXREADY == 0); // wait for RX buffer (full) |
return (halSPIRXBUF); |
} |
//Read a frame of bytes via SPI |
unsigned char spiReadFrame(unsigned char* pBuffer, unsigned int size) |
{ |
#ifndef withDMA |
unsigned long i = 0; |
// clock the actual data transfer and receive the bytes; spi_read automatically finds the Data Block |
for (i = 0; i < size; i++){ |
while (halSPITXREADY == 0); // wait while not ready for TX |
halSPI_SEND(DUMMY_CHAR); // dummy write |
while (halSPIRXREADY == 0); // wait for RX buffer (full) |
pBuffer[i] = halSPIRXBUF; |
} |
#else |
U1IFG &= ~(URXIFG1 + URXIFG1); /* clear flags */ |
/* Get the block */ |
/* DMA trigger is UART1 receive for both DMA0 and DMA1 */ |
DMACTL0 &= ~(DMA0TSEL_15 | DMA1TSEL_15); |
DMACTL0 |= (DMA0TSEL_9 | DMA1TSEL_9); |
/* Source DMA address: receive register. */ |
DMA0SA = U1RXBUF_; |
/* Destination DMA address: the user data buffer. */ |
DMA0DA = (unsigned short)pBuffer; |
/* The size of the block to be transferred */ |
DMA0SZ = size; |
/* Configure the DMA transfer*/ |
DMA0CTL = |
DMAIE | /* Enable interrupt */ |
DMADT_0 | /* Single transfer mode */ |
DMASBDB | /* Byte mode */ |
DMAEN | /* Enable DMA */ |
DMADSTINCR1 | DMADSTINCR0; /* Increment the destination address */ |
/* We depend on the DMA priorities here. Both triggers occur at |
the same time, since the source is identical. DMA0 is handled |
first, and retrieves the byte. DMA1 is triggered next, and |
sends the next byte. */ |
/* Source DMA address: constant 0xFF (don't increment)*/ |
DMA1SA = U1TXBUF_; |
/* Destination DMA address: the transmit buffer. */ |
DMA1DA = U1TXBUF_; |
/* Increment the destination address */ |
/* The size of the block to be transferred */ |
DMA1SZ = count-1; |
/* Configure the DMA transfer*/ |
DMA1CTL = |
DMADT_0 | /* Single transfer mode */ |
DMASBDB | /* Byte mode */ |
DMAEN; /* Enable DMA */ |
/* Kick off the transfer by sending the first byte */ |
halMMC_SEND(0xFF); |
_EINT(); LPM0; // wait till done |
#endif |
return(0); |
} |
//Send a frame of bytes via SPI |
unsigned char spiSendFrame(unsigned char* pBuffer, unsigned int size) |
{ |
#ifndef withDMA |
unsigned long i = 0; |
// clock the actual data transfer and receive the bytes; spi_read automatically finds the Data Block |
for (i = 0; i < size; i++){ |
while (halSPITXREADY ==0); // wait while not ready for TX |
halSPI_SEND(pBuffer[i]); // write |
while (halSPIRXREADY ==0); // wait for RX buffer (full) |
pBuffer[i] = halSPIRXBUF; |
} |
#else |
/* Get the block */ |
/* DMA trigger is UART send */ |
DMACTL0 &= ~(DMA0TSEL_15); |
DMACTL0 |= (DMA0TSEL_9); |
/* Source DMA address: the data buffer. */ |
DMA0SA = (unsigned short)pBuffer; |
/* Destination DMA address: the UART send register. */ |
DMA0DA = U1TXBUF_; |
/* The size of the block to be transferred */ |
DMA0SZ = count; |
/* Configure the DMA transfer*/ |
DMA0CTL = |
DMAREQ | /* start transfer */ |
DMADT_0 | /* Single transfer mode */ |
DMASBDB | /* Byte mode */ |
DMAEN | /* Enable DMA */ |
DMASRCINCR1 | DMASRCINCR0; /* Increment the source address */ |
#endif |
return(0); |
} |
#ifdef withDMA |
#ifdef __IAR_SYSTEMS_ICC__ |
#if __VER__ < 200 |
interrupt[DACDMA_VECTOR] void DMA_isr(void) |
#else |
#pragma vector = DACDMA_VECTOR |
__interrupt void DMA_isr(void) |
#endif |
#endif |
#ifdef __CROSSWORKS__ |
void DMA_isr(void) __interrupt[DACDMA_VECTOR] |
#endif |
#ifdef __TI_COMPILER_VERSION__ |
__interrupt void DMA_isr(void); |
DMA_ISR(DMA_isr) |
__interrupt void DMA_isr(void) |
#endif |
{ |
DMA0CTL &= ~(DMAIFG); |
LPM3_EXIT; |
} |
#endif |
//--------------------------------------------------------------------- |
#endif /* _SPILIB_C */ |
//MSP430 Projects/MSP430_Audio_Cube/hal_SPI.h |
---|
0,0 → 1,124 |
// ************************************************************************************* |
// |
// Filename: hal_SPI.h: |
// Declarations for Communication with the MMC (see mmc.c) in unprotected SPI mode. |
// |
// Version 1.1 |
// added ul declaration in macros mmcWriteSector and mmcReadSector |
// ************************************************************************************* |
#ifndef _SPILIB_H |
#define _SPILIB_H |
#include "hal_hardware_board.h" |
//---------------------------------------------------------------------------- |
// These constants are used to identify the chosen SPI and UART |
// interfaces. |
//---------------------------------------------------------------------------- |
#define SER_INTF_NULL 0 |
#define SER_INTF_USART0 1 |
#define SER_INTF_USART1 2 |
#define SER_INTF_USCIA0 3 |
#define SER_INTF_USCIA1 4 |
#define SER_INTF_USCIB0 5 |
#define SER_INTF_USCIB1 6 |
#define SER_INTF_USI 7 |
#define SER_INTF_BITBANG 8 |
#if SPI_SER_INTF == SER_INTF_USART0 |
#define halSPIRXBUF U0RXBUF |
#define halSPI_SEND(x) U0TXBUF=x |
#define halSPITXREADY (IFG1&UTXIFG0) /* Wait for TX to be ready */ |
#define halSPITXDONE (U0TCTL&TXEPT) /* Wait for TX to finish */ |
#define halSPIRXREADY (IFG1&URXIFG0) /* Wait for TX to be ready */ |
#define halSPIRXFG_CLR IFG1 &= ~URXIFG0 |
#define halSPI_PxIN SPI_USART0_PxIN |
#define halSPI_SOMI SPI_USART0_SOMI |
#elif SPI_SER_INTF == SER_INTF_USART1 |
#define halSPIRXBUF U1RXBUF |
#define halSPI_SEND(x) U1TXBUF=x |
#define halSPITXREADY (IFG2&UTXIFG1) /* Wait for TX to be ready */ |
#define halSPITXDONE (U1TCTL&TXEPT) /* Wait for TX to finish */ |
#define halSPIRXREADY (IFG2&URXIFG1) /* Wait for TX to be ready */ |
#define halSPIRXFG_CLR IFG2 &= ~URXIFG1 |
#define halSPI_PxIN SPI_USART1_PxIN |
#define halSPI_SOMI SPI_USART1_SOMI |
#elif SPI_SER_INTF == SER_INTF_USCIA0 |
#define halSPIRXBUF UCA0RXBUF |
#define halSPI_SEND(x) UCA0TXBUF=x |
#define halSPITXREADY (IFG2&UCA0TXIFG) /* Wait for TX to be ready */ |
#define halSPITXDONE !(UCA0STAT&UCBUSY) /* Wait for TX to finish */ |
#define halSPIRXREADY (IFG2&UCB0RXIFG) /* Wait for TX to be ready */ |
#define halSPIRXFG_CLR IFG2 &= ~UCA0RXIFG |
#define halSPI_PxIN SPI_USART0_PxIN |
#define halSPI_SOMI SPI_USART0_SOMI |
#elif SPI_SER_INTF == SER_INTF_USCIA1 |
#define halSPIRXBUF UCA1RXBUF |
#define halSPI_SEND(x) UCA1TXBUF=x |
#define halSPITXREADY (UC1IFG&UCA1TXIFG) /* Wait for TX to be ready */ |
#define halSPITXDONE !(UCA1STAT&UCBUSY) /* Wait for TX to finish */ |
#define halSPIRXREADY (UC1IFG&UCA1RXIFG) /* Wait for TX to be ready */ |
#define halSPIRXFG_CLR UC1IFG &= ~UCA1RXIFG |
#define halSPI_PxIN SPI_USART0_PxIN |
#define halSPI_SOMI SPI_USART0_SOMI |
#elif SPI_SER_INTF == SER_INTF_USCIB0 |
#define halSPIRXBUF UCB0RXBUF |
#define halSPI_SEND(x) UCB0TXBUF=x |
#define halSPITXREADY (UC0IFG&UCB0TXIFG) /* Wait for TX to be ready */ |
#define halSPITXDONE !(UCB0STAT&UCBUSY) /* Wait for TX to finish */ |
#define halSPIRXREADY (UC0IFG&UCB0RXIFG) /* Wait for TX to be ready */ |
#define halSPIRXFG_CLR UC0IFG &= ~UCB0RXIFG |
#define halSPI_PxIN SPI_USART0_PxIN |
#define halSPI_SOMI SPI_USART0_SOMI |
#elif SPI_SER_INTF == SER_INTF_USCIB1 |
#define halSPIRXBUF UCB1RXBUF |
#define halSPI_SEND(x) UCB1TXBUF=x |
#define halSPITXREADY (UC1IFG&UCB1TXIFG) /* Wait for TX to be ready */ |
#define halSPITXDONE !(UCB1STAT&UCBUSY) /* Wait for TX to finish */ |
#define halSPIRXREADY (UC1IFG&UCB1RXIFG) /* Wait for TX to be ready */ |
#define halSPIRXFG_CLR UC1IFG &= ~UCB1RXIFG |
#define halSPI_PxIN SPI_USART0_PxIN |
#define halSPI_SOMI SPI_USART0_SOMI |
#elif SPI_SER_INTF == SER_INTF_USI |
#define halSPIRXBUF USISRL |
#define halSPI_SEND(x) USISRL = x; USICNT = 8 |
#define halSPITXREADY (USICTL1&USIIFG) |
#define halSPITXDONE (USICTL1&USIIFG) |
#define halSPIRXREADY (USICTL1&USIIFG) |
#define halSPIRXFG_CLR |
#define halSPI_PxIN SPI_BITBANG_PxIN |
#define halSPI_SOMI SPI_BITBANG_SOMI |
#elif SPI_SER_INTF == SER_INTF_BITBANG |
#define halSPIRXBUF spi_bitbang_in_data |
#define halSPI_SEND(x) spi_bitbang_inout(x) |
#define halSPITXREADY 1 |
#define halSPITXDONE 1 |
#define halSPIRXREADY 1 |
#define halSPIRXFG_CLR |
#define halSPI_PxIN SPI_BITBANG_PxIN |
#define halSPI_SOMI SPI_BITBANG_SOMI |
#endif |
// Variables |
#define DUMMY_CHAR 0xFF |
// Function Prototypes |
void halSPISetup (void); |
unsigned char spiSendByte(const unsigned char data); |
unsigned char spiReadFrame(unsigned char* pBuffer, unsigned int size); |
unsigned char spiSendFrame(unsigned char* pBuffer, unsigned int size); |
void halSPISetSpeedHigh(void); |
void halSPISetSpeedLow(void); |
void halSPISetPolarityPhase(char polarity, char phase); |
#endif /* _SPILIB_H */ |
//MSP430 Projects/MSP430_Audio_Cube/hal_hardware_board.h |
---|
0,0 → 1,156 |
//---------------------------------------------------------------------------- |
// This include file contains definitions specific to the hardware board. |
//---------------------------------------------------------------------------- |
// ******************************************************** |
#include <msp430.h> |
//---------------------------------------------------------------------------- |
// SPI/UART port selections. Select which port will be used for the interface |
//---------------------------------------------------------------------------- |
// Define the SPI hardware module |
#define SPI_SER_INTF SER_INTF_USCIB0 |
// SPI port definitions // Adjust this according to the |
#define SPI_PxSEL P1SEL // MSP430 device being used. |
#define SPI_PxSEL2 P1SEL2 // Adjust the values for the chosen |
#define SPI_PxREN P1REN // interfaces, according to the pin |
#define SPI_PxDIR P1DIR // assignments indicated in the |
#define SPI_PxIN P1IN // chosen MSP430 device datasheet. |
#define SPI_PxOUT P1OUT |
#define SPI_SIMO BIT7 |
#define SPI_SOMI BIT6 |
#define SPI_UCLK BIT5 |
//---------------------------------------------------------------------------- |
// MMC/SD port selections. Select which port will be used for the interface |
//---------------------------------------------------------------------------- |
// MMC port definitions // Adjust the values for the chosen |
#define MMC_PxSEL SPI_PxSEL // interfaces, according to the pin |
#define MMC_PxDIR SPI_PxDIR // assignments indicated in the |
#define MMC_PxIN SPI_PxIN // chosen MSP430 device datasheet. |
#define MMC_PxOUT SPI_PxOUT |
#define MMC_SIMO SPI_SIMO |
#define MMC_SOMI SPI_SOMI |
#define MMC_UCLK SPI_UCLK |
// Chip Select |
#define MMC_CS_PxOUT P2OUT |
#define MMC_CS_PxDIR P2DIR |
#define MMC_CS BIT0 |
// Card Detect |
#define MMC_CD_PxIN P2IN |
#define MMC_CD_PxDIR P2DIR |
#define MMC_CD BIT2 |
// CS Control |
#define MMC_CS_LOW() MMC_CS_PxOUT &= ~MMC_CS // Card Select |
#define MMC_CS_HIGH() while(!halSPITXDONE); MMC_CS_PxOUT |= MMC_CS // Card Deselect |
// Chip Detect |
#define MMC_CD_STAT() MMC_CD_PxIN & MMC_CD |
//---------------------------------------------------------------------------- |
// VS10XX port selections. Select which port will be used for the interface |
//---------------------------------------------------------------------------- |
// VS10xx port definitions |
#define VS10XX_PxSEL SPI_PxSEL |
#define VS10XX_PxDIR SPI_PxDIR |
#define VS10XX_PxIN SPI_PxIN |
#define VS10XX_PxOUT SPI_PxOUT |
#define VS10XX_SIMO SPI_SIMO |
#define VS10XX_SOMI SPI_SOMI |
#define VS10XX_UCLK SPI_UCLK |
// Chip Command Select |
#define VS10XX_CS_PxOUT P2OUT |
#define VS10XX_CS_PxDIR P2DIR |
#define VS10XX_CS BIT5 |
// Chip Data Select |
#define VS10XX_DC_PxOUT P2OUT |
#define VS10XX_DC_PxDIR P2DIR |
#define VS10XX_DC BIT1 |
// DREQ Line |
#define VS10XX_DREQ_PxIN P2IN |
#define VS10XX_DREQ_PxDIR P2DIR |
#define VS10XX_DREQ BIT4 |
// CS Control |
#define VS10XX_CS_LOW() VS10XX_CS_PxOUT &= ~VS10XX_CS |
#define VS10XX_CS_HIGH() while(!halSPITXDONE); VS10XX_CS_PxOUT |= VS10XX_CS |
// DS Control |
#define VS10XX_DS_LOW() VS10XX_DC_PxOUT &= ~VS10XX_DC |
#define VS10XX_DS_HIGH() while(!halSPITXDONE); VS10XX_DC_PxOUT |= VS10XX_DC |
// DREQ Control |
#define VS10XX_DREQ_STAT() VS10XX_DREQ_PxIN & VS10XX_DREQ |
//---------------------------------------------------------------------------- |
// Accelerometer port selections. Select which port will be used for the interface |
//---------------------------------------------------------------------------- |
// Accelerometer Chip Select |
#define ADXL_CS_PxOUT P1OUT |
#define ADXL_CS_PxDIR P1DIR |
#define ADXL_CS BIT4 |
// Interrupt 1 |
#define ADXL_INT1_PxIN P1IN |
#define ADXL_INT1_PxDIR P1DIR |
#define ADXL_INT1_PxIFG P1IFG |
#define ADXL_INT1_PxIES P1IES |
#define ADXL_INT1_PxIE P1IE |
#define ADXL_INT1 BIT3 |
// Interrupt 2 |
#define ADXL_INT2_PxIN P1IN |
#define ADXL_INT2_PxDIR P1DIR |
#define ADXL_INT2_PxIFG P1IFG |
#define ADXL_INT2_PxIES P1IES |
#define ADXL_INT2_PxIE P1IE |
#define ADXL_INT2 BIT2 |
// CS Control |
#define ADXL_CS_LOW() ADXL_CS_PxOUT &= ~ADXL_CS |
#define ADXL_CS_HIGH() while(!halSPITXDONE); ADXL_CS_PxOUT |= ADXL_CS |
#define ADXL_INT1_STAT() ADXL_INT1_PxIN & ADXL_INT1 |
#define ADXL_INT2_STAT() ADXL_INT2_PxIN & ADXL_INT2 |
//---------------------------------------------------------------------------- |
// Misc port selections. Select which port will be used for the interface |
//---------------------------------------------------------------------------- |
// Reset Line |
#define LED_RED_PxOUT P1OUT |
#define LED_RED_PxDIR P1DIR |
#define LED_RED BIT1 |
// Reset Line |
#define LED_GREEN_PxOUT P1OUT |
#define LED_GREEN_PxDIR P1DIR |
#define LED_GREEN BIT0 |
// Reset Line |
#define CHIP_RESET_PxOUT P2OUT |
#define CHIP_RESET_PxDIR P2DIR |
#define CHIP_RESET BIT3 |
// Reset Control |
#define CHIP_RESET_LOW() CHIP_RESET_PxOUT &= ~CHIP_RESET |
#define CHIP_RESET_HIGH() CHIP_RESET_PxOUT |= CHIP_RESET |
// Red LED |
#define LED_RED_LOW() LED_RED_PxOUT &= ~LED_RED |
#define LED_RED_HIGH() LED_RED_PxOUT |= LED_RED |
// Green LED |
#define LED_GREEN_LOW() LED_GREEN_PxOUT &= ~LED_GREEN |
#define LED_GREEN_HIGH() LED_GREEN_PxOUT |= LED_GREEN |
//MSP430 Projects/MSP430_Audio_Cube/mmc.c |
---|
0,0 → 1,536 |
// *********************************************************** |
// File: mmc.c |
// Description: Library to access a MultiMediaCard |
// functions: init, read, write ... |
// C. Speck / S. Schauer |
// Texas Instruments, Inc |
// June 2005 |
// |
// Version 1.1 |
// corrected comments about connection the MMC to the MSP430 |
// increased timeout in mmcGetXXResponse |
// |
// *********************************************************** |
// MMC Lib |
// *********************************************************** |
/* *********************************************************** |
* THIS PROGRAM IS PROVIDED "AS IS". TI MAKES NO WARRANTIES OR |
* REPRESENTATIONS, EITHER EXPRESS, IMPLIED OR STATUTORY, |
* INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS |
* FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR |
* COMPLETENESS OF RESPONSES, RESULTS AND LACK OF NEGLIGENCE. |
* TI DISCLAIMS ANY WARRANTY OF TITLE, QUIET ENJOYMENT, QUIET |
* POSSESSION, AND NON-INFRINGEMENT OF ANY THIRD PARTY |
* INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO THE PROGRAM OR |
* YOUR USE OF THE PROGRAM. |
* |
* IN NO EVENT SHALL TI BE LIABLE FOR ANY SPECIAL, INCIDENTAL, |
* CONSEQUENTIAL OR INDIRECT DAMAGES, HOWEVER CAUSED, ON ANY |
* THEORY OF LIABILITY AND WHETHER OR NOT TI HAS BEEN ADVISED |
* OF THE POSSIBILITY OF SUCH DAMAGES, ARISING IN ANY WAY OUT |
* OF THIS AGREEMENT, THE PROGRAM, OR YOUR USE OF THE PROGRAM. |
* EXCLUDED DAMAGES INCLUDE, BUT ARE NOT LIMITED TO, COST OF |
* REMOVAL OR REINSTALLATION, COMPUTER TIME, LABOR COSTS, LOSS |
* OF GOODWILL, LOSS OF PROFITS, LOSS OF SAVINGS, OR LOSS OF |
* USE OR INTERRUPTION OF BUSINESS. IN NO EVENT WILL TI'S |
* AGGREGATE LIABILITY UNDER THIS AGREEMENT OR ARISING OUT OF |
* YOUR USE OF THE PROGRAM EXCEED FIVE HUNDRED DOLLARS |
* (U.S.$500). |
* |
* Unless otherwise stated, the Program written and copyrighted |
* by Texas Instruments is distributed as "freeware". You may, |
* only under TI's copyright in the Program, use and modify the |
* Program without any charge or restriction. You may |
* distribute to third parties, provided that you transfer a |
* copy of this license to the third party and the third party |
* agrees to these terms by its first use of the Program. You |
* must reproduce the copyright notice and any other legend of |
* ownership on each copy or partial copy, of the Program. |
* |
* You acknowledge and agree that the Program contains |
* copyrighted material, trade secrets and other TI proprietary |
* information and is protected by copyright laws, |
* international copyright treaties, and trade secret laws, as |
* well as other intellectual property laws. To protect TI's |
* rights in the Program, you agree not to decompile, reverse |
* engineer, disassemble or otherwise translate any object code |
* versions of the Program to a human-readable form. You agree |
* that in no event will you alter, remove or destroy any |
* copyright notice included in the Program. TI reserves all |
* rights not specifically granted under this license. Except |
* as specifically provided herein, nothing in this agreement |
* shall be construed as conferring by implication, estoppel, |
* or otherwise, upon you, any license or other right under any |
* TI patents, copyrights or trade secrets. |
* |
* You may not use the Program in non-TI devices. |
* ********************************************************* */ |
#ifndef _MMCLIB_C |
#define _MMCLIB_C |
// |
//--------------------------------------------------------------- |
#include "mmc.h" |
#include "hal_SPI.h" |
#include "hal_hardware_board.h" |
//#define withDMA |
// Function Prototypes |
char mmcGetResponse(void); |
char mmcGetXXResponse(const char resp); |
char mmcCheckBusy(void); |
char mmcGoIdle(); |
// Initialize MMC card |
char mmcInit(void) |
{ |
//raise CS and MOSI for 80 clock cycles |
//SendByte(0xff) 10 times with CS high |
//RAISE CS |
int i; |
// Port x Function Dir On/Off |
// mmcCS Out 0 - Active 1 - none Active |
// Dout Out 0 - off 1 - On -> init in SPI_Init |
// Din Inp 0 - off 1 - On -> init in SPI_Init |
// Clk Out - -> init in SPI_Init |
// mmcCD In 0 - card inserted |
// // Init Port for MMC (default high) |
// MMC_PxOUT |= MMC_SIMO + MMC_SOMI + MMC_UCLK; |
// MMC_PxDIR |= MMC_SIMO + MMC_UCLK; |
// MMC_PxDIR &= ~MMC_SOMI; |
// |
// // Chip Select |
// MMC_CS_PxOUT |= MMC_CS; |
// MMC_CS_PxDIR |= MMC_CS; |
// |
// // Card Detect |
// MMC_CD_PxDIR &= ~MMC_CD; |
// Enable secondary function |
#if SPI_SER_INTF == SER_INTF_BITBANG |
MMC_PxSEL |= MMC_SIMO + MMC_SOMI + MMC_UCLK; |
#endif |
// Ping the card to check if it exists |
// Set the clock speed to something slow |
halSPISetSpeedLow(); |
// Initialization sequence on powerup |
MMC_CS_HIGH(); |
for(i=0;i<=9;i++) |
spiSendByte(DUMMY_CHAR); |
__delay_cycles(100); |
return (mmcGoIdle()); |
} |
// Set MMC in Idle mode |
char mmcGoIdle() |
{ |
char response=0x01; |
MMC_CS_LOW(); |
// Send Command 0 to put MMC in SPI mode |
mmcSendCmd(MMC_GO_IDLE_STATE,0,0x95); |
// Now wait until idle state bit is cleared |
if(mmcGetResponse()!=0x01) |
return MMC_INIT_ERROR; |
while(response==0x01) |
{ |
MMC_CS_HIGH(); |
spiSendByte(DUMMY_CHAR); |
MMC_CS_LOW(); |
mmcSendCmd(MMC_SEND_OP_COND,0x00,0xff); |
response=mmcGetResponse(); |
} |
MMC_CS_HIGH(); |
// Card is now initialized, increase the clock speed |
halSPISetSpeedHigh(); |
spiSendByte(DUMMY_CHAR); |
spiSendByte(DUMMY_CHAR); |
return (MMC_SUCCESS); |
} |
// MMC Get Response |
char mmcGetResponse(void) |
{ |
//Response comes 1-8bytes after command |
//the first bit will be a 0 |
//followed by an error code |
//data will be 0xff until response |
int i=0; |
volatile unsigned char response; |
while(i<=64) |
{ |
response=spiSendByte(DUMMY_CHAR); |
if(response==0x00)break; |
if(response==0x01)break; |
i++; |
} |
return response; |
} |
char mmcGetXXResponse(const char resp) |
{ |
//Response comes 1-8bytes after command |
//the first bit will be a 0 |
//followed by an error code |
//data will be 0xff until response |
int i=0; |
char response; |
while(i<=1000) |
{ |
response=spiSendByte(DUMMY_CHAR); |
if(response==resp)break; |
i++; |
} |
return response; |
} |
// Check if MMC card is still busy |
char mmcCheckBusy(void) |
{ |
//Response comes 1-8bytes after command |
//the first bit will be a 0 |
//followed by an error code |
//data will be 0xff until response |
int i=0; |
char response; |
char rvalue; |
while(i<=64) |
{ |
response=spiSendByte(DUMMY_CHAR); |
response &= 0x1f; |
switch(response) |
{ |
case 0x05: rvalue=MMC_SUCCESS;break; |
case 0x0b: return(MMC_CRC_ERROR); |
case 0x0d: return(MMC_WRITE_ERROR); |
default: |
rvalue = MMC_OTHER_ERROR; |
break; |
} |
if(rvalue==MMC_SUCCESS)break; |
i++; |
} |
i=0; |
do |
{ |
response=spiSendByte(DUMMY_CHAR); |
i++; |
}while(response==0); |
return response; |
} |
// The card will respond with a standard response token followed by a data |
// block suffixed with a 16 bit CRC. |
// read a size Byte big block beginning at the address. |
char mmcReadBlock(const unsigned long address, const unsigned long count, unsigned char *pBuffer) |
{ |
char rvalue = MMC_RESPONSE_ERROR; |
// Set the block length to read |
if (mmcSetBlockLength (count) == MMC_SUCCESS) // block length could be set |
{ |
// CS = LOW (on) |
MMC_CS_LOW (); |
// send read command MMC_READ_SINGLE_BLOCK=CMD17 |
mmcSendCmd (MMC_READ_SINGLE_BLOCK,address, 0xFF); |
// Send 8 Clock pulses of delay, check if the MMC acknowledged the read block command |
// it will do this by sending an affirmative response |
// in the R1 format (0x00 is no errors) |
if (mmcGetResponse() == 0x00) |
{ |
// now look for the data token to signify the start of |
// the data |
if (mmcGetXXResponse(MMC_START_DATA_BLOCK_TOKEN) == MMC_START_DATA_BLOCK_TOKEN) |
{ |
// clock the actual data transfer and receive the bytes; spi_read automatically finds the Data Block |
spiReadFrame(pBuffer, count); |
// get CRC bytes (not really needed by us, but required by MMC) |
spiSendByte(DUMMY_CHAR); |
spiSendByte(DUMMY_CHAR); |
rvalue = MMC_SUCCESS; |
} |
else |
{ |
// the data token was never received |
rvalue = MMC_DATA_TOKEN_ERROR; // 3 |
} |
} |
else |
{ |
// the MMC never acknowledge the read command |
rvalue = MMC_RESPONSE_ERROR; // 2 |
} |
} |
else |
{ |
rvalue = MMC_BLOCK_SET_ERROR; // 1 |
} |
MMC_CS_HIGH (); |
spiSendByte(DUMMY_CHAR); |
return rvalue; |
} |
char mmcWriteBlock (const unsigned long address, const unsigned long count, unsigned char *pBuffer) |
{ |
char rvalue = MMC_RESPONSE_ERROR; // MMC_SUCCESS; |
// char c = 0x00; |
// Set the block length to read |
if (mmcSetBlockLength (count) == MMC_SUCCESS) // block length could be set |
{ |
// CS = LOW (on) |
MMC_CS_LOW (); |
// send write command |
mmcSendCmd (MMC_WRITE_BLOCK,address, 0xFF); |
// check if the MMC acknowledged the write block command |
// it will do this by sending an affirmative response |
// in the R1 format (0x00 is no errors) |
if (mmcGetXXResponse(MMC_R1_RESPONSE) == MMC_R1_RESPONSE) |
{ |
spiSendByte(DUMMY_CHAR); |
// send the data token to signify the start of the data |
spiSendByte(0xfe); |
// clock the actual data transfer and transmitt the bytes |
spiSendFrame(pBuffer, count); |
// put CRC bytes (not really needed by us, but required by MMC) |
spiSendByte(DUMMY_CHAR); |
spiSendByte(DUMMY_CHAR); |
// read the data response xxx0<status>1 : status 010: Data accected, status 101: Data |
// rejected due to a crc error, status 110: Data rejected due to a Write error. |
mmcCheckBusy(); |
rvalue = MMC_SUCCESS; |
} |
else |
{ |
// the MMC never acknowledge the write command |
rvalue = MMC_RESPONSE_ERROR; // 2 |
} |
} |
else |
{ |
rvalue = MMC_BLOCK_SET_ERROR; // 1 |
} |
// give the MMC the required clocks to finish up what ever it needs to do |
// for (i = 0; i < 9; ++i) |
// spiSendByte(0xff); |
MMC_CS_HIGH (); |
// Send 8 Clock pulses of delay. |
spiSendByte(DUMMY_CHAR); |
return rvalue; |
} |
// Send command to MMC |
void mmcSendCmd (const char cmd, unsigned long data, const char crc) |
{ |
unsigned char frame[6]; |
char temp; |
int i; |
frame[0]=(cmd|0x40); |
for(i=3;i>=0;i--){ |
temp=(char)(data>>(8*i)); |
frame[4-i]=(temp); |
} |
frame[5]=(crc); |
spiSendFrame(frame,6); |
} |
//--------------- set blocklength 2^n ------------------------------------------------------ |
char mmcSetBlockLength (const unsigned long blocklength) |
{ |
// CS = LOW (on) |
MMC_CS_LOW (); |
// Set the block length to read |
mmcSendCmd(MMC_SET_BLOCKLEN, blocklength, 0xFF); |
// get response from MMC - make sure that its 0x00 (R1 ok response format) |
if(mmcGetResponse()!=0x00) |
{ mmcInit(); |
mmcSendCmd(MMC_SET_BLOCKLEN, blocklength, 0xFF); |
mmcGetResponse(); |
} |
MMC_CS_HIGH (); |
// Send 8 Clock pulses of delay. |
spiSendByte(DUMMY_CHAR); |
return MMC_SUCCESS; |
} |
// Reading the contents of the CSD and CID registers in SPI mode is a simple read-block transaction. |
char mmcReadRegister (const char cmd_register, const unsigned char length, unsigned char *pBuffer) |
{ |
char uc = 0; |
char rvalue = MMC_TIMEOUT_ERROR; |
if (mmcSetBlockLength (length) == MMC_SUCCESS) |
{ |
MMC_CS_LOW (); |
// CRC not used: 0xff as last byte |
mmcSendCmd(cmd_register, 0x000000, 0xff); |
// wait for response |
// in the R1 format (0x00 is no errors) |
if (mmcGetResponse() == 0x00) |
{ |
if (mmcGetXXResponse(0xfe)== 0xfe) |
for (uc = 0; uc < length; uc++) |
pBuffer[uc] = spiSendByte(DUMMY_CHAR); //mmc_buffer[uc] = spiSendByte(0xff); |
// get CRC bytes (not really needed by us, but required by MMC) |
spiSendByte(DUMMY_CHAR); |
spiSendByte(DUMMY_CHAR); |
rvalue = MMC_SUCCESS; |
} |
else |
rvalue = MMC_RESPONSE_ERROR; |
// CS = HIGH (off) |
MMC_CS_HIGH (); |
// Send 8 Clock pulses of delay. |
spiSendByte(DUMMY_CHAR); |
} |
MMC_CS_HIGH (); |
return rvalue; |
} |
#include "math.h" |
unsigned long mmcReadCardSize(void) |
{ |
// Read contents of Card Specific Data (CSD) |
unsigned long MMC_CardSize; |
unsigned short i, // index |
j, // index |
b, // temporary variable |
response, // MMC response to command |
mmc_C_SIZE; |
unsigned char mmc_READ_BL_LEN, // Read block length |
mmc_C_SIZE_MULT; |
MMC_CS_LOW (); |
spiSendByte(MMC_READ_CSD); // CMD 9 |
for(i=4; i>0; i--) // Send four dummy bytes |
spiSendByte(0); |
spiSendByte(DUMMY_CHAR); // Send CRC byte |
response = mmcGetResponse(); |
// data transmission always starts with 0xFE |
b = spiSendByte(DUMMY_CHAR); |
if( !response ) |
{ |
while (b != 0xFE) b = spiSendByte(DUMMY_CHAR); |
// bits 127:87 |
for(j=5; j>0; j--) // Host must keep the clock running for at |
b = spiSendByte(DUMMY_CHAR); |
// 4 bits of READ_BL_LEN |
// bits 84:80 |
b =spiSendByte(DUMMY_CHAR); // lower 4 bits of CCC and |
mmc_READ_BL_LEN = b & 0x0F; |
b = spiSendByte(DUMMY_CHAR); |
// bits 73:62 C_Size |
// xxCC CCCC CCCC CC |
mmc_C_SIZE = (b & 0x03) << 10; |
b = spiSendByte(DUMMY_CHAR); |
mmc_C_SIZE += b << 2; |
b = spiSendByte(DUMMY_CHAR); |
mmc_C_SIZE += b >> 6; |
// bits 55:53 |
b = spiSendByte(DUMMY_CHAR); |
// bits 49:47 |
mmc_C_SIZE_MULT = (b & 0x03) << 1; |
b = spiSendByte(DUMMY_CHAR); |
mmc_C_SIZE_MULT += b >> 7; |
// bits 41:37 |
b = spiSendByte(DUMMY_CHAR); |
b = spiSendByte(DUMMY_CHAR); |
b = spiSendByte(DUMMY_CHAR); |
b = spiSendByte(DUMMY_CHAR); |
b = spiSendByte(DUMMY_CHAR); |
} |
for(j=4; j>0; j--) // Host must keep the clock running for at |
b = spiSendByte(DUMMY_CHAR); // least Ncr (max = 4 bytes) cycles after |
// the card response is received |
b = spiSendByte(DUMMY_CHAR); |
MMC_CS_LOW (); |
MMC_CardSize = (mmc_C_SIZE + 1); |
// power function with base 2 is better with a loop |
// i = (pow(2,mmc_C_SIZE_MULT+2)+0.5); |
for(i = 2,j=mmc_C_SIZE_MULT+2; j>1; j--) |
i <<= 1; |
MMC_CardSize *= i; |
// power function with base 2 is better with a loop |
//i = (pow(2,mmc_READ_BL_LEN)+0.5); |
for(i = 2,j=mmc_READ_BL_LEN; j>1; j--) |
i <<= 1; |
MMC_CardSize *= i; |
return (MMC_CardSize); |
} |
char mmcPing(void) { |
char stat = MMC_CD_STAT(); |
if (stat) |
return (MMC_SUCCESS); |
else |
return (MMC_INIT_ERROR); |
} |
#ifdef withDMA |
#ifdef __IAR_SYSTEMS_ICC__ |
#pragma vector = DACDMA_VECTOR |
__interrupt void DMA_isr(void) |
#endif |
#ifdef __TI_COMPILER_VERSION__ |
__interrupt void DMA_isr(void); |
DMA_ISR(DMA_isr) |
__interrupt void DMA_isr(void) |
#endif |
{ |
DMA0CTL &= ~(DMAIFG); |
LPM3_EXIT; |
} |
#endif |
//--------------------------------------------------------------------- |
#endif /* _MMCLIB_C */ |
//MSP430 Projects/MSP430_Audio_Cube/vs1053.c |
---|
0,0 → 1,524 |
/* |
VLSI Solution generic microcontroller example player / recorder for |
VS1053. |
v1.03 2012-12-11 HH Recording command 'p' was VS1063 only -> removed |
Added chip type recognition |
v1.02 2012-12-04 HH Command '_' incorrectly printed VS1063-specific fields |
v1.01 2012-11-28 HH Untabified |
v1.00 2012-11-27 HH First release |
*/ |
#include "player.h" |
#include "hal_SPI.h" |
#include "hal_hardware_board.h" |
#include "pff.h" |
/* Download the latest VS1053a Patches package and its |
vs1053b-patches-flac.plg. If you want to use the smaller patch set |
which doesn't contain the FLAC decoder, use vs1053b-patches.plg instead. |
The patches package is available at |
http://www.vlsi.fi/en/support/software/vs10xxpatches.html */ |
//#include "vs1053b-patches.plg" |
// Extracted plugin contents: |
#define PLUGIN_SIZE 40 |
const unsigned short plugin[40] = { /* Compressed plugin */ |
0x0007, 0x0001, 0x8010, 0x0006, 0x001c, 0x3e12, 0xb817, 0x3e14, /* 0 */ |
0xf812, 0x3e01, 0xb811, 0x0007, 0x9717, 0x0020, 0xffd2, 0x0030, /* 8 */ |
0x11d1, 0x3111, 0x8024, 0x3704, 0xc024, 0x3b81, 0x8024, 0x3101, /* 10 */ |
0x8024, 0x3b81, 0x8024, 0x3f04, 0xc024, 0x2808, 0x4800, 0x36f1, /* 18 */ |
0x9811, 0x0007, 0x0001, 0x8028, 0x0006, 0x0002, 0x2a00, 0x040e, |
}; |
/* We also want to have the VS1053b Ogg Vorbis Encoder plugin. To get more |
than one plugin included, we'll have to include it in a slightly more |
tricky way. To get the plugin included below, download the latest version |
of the VS1053 Ogg Vorbis Encoder Application from |
http://www.vlsi.fi/en/support/software/vs10xxapplications.html */ |
// #define SKIP_PLUGIN_VARNAME |
// const unsigned int encoderPlugin[] = { |
// #include "venc44k2q05.plg" |
// }; |
// #undef SKIP_PLUGIN_VARNAME |
/* VS1053b IMA ADPCM Encoder Fix, available at |
http://www.vlsi.fi/en/support/software/vs10xxpatches.html */ |
// #define SKIP_PLUGIN_VARNAME |
// const unsigned int imaFix[] = { |
// #include "imafix.plg" |
// }; |
// #undef SKIP_PLUGIN_VARNAME |
#define FILE_BUFFER_SIZE 224 // Minimum 32! |
#define SDI_MAX_TRANSFER_SIZE 32 |
#define SDI_END_FILL_BYTES_FLAC 12288 |
#define SDI_END_FILL_BYTES 2052 |
//#define REC_BUFFER_SIZE 224 |
#define REPORT_INTERVAL 4096 |
#define REPORT_INTERVAL_MIDI 512 |
#define min(a,b) (((a)<(b))?(a):(b)) |
enum AudioFormat { |
afUnknown, |
afRiff, |
afOggVorbis, |
afMp1, |
afMp2, |
afMp3, |
afAacMp4, |
afAacAdts, |
afAacAdif, |
afFlac, |
afWma, |
afMidi |
} audioFormat = afUnknown; |
const char *afName[] = { |
"unknown", |
"RIFF", |
"Ogg", |
"MP1", |
"MP2", |
"MP3", |
"AAC MP4", |
"AAC ADTS", |
"AAC ADIF", |
"FLAC", |
"WMA", |
"MIDI", |
}; |
/* |
* SCI Write |
*/ |
void WriteSci(unsigned char addr, unsigned int data) { |
unsigned char c; |
do { // Wait until DREQ is high |
c = VS10XX_DREQ_STAT(); |
} while (c == 0); |
VS10XX_CS_LOW(); |
spiSendByte(0x02); // Write command code |
spiSendByte(addr); // Write SCI register |
spiSendByte((unsigned char)(data >> 8)); |
spiSendByte((unsigned char)(data & 0xFF)); |
VS10XX_CS_HIGH(); |
} |
/* |
* SCI Read |
*/ |
unsigned int ReadSci(unsigned char addr) { |
unsigned char buffer[2]; |
int ret; |
unsigned char c; |
do { // Wait until DREQ is high |
c = VS10XX_DREQ_STAT(); |
} while (c == 0); |
VS10XX_CS_LOW(); |
spiSendByte(0x03); // Write command code |
spiSendByte(addr); // Write SCI register |
spiReadFrame(buffer, 2); |
ret = buffer[0] << 8; |
ret |= buffer[1]; |
VS10XX_CS_HIGH(); |
return ret; |
} |
/* |
* SDI Write |
*/ |
int WriteSdi(unsigned char *data, unsigned char bytes) { |
if (bytes > SDI_MAX_TRANSFER_SIZE) |
return -1; |
unsigned char c; |
do { // Wait until DREQ is high |
c = VS10XX_DREQ_STAT(); |
} while (c == 0); |
VS10XX_DS_LOW(); |
spiSendFrame(data, (unsigned int)bytes); |
VS10XX_DS_HIGH(); |
return 0; |
} |
/* |
Read 32-bit increasing counter value from addr. |
Because the 32-bit value can change while reading it, |
read MSB's twice and decide which is the correct one. |
*/ |
unsigned long ReadVS10xxMem32Counter(unsigned int addr) { |
unsigned int msbV1, lsb, msbV2; |
unsigned long res; |
WriteSci(SCI_WRAMADDR, addr+1); |
msbV1 = ReadSci(SCI_WRAM); |
WriteSci(SCI_WRAMADDR, addr); |
lsb = ReadSci(SCI_WRAM); |
msbV2 = ReadSci(SCI_WRAM); |
if (lsb < 0x8000U) { |
msbV1 = msbV2; |
} |
res = ((unsigned long)msbV1 << 16) | lsb; |
return res; |
} |
/* |
Read 32-bit non-changing value from addr. |
*/ |
unsigned long ReadVS10xxMem32(unsigned int addr) { |
unsigned int lsb; |
WriteSci(SCI_WRAMADDR, addr); |
lsb = ReadSci(SCI_WRAM); |
return lsb | ((unsigned long)ReadSci(SCI_WRAM) << 16); |
} |
/* |
Read 16-bit value from addr. |
*/ |
unsigned int ReadVS10xxMem(unsigned int addr) { |
WriteSci(SCI_WRAMADDR, addr); |
return ReadSci(SCI_WRAM); |
} |
/* |
Write 16-bit value to given VS10xx address |
*/ |
void WriteVS10xxMem(unsigned int addr, unsigned int data) { |
WriteSci(SCI_WRAMADDR, addr); |
WriteSci(SCI_WRAM, data); |
} |
/* |
Write 32-bit value to given VS10xx address |
*/ |
void WriteVS10xxMem32(unsigned int addr, unsigned long data) { |
WriteSci(SCI_WRAMADDR, addr); |
WriteSci(SCI_WRAM, (unsigned int)data); |
WriteSci(SCI_WRAM, (unsigned int)(data>>16)); |
} |
/* Note: code SS_VER=2 is used for both VS1002 and VS1011e */ |
const unsigned int chipNumber[16] = { |
1001, 1011, 1011, 1003, 1053, 1033, 1063, 1103, |
0, 0, 0, 0, 0, 0, 0, 0 |
}; |
void Set32(unsigned char *d, unsigned long n) { |
unsigned int i; |
for (i=0; i<4; i++) { |
*d++ = (unsigned char)n; |
n >>= 8; |
} |
} |
void Set16(unsigned char *d, unsigned int n) { |
unsigned int i; |
for (i=0; i<2; i++) { |
*d++ = (unsigned char)n; |
n >>= 8; |
} |
} |
/* |
Loads a plugin. |
This is a slight modification of the LoadUserCode() example |
provided in many of VLSI Solution's program packages. |
*/ |
void LoadPlugin(const unsigned short *d, unsigned short len) { |
unsigned int i = 0; |
while (i<len) { |
unsigned short addr, n, val; |
addr = d[i++]; |
n = d[i++]; |
if (n & 0x8000U) { /* RLE run, replicate n samples */ |
n &= 0x7FFF; |
val = d[i++]; |
while (n--) { |
WriteSci(addr, val); |
} |
} else { /* Copy run, copy n samples */ |
while (n--) { |
val = d[i++]; |
WriteSci(addr, val); |
} |
} |
} |
} |
enum PlayerStates { |
psPlayback = 0, |
psStopped |
} playerState; |
/* |
* Executes a software reset |
*/ |
void VS1053SoftwareReset(void) { |
unsigned char c; |
unsigned short oldMode = ReadSci(SCI_MODE); |
WriteSci(SCI_MODE, oldMode | SM_RESET); |
__delay_cycles(100); |
do { // Wait until DREQ is high |
c = VS10XX_DREQ_STAT(); |
} while (c == 0); |
} |
/* |
This function plays back an audio file. |
File playback: |
1. Send an audio file to VS1053b |
2. Read extra parameter value endFillByte |
3. Send at least 2052 bytes of endFillByte |
4. Set SCI_MODE bit SM_CANCEL |
5. Send at least 32 bytes of endFillByte |
6. Read SCI_MODE. If SM_CANCEL is set, goto step 5 |
If still set after 2048 bytes, do a software reset |
Cancelling playback: |
1. Send a portion of an audio file to VS1053b |
2. Set SCI_MODE bit SM_CANCEL |
3. Continue to send audio file, check SM_CANCEL every 32 bytes |
If set, goto step 3 |
If still set after 2048 bytes, do a software reset |
4. Read extra parameter value endFillByte |
5. Send 2052 bytes of endFillByte |
*/ |
void VS1053PlayFile(const char *fileName) { |
unsigned char playBuf[FILE_BUFFER_SIZE]; |
unsigned short bytesRead; // Number of bytes read by pf_read() |
unsigned short bytesInBuffer; // How many valid bytes in buffer left |
unsigned short pos = 0; // File position |
int endFillByte = 0; // What byte value to send after file |
int playMode = ReadVS10xxMem(PAR_PLAY_MODE); |
long nextReportPos = 0; // File pointer where to next collect/report |
FRESULT res; |
unsigned int i; |
playerState = psPlayback; // Set state to normal playback |
WriteSci(SCI_DECODE_TIME, 0); // Reset DECODE_TIME |
res = pf_open(fileName); |
if (res != FR_OK) |
return; |
/* Main playback loop */ |
// Read the entire file FILE_BUFFER_SIZE (32) bytes at a time |
do { |
unsigned char *bufP = playBuf; |
// Read FILE_BUFFER_SIZE (32) bytes from the file into the buffer |
res = pf_read(playBuf, FILE_BUFFER_SIZE, &bytesRead); |
if (res != FR_OK) |
break; |
bytesInBuffer = bytesRead; |
while (bytesInBuffer && playerState != psStopped) { |
if (!(playMode & PAR_PLAY_MODE_PAUSE_ENA)) { |
int bytesToWrite = min(SDI_MAX_TRANSFER_SIZE, bytesInBuffer); |
// This is the heart of the algorithm: on the following line |
// actual audio data gets sent to VS10xx. |
WriteSdi(bufP, bytesToWrite); |
bufP += bytesToWrite; |
bytesInBuffer -= bytesToWrite; |
pos += bytesToWrite; |
} |
/* If playback is going on as normal, see if we need to collect and |
possibly report */ |
if (playerState == psPlayback && pos >= nextReportPos) { |
nextReportPos += (audioFormat == afMidi || audioFormat == afUnknown) ? |
REPORT_INTERVAL_MIDI : REPORT_INTERVAL; |
/* It is important to collect endFillByte while still in normal |
playback. If we need to later cancel playback or run into any |
trouble with e.g. a broken file, we need to be able to repeatedly |
send this byte until the decoder has been able to exit. */ |
endFillByte = ReadVS10xxMem(PAR_END_FILL_BYTE); |
} |
} |
} while(bytesRead == FILE_BUFFER_SIZE && playerState != psStopped); |
/* Earlier we collected endFillByte. Now, just in case the file was |
broken, or if a cancel playback command has been given, write |
SDI_END_FILL_BYTES (2052) bytes of endFillByte. */ |
for (i = 0; i < FILE_BUFFER_SIZE; i++) { |
playBuf[i] = endFillByte; |
} |
for (i = 0; i < SDI_END_FILL_BYTES; i += SDI_MAX_TRANSFER_SIZE) { |
WriteSdi(playBuf, SDI_MAX_TRANSFER_SIZE); |
} |
/* If the file actually ended, and playback cancellation was not |
done earlier, do it now. */ |
if (playerState == psPlayback) { |
pos = SDI_MAX_TRANSFER_SIZE; |
unsigned short oldMode = ReadSci(SCI_MODE); |
WriteSci(SCI_MODE, oldMode | SM_CANCEL); |
// Write 32 bytes of endFillByte |
WriteSdi(playBuf, SDI_MAX_TRANSFER_SIZE); |
i = ReadSci(SCI_MODE); |
while (i & SM_CANCEL) { |
// Reset after sending 2048 bytes |
if (pos > 2048) { |
VS1053SoftwareReset(); |
break; |
} |
WriteSdi(playBuf, SDI_MAX_TRANSFER_SIZE); |
pos += SDI_MAX_TRANSFER_SIZE; |
i = ReadSci(SCI_MODE); |
} |
} |
} |
/* |
* Main initialization function |
*/ |
int VS1053Init(void) { |
if (VSInitHardware() != 0) |
return 1; |
if (VSInitSoftware() != 0) |
return 1; |
return 0; |
} |
/* |
Hardware Initialization for VS1053. |
*/ |
int VSInitHardware(void) { |
/* Write here your microcontroller code which puts VS10xx in hardware |
reset and back (set xRESET to 0 for at least a few clock cycles, |
then to 1). */ |
// // Chip Command Select (idle high) |
// VS10XX_CS_PxOUT |= VS10XX_CS; |
// VS10XX_CS_PxDIR |= VS10XX_CS; |
// |
// // Chip Data Select (idle high) |
// VS10XX_DC_PxOUT |= VS10XX_DC; |
// VS10XX_DC_PxDIR |= VS10XX_DC; |
// |
// // Reset (idle high) |
// VS10XX_RESET_PxOUT |= VS10XX_RESET; |
// VS10XX_RESET_PxDIR |= VS10XX_RESET; |
// |
// // DREQ Line |
// VS10XX_DREQ_PxDIR &= ~VS10XX_DREQ; |
CHIP_RESET_LOW(); |
__delay_cycles(10000); |
CHIP_RESET_HIGH(); |
unsigned char c; |
do { // Wait until DREQ is high |
c = VS10XX_DREQ_STAT(); |
} while (c == 0); |
return 0; |
} |
/* |
Software Initialization for VS1053. |
Note that you need to check whether SM_SDISHARE should be set in |
your application or not. |
*/ |
int VSInitSoftware(void) { |
unsigned int ssVer; |
unsigned char c; |
do { // Wait until DREQ is high |
c = VS10XX_DREQ_STAT(); |
} while (c == 0); |
/* Initial SPI bus speed needs to be < 1.5Mhz */ |
halSPISetSpeedLow(); |
/* Start initialization with a dummy read, which makes sure our |
microcontroller chips selects and everything are where they |
are supposed to be and that VS10xx's SCI bus is in a known state. */ |
ReadSci(SCI_MODE); |
/* First real operation is a software reset. After the software |
reset we know what the status of the IC is. You need, depending |
on your application, either set or not set SM_SDISHARE. See the |
datasheet for details. */ |
// WriteSci(SCI_MODE, SM_SDINEW|SM_SDISHARE|SM_TESTS|SM_RESET); |
WriteSci(SCI_MODE, SM_SDINEW|SM_RESET); |
/* A quick sanity check: write to two registers, then test if we |
get the same results. Note that if you use a too high SPI |
speed, the MSB is the most likely to fail when read again. */ |
WriteSci(SCI_HDAT0, 0xABAD); |
WriteSci(SCI_HDAT1, 0x1DEA); |
if (ReadSci(SCI_HDAT0) != 0xABAD || ReadSci(SCI_HDAT1) != 0x1DEA) { |
// There is something wrong with VS10xx |
return 1; |
} |
/* Set the clock. Until this point we need to run SPI slow so that |
we do not exceed the maximum speeds mentioned in |
Chapter SPI Timing Diagram in the datasheet. */ |
WriteSci(SCI_CLOCKF, HZ_TO_SC_FREQ(12288000) | SC_MULT_53_35X | SC_ADD_53_10X); |
// WriteSci(SCI_CLOCKF, 0x6000); |
__delay_cycles(10000); |
/* Now when we have upped the VS10xx clock speed, the microcontroller |
SPI bus can run faster. Do that before you start playing or |
recording files. */ |
halSPISetSpeedHigh(); |
/* A quick sanity check: write to two registers, then test if we |
get the same results. Note that if you use a too high SPI |
speed, the MSB is the most likely to fail when read again. */ |
WriteSci(SCI_HDAT0, 0xABAD); |
WriteSci(SCI_HDAT1, 0x1DEA); |
if (ReadSci(SCI_HDAT0) != 0xABAD || ReadSci(SCI_HDAT1) != 0x1DEA) { |
// There is something wrong with VS10xx |
return 1; |
} |
/* Check VS10xx type */ |
ssVer = ((ReadSci(SCI_STATUS) >> 4) & 15); |
if (chipNumber[ssVer]) { |
// Chip is VS%d\n", chipNumber[ssVer]); |
if (chipNumber[ssVer] != 1053) { |
// Incorrect chip |
return 1; |
} |
} else { |
// Unknown VS10xx SCI_MODE field |
return 1; |
} |
/* Set up other parameters. */ |
// WriteVS10xxMem(PAR_CONFIG1, PAR_CONFIG1_AAC_SBR_SELECTIVE_UPSAMPLE); |
/* Set volume level to max */ |
WriteSci(SCI_VOL, 0x0000); |
/* Now it's time to load the proper patch set. */ |
LoadPlugin(plugin, sizeof(plugin)/sizeof(plugin[0])); |
/* We're ready to go. */ |
return 0; |
} |
//MSP430 Projects/MSP430_Audio_Cube/.ccsproject |
---|
0,0 → 1,13 |
<?xml version="1.0" encoding="UTF-8" ?> |
<?ccsproject version="1.0"?> |
<projectOptions> |
<deviceVariant value="MSP430G2231"/> |
<deviceFamily value="MSP430"/> |
<codegenToolVersion value="4.2.1"/> |
<isElfFormat value="true"/> |
<connection value="common/targetdb/connections/TIMSP430-USB.xml"/> |
<linkerCommandFile value="lnk_msp430g2231.cmd"/> |
<rts value="libc.a"/> |
<templateProperties value="id=com.ti.common.project.core.emptyProjectWithMainTemplate_msp430,"/> |
<isTargetManual value="false"/> |
</projectOptions> |
//MSP430 Projects/MSP430_Audio_Cube/.cproject |
---|
0,0 → 1,179 |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
<?fileVersion 4.0.0?> |
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> |
<storageModule configRelations="2" moduleId="org.eclipse.cdt.core.settings"> |
<cconfiguration id="com.ti.ccstudio.buildDefinitions.MSP430.Debug.1717714940"> |
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.MSP430.Debug.1717714940" moduleId="org.eclipse.cdt.core.settings" name="Debug"> |
<externalSettings/> |
<extensions> |
<extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/> |
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
</extensions> |
</storageModule> |
<storageModule moduleId="cdtBuildSystem" version="4.0.0"> |
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.MSP430.Debug.1717714940" name="Debug" parent="com.ti.ccstudio.buildDefinitions.MSP430.Debug"> |
<folderInfo id="com.ti.ccstudio.buildDefinitions.MSP430.Debug.1717714940." name="/" resourcePath=""> |
<toolChain id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.DebugToolchain.2065485195" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.linkerDebug.1179055826"> |
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1899788944" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> |
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=MSP430G2553"/> |
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/> |
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.5.0"/> |
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=lnk_msp430g2553.cmd"/> |
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/> |
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.622734528" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="4.2.1" valueType="string"/> |
<targetPlatform id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.targetPlatformDebug.857143867" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.targetPlatformDebug"/> |
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.builderDebug.1160896875" keepEnvironmentInBuildfile="false" name="GNU Make" parallelBuildOn="false" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.builderDebug"/> |
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.compilerDebug.1014148247" name="MSP430 Compiler" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.compilerDebug"> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.SILICON_VERSION.2082551406" name="Silicon version (--silicon_version, -v)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.SILICON_VERSION.msp" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DEFINE.1006513326" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DEFINE" valueType="definedSymbols"> |
<listOptionValue builtIn="false" value="__MSP430G2553__"/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.PRINTF_SUPPORT.371970179" name="Level of printf/scanf support required (--printf_support)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.PRINTF_SUPPORT" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.PRINTF_SUPPORT.minimal" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ABI.1176118498" name="Application binary interface [See 'General' page to edit] (--abi)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ABI.eabi" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.OPT_LEVEL.167272745" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.OPT_LEVEL.off" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.INCLUDE_PATH.105242099" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.INCLUDE_PATH" valueType="includePath"> |
<listOptionValue builtIn="false" value=""${CCS_BASE_ROOT}/msp430/include""/> |
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DEBUGGING_MODEL.2118787830" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WARNING.386877839" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WARNING" valueType="stringList"> |
<listOptionValue builtIn="false" value="225"/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DISPLAY_ERROR_NUMBER.1631786601" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WRAP.1530752290" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WRAP.off" valueType="enumerated"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__C_SRCS.457281545" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__C_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__CPP_SRCS.780931535" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__CPP_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM_SRCS.347686739" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM2_SRCS.1148386440" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM2_SRCS"/> |
</tool> |
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.linkerDebug.1179055826" name="MSP430 Linker" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.linkerDebug"> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.HEAP_SIZE.42651522" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.HEAP_SIZE" value="80" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.STACK_SIZE.681580373" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.STACK_SIZE" value="80" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.OUTPUT_FILE.1138098778" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.OUTPUT_FILE" value=""${ProjName}.out"" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.MAP_FILE.1802452996" name="Input and output sections listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.SEARCH_PATH.447130654" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.SEARCH_PATH" valueType="libPaths"> |
<listOptionValue builtIn="false" value=""${CCS_BASE_ROOT}/msp430/include""/> |
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/> |
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DISPLAY_ERROR_NUMBER.1658991631" name="Emit diagnostic identifier numbers (--display_error_number)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DIAG_WRAP.196510275" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DIAG_WRAP.off" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.XML_LINK_INFO.1607229780" name="Detailed link information data-base into <file> (--xml_link_info, -xml_link_info)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.XML_LINK_INFO" value=""${ProjName}_linkInfo.xml"" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.LIBRARY.1714663703" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.LIBRARY" valueType="libs"> |
<listOptionValue builtIn="false" value=""libc.a""/> |
</option> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD_SRCS.646345309" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD2_SRCS.877501338" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD2_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__GEN_CMDS.744111781" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__GEN_CMDS"/> |
</tool> |
</toolChain> |
</folderInfo> |
<sourceEntries> |
<entry excluding="lnk_msp430g2452.cmd|lnk_msp430g2231.cmd|lnk_msp430g2453.cmd" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> |
</sourceEntries> |
</configuration> |
</storageModule> |
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> |
</cconfiguration> |
<cconfiguration id="com.ti.ccstudio.buildDefinitions.MSP430.Release.2034998959"> |
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.MSP430.Release.2034998959" moduleId="org.eclipse.cdt.core.settings" name="Release"> |
<externalSettings/> |
<extensions> |
<extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/> |
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
</extensions> |
</storageModule> |
<storageModule moduleId="cdtBuildSystem" version="4.0.0"> |
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.MSP430.Release.2034998959" name="Release" parent="com.ti.ccstudio.buildDefinitions.MSP430.Release"> |
<folderInfo id="com.ti.ccstudio.buildDefinitions.MSP430.Release.2034998959." name="/" resourcePath=""> |
<toolChain id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.ReleaseToolchain.1628771736" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.linkerRelease.1660460902"> |
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.598034057" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> |
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=MSP430G2553"/> |
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/> |
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.5.0"/> |
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=lnk_msp430g2553.cmd"/> |
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/> |
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1881207371" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="4.2.1" valueType="string"/> |
<targetPlatform id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.targetPlatformRelease.1551154892" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.targetPlatformRelease"/> |
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.builderRelease.2029645259" keepEnvironmentInBuildfile="false" name="GNU Make" parallelBuildOn="false" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.builderRelease"/> |
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.compilerRelease.772431778" name="MSP430 Compiler" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.compilerRelease"> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.SILICON_VERSION.262162155" name="Silicon version (--silicon_version, -v)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.SILICON_VERSION.msp" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DEFINE.2086002081" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DEFINE" valueType="definedSymbols"> |
<listOptionValue builtIn="false" value="__MSP430G2553__"/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.PRINTF_SUPPORT.419432645" name="Level of printf/scanf support required (--printf_support)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.PRINTF_SUPPORT" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.PRINTF_SUPPORT.minimal" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ABI.1999651833" name="Application binary interface [See 'General' page to edit] (--abi)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ABI.eabi" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.OPT_LEVEL.release.1812658859" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.OPT_LEVEL.release" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.OPT_LEVEL.4" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.OPT_FOR_SPEED.1909135124" name="Speed vs. size trade-offs (--opt_for_speed, -mf)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.OPT_FOR_SPEED.5" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.INCLUDE_PATH.489556619" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.INCLUDE_PATH" valueType="includePath"> |
<listOptionValue builtIn="false" value=""${CCS_BASE_ROOT}/msp430/include""/> |
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ADVICE__POWER.2058983767" name="Enable checking of ULP power rules (--advice:power)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ADVICE__POWER" value=""all"" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WARNING.187795310" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WARNING" valueType="stringList"> |
<listOptionValue builtIn="false" value="225"/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DISPLAY_ERROR_NUMBER.854778601" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WRAP.242556780" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WRAP.off" valueType="enumerated"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__C_SRCS.1942787048" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__C_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__CPP_SRCS.824194648" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__CPP_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM_SRCS.1650490680" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM2_SRCS.2138018140" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM2_SRCS"/> |
</tool> |
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.linkerRelease.1660460902" name="MSP430 Linker" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.linkerRelease"> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.HEAP_SIZE.283213000" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.HEAP_SIZE" value="80" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.STACK_SIZE.1206225958" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.STACK_SIZE" value="80" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.OUTPUT_FILE.2072510543" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.OUTPUT_FILE" value=""${ProjName}.out"" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.MAP_FILE.1089100589" name="Input and output sections listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.SEARCH_PATH.1855398728" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.SEARCH_PATH" valueType="libPaths"> |
<listOptionValue builtIn="false" value=""${CCS_BASE_ROOT}/msp430/include""/> |
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/> |
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DISPLAY_ERROR_NUMBER.2049234367" name="Emit diagnostic identifier numbers (--display_error_number)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DIAG_WRAP.386853167" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DIAG_WRAP.off" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.XML_LINK_INFO.1156577223" name="Detailed link information data-base into <file> (--xml_link_info, -xml_link_info)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.XML_LINK_INFO" value=""${ProjName}_linkInfo.xml"" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.LIBRARY.41533112" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.LIBRARY" valueType="libs"> |
<listOptionValue builtIn="false" value=""libc.a""/> |
</option> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD_SRCS.134962422" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD2_SRCS.333797821" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD2_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__GEN_CMDS.1115377560" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__GEN_CMDS"/> |
</tool> |
</toolChain> |
</folderInfo> |
<sourceEntries> |
<entry excluding="lnk_msp430g2452.cmd|lnk_msp430g2453.cmd|lnk_msp430g2231.cmd" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> |
</sourceEntries> |
</configuration> |
</storageModule> |
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> |
</cconfiguration> |
</storageModule> |
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> |
<storageModule moduleId="cdtBuildSystem" version="4.0.0"> |
<project id="MSP430_G2231.com.ti.ccstudio.buildDefinitions.MSP430.ProjectType.1291860156" name="MSP430" projectType="com.ti.ccstudio.buildDefinitions.MSP430.ProjectType"/> |
</storageModule> |
<storageModule moduleId="scannerConfiguration"/> |
<storageModule moduleId="org.eclipse.cdt.core.language.mapping"> |
<project-mappings> |
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.asmSource" language="com.ti.ccstudio.core.TIASMLanguage"/> |
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cHeader" language="com.ti.ccstudio.core.TIGCCLanguage"/> |
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cSource" language="com.ti.ccstudio.core.TIGCCLanguage"/> |
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxHeader" language="com.ti.ccstudio.core.TIGPPLanguage"/> |
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxSource" language="com.ti.ccstudio.core.TIGPPLanguage"/> |
</project-mappings> |
</storageModule> |
<storageModule moduleId="refreshScope"/> |
<storageModule moduleId="null.endianPreference"/> |
<storageModule moduleId="cpuFamily"/> |
</cproject> |
//MSP430 Projects/MSP430_Audio_Cube/.project |
---|
0,0 → 1,27 |
<?xml version="1.0" encoding="UTF-8"?> |
<projectDescription> |
<name>MSP430_Audio_Project</name> |
<comment></comment> |
<projects> |
</projects> |
<buildSpec> |
<buildCommand> |
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> |
<arguments> |
</arguments> |
</buildCommand> |
<buildCommand> |
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> |
<triggers>full,incremental,</triggers> |
<arguments> |
</arguments> |
</buildCommand> |
</buildSpec> |
<natures> |
<nature>com.ti.ccstudio.core.ccsNature</nature> |
<nature>org.eclipse.cdt.core.cnature</nature> |
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> |
<nature>org.eclipse.cdt.core.ccnature</nature> |
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> |
</natures> |
</projectDescription> |
//MSP430 Projects/MSP430_Audio_Cube/.settings/org.eclipse.cdt.codan.core.prefs |
---|
0,0 → 1,3 |
eclipse.preferences.version=1 |
inEditor=false |
onBuild=false |
//MSP430 Projects/MSP430_Audio_Cube/.settings/org.eclipse.cdt.core.prefs |
---|
0,0 → 1,5 |
eclipse.preferences.version=1 |
environment/project/com.ti.ccstudio.buildDefinitions.MSP430.Debug.1717714940/append=true |
environment/project/com.ti.ccstudio.buildDefinitions.MSP430.Debug.1717714940/appendContributed=true |
environment/project/com.ti.ccstudio.buildDefinitions.MSP430.Release.2034998959/append=true |
environment/project/com.ti.ccstudio.buildDefinitions.MSP430.Release.2034998959/appendContributed=true |
//MSP430 Projects/MSP430_Audio_Cube/.settings/org.eclipse.cdt.debug.core.prefs |
---|
0,0 → 1,2 |
eclipse.preferences.version=1 |
org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker |
//MSP430 Projects/MSP430_Audio_Cube/.settings/org.eclipse.core.resources.prefs |
---|
0,0 → 1,11 |
eclipse.preferences.version=1 |
encoding//Debug/makefile=UTF-8 |
encoding//Debug/objects.mk=UTF-8 |
encoding//Debug/sources.mk=UTF-8 |
encoding//Debug/subdir_rules.mk=UTF-8 |
encoding//Debug/subdir_vars.mk=UTF-8 |
encoding//Release/makefile=UTF-8 |
encoding//Release/objects.mk=UTF-8 |
encoding//Release/sources.mk=UTF-8 |
encoding//Release/subdir_rules.mk=UTF-8 |
encoding//Release/subdir_vars.mk=UTF-8 |
//MSP430 Projects/MSP430_Audio_Cube/README.txt |
---|
0,0 → 1,8 |
// MMC Library Source: http://www.ti.com/lit/an/slaa281b/slaa281b.pdf |
// FAT Library Source: http://elm-chan.org/fsw/ff/00index_p.html |
// Other resouces: |
// - http://nerdclub-uk.blogspot.com/2012/11/how-spi-works-with-sd-card.html |
Not implemented: |
- diskio.c write to SD card function |
- vs1053.c record audio to file function |
//MSP430 Projects/MSP430_Audio_Cube/adxl345.h |
---|
0,0 → 1,84 |
#define ADXL345_LOW_POWER_MODE |
// Chip Address |
#define ADXL345_ADDRESS (0x53) // Assumes ALT address pin low |
// Register Defines |
#define ADXL345_REG_DEVID (0x00) // Device ID |
#define ADXL345_REG_THRESH_TAP (0x1D) // Tap threshold |
#define ADXL345_REG_OFSX (0x1E) // X-axis offset |
#define ADXL345_REG_OFSY (0x1F) // Y-axis offset |
#define ADXL345_REG_OFSZ (0x20) // Z-axis offset |
#define ADXL345_REG_DUR (0x21) // Tap duration |
#define ADXL345_REG_LATENT (0x22) // Tap latency |
#define ADXL345_REG_WINDOW (0x23) // Tap window |
#define ADXL345_REG_THRESH_ACT (0x24) // Activity threshold |
#define ADXL345_REG_THRESH_INACT (0x25) // Inactivity threshold |
#define ADXL345_REG_TIME_INACT (0x26) // Inactivity time |
#define ADXL345_REG_ACT_INACT_CTL (0x27) // Axis enable control for activity and inactivity detection |
#define ADXL345_REG_THRESH_FF (0x28) // Free-fall threshold |
#define ADXL345_REG_TIME_FF (0x29) // Free-fall time |
#define ADXL345_REG_TAP_AXES (0x2A) // Axis control for single/double tap |
#define ADXL345_REG_ACT_TAP_STATUS (0x2B) // Source for single/double tap |
#define ADXL345_REG_BW_RATE (0x2C) // Data rate and power mode control |
#define ADXL345_REG_POWER_CTL (0x2D) // Power-saving features control |
#define ADXL345_REG_INT_ENABLE (0x2E) // Interrupt enable control |
#define ADXL345_REG_INT_MAP (0x2F) // Interrupt mapping control |
#define ADXL345_REG_INT_SOURCE (0x30) // Source of interrupts |
#define ADXL345_REG_DATA_FORMAT (0x31) // Data format control |
#define ADXL345_REG_DATAX0 (0x32) // X-axis data 0 |
#define ADXL345_REG_DATAX1 (0x33) // X-axis data 1 |
#define ADXL345_REG_DATAY0 (0x34) // Y-axis data 0 |
#define ADXL345_REG_DATAY1 (0x35) // Y-axis data 1 |
#define ADXL345_REG_DATAZ0 (0x36) // Z-axis data 0 |
#define ADXL345_REG_DATAZ1 (0x37) // Z-axis data 1 |
#define ADXL345_REG_FIFO_CTL (0x38) // FIFO control |
#define ADXL345_REG_FIFO_STATUS (0x39) // FIFO status |
#define ADXL345_MG2G_MULTIPLIER (0.004) // 4mg per lsb |
#define ADXL_BYTE_READ (0x80) |
#define ADXL_BYTE_WRITE (0x80) |
#define ADXL_MULTI_BYTE_READ (0xC0) |
// Register values for ADXL345_REG_BW_RATE |
typedef enum |
{ |
#ifndef ADXL345_LOW_POWER_MODE |
ADXL345_DATARATE_3200_HZ = 0xF, // 1600Hz Bandwidth 140µA IDD |
ADXL345_DATARATE_1600_HZ = 0xE, // 800Hz Bandwidth 90µA IDD |
ADXL345_DATARATE_800_HZ = 0xD, // 400Hz Bandwidth 140µA IDD |
ADXL345_DATARATE_6_25HZ = 0x6, // 3.13Hz Bandwidth 45µA IDD |
ADXL345_DATARATE_3_13_HZ = 0x5, // 1.56Hz Bandwidth 40µA IDD |
ADXL345_DATARATE_1_56_HZ = 0x4, // 0.78Hz Bandwidth 34µA IDD |
ADXL345_DATARATE_0_78_HZ = 0x3, // 0.39Hz Bandwidth 23µA IDD |
ADXL345_DATARATE_0_39_HZ = 0x2, // 0.20Hz Bandwidth 23µA IDD |
ADXL345_DATARATE_0_20_HZ = 0x1, // 0.10Hz Bandwidth 23µA IDD |
ADXL345_DATARATE_0_10_HZ = 0x0, // 0.05Hz Bandwidth 23µA IDD (default value) |
#endif |
ADXL345_DATARATE_400_HZ = 0xC, // 200Hz Bandwidth 140µA IDD / 90uA LP |
ADXL345_DATARATE_200_HZ = 0xB, // 100Hz Bandwidth 140µA IDD / 60uA LP |
ADXL345_DATARATE_100_HZ = 0xA, // 50Hz Bandwidth 140µA IDD / 50uA LP |
ADXL345_DATARATE_50_HZ = 0x9, // 25Hz Bandwidth 90µA IDD / 45uA LP |
ADXL345_DATARATE_25_HZ = 0x8, // 12.5Hz Bandwidth 60µA IDD / 40uA LP |
ADXL345_DATARATE_12_5_HZ = 0x7 // 6.25Hz Bandwidth 50µA IDD / 35uA LP |
} dataRate_t; |
// Register values for ADXL345_REG_DATA_FORMAT |
typedef enum |
{ |
ADXL345_RANGE_16_G = 0x3, // +/- 16g |
ADXL345_RANGE_8_G = 0x2, // +/- 8g |
ADXL345_RANGE_4_G = 0x1, // +/- 4g |
ADXL345_RANGE_2_G = 0x0 // +/- 2g (default value) |
} range_t; |
unsigned char ADXLInit(void); |
void ADXLStandbyOn(void); |
void ADXLStandbyOff(void); |
void ADXLInitInterrupts(void); |
void ADXLClearInterrupts(void); |
void ADXLRead(int *x, int *y, int *z); |
void ADXLSetRange(range_t range); |
void ADXLSetDataRate(dataRate_t rate); |
//MSP430 Projects/MSP430_Audio_Cube/diskio.c |
---|
0,0 → 1,83 |
/*-----------------------------------------------------------------------*/ |
/* Low level disk I/O module skeleton for Petit FatFs (C)ChaN, 2009 */ |
/*-----------------------------------------------------------------------*/ |
#include "diskio.h" |
#include "mmc.h" |
/*-----------------------------------------------------------------------*/ |
/* Initialize Disk Drive */ |
/*-----------------------------------------------------------------------*/ |
DSTATUS disk_initialize (void) |
{ |
int i; |
// Try the initialization sequence up to four times |
for (i = 0; i < 4; i++) { |
if (mmcInit() == MMC_SUCCESS) |
return STA_OK; |
} |
return STA_NOINIT; |
} |
/*-----------------------------------------------------------------------*/ |
/* Read Partial Sector */ |
/*-----------------------------------------------------------------------*/ |
DRESULT disk_readp ( |
BYTE* dest, /* Pointer to the destination object */ |
DWORD sector, /* Sector number (LBA) */ |
WORD sofs, /* Offset in the sector */ |
WORD count /* Byte count (bit15:destination) */ |
) |
{ |
DRESULT res; |
DWORD address = (sector * MMC_SECTOR_SIZE) + sofs; |
if (mmcReadBlock(address, count, dest) == MMC_SUCCESS) { |
res = RES_OK; |
} else { |
res = RES_ERROR; |
} |
return res; |
} |
/*-----------------------------------------------------------------------*/ |
/* Write Partial Sector */ |
/*-----------------------------------------------------------------------*/ |
//DRESULT disk_writep ( |
// BYTE* buff, /* Pointer to the data to be written, NULL:Initiate/Finalize write operation */ |
// DWORD sc /* Sector number (LBA) or Number of bytes to send */ |
//) |
//{ |
// DRESULT res; |
// |
// |
// if (!buff) { |
// if (sc) { |
// |
// // Initiate write process |
// |
// } else { |
// |
// // Finalize write process |
// |
// } |
// } else { |
// |
// // Send data to the disk |
// |
// } |
// |
// return res; |
//} |
//MSP430 Projects/MSP430_Audio_Cube/diskio.h |
---|
0,0 → 1,39 |
/*----------------------------------------------------------------------- |
/ PFF - Low level disk interface modlue include file (C)ChaN, 2009 |
/-----------------------------------------------------------------------*/ |
#ifndef _DISKIO |
#include "integer.h" |
/* Status of Disk Functions */ |
typedef BYTE DSTATUS; |
/* Results of Disk Functions */ |
typedef enum { |
RES_OK = 0, /* 0: Function succeeded */ |
RES_ERROR, /* 1: Disk error */ |
RES_NOTRDY, /* 2: Not ready */ |
RES_PARERR /* 3: Invalid parameter */ |
} DRESULT; |
/*---------------------------------------*/ |
/* Prototypes for disk control functions */ |
DSTATUS disk_initialize (void); |
DRESULT disk_readp (BYTE* dest, DWORD sector, WORD offset, WORD count); |
//DRESULT disk_writep (BYTE*, DWORD); |
#define STA_OK 0x00 |
#define STA_NOINIT 0x01 /* Drive not initialized */ |
#define STA_NODISK 0x02 /* No medium in the drive */ |
/* Card type flags (CardType) */ |
#define CT_MMC 0x01 /* MMC ver 3 */ |
#define CT_SD1 0x02 /* SD ver 1 */ |
#define CT_SD2 0x04 /* SD ver 2 */ |
#define CT_SDC (CT_SD1|CT_SD2) /* SD */ |
#define CT_BLOCK 0x08 /* Block addressing */ |
#define _DISKIO |
#endif |
//MSP430 Projects/MSP430_Audio_Cube/imafix.plg |
---|
0,0 → 1,38 |
/* User application code loading tables for VS10xx */ |
#if 0 |
void LoadUserCode(void) { |
int i = 0; |
while (i<sizeof(plugin)/sizeof(plugin[0])) { |
unsigned short addr, n, val; |
addr = plugin[i++]; |
n = plugin[i++]; |
if (n & 0x8000U) { /* RLE run, replicate n samples */ |
n &= 0x7FFF; |
val = plugin[i++]; |
while (n--) { |
WriteVS10xxRegister(addr, val); |
} |
} else { /* Copy run, copy n samples */ |
while (n--) { |
val = plugin[i++]; |
WriteVS10xxRegister(addr, val); |
} |
} |
} |
} |
#endif |
#ifndef SKIP_PLUGIN_VARNAME |
#define PLUGIN_SIZE 40 |
const unsigned short plugin[40] = { /* Compressed plugin */ |
#endif |
0x0007, 0x0001, 0x8010, 0x0006, 0x001c, 0x3e12, 0xb817, 0x3e14, /* 0 */ |
0xf812, 0x3e01, 0xb811, 0x0007, 0x9717, 0x0020, 0xffd2, 0x0030, /* 8 */ |
0x11d1, 0x3111, 0x8024, 0x3704, 0xc024, 0x3b81, 0x8024, 0x3101, /* 10 */ |
0x8024, 0x3b81, 0x8024, 0x3f04, 0xc024, 0x2808, 0x4800, 0x36f1, /* 18 */ |
0x9811, 0x0007, 0x0001, 0x8028, 0x0006, 0x0002, 0x2a00, 0x040e, |
#ifndef SKIP_PLUGIN_VARNAME |
}; |
#endif |
//MSP430 Projects/MSP430_Audio_Cube/integer.h |
---|
0,0 → 1,28 |
/*-------------------------------------------*/ |
/* Integer type definitions for FatFs module */ |
/*-------------------------------------------*/ |
#ifndef _INTEGER |
#define _INTEGER |
/* These types must be 16-bit, 32-bit or larger integer */ |
typedef int INT; |
typedef unsigned int UINT; |
/* These types must be 8-bit integer */ |
typedef char CHAR; |
typedef unsigned char UCHAR; |
typedef unsigned char BYTE; |
/* These types must be 16-bit integer */ |
typedef short SHORT; |
typedef unsigned short USHORT; |
typedef unsigned short WORD; |
typedef unsigned short WCHAR; |
/* These types must be 32-bit integer */ |
typedef long LONG; |
typedef unsigned long ULONG; |
typedef unsigned long DWORD; |
#endif |
//MSP430 Projects/MSP430_Audio_Cube/lnk_msp430g2553.cmd |
---|
0,0 → 1,132 |
/* ============================================================================ */ |
/* Copyright (c) 2013, Texas Instruments Incorporated */ |
/* All rights reserved. */ |
/* */ |
/* Redistribution and use in source and binary forms, with or without */ |
/* modification, are permitted provided that the following conditions */ |
/* are met: */ |
/* */ |
/* * Redistributions of source code must retain the above copyright */ |
/* notice, this list of conditions and the following disclaimer. */ |
/* */ |
/* * Redistributions in binary form must reproduce the above copyright */ |
/* notice, this list of conditions and the following disclaimer in the */ |
/* documentation and/or other materials provided with the distribution. */ |
/* */ |
/* * Neither the name of Texas Instruments Incorporated nor the names of */ |
/* its contributors may be used to endorse or promote products derived */ |
/* from this software without specific prior written permission. */ |
/* */ |
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" */ |
/* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, */ |
/* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */ |
/* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */ |
/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, */ |
/* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, */ |
/* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; */ |
/* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, */ |
/* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */ |
/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ |
/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ |
/* ============================================================================ */ |
/******************************************************************************/ |
/* lnk_msp430g2553.cmd - LINKER COMMAND FILE FOR LINKING MSP430G2553 PROGRAMS */ |
/* */ |
/* Usage: lnk430 <obj files...> -o <out file> -m <map file> lnk.cmd */ |
/* cl430 <src files...> -z -o <out file> -m <map file> lnk.cmd */ |
/* */ |
/*----------------------------------------------------------------------------*/ |
/* These linker options are for command line linking only. For IDE linking, */ |
/* you should set your linker options in Project Properties */ |
/* -c LINK USING C CONVENTIONS */ |
/* -stack 0x0100 SOFTWARE STACK SIZE */ |
/* -heap 0x0100 HEAP AREA SIZE */ |
/* */ |
/*----------------------------------------------------------------------------*/ |
/****************************************************************************/ |
/* SPECIFY THE SYSTEM MEMORY MAP */ |
/****************************************************************************/ |
MEMORY |
{ |
SFR : origin = 0x0000, length = 0x0010 |
PERIPHERALS_8BIT : origin = 0x0010, length = 0x00F0 |
PERIPHERALS_16BIT : origin = 0x0100, length = 0x0100 |
RAM : origin = 0x0200, length = 0x0200 |
INFOA : origin = 0x10C0, length = 0x0040 |
INFOB : origin = 0x1080, length = 0x0040 |
INFOC : origin = 0x1040, length = 0x0040 |
INFOD : origin = 0x1000, length = 0x0040 |
FLASH : origin = 0xC000, length = 0x3FE0 |
INT00 : origin = 0xFFE0, length = 0x0002 |
INT01 : origin = 0xFFE2, length = 0x0002 |
INT02 : origin = 0xFFE4, length = 0x0002 |
INT03 : origin = 0xFFE6, length = 0x0002 |
INT04 : origin = 0xFFE8, length = 0x0002 |
INT05 : origin = 0xFFEA, length = 0x0002 |
INT06 : origin = 0xFFEC, length = 0x0002 |
INT07 : origin = 0xFFEE, length = 0x0002 |
INT08 : origin = 0xFFF0, length = 0x0002 |
INT09 : origin = 0xFFF2, length = 0x0002 |
INT10 : origin = 0xFFF4, length = 0x0002 |
INT11 : origin = 0xFFF6, length = 0x0002 |
INT12 : origin = 0xFFF8, length = 0x0002 |
INT13 : origin = 0xFFFA, length = 0x0002 |
INT14 : origin = 0xFFFC, length = 0x0002 |
RESET : origin = 0xFFFE, length = 0x0002 |
} |
/****************************************************************************/ |
/* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */ |
/****************************************************************************/ |
SECTIONS |
{ |
.bss : {} > RAM /* GLOBAL & STATIC VARS */ |
.data : {} > RAM /* GLOBAL & STATIC VARS */ |
.sysmem : {} > RAM /* DYNAMIC MEMORY ALLOCATION AREA */ |
.stack : {} > RAM (HIGH) /* SOFTWARE SYSTEM STACK */ |
.text : {} > FLASH /* CODE */ |
.cinit : {} > FLASH /* INITIALIZATION TABLES */ |
.const : {} > FLASH /* CONSTANT DATA */ |
.cio : {} > RAM /* C I/O BUFFER */ |
.pinit : {} > FLASH /* C++ CONSTRUCTOR TABLES */ |
.init_array : {} > FLASH /* C++ CONSTRUCTOR TABLES */ |
.mspabi.exidx : {} > FLASH /* C++ CONSTRUCTOR TABLES */ |
.mspabi.extab : {} > FLASH /* C++ CONSTRUCTOR TABLES */ |
.infoA : {} > INFOA /* MSP430 INFO FLASH MEMORY SEGMENTS */ |
.infoB : {} > INFOB |
.infoC : {} > INFOC |
.infoD : {} > INFOD |
/* MSP430 INTERRUPT VECTORS */ |
.int00 : {} > INT00 |
.int01 : {} > INT01 |
PORT1 : { * ( .int02 ) } > INT02 type = VECT_INIT |
PORT2 : { * ( .int03 ) } > INT03 type = VECT_INIT |
.int04 : {} > INT04 |
ADC10 : { * ( .int05 ) } > INT05 type = VECT_INIT |
USCIAB0TX : { * ( .int06 ) } > INT06 type = VECT_INIT |
USCIAB0RX : { * ( .int07 ) } > INT07 type = VECT_INIT |
TIMER0_A1 : { * ( .int08 ) } > INT08 type = VECT_INIT |
TIMER0_A0 : { * ( .int09 ) } > INT09 type = VECT_INIT |
WDT : { * ( .int10 ) } > INT10 type = VECT_INIT |
COMPARATORA : { * ( .int11 ) } > INT11 type = VECT_INIT |
TIMER1_A1 : { * ( .int12 ) } > INT12 type = VECT_INIT |
TIMER1_A0 : { * ( .int13 ) } > INT13 type = VECT_INIT |
NMI : { * ( .int14 ) } > INT14 type = VECT_INIT |
.reset : {} > RESET /* MSP430 RESET VECTOR */ |
} |
/****************************************************************************/ |
/* INCLUDE PERIPHERALS MEMORY MAP */ |
/****************************************************************************/ |
-l msp430g2553.cmd |
//MSP430 Projects/MSP430_Audio_Cube/mmc.h |
---|
0,0 → 1,106 |
// ************************************************************************************* |
// |
// Filename: mmc.h: |
// Declarations for Communication with the MMC (see mmc.c) in unprotected SPI mode. |
// |
// Version 1.1 |
// added ul declaration in macros mmcWriteSector and mmcReadSector |
// ************************************************************************************* |
#ifndef _MMCLIB_H |
#define _MMCLIB_H |
// macro defines |
#define HIGH(a) ((a>>8)&0xFF) // high byte from word |
#define LOW(a) (a&0xFF) // low byte from word |
#define MMC_SECTOR_SIZE 512ul |
// Tokens (necessary because at NPO/IDLE (and CS active) only 0xff is on the data/command line) |
#define MMC_START_DATA_BLOCK_TOKEN 0xfe // Data token start byte, Start Single Block Read |
#define MMC_START_DATA_MULTIPLE_BLOCK_READ 0xfe // Data token start byte, Start Multiple Block Read |
#define MMC_START_DATA_BLOCK_WRITE 0xfe // Data token start byte, Start Single Block Write |
#define MMC_START_DATA_MULTIPLE_BLOCK_WRITE 0xfc // Data token start byte, Start Multiple Block Write |
#define MMC_STOP_DATA_MULTIPLE_BLOCK_WRITE 0xfd // Data toke stop byte, Stop Multiple Block Write |
// an affirmative R1 response (no errors) |
#define MMC_R1_RESPONSE 0x00 |
// this variable will be used to track the current block length |
// this allows the block length to be set only when needed |
// unsigned long _BlockLength = 0; |
// error/success codes |
#define MMC_SUCCESS 0x00 |
#define MMC_BLOCK_SET_ERROR 0x01 |
#define MMC_RESPONSE_ERROR 0x02 |
#define MMC_DATA_TOKEN_ERROR 0x03 |
#define MMC_INIT_ERROR 0x04 |
#define MMC_CRC_ERROR 0x10 |
#define MMC_WRITE_ERROR 0x11 |
#define MMC_OTHER_ERROR 0x12 |
#define MMC_TIMEOUT_ERROR 0xFF |
// commands: first bit 0 (start bit), second 1 (transmission bit); CMD-number + 0ffsett 0x40 |
#define MMC_GO_IDLE_STATE 0x40 //CMD0 |
#define MMC_SEND_OP_COND 0x41 //CMD1 |
#define MMC_READ_CSD 0x49 //CMD9 |
#define MMC_SEND_CID 0x4a //CMD10 |
#define MMC_STOP_TRANSMISSION 0x4c //CMD12 |
#define MMC_SEND_STATUS 0x4d //CMD13 |
#define MMC_SET_BLOCKLEN 0x50 //CMD16 Set block length for next read/write |
#define MMC_READ_SINGLE_BLOCK 0x51 //CMD17 Read block from memory |
#define MMC_READ_MULTIPLE_BLOCK 0x52 //CMD18 |
#define MMC_CMD_WRITEBLOCK 0x54 //CMD20 Write block to memory |
#define MMC_WRITE_BLOCK 0x58 //CMD24 |
#define MMC_WRITE_MULTIPLE_BLOCK 0x59 //CMD25 |
#define MMC_WRITE_CSD 0x5b //CMD27 PROGRAM_CSD |
#define MMC_SET_WRITE_PROT 0x5c //CMD28 |
#define MMC_CLR_WRITE_PROT 0x5d //CMD29 |
#define MMC_SEND_WRITE_PROT 0x5e //CMD30 |
#define MMC_TAG_SECTOR_START 0x60 //CMD32 |
#define MMC_TAG_SECTOR_END 0x61 //CMD33 |
#define MMC_UNTAG_SECTOR 0x62 //CMD34 |
#define MMC_TAG_EREASE_GROUP_START 0x63 //CMD35 |
#define MMC_TAG_EREASE_GROUP_END 0x64 //CMD36 |
#define MMC_UNTAG_EREASE_GROUP 0x65 //CMD37 |
#define MMC_EREASE 0x66 //CMD38 |
#define MMC_READ_OCR 0x67 //CMD39 |
#define MMC_CRC_ON_OFF 0x68 //CMD40 |
// mmc init |
char mmcInit(void); |
// check if MMC card is present |
char mmcPing(void); |
// send command to MMC |
void mmcSendCmd (const char cmd, unsigned long data, const char crc); |
// set MMC in Idle mode |
char mmcGoIdle(); |
// set MMC block length of count=2^n Byte |
char mmcSetBlockLength (const unsigned long); |
// read a size Byte big block beginning at the address. |
char mmcReadBlock(const unsigned long address, const unsigned long count, unsigned char *pBuffer); |
#define mmcReadSector(sector, pBuffer) mmcReadBlock(sector*MMC_SECTOR_SIZE, MMC_SECTOR_SIZE, pBuffer) |
// write a size Byte big block beginning at the (aligned) address |
char mmcWriteBlock (const unsigned long address, const unsigned long count, unsigned char *pBuffer); |
#define mmcWriteSector(sector, pBuffer) mmcWriteBlock(sector*MMC_SECTOR_SIZE, MMC_SECTOR_SIZE, pBuffer) |
// Read Register arg1 with Length arg2 (into the buffer) |
char mmcReadRegister(const char, const unsigned char, unsigned char *pBuffer); |
// Read the Card Size from the CSD Register |
unsigned long mmcReadCardSize(void); |
#endif /* _MMCLIB_H */ |
//MSP430 Projects/MSP430_Audio_Cube/pff.c |
---|
0,0 → 1,1114 |
/*----------------------------------------------------------------------------/ |
/ Petit FatFs - FAT file system module R0.02a (C)ChaN, 2010 |
/-----------------------------------------------------------------------------/ |
/ Petit FatFs module is an open source software to implement FAT file system to |
/ small embedded systems. This is a free software and is opened for education, |
/ research and commercial developments under license policy of following trems. |
/ |
/ Copyright (C) 2010, ChaN, all right reserved. |
/ |
/ * The Petit FatFs module is a free software and there is NO WARRANTY. |
/ * No restriction on use. You can use, modify and redistribute it for |
/ personal, non-profit or commercial use UNDER YOUR RESPONSIBILITY. |
/ * Redistributions of source code must retain the above copyright notice. |
/ |
/-----------------------------------------------------------------------------/ |
/ Jun 15,'09 R0.01a First release. (Branched from FatFs R0.07b.) |
/ |
/ Dec 14,'09 R0.02 Added multiple code page support. |
/ Added write funciton. |
/ Changed stream read mode interface. |
/ Dec 07,'10 R0.02a Added some configuration options. |
/ Fixed fails to open objects with DBCS character. |
/----------------------------------------------------------------------------*/ |
#include "pff.h" /* Petit FatFs configurations and declarations */ |
#include "diskio.h" /* Declarations of low level disk I/O functions */ |
/*-------------------------------------------------------------------------- |
Module Private Definitions |
---------------------------------------------------------------------------*/ |
#if _FS_FAT32 |
#define LD_CLUST(dir) (((DWORD)LD_WORD(dir+DIR_FstClusHI)<<16) | LD_WORD(dir+DIR_FstClusLO)) |
#else |
#define LD_CLUST(dir) LD_WORD(dir+DIR_FstClusLO) |
#endif |
/*--------------------------------------------------------*/ |
/* DBCS code ranges and SBCS extend char conversion table */ |
#if _CODE_PAGE == 932 /* Japanese Shift-JIS */ |
#define _DF1S 0x81 /* DBC 1st byte range 1 start */ |
#define _DF1E 0x9F /* DBC 1st byte range 1 end */ |
#define _DF2S 0xE0 /* DBC 1st byte range 2 start */ |
#define _DF2E 0xFC /* DBC 1st byte range 2 end */ |
#define _DS1S 0x40 /* DBC 2nd byte range 1 start */ |
#define _DS1E 0x7E /* DBC 2nd byte range 1 end */ |
#define _DS2S 0x80 /* DBC 2nd byte range 2 start */ |
#define _DS2E 0xFC /* DBC 2nd byte range 2 end */ |
#elif _CODE_PAGE == 936 /* Simplified Chinese GBK */ |
#define _DF1S 0x81 |
#define _DF1E 0xFE |
#define _DS1S 0x40 |
#define _DS1E 0x7E |
#define _DS2S 0x80 |
#define _DS2E 0xFE |
#elif _CODE_PAGE == 949 /* Korean */ |
#define _DF1S 0x81 |
#define _DF1E 0xFE |
#define _DS1S 0x41 |
#define _DS1E 0x5A |
#define _DS2S 0x61 |
#define _DS2E 0x7A |
#define _DS3S 0x81 |
#define _DS3E 0xFE |
#elif _CODE_PAGE == 950 /* Traditional Chinese Big5 */ |
#define _DF1S 0x81 |
#define _DF1E 0xFE |
#define _DS1S 0x40 |
#define _DS1E 0x7E |
#define _DS2S 0xA1 |
#define _DS2E 0xFE |
#elif _CODE_PAGE == 437 /* U.S. (OEM) */ |
#define _DF1S 0 |
#define _EXCVT {0x80,0x9A,0x90,0x41,0x8E,0x41,0x8F,0x80,0x45,0x45,0x45,0x49,0x49,0x49,0x8E,0x8F,0x90,0x92,0x92,0x4F,0x99,0x4F,0x55,0x55,0x59,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \ |
0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ |
0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} |
#elif _CODE_PAGE == 720 /* Arabic (OEM) */ |
#define _DF1S 0 |
#define _EXCVT {0x80,0x81,0x45,0x41,0x84,0x41,0x86,0x43,0x45,0x45,0x45,0x49,0x49,0x8D,0x8E,0x8F,0x90,0x92,0x92,0x93,0x94,0x95,0x49,0x49,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \ |
0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ |
0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} |
#elif _CODE_PAGE == 737 /* Greek (OEM) */ |
#define _DF1S 0 |
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x92,0x92,0x93,0x94,0x95,0x96,0x97,0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87, \ |
0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0xAA,0x92,0x93,0x94,0x95,0x96,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ |
0x97,0xEA,0xEB,0xEC,0xE4,0xED,0xEE,0xE7,0xE8,0xF1,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} |
#elif _CODE_PAGE == 775 /* Baltic (OEM) */ |
#define _DF1S 0 |
#define _EXCVT {0x80,0x9A,0x91,0xA0,0x8E,0x95,0x8F,0x80,0xAD,0xED,0x8A,0x8A,0xA1,0x8D,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0x95,0x96,0x97,0x97,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9F, \ |
0xA0,0xA1,0xE0,0xA3,0xA3,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xB5,0xB6,0xB7,0xB8,0xBD,0xBE,0xC6,0xC7,0xA5,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ |
0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE3,0xE8,0xE8,0xEA,0xEA,0xEE,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} |
#elif _CODE_PAGE == 850 /* Multilingual Latin 1 (OEM) */ |
#define _DF1S 0 |
#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xB7,0x8F,0x80,0xD2,0xD3,0xD4,0xD8,0xD7,0xDE,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0xE3,0xEA,0xEB,0x59,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9F, \ |
0xB5,0xD6,0xE0,0xE9,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ |
0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE7,0xE7,0xE9,0xEA,0xEB,0xED,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} |
#elif _CODE_PAGE == 852 /* Latin 2 (OEM) */ |
#define _DF1S 0 |
#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xDE,0x8F,0x80,0x9D,0xD3,0x8A,0x8A,0xD7,0x8D,0x8E,0x8F,0x90,0x91,0x91,0xE2,0x99,0x95,0x95,0x97,0x97,0x99,0x9A,0x9B,0x9B,0x9D,0x9E,0x9F, \ |
0xB5,0xD6,0xE0,0xE9,0xA4,0xA4,0xA6,0xA6,0xA8,0xA8,0xAA,0x8D,0xAC,0xB8,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBD,0xBF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC6,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD1,0xD1,0xD2,0xD3,0xD2,0xD5,0xD6,0xD7,0xB7,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ |
0xE0,0xE1,0xE2,0xE3,0xE3,0xD5,0xE6,0xE6,0xE8,0xE9,0xE8,0xEB,0xED,0xED,0xDD,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xEB,0xFC,0xFC,0xFE,0xFF} |
#elif _CODE_PAGE == 855 /* Cyrillic (OEM) */ |
#define _DF1S 0 |
#define _EXCVT {0x81,0x81,0x83,0x83,0x85,0x85,0x87,0x87,0x89,0x89,0x8B,0x8B,0x8D,0x8D,0x8F,0x8F,0x91,0x91,0x93,0x93,0x95,0x95,0x97,0x97,0x99,0x99,0x9B,0x9B,0x9D,0x9D,0x9F,0x9F, \ |
0xA1,0xA1,0xA3,0xA3,0xA5,0xA5,0xA7,0xA7,0xA9,0xA9,0xAB,0xAB,0xAD,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB6,0xB6,0xB8,0xB8,0xB9,0xBA,0xBB,0xBC,0xBE,0xBE,0xBF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD1,0xD1,0xD3,0xD3,0xD5,0xD5,0xD7,0xD7,0xDD,0xD9,0xDA,0xDB,0xDC,0xDD,0xE0,0xDF, \ |
0xE0,0xE2,0xE2,0xE4,0xE4,0xE6,0xE6,0xE8,0xE8,0xEA,0xEA,0xEC,0xEC,0xEE,0xEE,0xEF,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF8,0xFA,0xFA,0xFC,0xFC,0xFD,0xFE,0xFF} |
#elif _CODE_PAGE == 857 /* Turkish (OEM) */ |
#define _DF1S 0 |
#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xB7,0x8F,0x80,0xD2,0xD3,0xD4,0xD8,0xD7,0x98,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0xE3,0xEA,0xEB,0x98,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9E, \ |
0xB5,0xD6,0xE0,0xE9,0xA5,0xA5,0xA6,0xA6,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ |
0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xDE,0x59,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} |
#elif _CODE_PAGE == 858 /* Multilingual Latin 1 + Euro (OEM) */ |
#define _DF1S 0 |
#define _EXCVT {0x80,0x9A,0x90,0xB6,0x8E,0xB7,0x8F,0x80,0xD2,0xD3,0xD4,0xD8,0xD7,0xDE,0x8E,0x8F,0x90,0x92,0x92,0xE2,0x99,0xE3,0xEA,0xEB,0x59,0x99,0x9A,0x9D,0x9C,0x9D,0x9E,0x9F, \ |
0xB5,0xD6,0xE0,0xE9,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC7,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD1,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ |
0xE0,0xE1,0xE2,0xE3,0xE5,0xE5,0xE6,0xE7,0xE7,0xE9,0xEA,0xEB,0xED,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} |
#elif _CODE_PAGE == 862 /* Hebrew (OEM) */ |
#define _DF1S 0 |
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \ |
0x41,0x49,0x4F,0x55,0xA5,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0x21,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ |
0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} |
#elif _CODE_PAGE == 866 /* Russian (OEM) */ |
#define _DF1S 0 |
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \ |
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ |
0x90,0x91,0x92,0x93,0x9d,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,0xF0,0xF0,0xF2,0xF2,0xF4,0xF4,0xF6,0xF6,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} |
#elif _CODE_PAGE == 874 /* Thai (OEM, Windows) */ |
#define _DF1S 0 |
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \ |
0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ |
0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} |
#elif _CODE_PAGE == 1250 /* Central Europe (Windows) */ |
#define _DF1S 0 |
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x8D,0x8E,0x8F, \ |
0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xA3,0xB4,0xB5,0xB6,0xB7,0xB8,0xA5,0xAA,0xBB,0xBC,0xBD,0xBC,0xAF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF} |
#elif _CODE_PAGE == 1251 /* Cyrillic (Windows) */ |
#define _DF1S 0 |
#define _EXCVT {0x80,0x81,0x82,0x82,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x80,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x8D,0x8E,0x8F, \ |
0xA0,0xA2,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB2,0xA5,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xA3,0xBD,0xBD,0xAF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF} |
#elif _CODE_PAGE == 1252 /* Latin 1 (Windows) */ |
#define _DF1S 0 |
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0xAd,0x9B,0x8C,0x9D,0xAE,0x9F, \ |
0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0x9F} |
#elif _CODE_PAGE == 1253 /* Greek (Windows) */ |
#define _DF1S 0 |
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \ |
0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xA2,0xB8,0xB9,0xBA, \ |
0xE0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xF2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xFB,0xBC,0xFD,0xBF,0xFF} |
#elif _CODE_PAGE == 1254 /* Turkish (Windows) */ |
#define _DF1S 0 |
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x8A,0x9B,0x8C,0x9D,0x9E,0x9F, \ |
0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0x9F} |
#elif _CODE_PAGE == 1255 /* Hebrew (Windows) */ |
#define _DF1S 0 |
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \ |
0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ |
0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF} |
#elif _CODE_PAGE == 1256 /* Arabic (Windows) */ |
#define _DF1S 0 |
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x8C,0x9D,0x9E,0x9F, \ |
0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ |
0x41,0xE1,0x41,0xE3,0xE4,0xE5,0xE6,0x43,0x45,0x45,0x45,0x45,0xEC,0xED,0x49,0x49,0xF0,0xF1,0xF2,0xF3,0x4F,0xF5,0xF6,0xF7,0xF8,0x55,0xFA,0x55,0x55,0xFD,0xFE,0xFF} |
#elif _CODE_PAGE == 1257 /* Baltic (Windows) */ |
#define _DF1S 0 |
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F, \ |
0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xA8,0xB9,0xAA,0xBB,0xBC,0xBD,0xBE,0xAF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xFF} |
#elif _CODE_PAGE == 1258 /* Vietnam (OEM, Windows) */ |
#define _DF1S 0 |
#define _EXCVT {0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0xAC,0x9D,0x9E,0x9F, \ |
0xA0,0x21,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF, \ |
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xEC,0xCD,0xCE,0xCF,0xD0,0xD1,0xF2,0xD3,0xD4,0xD5,0xD6,0xF7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xFE,0x9F} |
#elif _CODE_PAGE == 1 /* ASCII (for only non-LFN cfg) */ |
#define _DF1S 0 |
#else |
#error Unknown code page |
#endif |
/* Character code support macros */ |
#define IsUpper(c) (((c)>='A')&&((c)<='Z')) |
#define IsLower(c) (((c)>='a')&&((c)<='z')) |
#if _DF1S /* DBCS configuration */ |
#ifdef _DF2S /* Two 1st byte areas */ |
#define IsDBCS1(c) (((BYTE)(c) >= _DF1S && (BYTE)(c) <= _DF1E) || ((BYTE)(c) >= _DF2S && (BYTE)(c) <= _DF2E)) |
#else /* One 1st byte area */ |
#define IsDBCS1(c) ((BYTE)(c) >= _DF1S && (BYTE)(c) <= _DF1E) |
#endif |
#ifdef _DS3S /* Three 2nd byte areas */ |
#define IsDBCS2(c) (((BYTE)(c) >= _DS1S && (BYTE)(c) <= _DS1E) || ((BYTE)(c) >= _DS2S && (BYTE)(c) <= _DS2E) || ((BYTE)(c) >= _DS3S && (BYTE)(c) <= _DS3E)) |
#else /* Two 2nd byte areas */ |
#define IsDBCS2(c) (((BYTE)(c) >= _DS1S && (BYTE)(c) <= _DS1E) || ((BYTE)(c) >= _DS2S && (BYTE)(c) <= _DS2E)) |
#endif |
#else /* SBCS configuration */ |
#define IsDBCS1(c) 0 |
#define IsDBCS2(c) 0 |
#endif /* _DF1S */ |
/* FatFs refers the members in the FAT structures with byte offset instead |
/ of structure member because there are incompatibility of the packing option |
/ between various compilers. */ |
#define BS_jmpBoot 0 |
#define BS_OEMName 3 |
#define BPB_BytsPerSec 11 |
#define BPB_SecPerClus 13 |
#define BPB_RsvdSecCnt 14 |
#define BPB_NumFATs 16 |
#define BPB_RootEntCnt 17 |
#define BPB_TotSec16 19 |
#define BPB_Media 21 |
#define BPB_FATSz16 22 |
#define BPB_SecPerTrk 24 |
#define BPB_NumHeads 26 |
#define BPB_HiddSec 28 |
#define BPB_TotSec32 32 |
#define BS_55AA 510 |
#define BS_DrvNum 36 |
#define BS_BootSig 38 |
#define BS_VolID 39 |
#define BS_VolLab 43 |
#define BS_FilSysType 54 |
#define BPB_FATSz32 36 |
#define BPB_ExtFlags 40 |
#define BPB_FSVer 42 |
#define BPB_RootClus 44 |
#define BPB_FSInfo 48 |
#define BPB_BkBootSec 50 |
#define BS_DrvNum32 64 |
#define BS_BootSig32 66 |
#define BS_VolID32 67 |
#define BS_VolLab32 71 |
#define BS_FilSysType32 82 |
#define MBR_Table 446 |
#define DIR_Name 0 |
#define DIR_Attr 11 |
#define DIR_NTres 12 |
#define DIR_CrtTime 14 |
#define DIR_CrtDate 16 |
#define DIR_FstClusHI 20 |
#define DIR_WrtTime 22 |
#define DIR_WrtDate 24 |
#define DIR_FstClusLO 26 |
#define DIR_FileSize 28 |
/*-------------------------------------------------------------------------- |
Private Functions |
---------------------------------------------------------------------------*/ |
static |
FATFS *FatFs; /* Pointer to the file system object (logical drive) */ |
/* Fill memory */ |
static |
void mem_set (void* dst, int val, int cnt) { |
char *d = (char*)dst; |
while (cnt--) *d++ = (char)val; |
} |
/* Compare memory to memory */ |
static |
int mem_cmp (const void* dst, const void* src, int cnt) { |
const char *d = (const char *)dst, *s = (const char *)src; |
int r = 0; |
while (cnt-- && (r = *d++ - *s++) == 0) ; |
return r; |
} |
/*-----------------------------------------------------------------------*/ |
/* FAT access - Read value of a FAT entry */ |
/*-----------------------------------------------------------------------*/ |
static |
CLUST get_fat ( /* 1:IO error, Else:Cluster status */ |
CLUST clst /* Cluster# to get the link information */ |
) |
{ |
WORD wc, bc, ofs; |
BYTE buf[4]; |
FATFS *fs = FatFs; |
if (clst < 2 || clst >= fs->n_fatent) /* Range check */ |
return 1; |
switch (fs->fs_type) { |
#if _FS_FAT12 |
case FS_FAT12 : |
bc = (WORD)clst; bc += bc / 2; |
ofs = bc % 512; bc /= 512; |
if (ofs != 511) { |
if (disk_readp(buf, fs->fatbase + bc, ofs, 2)) break; |
} else { |
if (disk_readp(buf, fs->fatbase + bc, 511, 1)) break; |
if (disk_readp(buf+1, fs->fatbase + bc + 1, 0, 1)) break; |
} |
wc = LD_WORD(buf); |
return (clst & 1) ? (wc >> 4) : (wc & 0xFFF); |
#endif |
case FS_FAT16 : |
if (disk_readp(buf, fs->fatbase + clst / 256, (WORD)(((WORD)clst % 256) * 2), 2)) break; |
return LD_WORD(buf); |
#if _FS_FAT32 |
case FS_FAT32 : |
if (disk_readp(buf, fs->fatbase + clst / 128, (WORD)(((WORD)clst % 128) * 4), 4)) break; |
return LD_DWORD(buf) & 0x0FFFFFFF; |
#endif |
} |
return 1; /* An error occured at the disk I/O layer */ |
} |
/*-----------------------------------------------------------------------*/ |
/* Get sector# from cluster# */ |
/*-----------------------------------------------------------------------*/ |
static |
DWORD clust2sect ( /* !=0: Sector number, 0: Failed - invalid cluster# */ |
CLUST clst /* Cluster# to be converted */ |
) |
{ |
FATFS *fs = FatFs; |
clst -= 2; |
if (clst >= (fs->n_fatent - 2)) return 0; /* Invalid cluster# */ |
return (DWORD)clst * fs->csize + fs->database; |
} |
/*-----------------------------------------------------------------------*/ |
/* Directory handling - Rewind directory index */ |
/*-----------------------------------------------------------------------*/ |
static |
FRESULT dir_rewind ( |
DIR *dj /* Pointer to directory object */ |
) |
{ |
CLUST clst; |
FATFS *fs = FatFs; |
dj->index = 0; |
clst = dj->sclust; |
if (clst == 1 || clst >= fs->n_fatent) /* Check start cluster range */ |
return FR_DISK_ERR; |
if (_FS_FAT32 && !clst && fs->fs_type == FS_FAT32) /* Replace cluster# 0 with root cluster# if in FAT32 */ |
clst = (CLUST)fs->dirbase; |
dj->clust = clst; /* Current cluster */ |
dj->sect = clst ? clust2sect(clst) : fs->dirbase; /* Current sector */ |
return FR_OK; /* Seek succeeded */ |
} |
/*-----------------------------------------------------------------------*/ |
/* Directory handling - Move directory index next */ |
/*-----------------------------------------------------------------------*/ |
static |
FRESULT dir_next ( /* FR_OK:Succeeded, FR_NO_FILE:End of table */ |
DIR *dj /* Pointer to directory object */ |
) |
{ |
CLUST clst; |
WORD i; |
FATFS *fs = FatFs; |
i = dj->index + 1; |
if (!i || !dj->sect) /* Report EOT when index has reached 65535 */ |
return FR_NO_FILE; |
if (!(i % 16)) { /* Sector changed? */ |
dj->sect++; /* Next sector */ |
if (dj->clust == 0) { /* Static table */ |
if (i >= fs->n_rootdir) /* Report EOT when end of table */ |
return FR_NO_FILE; |
} |
else { /* Dynamic table */ |
if (((i / 16) & (fs->csize-1)) == 0) { /* Cluster changed? */ |
clst = get_fat(dj->clust); /* Get next cluster */ |
if (clst <= 1) return FR_DISK_ERR; |
if (clst >= fs->n_fatent) /* When it reached end of dynamic table */ |
return FR_NO_FILE; /* Report EOT */ |
dj->clust = clst; /* Initialize data for new cluster */ |
dj->sect = clust2sect(clst); |
} |
} |
} |
dj->index = i; |
return FR_OK; |
} |
/*-----------------------------------------------------------------------*/ |
/* Directory handling - Find an object in the directory */ |
/*-----------------------------------------------------------------------*/ |
static |
FRESULT dir_find ( |
DIR *dj, /* Pointer to the directory object linked to the file name */ |
BYTE *dir /* 32-byte working buffer */ |
) |
{ |
FRESULT res; |
BYTE c; |
res = dir_rewind(dj); /* Rewind directory object */ |
if (res != FR_OK) return res; |
do { |
res = disk_readp(dir, dj->sect, (WORD)((dj->index % 16) * 32), 32) /* Read an entry */ |
? FR_DISK_ERR : FR_OK; |
if (res != FR_OK) break; |
c = dir[DIR_Name]; /* First character */ |
if (c == 0) { res = FR_NO_FILE; break; } /* Reached to end of table */ |
if (!(dir[DIR_Attr] & AM_VOL) && !mem_cmp(dir, dj->fn, 11)) /* Is it a valid entry? */ |
break; |
res = dir_next(dj); /* Next entry */ |
} while (res == FR_OK); |
return res; |
} |
/*-----------------------------------------------------------------------*/ |
/* Read an object from the directory */ |
/*-----------------------------------------------------------------------*/ |
#if _USE_DIR |
static |
FRESULT dir_read ( |
DIR *dj, /* Pointer to the directory object to store read object name */ |
BYTE *dir /* 32-byte working buffer */ |
) |
{ |
FRESULT res; |
BYTE a, c; |
res = FR_NO_FILE; |
while (dj->sect) { |
res = disk_readp(dir, dj->sect, (WORD)((dj->index % 16) * 32), 32) /* Read an entry */ |
? FR_DISK_ERR : FR_OK; |
if (res != FR_OK) break; |
c = dir[DIR_Name]; |
if (c == 0) { res = FR_NO_FILE; break; } /* Reached to end of table */ |
a = dir[DIR_Attr] & AM_MASK; |
if (c != 0xE5 && c != '.' && !(a & AM_VOL)) /* Is it a valid entry? */ |
break; |
res = dir_next(dj); /* Next entry */ |
if (res != FR_OK) break; |
} |
if (res != FR_OK) dj->sect = 0; |
return res; |
} |
#endif |
/*-----------------------------------------------------------------------*/ |
/* Pick a segment and create the object name in directory form */ |
/*-----------------------------------------------------------------------*/ |
#ifdef _EXCVT |
static const BYTE cvt[] = _EXCVT; |
#endif |
static |
FRESULT create_name ( |
DIR *dj, /* Pointer to the directory object */ |
const char **path /* Pointer to pointer to the segment in the path string */ |
) |
{ |
BYTE c, d, ni, si, i, *sfn; |
const char *p; |
/* Create file name in directory form */ |
sfn = dj->fn; |
mem_set(sfn, ' ', 11); |
si = i = 0; ni = 8; |
p = *path; |
for (;;) { |
c = p[si++]; |
if (c <= ' ' || c == '/') break; /* Break on end of segment */ |
if (c == '.' || i >= ni) { |
if (ni != 8 || c != '.') break; |
i = 8; ni = 11; |
continue; |
} |
#ifdef _EXCVT |
if (c >= 0x80) /* To upper extended char (SBCS) */ |
c = cvt[c - 0x80]; |
#endif |
if (IsDBCS1(c) && i < ni - 1) { /* DBC 1st byte? */ |
d = p[si++]; /* Get 2nd byte */ |
sfn[i++] = c; |
sfn[i++] = d; |
} else { /* Single byte code */ |
if (IsLower(c)) c -= 0x20; /* toupper */ |
sfn[i++] = c; |
} |
} |
*path = &p[si]; /* Rerurn pointer to the next segment */ |
sfn[11] = (c <= ' ') ? 1 : 0; /* Set last segment flag if end of path */ |
return FR_OK; |
} |
/*-----------------------------------------------------------------------*/ |
/* Get file information from directory entry */ |
/*-----------------------------------------------------------------------*/ |
#if _USE_DIR |
static |
void get_fileinfo ( /* No return code */ |
DIR *dj, /* Pointer to the directory object */ |
BYTE *dir, /* 32-byte working buffer */ |
FILINFO *fno /* Pointer to store the file information */ |
) |
{ |
BYTE i, c; |
char *p; |
p = fno->fname; |
if (dj->sect) { |
for (i = 0; i < 8; i++) { /* Copy file name body */ |
c = dir[i]; |
if (c == ' ') break; |
if (c == 0x05) c = 0xE5; |
*p++ = c; |
} |
if (dir[8] != ' ') { /* Copy file name extension */ |
*p++ = '.'; |
for (i = 8; i < 11; i++) { |
c = dir[i]; |
if (c == ' ') break; |
*p++ = c; |
} |
} |
fno->fattrib = dir[DIR_Attr]; /* Attribute */ |
fno->fsize = LD_DWORD(dir+DIR_FileSize); /* Size */ |
fno->fdate = LD_WORD(dir+DIR_WrtDate); /* Date */ |
fno->ftime = LD_WORD(dir+DIR_WrtTime); /* Time */ |
} |
*p = 0; |
} |
#endif /* _USE_DIR */ |
/*-----------------------------------------------------------------------*/ |
/* Follow a file path */ |
/*-----------------------------------------------------------------------*/ |
static |
FRESULT follow_path ( /* FR_OK(0): successful, !=0: error code */ |
DIR *dj, /* Directory object to return last directory and found object */ |
BYTE *dir, /* 32-byte working buffer */ |
const char *path /* Full-path string to find a file or directory */ |
) |
{ |
FRESULT res; |
while (*path == ' ') path++; /* Skip leading spaces */ |
if (*path == '/') path++; /* Strip heading separator */ |
dj->sclust = 0; /* Set start directory (always root dir) */ |
if ((BYTE)*path <= ' ') { /* Null path means the root directory */ |
res = dir_rewind(dj); |
dir[0] = 0; |
} else { /* Follow path */ |
for (;;) { |
res = create_name(dj, &path); /* Get a segment */ |
if (res != FR_OK) break; |
res = dir_find(dj, dir); /* Find it */ |
if (res != FR_OK) { /* Could not find the object */ |
if (res == FR_NO_FILE && !*(dj->fn+11)) |
res = FR_NO_PATH; |
break; |
} |
if (*(dj->fn+11)) break; /* Last segment match. Function completed. */ |
if (!(dir[DIR_Attr] & AM_DIR)) { /* Cannot follow because it is a file */ |
res = FR_NO_PATH; break; |
} |
dj->sclust = LD_CLUST(dir); |
} |
} |
return res; |
} |
/*-----------------------------------------------------------------------*/ |
/* Check a sector if it is an FAT boot record */ |
/*-----------------------------------------------------------------------*/ |
static |
BYTE check_fs ( /* 0:The FAT boot record, 1:Valid boot record but not an FAT, 2:Not a boot record, 3:Error */ |
BYTE *buf, /* Working buffer */ |
DWORD sect /* Sector# (lba) to check if it is an FAT boot record or not */ |
) |
{ |
if (disk_readp(buf, sect, 510, 2)) /* Read the boot sector */ |
return 3; |
if (LD_WORD(buf) != 0xAA55) /* Check record signature */ |
return 2; |
if (!disk_readp(buf, sect, BS_FilSysType, 2) && LD_WORD(buf) == 0x4146) /* Check FAT12/16 */ |
return 0; |
if (_FS_FAT32 && !disk_readp(buf, sect, BS_FilSysType32, 2) && LD_WORD(buf) == 0x4146) /* Check FAT32 */ |
return 0; |
return 1; |
} |
/*-------------------------------------------------------------------------- |
Public Functions |
--------------------------------------------------------------------------*/ |
/*-----------------------------------------------------------------------*/ |
/* Mount/Unmount a Locical Drive */ |
/*-----------------------------------------------------------------------*/ |
FRESULT pf_mount ( |
FATFS *fs /* Pointer to new file system object (NULL: Unmount) */ |
) |
{ |
BYTE fmt, buf[36]; |
DWORD bsect, fsize, tsect, mclst; |
FatFs = 0; |
if (!fs) return FR_OK; /* Unregister fs object */ |
if (disk_initialize() & STA_NOINIT) /* Check if the drive is ready or not */ |
return FR_NOT_READY; |
/* Search FAT partition on the drive */ |
bsect = 0; |
fmt = check_fs(buf, bsect); /* Check sector 0 as an SFD format */ |
if (fmt == 1) { /* Not an FAT boot record, it may be FDISK format */ |
/* Check a partition listed in top of the partition table */ |
if (disk_readp(buf, bsect, MBR_Table, 16)) { /* 1st partition entry */ |
fmt = 3; |
} else { |
if (buf[4]) { /* Is the partition existing? */ |
bsect = LD_DWORD(&buf[8]); /* Partition offset in LBA */ |
fmt = check_fs(buf, bsect); /* Check the partition */ |
} |
} |
} |
if (fmt == 3) return FR_DISK_ERR; |
if (fmt) return FR_NO_FILESYSTEM; /* No valid FAT patition is found */ |
/* Initialize the file system object */ |
if (disk_readp(buf, bsect, 13, sizeof(buf))) return FR_DISK_ERR; |
fsize = LD_WORD(buf+BPB_FATSz16-13); /* Number of sectors per FAT */ |
if (!fsize) fsize = LD_DWORD(buf+BPB_FATSz32-13); |
fsize *= buf[BPB_NumFATs-13]; /* Number of sectors in FAT area */ |
fs->fatbase = bsect + LD_WORD(buf+BPB_RsvdSecCnt-13); /* FAT start sector (lba) */ |
fs->csize = buf[BPB_SecPerClus-13]; /* Number of sectors per cluster */ |
fs->n_rootdir = LD_WORD(buf+BPB_RootEntCnt-13); /* Nmuber of root directory entries */ |
tsect = LD_WORD(buf+BPB_TotSec16-13); /* Number of sectors on the file system */ |
if (!tsect) tsect = LD_DWORD(buf+BPB_TotSec32-13); |
mclst = (tsect /* Last cluster# + 1 */ |
- LD_WORD(buf+BPB_RsvdSecCnt-13) - fsize - fs->n_rootdir / 16 |
) / fs->csize + 2; |
fs->n_fatent = (CLUST)mclst; |
fmt = FS_FAT16; /* Determine the FAT sub type */ |
if (mclst < 0xFF7) /* Number of clusters < 0xFF5 */ |
#if _FS_FAT12 |
fmt = FS_FAT12; |
#else |
return FR_NO_FILESYSTEM; |
#endif |
if (mclst >= 0xFFF7) /* Number of clusters >= 0xFFF5 */ |
#if _FS_FAT32 |
fmt = FS_FAT32; |
#else |
return FR_NO_FILESYSTEM; |
#endif |
fs->fs_type = fmt; /* FAT sub-type */ |
if (_FS_FAT32 && fmt == FS_FAT32) |
fs->dirbase = LD_DWORD(buf+(BPB_RootClus-13)); /* Root directory start cluster */ |
else |
fs->dirbase = fs->fatbase + fsize; /* Root directory start sector (lba) */ |
fs->database = fs->fatbase + fsize + fs->n_rootdir / 16; /* Data start sector (lba) */ |
fs->flag = 0; |
FatFs = fs; |
return FR_OK; |
} |
/*-----------------------------------------------------------------------*/ |
/* Open or Create a File */ |
/*-----------------------------------------------------------------------*/ |
FRESULT pf_open ( |
const char *path /* Pointer to the file name */ |
) |
{ |
FRESULT res; |
DIR dj; |
BYTE sp[12], dir[32]; |
FATFS *fs = FatFs; |
if (!fs) /* Check file system */ |
return FR_NOT_ENABLED; |
fs->flag = 0; |
dj.fn = sp; |
res = follow_path(&dj, dir, path); /* Follow the file path */ |
if (res != FR_OK) return res; /* Follow failed */ |
if (!dir[0] || (dir[DIR_Attr] & AM_DIR)) /* It is a directory */ |
return FR_NO_FILE; |
fs->org_clust = LD_CLUST(dir); /* File start cluster */ |
fs->fsize = LD_DWORD(dir+DIR_FileSize); /* File size */ |
fs->fptr = 0; /* File pointer */ |
fs->flag = FA_OPENED; |
return FR_OK; |
} |
/*-----------------------------------------------------------------------*/ |
/* Read File */ |
/*-----------------------------------------------------------------------*/ |
#if _USE_READ |
FRESULT pf_read ( |
void* buff, /* Pointer to the read buffer (NULL:Forward data to the stream)*/ |
WORD btr, /* Number of bytes to read */ |
WORD* br /* Pointer to number of bytes read */ |
) |
{ |
DRESULT dr; |
CLUST clst; |
DWORD sect, remain; |
WORD rcnt; |
BYTE cs, *rbuff = buff; |
FATFS *fs = FatFs; |
*br = 0; |
if (!fs) return FR_NOT_ENABLED; /* Check file system */ |
if (!(fs->flag & FA_OPENED)) /* Check if opened */ |
return FR_NOT_OPENED; |
remain = fs->fsize - fs->fptr; |
if (btr > remain) btr = (WORD)remain; /* Truncate btr by remaining bytes */ |
while (btr) { /* Repeat until all data transferred */ |
if ((fs->fptr % 512) == 0) { /* On the sector boundary? */ |
cs = (BYTE)(fs->fptr / 512 & (fs->csize - 1)); /* Sector offset in the cluster */ |
if (!cs) { /* On the cluster boundary? */ |
clst = (fs->fptr == 0) ? /* On the top of the file? */ |
fs->org_clust : get_fat(fs->curr_clust); |
if (clst <= 1) goto fr_abort; |
fs->curr_clust = clst; /* Update current cluster */ |
} |
sect = clust2sect(fs->curr_clust); /* Get current sector */ |
if (!sect) goto fr_abort; |
fs->dsect = sect + cs; |
} |
rcnt = (WORD)(512 - (fs->fptr % 512)); /* Get partial sector data from sector buffer */ |
if (rcnt > btr) rcnt = btr; |
dr = disk_readp(!buff ? 0 : rbuff, fs->dsect, (WORD)(fs->fptr % 512), rcnt); |
if (dr) goto fr_abort; |
fs->fptr += rcnt; rbuff += rcnt; /* Update pointers and counters */ |
btr -= rcnt; *br += rcnt; |
} |
return FR_OK; |
fr_abort: |
fs->flag = 0; |
return FR_DISK_ERR; |
} |
#endif |
/*-----------------------------------------------------------------------*/ |
/* Write File */ |
/*-----------------------------------------------------------------------*/ |
#if _USE_WRITE |
FRESULT pf_write ( |
const void* buff, /* Pointer to the data to be written */ |
WORD btw, /* Number of bytes to write (0:Finalize the current write operation) */ |
WORD* bw /* Pointer to number of bytes written */ |
) |
{ |
CLUST clst; |
DWORD sect, remain; |
const BYTE *p = buff; |
BYTE cs; |
WORD wcnt; |
FATFS *fs = FatFs; |
*bw = 0; |
if (!fs) return FR_NOT_ENABLED; /* Check file system */ |
if (!(fs->flag & FA_OPENED)) /* Check if opened */ |
return FR_NOT_OPENED; |
if (!btw) { /* Finalize request */ |
if ((fs->flag & FA__WIP) && disk_writep(0, 0)) goto fw_abort; |
fs->flag &= ~FA__WIP; |
return FR_OK; |
} else { /* Write data request */ |
if (!(fs->flag & FA__WIP)) /* Round-down fptr to the sector boundary */ |
fs->fptr &= 0xFFFFFE00; |
} |
remain = fs->fsize - fs->fptr; |
if (btw > remain) btw = (WORD)remain; /* Truncate btw by remaining bytes */ |
while (btw) { /* Repeat until all data transferred */ |
if (((WORD)fs->fptr % 512) == 0) { /* On the sector boundary? */ |
cs = (BYTE)(fs->fptr / 512 & (fs->csize - 1)); /* Sector offset in the cluster */ |
if (!cs) { /* On the cluster boundary? */ |
clst = (fs->fptr == 0) ? /* On the top of the file? */ |
fs->org_clust : get_fat(fs->curr_clust); |
if (clst <= 1) goto fw_abort; |
fs->curr_clust = clst; /* Update current cluster */ |
} |
sect = clust2sect(fs->curr_clust); /* Get current sector */ |
if (!sect) goto fw_abort; |
fs->dsect = sect + cs; |
if (disk_writep(0, fs->dsect)) goto fw_abort; /* Initiate a sector write operation */ |
fs->flag |= FA__WIP; |
} |
wcnt = 512 - ((WORD)fs->fptr % 512); /* Number of bytes to write to the sector */ |
if (wcnt > btw) wcnt = btw; |
if (disk_writep(p, wcnt)) goto fw_abort; /* Send data to the sector */ |
fs->fptr += wcnt; p += wcnt; /* Update pointers and counters */ |
btw -= wcnt; *bw += wcnt; |
if (((WORD)fs->fptr % 512) == 0) { |
if (disk_writep(0, 0)) goto fw_abort; /* Finalize the currtent secter write operation */ |
fs->flag &= ~FA__WIP; |
} |
} |
return FR_OK; |
fw_abort: |
fs->flag = 0; |
return FR_DISK_ERR; |
} |
#endif |
/*-----------------------------------------------------------------------*/ |
/* Seek File R/W Pointer */ |
/*-----------------------------------------------------------------------*/ |
#if _USE_LSEEK |
FRESULT pf_lseek ( |
DWORD ofs /* File pointer from top of file */ |
) |
{ |
CLUST clst; |
DWORD bcs, sect, ifptr; |
FATFS *fs = FatFs; |
if (!fs) return FR_NOT_ENABLED; /* Check file system */ |
if (!(fs->flag & FA_OPENED)) /* Check if opened */ |
return FR_NOT_OPENED; |
if (ofs > fs->fsize) ofs = fs->fsize; /* Clip offset with the file size */ |
ifptr = fs->fptr; |
fs->fptr = 0; |
if (ofs > 0) { |
bcs = (DWORD)fs->csize * 512; /* Cluster size (byte) */ |
if (ifptr > 0 && |
(ofs - 1) / bcs >= (ifptr - 1) / bcs) { /* When seek to same or following cluster, */ |
fs->fptr = (ifptr - 1) & ~(bcs - 1); /* start from the current cluster */ |
ofs -= fs->fptr; |
clst = fs->curr_clust; |
} else { /* When seek to back cluster, */ |
clst = fs->org_clust; /* start from the first cluster */ |
fs->curr_clust = clst; |
} |
while (ofs > bcs) { /* Cluster following loop */ |
clst = get_fat(clst); /* Follow cluster chain */ |
if (clst <= 1 || clst >= fs->n_fatent) goto fe_abort; |
fs->curr_clust = clst; |
fs->fptr += bcs; |
ofs -= bcs; |
} |
fs->fptr += ofs; |
sect = clust2sect(clst); /* Current sector */ |
if (!sect) goto fe_abort; |
fs->dsect = sect + (fs->fptr / 512 & (fs->csize - 1)); |
} |
return FR_OK; |
fe_abort: |
fs->flag = 0; |
return FR_DISK_ERR; |
} |
#endif |
/*-----------------------------------------------------------------------*/ |
/* Create a Directroy Object */ |
/*-----------------------------------------------------------------------*/ |
#if _USE_DIR |
FRESULT pf_opendir ( |
DIR *dj, /* Pointer to directory object to create */ |
const char *path /* Pointer to the directory path */ |
) |
{ |
FRESULT res; |
BYTE sp[12], dir[32]; |
FATFS *fs = FatFs; |
if (!fs) { /* Check file system */ |
res = FR_NOT_ENABLED; |
} else { |
dj->fn = sp; |
res = follow_path(dj, dir, path); /* Follow the path to the directory */ |
if (res == FR_OK) { /* Follow completed */ |
if (dir[0]) { /* It is not the root dir */ |
if (dir[DIR_Attr] & AM_DIR) /* The object is a directory */ |
dj->sclust = LD_CLUST(dir); |
else /* The object is not a directory */ |
res = FR_NO_PATH; |
} |
if (res == FR_OK) |
res = dir_rewind(dj); /* Rewind dir */ |
} |
if (res == FR_NO_FILE) res = FR_NO_PATH; |
} |
return res; |
} |
/*-----------------------------------------------------------------------*/ |
/* Read Directory Entry in Sequense */ |
/*-----------------------------------------------------------------------*/ |
FRESULT pf_readdir ( |
DIR *dj, /* Pointer to the open directory object */ |
FILINFO *fno /* Pointer to file information to return */ |
) |
{ |
FRESULT res; |
BYTE sp[12], dir[32]; |
FATFS *fs = FatFs; |
if (!fs) { /* Check file system */ |
res = FR_NOT_ENABLED; |
} else { |
dj->fn = sp; |
if (!fno) { |
res = dir_rewind(dj); |
} else { |
res = dir_read(dj, dir); |
if (res == FR_NO_FILE) { |
dj->sect = 0; |
res = FR_OK; |
} |
if (res == FR_OK) { /* A valid entry is found */ |
get_fileinfo(dj, dir, fno); /* Get the object information */ |
res = dir_next(dj); /* Increment index for next */ |
if (res == FR_NO_FILE) { |
dj->sect = 0; |
res = FR_OK; |
} |
} |
} |
} |
return res; |
} |
#endif /* _USE_DIR */ |
//MSP430 Projects/MSP430_Audio_Cube/pff.h |
---|
0,0 → 1,192 |
/*---------------------------------------------------------------------------/ |
/ Petit FatFs - FAT file system module include file R0.02a (C)ChaN, 2010 |
/----------------------------------------------------------------------------/ |
/ Petit FatFs module is an open source software to implement FAT file system to |
/ small embedded systems. This is a free software and is opened for education, |
/ research and commercial developments under license policy of following trems. |
/ |
/ Copyright (C) 2010, ChaN, all right reserved. |
/ |
/ * The Petit FatFs module is a free software and there is NO WARRANTY. |
/ * No restriction on use. You can use, modify and redistribute it for |
/ personal, non-profit or commercial use UNDER YOUR RESPONSIBILITY. |
/ * Redistributions of source code must retain the above copyright notice. |
/ |
/----------------------------------------------------------------------------*/ |
#include "integer.h" |
/*---------------------------------------------------------------------------/ |
/ Petit FatFs Configuration Options |
/ |
/ CAUTION! Do not forget to make clean the project after any changes to |
/ the configuration options. |
/ |
/----------------------------------------------------------------------------*/ |
#ifndef _FATFS |
#define _FATFS |
#define _USE_READ 1 /* 1:Enable pf_read() */ |
#define _USE_DIR 1 /* 1:Enable pf_opendir() and pf_readdir() */ |
#define _USE_LSEEK 0 /* 1:Enable pf_lseek() */ |
#define _USE_WRITE 0 /* 1:Enable pf_write() */ |
#define _FS_FAT12 1 /* 1:Enable FAT12 support */ |
#define _FS_FAT32 0 /* 1:Enable FAT32 support */ |
#define _CODE_PAGE 1 |
/* Defines which code page is used for path name. Supported code pages are: |
/ 932, 936, 949, 950, 437, 720, 737, 775, 850, 852, 855, 857, 858, 862, 866, |
/ 874, 1250, 1251, 1252, 1253, 1254, 1255, 1257, 1258 and 1 (ASCII only). |
/ SBCS code pages except for 1 requiers a case conversion table. This |
/ might occupy 128 bytes on the RAM on some platforms, e.g. avr-gcc. */ |
#define _WORD_ACCESS 0 |
/* The _WORD_ACCESS option defines which access method is used to the word |
/ data in the FAT structure. |
/ |
/ 0: Byte-by-byte access. Always compatible with all platforms. |
/ 1: Word access. Do not choose this unless following condition is met. |
/ |
/ When the byte order on the memory is big-endian or address miss-aligned |
/ word access results incorrect behavior, the _WORD_ACCESS must be set to 0. |
/ If it is not the case, the value can also be set to 1 to improve the |
/ performance and code efficiency. */ |
/* End of configuration options. Do not change followings without care. */ |
/*--------------------------------------------------------------------------*/ |
#if _FS_FAT32 |
#define CLUST DWORD |
#else |
#define CLUST WORD |
#endif |
/* File system object structure */ |
typedef struct { |
BYTE fs_type; /* FAT sub type */ |
BYTE flag; /* File status flags */ |
BYTE csize; /* Number of sectors per cluster */ |
BYTE pad1; |
WORD n_rootdir; /* Number of root directory entries (0 on FAT32) */ |
CLUST n_fatent; /* Number of FAT entries (= number of clusters + 2) */ |
DWORD fatbase; /* FAT start sector */ |
DWORD dirbase; /* Root directory start sector (Cluster# on FAT32) */ |
DWORD database; /* Data start sector */ |
DWORD fptr; /* File R/W pointer */ |
DWORD fsize; /* File size */ |
CLUST org_clust; /* File start cluster */ |
CLUST curr_clust; /* File current cluster */ |
DWORD dsect; /* File current data sector */ |
} FATFS; |
/* Directory object structure */ |
typedef struct { |
WORD index; /* Current read/write index number */ |
BYTE* fn; /* Pointer to the SFN (in/out) {file[8],ext[3],status[1]} */ |
CLUST sclust; /* Table start cluster (0:Static table) */ |
CLUST clust; /* Current cluster */ |
DWORD sect; /* Current sector */ |
} DIR; |
/* File status structure */ |
typedef struct { |
DWORD fsize; /* File size */ |
WORD fdate; /* Last modified date */ |
WORD ftime; /* Last modified time */ |
BYTE fattrib; /* Attribute */ |
char fname[13]; /* File name */ |
} FILINFO; |
/* File function return code (FRESULT) */ |
typedef enum { |
FR_OK = 0, /* 0 */ |
FR_DISK_ERR, /* 1 */ |
FR_NOT_READY, /* 2 */ |
FR_NO_FILE, /* 3 */ |
FR_NO_PATH, /* 4 */ |
FR_NOT_OPENED, /* 5 */ |
FR_NOT_ENABLED, /* 6 */ |
FR_NO_FILESYSTEM /* 7 */ |
} FRESULT; |
/*--------------------------------------------------------------*/ |
/* Petit FatFs module application interface */ |
FRESULT pf_mount (FATFS*); /* Mount/Unmount a logical drive */ |
FRESULT pf_open (const char*); /* Open a file */ |
FRESULT pf_read (void*, WORD, WORD*); /* Read data from the open file */ |
FRESULT pf_write (const void*, WORD, WORD*); /* Write data to the open file */ |
FRESULT pf_lseek (DWORD); /* Move file pointer of the open file */ |
FRESULT pf_opendir (DIR*, const char*); /* Open a directory */ |
FRESULT pf_readdir (DIR*, FILINFO*); /* Read a directory item from the open directory */ |
/*--------------------------------------------------------------*/ |
/* Flags and offset address */ |
/* File status flag (FATFS.flag) */ |
#define FA_OPENED 0x01 |
#define FA_WPRT 0x02 |
#define FA__WIP 0x40 |
/* FAT sub type (FATFS.fs_type) */ |
#define FS_FAT12 1 |
#define FS_FAT16 2 |
#define FS_FAT32 3 |
/* File attribute bits for directory entry */ |
#define AM_RDO 0x01 /* Read only */ |
#define AM_HID 0x02 /* Hidden */ |
#define AM_SYS 0x04 /* System */ |
#define AM_VOL 0x08 /* Volume label */ |
#define AM_LFN 0x0F /* LFN entry */ |
#define AM_DIR 0x10 /* Directory */ |
#define AM_ARC 0x20 /* Archive */ |
#define AM_MASK 0x3F /* Mask of defined bits */ |
/*--------------------------------*/ |
/* Multi-byte word access macros */ |
#if _WORD_ACCESS == 1 /* Enable word access to the FAT structure */ |
#define LD_WORD(ptr) (WORD)(*(WORD*)(BYTE*)(ptr)) |
#define LD_DWORD(ptr) (DWORD)(*(DWORD*)(BYTE*)(ptr)) |
#define ST_WORD(ptr,val) *(WORD*)(BYTE*)(ptr)=(WORD)(val) |
#define ST_DWORD(ptr,val) *(DWORD*)(BYTE*)(ptr)=(DWORD)(val) |
#else /* Use byte-by-byte access to the FAT structure */ |
#define LD_WORD(ptr) (WORD)(((WORD)*((BYTE*)(ptr)+1)<<8)|(WORD)*(BYTE*)(ptr)) |
#define LD_DWORD(ptr) (DWORD)(((DWORD)*((BYTE*)(ptr)+3)<<24)|((DWORD)*((BYTE*)(ptr)+2)<<16)|((WORD)*((BYTE*)(ptr)+1)<<8)|*(BYTE*)(ptr)) |
#define ST_WORD(ptr,val) *(BYTE*)(ptr)=(BYTE)(val); *((BYTE*)(ptr)+1)=(BYTE)((WORD)(val)>>8) |
#define ST_DWORD(ptr,val) *(BYTE*)(ptr)=(BYTE)(val); *((BYTE*)(ptr)+1)=(BYTE)((WORD)(val)>>8); *((BYTE*)(ptr)+2)=(BYTE)((DWORD)(val)>>16); *((BYTE*)(ptr)+3)=(BYTE)((DWORD)(val)>>24) |
#endif |
#endif /* _FATFS */ |
//MSP430 Projects/MSP430_Audio_Cube/player.h |
---|
0,0 → 1,21 |
/* |
VLSI Solution generic microcontroller example player / recorder definitions. |
v1.00. |
See VS10xx AppNote: Playback and Recording for details. |
v1.00 2012-11-23 HH First release |
*/ |
#ifndef PLAYER_RECORDER_H |
#define PLAYER_RECORDER_H |
#include "vs10xx_uc.h" |
int VS1053Init(void); |
int VSInitHardware(void); |
int VSInitSoftware(void); |
void VS1053PlayFile(const char *fileName); |
#endif |
//MSP430 Projects/MSP430_Audio_Cube/targetConfigs/MSP430G2231.ccxml |
---|
0,0 → 1,12 |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
<configurations XML_version="1.2" id="configurations_0"> |
<configuration XML_version="1.2" id="configuration_0"> |
<instance XML_version="1.2" desc="TI MSP430 USB1" href="connections/TIMSP430-USB.xml" id="TI MSP430 USB1" xml="TIMSP430-USB.xml" xmlpath="connections"/> |
<connection XML_version="1.2" id="TI MSP430 USB1"> |
<instance XML_version="1.2" href="drivers/msp430_emu.xml" id="drivers" xml="msp430_emu.xml" xmlpath="drivers"/> |
<platform XML_version="1.2" id="platform_0"> |
<instance XML_version="1.2" desc="MSP430G2231" href="devices/MSP430G2231.xml" id="MSP430G2231" xml="MSP430G2231.xml" xmlpath="devices"/> |
</platform> |
</connection> |
</configuration> |
</configurations> |
//MSP430 Projects/MSP430_Audio_Cube/targetConfigs/MSP430G2452.ccxml |
---|
0,0 → 1,12 |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
<configurations XML_version="1.2" id="configurations_0"> |
<configuration XML_version="1.2" id="configuration_0"> |
<instance XML_version="1.2" desc="TI MSP430 USB1" href="connections/TIMSP430-USB.xml" id="TI MSP430 USB1" xml="TIMSP430-USB.xml" xmlpath="connections"/> |
<connection XML_version="1.2" id="TI MSP430 USB1"> |
<instance XML_version="1.2" href="drivers/msp430_emu.xml" id="drivers" xml="msp430_emu.xml" xmlpath="drivers"/> |
<platform XML_version="1.2" id="platform_0"> |
<instance XML_version="1.2" desc="MSP430G2452" href="devices/MSP430G2452.xml" id="MSP430G2452" xml="MSP430G2452.xml" xmlpath="devices"/> |
</platform> |
</connection> |
</configuration> |
</configurations> |
//MSP430 Projects/MSP430_Audio_Cube/targetConfigs/MSP430G2453.ccxml |
---|
0,0 → 1,12 |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
<configurations XML_version="1.2" id="configurations_0"> |
<configuration XML_version="1.2" id="configuration_0"> |
<instance XML_version="1.2" desc="TI MSP430 USB1" href="connections/TIMSP430-USB.xml" id="TI MSP430 USB1" xml="TIMSP430-USB.xml" xmlpath="connections"/> |
<connection XML_version="1.2" id="TI MSP430 USB1"> |
<instance XML_version="1.2" href="drivers/msp430_emu.xml" id="drivers" xml="msp430_emu.xml" xmlpath="drivers"/> |
<platform XML_version="1.2" id="platform_0"> |
<instance XML_version="1.2" desc="MSP430G2453" href="devices/MSP430G2453.xml" id="MSP430G2453" xml="MSP430G2453.xml" xmlpath="devices"/> |
</platform> |
</connection> |
</configuration> |
</configurations> |
//MSP430 Projects/MSP430_Audio_Cube/targetConfigs/MSP430G2553.ccxml |
---|
0,0 → 1,12 |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
<configurations XML_version="1.2" id="configurations_0"> |
<configuration XML_version="1.2" id="configuration_0"> |
<instance XML_version="1.2" desc="TI MSP430 USB1" href="connections/TIMSP430-USB.xml" id="TI MSP430 USB1" xml="TIMSP430-USB.xml" xmlpath="connections"/> |
<connection XML_version="1.2" id="TI MSP430 USB1"> |
<instance XML_version="1.2" href="drivers/msp430_emu.xml" id="drivers" xml="msp430_emu.xml" xmlpath="drivers"/> |
<platform XML_version="1.2" id="platform_0"> |
<instance XML_version="1.2" desc="MSP430G2553" href="devices/MSP430G2553.xml" id="MSP430G2553" xml="MSP430G2553.xml" xmlpath="devices"/> |
</platform> |
</connection> |
</configuration> |
</configurations> |
//MSP430 Projects/MSP430_Audio_Cube/targetConfigs/readme.txt |
---|
0,0 → 1,9 |
The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based |
on the device and connection settings specified in your project on the Properties > General page. |
Please note that in automatic target-configuration management, changes to the project's device and/or |
connection settings will either modify an existing or generate a new target-configuration file. Thus, |
if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively, |
you may create your own target-configuration file for this project and manage it manually. You can |
always switch back to automatic target-configuration management by checking the "Manage the project's |
target-configuration automatically" checkbox on the project's Properties > General page. |
//MSP430 Projects/MSP430_Audio_Cube/vs1053b-patches.plg |
---|
0,0 → 1,449 |
/* User application code loading tables for VS10xx */ |
#if 0 |
void LoadUserCode(void) { |
int i = 0; |
while (i<sizeof(plugin)/sizeof(plugin[0])) { |
unsigned short addr, n, val; |
addr = plugin[i++]; |
n = plugin[i++]; |
if (n & 0x8000U) { /* RLE run, replicate n samples */ |
n &= 0x7FFF; |
val = plugin[i++]; |
while (n--) { |
WriteVS10xxRegister(addr, val); |
} |
} else { /* Copy run, copy n samples */ |
while (n--) { |
val = plugin[i++]; |
WriteVS10xxRegister(addr, val); |
} |
} |
} |
} |
#endif |
#ifndef SKIP_PLUGIN_VARNAME |
const unsigned short plugin[] = { /* Compressed plugin */ |
0x0007,0x0001, /*copy 1*/ |
0x8300, |
0x0006,0x062c, /*copy 1580*/ |
0xb080,0x1402,0x0fdf,0xffc1,0x0007,0x9257,0xb212,0x3c00, |
0x3d00,0x4024,0x0030,0x0297,0x3f00,0x0024,0x0000,0x0401, |
0x000a,0x1055,0x0006,0x0017,0x3f10,0x3401,0x000a,0x2795, |
0x3f00,0x3401,0x0001,0x70d7,0xf400,0x55c0,0x0000,0x0817, |
0xf400,0x57c0,0xc090,0x0024,0x0006,0x0297,0x3f00,0x0024, |
0x0000,0x0000,0x0007,0x81d7,0x3f10,0x0024,0x3f10,0x0024, |
0x0006,0x01d7,0x3f00,0x0024,0x0000,0x190d,0x000f,0xf94f, |
0x0000,0xca0e,0x280f,0xe100,0x0006,0x2016,0x0000,0x0080, |
0x0005,0x4f92,0x3009,0x2800,0x2909,0xf840,0x3613,0x0024, |
0x0006,0x0197,0x0006,0xa115,0xb080,0x0024,0x3f00,0x3400, |
0x0007,0x8a57,0x3700,0x0024,0x4080,0x0024,0x0000,0x0040, |
0x2800,0xcbd5,0x0006,0xa2d7,0x3009,0x3c00,0x0006,0xa157, |
0x3009,0x1c00,0x0006,0x01d7,0x0000,0x190d,0x000a,0x708f, |
0x0000,0xd4ce,0x290b,0x1a80,0x3f00,0x184c,0x0030,0x0017, |
0x4080,0x1c01,0x0000,0x0200,0x2800,0xc7d5,0xb102,0x0024, |
0x0000,0xca08,0x2800,0xc7d5,0x0000,0xd0ce,0x0011,0x210f, |
0x0000,0x190d,0x280f,0xcb00,0x3613,0x0024,0x0006,0xa115, |
0x0006,0x01d7,0x37f0,0x1401,0x6100,0x1c01,0x4012,0x0024, |
0x0000,0x8000,0x6010,0x0024,0x34f3,0x0400,0x2800,0xd398, |
0x0000,0x0024,0x0000,0x8001,0x6010,0x3c01,0x0000,0x000d, |
0x2811,0x8259,0x0000,0x0024,0x2a11,0x2100,0x0030,0x0257, |
0x3700,0x0024,0x4080,0x0024,0x0000,0x0024,0x2800,0xd6d5, |
0x0006,0x0197,0x0006,0xa115,0x3f00,0x3400,0x003f,0xc000, |
0xb600,0x41c1,0x0012,0x5103,0x000c,0xc002,0xdcd6,0x0024, |
0x0000,0x0024,0x2800,0xd955,0x0000,0x0024,0x2800,0x8a40, |
0x0001,0x1208,0x0019,0xd4c2,0x0013,0xd9c3,0x6fd6,0x0024, |
0x0000,0x190d,0x2800,0xdd95,0x0014,0x1b01,0x0020,0x480f, |
0x0000,0xdc4e,0x2920,0x41c0,0x0000,0x190d,0x2801,0x1200, |
0x0000,0x0024,0x0039,0x324f,0x0001,0x408e,0x2820,0x4a18, |
0xb882,0x0024,0x2a20,0x48c0,0x003f,0xfd00,0xb700,0x0024, |
0x003f,0xf901,0x6010,0x0024,0x0014,0x1b01,0x280a,0xc505, |
0x0000,0x190d,0x0015,0x59c0,0x6fc2,0x0024,0x0000,0x0024, |
0x2800,0xe815,0x0000,0x0024,0x290c,0x4840,0x3613,0x0024, |
0x290c,0x4840,0x4086,0x184c,0x0000,0x18c2,0x6234,0x0024, |
0x0000,0x1d02,0x2800,0xe395,0x6234,0x0024,0x0030,0x0317, |
0x2800,0xe800,0x3f00,0x0024,0x0000,0x1d82,0x2800,0xe655, |
0x6234,0x0024,0x2912,0x0d00,0x4084,0x184c,0xf200,0x0024, |
0x6200,0x0024,0x0006,0x0017,0xb080,0x3c40,0x2800,0xe800, |
0x3f00,0x0024,0x0000,0x0202,0x2800,0xe815,0xa024,0x0024, |
0xc020,0x0024,0x0030,0x02d7,0x2800,0xe800,0x3f00,0x0024, |
0x000a,0x8c8f,0x0000,0xe94e,0x000c,0x0981,0x280a,0x71c0, |
0x002c,0x9d40,0x000a,0x708f,0x0000,0xd4ce,0x280a,0xc0d5, |
0x0012,0x5182,0x6fd6,0x0024,0x003f,0xfd81,0x280a,0x8e45, |
0xb710,0x0024,0xb710,0x0024,0x003f,0xfc01,0x6012,0x0024, |
0x0000,0x0101,0x2801,0x08d5,0xffd2,0x0024,0x48b2,0x0024, |
0x4190,0x0024,0x0000,0x190d,0x2801,0x08d5,0x0000,0x0024, |
0x0030,0x0250,0xb880,0x104c,0x3cf0,0x0024,0x0010,0x5500, |
0xb880,0x23c0,0xb882,0x2000,0x0007,0x8590,0x2914,0xbec0, |
0x0000,0x0440,0x0007,0x8b50,0xb880,0x0024,0x2920,0x0100, |
0x3800,0x0024,0x2920,0x0000,0x0006,0x8a91,0x0000,0x0800, |
0xb882,0xa440,0x3009,0x27c1,0x003f,0xfd81,0xb710,0x0024, |
0x003f,0xfc01,0x6012,0x0024,0x0000,0x0101,0x2801,0x1215, |
0x0000,0x0024,0x4f86,0x0024,0xffe2,0x0024,0x48b2,0x0024, |
0x4190,0x0024,0x0000,0x0024,0x2801,0x1215,0x0000,0x0024, |
0x2912,0x2d80,0x0000,0x0780,0x4080,0x0024,0x0006,0x8a90, |
0x2801,0x1215,0x0000,0x01c2,0xb886,0x8040,0x3613,0x03c1, |
0xbcd2,0x0024,0x0030,0x0011,0x2800,0xfbd5,0x0000,0x0024, |
0x003f,0xff42,0xb886,0x8040,0x3009,0x03c1,0x0000,0x0020, |
0xac22,0x0024,0x0000,0x0102,0x6cd2,0x0024,0x3e10,0x0024, |
0x2909,0x8c80,0x3e00,0x4024,0x36f3,0x0024,0x3e11,0x8024, |
0x0000,0x0201,0x2901,0x3740,0x3e01,0xc024,0x36e3,0x104c, |
0xf400,0x4512,0x2900,0x0c80,0x34f3,0x0024,0x3100,0x0024, |
0xb010,0x0024,0x0000,0x0401,0x2801,0x1215,0x0000,0x0024, |
0x291a,0x8a40,0x0000,0x0100,0x2920,0x0200,0x3613,0x0024, |
0x2920,0x0280,0x3613,0x0024,0x408e,0x184c,0xb68c,0xb840, |
0x4f82,0x0024,0x2920,0x0280,0x0000,0x0401,0xb182,0x9bcc, |
0xcfce,0x0024,0x003f,0xfd81,0xb710,0x0024,0x003f,0xfc01, |
0x6012,0x0024,0x0000,0x0101,0x2801,0x1215,0x0000,0x0024, |
0x4f86,0x0024,0xffe2,0x0024,0x48b2,0x0024,0x4190,0x0024, |
0x0000,0x0024,0x2801,0x1215,0x0000,0x0024,0x2912,0x2d80, |
0x0000,0x0780,0x4080,0x0024,0x0000,0x01c2,0x2800,0xf785, |
0x0006,0x8a90,0x2801,0x1200,0x0000,0x0024,0x0000,0x190d, |
0x000a,0x708f,0x280a,0xc0c0,0x0000,0xd4ce,0x2920,0x0100, |
0x0000,0x0401,0x0000,0x0180,0x2920,0x0200,0x3613,0x0024, |
0x2920,0x0280,0x3613,0x0024,0x0000,0x0401,0x2920,0x0280, |
0x4084,0x984c,0x0019,0x9d01,0x6212,0x0024,0x001e,0x5c01, |
0x2801,0x0d55,0x6012,0x0024,0x0000,0x0024,0x2801,0x0f45, |
0x0000,0x0024,0x001b,0x5bc1,0x6212,0x0024,0x001b,0xdd81, |
0x2801,0x1315,0x6012,0x0024,0x0000,0x0024,0x2801,0x1315, |
0x0000,0x0024,0x0000,0x004d,0x000a,0xbf4f,0x280a,0xb880, |
0x0001,0x104e,0x0020,0xfb4f,0x0000,0x190d,0x0001,0x180e, |
0x2920,0x0480,0x3009,0x2bc1,0x291a,0x8a40,0x36e3,0x0024, |
0x0000,0x190d,0x000a,0x708f,0x280a,0xcac0,0x0000,0xd4ce, |
0x0030,0x0017,0x3700,0x4024,0x0000,0x0200,0xb102,0x0024, |
0x0000,0x0024,0x2801,0x1705,0x0000,0x0024,0x0000,0x00c0, |
0x0005,0x4f92,0x3009,0x2800,0x2909,0xf840,0x3613,0x0024, |
0x0006,0x0197,0x0006,0xa115,0xb080,0x0024,0x3f00,0x3400, |
0x0000,0x190d,0x000a,0x708f,0x280a,0xc0c0,0x0000,0xd4ce, |
0x0000,0x004d,0x0020,0xfe0f,0x2820,0xfb40,0x0001,0x190e, |
0x2801,0x1b15,0x0000,0x0024,0x3009,0x13c0,0x6012,0x0024, |
0x0000,0x0024,0x2801,0x3645,0x0000,0x0024,0x3413,0x0024, |
0x34b0,0x0024,0x4080,0x0024,0x0000,0x0200,0x2801,0x1e15, |
0xb882,0x0024,0x3453,0x0024,0x3009,0x13c0,0x4080,0x0024, |
0x0000,0x0200,0x2801,0x3645,0x0000,0x0024,0xb882,0x130c, |
0x0000,0x004d,0x0021,0x058f,0x2821,0x0340,0x0001,0x1f0e, |
0x2801,0x2f95,0x6012,0x0024,0x0000,0x0024,0x2801,0x2f95, |
0x0000,0x0024,0x34c3,0x184c,0x3e13,0xb80f,0xf400,0x4500, |
0x0026,0x9dcf,0x0001,0x230e,0x0000,0xfa0d,0x2926,0x8e80, |
0x3e10,0x110c,0x36f3,0x0024,0x2801,0x2f80,0x36f3,0x980f, |
0x001c,0xdd00,0x001c,0xd901,0x6ec2,0x0024,0x001c,0xdd00, |
0x2801,0x2615,0x0018,0xdbc1,0x3413,0x184c,0xf400,0x4500, |
0x2926,0xc640,0x3e00,0x13cc,0x2801,0x2d00,0x36f3,0x0024, |
0x6ec2,0x0024,0x003f,0xc000,0x2801,0x2895,0x002a,0x4001, |
0x3413,0x184c,0xf400,0x4500,0x2926,0xafc0,0x3e00,0x13cc, |
0x2801,0x2d00,0x36f3,0x0024,0xb400,0x0024,0xd100,0x0024, |
0x0000,0x0024,0x2801,0x2d05,0x0000,0x0024,0x3613,0x0024, |
0x3e11,0x4024,0x2926,0x8540,0x3e01,0x0024,0x4080,0x1b8c, |
0x0000,0x0024,0x2801,0x2d05,0x0000,0x0024,0x3413,0x184c, |
0xf400,0x4500,0x2926,0x8e80,0x3e10,0x13cc,0x36f3,0x0024, |
0x3110,0x8024,0x31f0,0xc024,0x0000,0x4000,0x0000,0x0021, |
0x6d06,0x0024,0x3110,0x8024,0x2826,0xa8c4,0x31f0,0xc024, |
0x2826,0xad00,0x0000,0x0024,0x34c3,0x184c,0x3410,0x8024, |
0x34f0,0xc024,0x0000,0x4000,0x0000,0x0021,0x6d06,0x0024, |
0x3410,0x8024,0x2801,0x3654,0x3430,0xc024,0x4d86,0x0024, |
0x0000,0x0200,0x2922,0x1885,0x0001,0x34c8,0x0000,0x0200, |
0x3e10,0x8024,0x2921,0xca80,0x3e00,0xc024,0x291a,0x8a40, |
0x0000,0x0024,0x2922,0x1880,0x36f3,0x0024,0x0000,0x004d, |
0x0021,0x0ecf,0x2821,0x0bc0,0x0001,0x35ce,0x2801,0x1800, |
0x3c30,0x4024,0x0000,0x190d,0x0000,0x3a4e,0x2821,0x0f80, |
0x0027,0x9e0f,0x0020,0xcd4f,0x2820,0xc780,0x0001,0x380e, |
0x0006,0xf017,0x0000,0x0015,0xb070,0xbc15,0x0000,0x3a4e, |
0x0027,0x9e0f,0x2820,0xcd80,0x0000,0x190d,0x3613,0x0024, |
0x3e10,0xb803,0x3e14,0x3811,0x3e11,0x3805,0x3e00,0x3801, |
0x0007,0xc390,0x0006,0xa011,0x3010,0x0444,0x3050,0x4405, |
0x6458,0x0302,0xff94,0x4081,0x0003,0xffc5,0x48b6,0x0024, |
0xff82,0x0024,0x42b2,0x0042,0xb458,0x0003,0x4cd6,0x9801, |
0xf248,0x1bc0,0xb58a,0x0024,0x6de6,0x1804,0x0006,0x0010, |
0x3810,0x9bc5,0x3800,0xc024,0x36f4,0x1811,0x36f0,0x9803, |
0x283e,0x2d80,0x0fff,0xffc3,0x2801,0x5280,0x0000,0x0024, |
0x3413,0x0024,0x2801,0x4245,0xf400,0x4510,0x2801,0x46c0, |
0x6894,0x13cc,0x3000,0x184c,0x6090,0x93cc,0x38b0,0x3812, |
0x3004,0x4024,0x0000,0x0910,0x3183,0x0024,0x3100,0x4024, |
0x6016,0x0024,0x000c,0x8012,0x2801,0x4551,0xb884,0x104c, |
0x6894,0x3002,0x0000,0x028d,0x003a,0x5e0f,0x0001,0x5a8e, |
0x2939,0xb0c0,0x3e10,0x93cc,0x4084,0x9bd2,0x4282,0x0024, |
0x0000,0x0041,0x2801,0x48c5,0x6212,0x0024,0x0000,0x0040, |
0x2801,0x4dc5,0x000c,0x8390,0x2a01,0x5140,0x34c3,0x0024, |
0x3444,0x0024,0x3073,0x0024,0x3053,0x0024,0x3000,0x0024, |
0x6092,0x098c,0x0000,0x0241,0x2801,0x5145,0x32a0,0x0024, |
0x6012,0x0024,0x0000,0x0024,0x2801,0x5155,0x0000,0x0024, |
0x3613,0x0024,0x3001,0x3844,0x2920,0x0580,0x3009,0x3852, |
0xc090,0x9bd2,0x2801,0x5140,0x3800,0x1bc4,0x000c,0x4113, |
0xb880,0x2380,0x3304,0x4024,0x3800,0x05cc,0xcc92,0x05cc, |
0x3910,0x0024,0x3910,0x4024,0x000c,0x8110,0x3910,0x0024, |
0x39f0,0x4024,0x3810,0x0024,0x38d0,0x4024,0x3810,0x0024, |
0x38f0,0x4024,0x34c3,0x0024,0x3444,0x0024,0x3073,0x0024, |
0x3063,0x0024,0x3000,0x0024,0x4080,0x0024,0x0000,0x0024, |
0x2839,0x53d5,0x4284,0x0024,0x3613,0x0024,0x2801,0x5485, |
0x6898,0xb804,0x0000,0x0084,0x293b,0x1cc0,0x3613,0x0024, |
0x000c,0x8117,0x3711,0x0024,0x37d1,0x4024,0x4e8a,0x0024, |
0x0000,0x0015,0x2801,0x5745,0xce9a,0x0024,0x3f11,0x0024, |
0x3f01,0x4024,0x000c,0x8197,0x408a,0x9bc4,0x3f15,0x4024, |
0x2801,0x5985,0x4284,0x3c15,0x6590,0x0024,0x0000,0x0024, |
0x2839,0x53d5,0x4284,0x0024,0x0000,0x0024,0x2801,0x4118, |
0x458a,0x0024,0x2a39,0x53c0,0x003e,0x2d4f,0x283a,0x5ed5, |
0x0001,0x39ce,0x000c,0x4653,0x0000,0x0246,0xffac,0x0c01, |
0x48be,0x0024,0x4162,0x4546,0x6642,0x4055,0x3501,0x8024, |
0x0000,0x0087,0x667c,0x4057,0x000c,0x41d5,0x283a,0x62d5, |
0x3501,0x8024,0x667c,0x1c47,0x3701,0x8024,0x283a,0x62d5, |
0xc67c,0x0024,0x0000,0x0024,0x283a,0x62c5,0x0000,0x0024, |
0x2a3a,0x5ec0,0x3009,0x3851,0x3e14,0xf812,0x3e12,0xb817, |
0x3e11,0x8024,0x0006,0x0293,0x3301,0x8024,0x468c,0x3804, |
0x0006,0xa057,0x2801,0x6684,0x0006,0x0011,0x469c,0x0024, |
0x3be1,0x8024,0x2801,0x6695,0x0006,0xc392,0x3311,0x0024, |
0x33f1,0x2844,0x3009,0x2bc4,0x0030,0x04d2,0x3311,0x0024, |
0x3a11,0x0024,0x3201,0x8024,0x003f,0xfc04,0xb64c,0x0fc4, |
0xc648,0x0024,0x3a01,0x0024,0x3111,0x1fd3,0x6498,0x07c6, |
0x868c,0x2444,0x0023,0xffd2,0x3901,0x8e06,0x0030,0x0551, |
0x3911,0x8e06,0x3961,0x9c44,0xf400,0x44c6,0xd46c,0x1bc4, |
0x36f1,0xbc13,0x2801,0x7015,0x36f2,0x9817,0x002b,0xffd2, |
0x3383,0x188c,0x3e01,0x8c06,0x0006,0xa097,0x3009,0x1c12, |
0x3213,0x0024,0x468c,0xbc12,0x002b,0xffd2,0xf400,0x4197, |
0x2801,0x6d04,0x3713,0x0024,0x2801,0x6d45,0x37e3,0x0024, |
0x3009,0x2c17,0x3383,0x0024,0x3009,0x0c06,0x468c,0x4197, |
0x0006,0xa052,0x2801,0x6f44,0x3713,0x2813,0x2801,0x6f85, |
0x37e3,0x0024,0x3009,0x2c17,0x36f1,0x8024,0x36f2,0x9817, |
0x36f4,0xd812,0x2100,0x0000,0x3904,0x5bd1,0x2a01,0x604e, |
0x3e11,0x7804,0x0030,0x0257,0x3701,0x0024,0x0013,0x4d05, |
0xd45b,0xe0e1,0x0007,0xc795,0x2801,0x7795,0x0fff,0xff45, |
0x3511,0x184c,0x4488,0xb808,0x0006,0x8a97,0x2801,0x7745, |
0x3009,0x1c40,0x3511,0x1fc1,0x0000,0x0020,0xac52,0x1405, |
0x6ce2,0x0024,0x0000,0x0024,0x2801,0x7741,0x68c2,0x0024, |
0x291a,0x8a40,0x3e10,0x0024,0x2921,0xca80,0x3e00,0x4024, |
0x36f3,0x0024,0x3009,0x1bc8,0x36f0,0x1801,0x3601,0x5804, |
0x3e13,0x780f,0x3e13,0xb808,0x0008,0x9b0f,0x0001,0x7a4e, |
0x2908,0x9300,0x0000,0x004d,0x36f3,0x9808,0x2000,0x0000, |
0x36f3,0x580f,0x0007,0x81d7,0x3711,0x8024,0x3711,0xc024, |
0x3700,0x0024,0x0000,0x2001,0xb012,0x0024,0x0034,0x0000, |
0x2801,0x7d05,0x0000,0x01c1,0x0014,0xc000,0x0000,0x01c1, |
0x4fce,0x0024,0xffea,0x0024,0x48b6,0x0024,0x4384,0x4097, |
0xb886,0x45c6,0xfede,0x0024,0x4db6,0x0024,0x466c,0x0024, |
0x0006,0xc610,0x8dd6,0x8007,0x0000,0x00c6,0xff6e,0x0024, |
0x48b2,0x0024,0x0034,0x2406,0xffee,0x0024,0x2914,0xaa80, |
0x40b2,0x0024,0xf1c6,0x0024,0xf1d6,0x0024,0x0000,0x0201, |
0x8d86,0x0024,0x61de,0x0024,0x0006,0xc612,0x2801,0x8381, |
0x0006,0xc713,0x4c86,0x0024,0x2912,0x1180,0x0006,0xc351, |
0x0006,0x0210,0x2912,0x0d00,0x3810,0x984c,0xf200,0x2043, |
0x2808,0xa000,0x3800,0x0024, |
0x0007,0x0001, /*copy 1*/ |
0x802e, |
0x0006,0x0002, /*copy 2*/ |
0x2801,0x7100, |
0x0007,0x0001, /*copy 1*/ |
0x8050, |
0x0006,0x042a, /*copy 1066*/ |
0x3e12,0x3800,0x3e00,0xb804,0x0030,0x0015,0x0007,0x8257, |
0x3700,0x984c,0xf224,0x1444,0xf224,0x0024,0x0008,0x0002, |
0x2910,0x0181,0x0000,0x1488,0xb428,0x1402,0x0000,0x8004, |
0x2910,0x0195,0x0000,0x1488,0xb428,0x0024,0x0006,0x0095, |
0x2800,0x2085,0x3e13,0x780e,0x3e11,0x7803,0x3e13,0xf806, |
0x3e01,0xf801,0x3510,0x8024,0x3510,0xc024,0x0000,0x0021, |
0xf2d6,0x1444,0x4090,0x1745,0x0000,0x0022,0xf2ea,0x4497, |
0x2400,0x1c40,0x6090,0x1c46,0xfe6c,0x0024,0xcdb6,0x1c46, |
0xfe6c,0x0024,0xceba,0x1c46,0x4d86,0x3442,0x0000,0x09c7, |
0x2800,0x1dc5,0xf5d4,0x3443,0x6724,0x0024,0x4e8a,0x3444, |
0x0000,0x0206,0x2800,0x1f05,0xf5e8,0x3705,0x6748,0x0024, |
0xa264,0x9801,0xc248,0x1bc7,0x0030,0x03d5,0x3d01,0x0024, |
0x36f3,0xd806,0x3601,0x5803,0x36f3,0x0024,0x36f3,0x580e, |
0x0007,0x8257,0x0000,0x6004,0x3730,0x8024,0xb244,0x1c04, |
0xd428,0x3c02,0x0006,0xc717,0x2800,0x2445,0x4284,0x0024, |
0x3613,0x3c02,0x0006,0xc357,0x2901,0x7100,0x3e11,0x5c05, |
0x4284,0x1bc5,0x0000,0x0024,0x2800,0x2705,0x0000,0x0024, |
0x3613,0x0024,0x3e10,0x3813,0x3e14,0x8024,0x3e04,0x8024, |
0x2900,0x4340,0x0006,0x02d3,0x36e3,0x0024,0x3009,0x1bd3, |
0x0007,0x8257,0x3700,0x8024,0xf224,0x0024,0x0000,0x0024, |
0x2800,0x2911,0x3600,0x9844,0x2900,0x2ec0,0x0000,0x2988, |
0x2911,0xf140,0x0000,0x0024,0x0030,0x0057,0x3700,0x0024, |
0xf200,0x4595,0x0fff,0xfe02,0xa024,0x164c,0x8000,0x17cc, |
0x3f00,0x0024,0x3500,0x0024,0x0021,0x6d82,0xd024,0x44c0, |
0x0006,0xa402,0x2800,0x2dd5,0xd024,0x0024,0x0000,0x0000, |
0x2800,0x2dd5,0x000b,0x6d57,0x3009,0x3c00,0x36f0,0x8024, |
0x36f2,0x1800,0x2000,0x0000,0x0000,0x0024,0x3e14,0x7810, |
0x3e13,0xb80d,0x3e13,0xf80a,0x3e10,0xb803,0x3e11,0x3805, |
0x3e11,0xb807,0x3e14,0xf801,0x0001,0x000a,0x0006,0xc4d5, |
0xbf8e,0x9442,0x3e01,0x9403,0x0006,0xa017,0x0023,0xffd1, |
0x0000,0x0053,0x3281,0xf806,0x4091,0x2d64,0x2400,0x3440, |
0x4efa,0x9c10,0xf1eb,0x6061,0xfe55,0x2f66,0x5653,0x2d64, |
0x48b2,0xa201,0x4efa,0xa201,0x36f3,0x3c10,0x36f4,0xd801, |
0x36f1,0x9807,0x36f1,0x1805,0x36f0,0x9803,0x36f3,0xd80a, |
0x36f3,0x980d,0x2000,0x0000,0x36f4,0x5810,0x3e12,0xb817, |
0x3e14,0xf812,0x3e01,0xb811,0x0007,0x9717,0x0020,0xffd2, |
0x0030,0x11d1,0x3111,0x8024,0x3704,0xc024,0x3b81,0x8024, |
0x3101,0x8024,0x3b81,0x8024,0x3f04,0xc024,0x2808,0x4800, |
0x36f1,0x9811,0x36f3,0x0024,0x3009,0x3848,0x3e14,0x3811, |
0x3e00,0x0024,0x0000,0x4000,0x0001,0x0010,0x2915,0x94c0, |
0x0001,0xcc11,0x36f0,0x0024,0x2927,0x9e40,0x3604,0x1811, |
0x3613,0x0024,0x3e14,0x3811,0x3e00,0x0024,0x0000,0x4000, |
0x0001,0x0010,0x2915,0x94c0,0x0001,0xcc11,0x36f0,0x0024, |
0x36f4,0x1811,0x3009,0x1808,0x2000,0x0000,0x0000,0x190d, |
0x3600,0x3840,0x3e13,0x780e,0x3e13,0xf808,0x3e00,0x0024, |
0x0000,0x3a4e,0x0027,0x9e0f,0x2922,0xb680,0x0000,0x190d, |
0x36f3,0x0024,0x36f3,0xd808,0x36f3,0x580e,0x2000,0x0000, |
0x3009,0x1800,0x3613,0x0024,0x3e22,0xb815,0x3e05,0xb814, |
0x3615,0x0024,0x0000,0x800a,0x3e13,0x7801,0x3e10,0xb803, |
0x3e11,0x3805,0x3e11,0xb807,0x3e14,0x3811,0x3e14,0xb813, |
0x3e03,0xf80e,0xb488,0x44d5,0x3543,0x134c,0x34e5,0xc024, |
0x3524,0x8024,0x35a4,0xc024,0x3710,0x8a0c,0x3540,0x4a0c, |
0x3d44,0x8024,0x3a10,0x8024,0x3590,0x0024,0x4010,0x15c1, |
0x6010,0x3400,0x3710,0x8024,0x2800,0x4f04,0x3af0,0x8024, |
0x3df0,0x0024,0x3591,0x4024,0x3530,0x4024,0x4192,0x4050, |
0x6100,0x1482,0x4020,0x1753,0xbf8e,0x1582,0x4294,0x4011, |
0xbd86,0x408e,0x2400,0x4d0e,0xfe6d,0x2819,0x520e,0x0a00, |
0x5207,0x2819,0x4fbe,0x0024,0xad56,0x904c,0xaf5e,0x1010, |
0xf7d4,0x0024,0xf7fc,0x2042,0x6498,0x2046,0x3cf4,0x0024, |
0x3400,0x170c,0x4090,0x1492,0x35a4,0xc024,0x2800,0x4795, |
0x3c00,0x0024,0x4480,0x914c,0x36f3,0xd80e,0x36f4,0x9813, |
0x36f4,0x1811,0x36f1,0x9807,0x36f1,0x1805,0x36f0,0x9803, |
0x36f3,0x5801,0x3405,0x9014,0x36e3,0x0024,0x2000,0x0000, |
0x36f2,0x9815,0x3e12,0xb817,0x3e12,0x3815,0x3e05,0xb814, |
0x3625,0x0024,0x0000,0x800a,0x3e10,0x3801,0x3e10,0xb803, |
0x3e11,0x3805,0x3e11,0xb807,0x3e14,0x3811,0x0006,0xa090, |
0x2912,0x0d00,0x3e14,0xc024,0x4088,0x8000,0x4080,0x0024, |
0x0007,0x90d1,0x2800,0x5905,0x0000,0x0024,0x0007,0x9051, |
0x3100,0x4024,0x4100,0x0024,0x3900,0x0024,0x0007,0x90d1, |
0x0004,0x0000,0x31f0,0x4024,0x6014,0x0400,0x0000,0x0024, |
0x2800,0x5d51,0x4080,0x0024,0x0000,0x0000,0x2800,0x5cc5, |
0x0000,0x0024,0x0007,0x9053,0x3300,0x0024,0x4080,0x0024, |
0x0000,0x0000,0x2800,0x5d58,0x0000,0x0024,0x0007,0x9051, |
0x3900,0x0024,0x3200,0x504c,0x6410,0x0024,0x3cf0,0x0000, |
0x4080,0x0024,0x0006,0xc691,0x2800,0x7605,0x3009,0x0400, |
0x0007,0x9051,0x0000,0x1001,0x3100,0x0024,0x6012,0x0024, |
0x0006,0xc6d0,0x2800,0x6a49,0x003f,0xe000,0x0006,0xc693, |
0x3900,0x0c00,0x3009,0x0001,0x6014,0x0024,0x0007,0x1ad0, |
0x2800,0x6a55,0x3009,0x0000,0x4080,0x0024,0x0000,0x0301, |
0x2800,0x6445,0x4090,0x0024,0x0000,0x0024,0x2800,0x6555, |
0x0000,0x0024,0x3009,0x0000,0xc012,0x0024,0x2800,0x6a40, |
0x3009,0x2001,0x3009,0x0000,0x6012,0x0024,0x0000,0x0341, |
0x2800,0x6755,0x0000,0x0024,0x6190,0x0024,0x2800,0x6a40, |
0x3009,0x2000,0x6012,0x0024,0x0000,0x0381,0x2800,0x6915, |
0x0000,0x0024,0x6190,0x0024,0x2800,0x6a40,0x3009,0x2000, |
0x6012,0x0024,0x0000,0x00c0,0x2800,0x6a55,0x0000,0x0024, |
0x3009,0x2000,0x0006,0xa090,0x3009,0x0000,0x4080,0x0024, |
0x0000,0x0081,0x2800,0x6f15,0x0007,0x8c13,0x3300,0x104c, |
0xb010,0x0024,0x0002,0x8001,0x2800,0x7185,0x34f0,0x0024, |
0x2800,0x6f00,0x0000,0x0024,0x0006,0xc351,0x3009,0x0000, |
0x6090,0x0024,0x3009,0x2000,0x2900,0x0b80,0x3009,0x0405, |
0x0006,0xc690,0x0006,0xc6d1,0x3009,0x0000,0x3009,0x0401, |
0x6014,0x0024,0x0006,0xa093,0x2800,0x6d91,0xb880,0x0024, |
0x2800,0x7ec0,0x3009,0x2c00,0x4040,0x0024,0x6012,0x0024, |
0x0006,0xc6d0,0x2800,0x7ed8,0x0000,0x0024,0x0006,0xc693, |
0x3009,0x0c00,0x3009,0x0001,0x6014,0x0024,0x0006,0xc350, |
0x2800,0x7ec1,0x0000,0x0024,0x6090,0x0024,0x3009,0x2c00, |
0x3009,0x0005,0x2900,0x0b80,0x0000,0x7ec8,0x3009,0x0400, |
0x4080,0x0024,0x0003,0x8000,0x2800,0x7ec5,0x0000,0x0024, |
0x6400,0x0024,0x0000,0x0081,0x2800,0x7ec9,0x0000,0x0024, |
0x0007,0x8c13,0x3300,0x0024,0xb010,0x0024,0x0006,0xc650, |
0x2800,0x7ed5,0x0000,0x0024,0x0001,0x0002,0x3413,0x0000, |
0x3009,0x0401,0x4010,0x8406,0x0000,0x0281,0xa010,0x13c1, |
0x4122,0x0024,0x0000,0x03c2,0x6122,0x8002,0x462c,0x0024, |
0x469c,0x0024,0xfee2,0x0024,0x48be,0x0024,0x6066,0x8400, |
0x0006,0xc350,0x2800,0x7ec1,0x0000,0x0024,0x4090,0x0024, |
0x3009,0x2400,0x2900,0x0b80,0x3009,0x0005,0x0007,0x1b50, |
0x2912,0x0d00,0x3613,0x0024,0x3a00,0x0380,0x4080,0x0024, |
0x0000,0x00c1,0x2800,0x8785,0x3009,0x0000,0xb010,0x008c, |
0x4192,0x0024,0x6012,0x0024,0x0006,0xf051,0x2800,0x8598, |
0x3009,0x0400,0x0007,0x1fd1,0x30e3,0x0400,0x4080,0x0024, |
0x0000,0x0301,0x2800,0x8785,0x3009,0x0000,0xb010,0x0024, |
0x0000,0x0101,0x6012,0x0024,0x0006,0xf051,0x2800,0x8795, |
0x0000,0x0024,0x3023,0x0400,0xf200,0x184c,0xb880,0xa400, |
0x3009,0x2000,0x3009,0x0441,0x3e10,0x4402,0x2909,0xa9c0, |
0x3e10,0x8024,0x36e3,0x0024,0x36f4,0xc024,0x36f4,0x1811, |
0x36f1,0x9807,0x36f1,0x1805,0x36f0,0x9803,0x36f0,0x1801, |
0x3405,0x9014,0x36f3,0x0024,0x36f2,0x1815,0x2000,0x0000, |
0x36f2,0x9817,0x3613,0x0024,0x3e12,0xb817,0x3e12,0x3815, |
0x3e05,0xb814,0x3615,0x0024,0x0000,0x800a,0x3e10,0xb803, |
0x0012,0x5103,0x3e11,0x3805,0x3e11,0xb807,0x3e14,0x380d, |
0x0030,0x0250,0x3e13,0xf80e,0xbe8b,0x83e0,0x290c,0x4840, |
0x3613,0x0024,0x290c,0x4840,0x4086,0x984c,0x0000,0x00ce, |
0x2400,0x918e,0x3009,0x1bc0,0x0000,0x01c3,0xae3a,0x184c, |
0x0000,0x0043,0x3009,0x3842,0x290c,0x4840,0x3009,0x3840, |
0x4084,0x9bc0,0xfe26,0x9bc2,0xceba,0x0024,0x4e8e,0x0024, |
0x4e9a,0x0024,0x4f8e,0x0024,0x0000,0x0102,0x2800,0x96c5, |
0x0030,0x0010,0x0000,0x0206,0x3613,0x0024,0x290c,0x4840, |
0x3009,0x3840,0x3000,0xdbc0,0xb366,0x0024,0x0000,0x0024, |
0x2800,0x96d5,0x4e8e,0x0024,0x4e9a,0x0024,0x4f8e,0x0024, |
0x0030,0x0010,0x2800,0x9395,0x0000,0x0206,0x36f3,0xd80e, |
0x36f4,0x180d,0x36f1,0x9807,0x36f1,0x1805,0x36f0,0x9803, |
0x3405,0x9014,0x36f3,0x0024,0x36f2,0x1815,0x2000,0x0000, |
0x36f2,0x9817, |
0x0007,0x0001, /*copy 1*/ |
0x8030, |
0x0006,0x0002, /*copy 2*/ |
0x2800,0x1400, |
0x0007,0x0001, /*copy 1*/ |
0x8028, |
0x0006,0x0002, /*copy 2*/ |
0x2a00,0x36ce, |
0x0007,0x0001, /*copy 1*/ |
0x8032, |
0x0006,0x0002, /*copy 2*/ |
0x2800,0x5340, |
0x0007,0x0001, /*copy 1*/ |
0x3580, |
0x0006, 0x8038, 0x0000, /*Rle(56)*/ |
0x0007,0x0001, /*copy 1*/ |
0xfab3, |
0x0006,0x01a4, /*copy 420*/ |
0x0001,0x0001,0x0001,0x0001,0x0000,0xffff,0xfffe,0xfffb, |
0xfff9,0xfff5,0xfff2,0xffed,0xffe8,0xffe3,0xffde,0xffd8, |
0xffd3,0xffce,0xffca,0xffc7,0xffc4,0xffc4,0xffc5,0xffc7, |
0xffcc,0xffd3,0xffdc,0xffe6,0xfff3,0x0001,0x0010,0x001f, |
0x002f,0x003f,0x004e,0x005b,0x0066,0x006f,0x0074,0x0075, |
0x0072,0x006b,0x005f,0x004f,0x003c,0x0024,0x0009,0xffed, |
0xffcf,0xffb0,0xff93,0xff77,0xff5f,0xff4c,0xff3d,0xff35, |
0xff34,0xff3b,0xff4a,0xff60,0xff7e,0xffa2,0xffcd,0xfffc, |
0x002e,0x0061,0x0094,0x00c4,0x00f0,0x0114,0x0131,0x0144, |
0x014b,0x0146,0x0134,0x0116,0x00eb,0x00b5,0x0075,0x002c, |
0xffde,0xff8e,0xff3d,0xfeef,0xfea8,0xfe6a,0xfe39,0xfe16, |
0xfe05,0xfe06,0xfe1b,0xfe43,0xfe7f,0xfecd,0xff2a,0xff95, |
0x0009,0x0082,0x00fd,0x0173,0x01e1,0x0242,0x0292,0x02cc, |
0x02ec,0x02f2,0x02da,0x02a5,0x0253,0x01e7,0x0162,0x00c9, |
0x0021,0xff70,0xfebc,0xfe0c,0xfd68,0xfcd5,0xfc5b,0xfc00, |
0xfbc9,0xfbb8,0xfbd2,0xfc16,0xfc85,0xfd1b,0xfdd6,0xfeae, |
0xff9e,0x009c,0x01a0,0x02a1,0x0392,0x046c,0x0523,0x05b0, |
0x060a,0x062c,0x0613,0x05bb,0x0526,0x0456,0x0351,0x021f, |
0x00c9,0xff5a,0xfde1,0xfc6a,0xfb05,0xf9c0,0xf8aa,0xf7d0, |
0xf73d,0xf6fa,0xf70f,0xf77e,0xf848,0xf96b,0xfadf,0xfc9a, |
0xfe8f,0x00ad,0x02e3,0x051a,0x073f,0x0939,0x0af4,0x0c5a, |
0x0d59,0x0de1,0x0de5,0x0d5c,0x0c44,0x0a9e,0x0870,0x05c7, |
0x02b4,0xff4e,0xfbaf,0xf7f8,0xf449,0xf0c7,0xed98,0xeae0, |
0xe8c4,0xe765,0xe6e3,0xe756,0xe8d2,0xeb67,0xef19,0xf3e9, |
0xf9cd,0x00b5,0x088a,0x112b,0x1a72,0x2435,0x2e42,0x3866, |
0x426b,0x4c1b,0x553e,0x5da2,0x6516,0x6b6f,0x7087,0x7441, |
0x7686,0x774a,0x7686,0x7441,0x7087,0x6b6f,0x6516,0x5da2, |
0x553e,0x4c1b,0x426b,0x3866,0x2e42,0x2435,0x1a72,0x112b, |
0x088a,0x00b5,0xf9cd,0xf3e9,0xef19,0xeb67,0xe8d2,0xe756, |
0xe6e3,0xe765,0xe8c4,0xeae0,0xed98,0xf0c7,0xf449,0xf7f8, |
0xfbaf,0xff4e,0x02b4,0x05c7,0x0870,0x0a9e,0x0c44,0x0d5c, |
0x0de5,0x0de1,0x0d59,0x0c5a,0x0af4,0x0939,0x073f,0x051a, |
0x02e3,0x00ad,0xfe8f,0xfc9a,0xfadf,0xf96b,0xf848,0xf77e, |
0xf70f,0xf6fa,0xf73d,0xf7d0,0xf8aa,0xf9c0,0xfb05,0xfc6a, |
0xfde1,0xff5a,0x00c9,0x021f,0x0351,0x0456,0x0526,0x05bb, |
0x0613,0x062c,0x060a,0x05b0,0x0523,0x046c,0x0392,0x02a1, |
0x01a0,0x009c,0xff9e,0xfeae,0xfdd6,0xfd1b,0xfc85,0xfc16, |
0xfbd2,0xfbb8,0xfbc9,0xfc00,0xfc5b,0xfcd5,0xfd68,0xfe0c, |
0xfebc,0xff70,0x0021,0x00c9,0x0162,0x01e7,0x0253,0x02a5, |
0x02da,0x02f2,0x02ec,0x02cc,0x0292,0x0242,0x01e1,0x0173, |
0x00fd,0x0082,0x0009,0xff95,0xff2a,0xfecd,0xfe7f,0xfe43, |
0xfe1b,0xfe06,0xfe05,0xfe16,0xfe39,0xfe6a,0xfea8,0xfeef, |
0xff3d,0xff8e,0xffde,0x002c,0x0075,0x00b5,0x00eb,0x0116, |
0x0134,0x0146,0x014b,0x0144,0x0131,0x0114,0x00f0,0x00c4, |
0x0094,0x0061,0x002e,0xfffc,0xffcd,0xffa2,0xff7e,0xff60, |
0xff4a,0xff3b,0xff34,0xff35,0xff3d,0xff4c,0xff5f,0xff77, |
0xff93,0xffb0,0xffcf,0xffed,0x0009,0x0024,0x003c,0x004f, |
0x005f,0x006b,0x0072,0x0075,0x0074,0x006f,0x0066,0x005b, |
0x004e,0x003f,0x002f,0x001f,0x0010,0x0001,0xfff3,0xffe6, |
0xffdc,0xffd3,0xffcc,0xffc7,0xffc5,0xffc4,0xffc4,0xffc7, |
0xffca,0xffce,0xffd3,0xffd8,0xffde,0xffe3,0xffe8,0xffed, |
0xfff2,0xfff5,0xfff9,0xfffb,0xfffe,0xffff,0x0000,0x0001, |
0x0001,0x0001,0x0001,0x0000, |
0x0007,0x0001, /*copy 1*/ |
0x180b, |
0x0006,0x000b, /*copy 11*/ |
0x000f,0x0010,0x001c,0xfab3,0x3580,0x804b,0xa04b,0x0001, |
0x0000,0x3580,0x01a4, |
0x000a,0x0001, /*copy 1*/ |
0x0300, |
#define PLUGIN_SIZE 3134 |
#endif |
//MSP430 Projects/MSP430_Audio_Cube/vs10xx_uc.h |
---|
0,0 → 1,554 |
#ifndef VS10XX_MICROCONTROLLER_DEFINITIONS_H |
#define VS10XX_MICROCONTROLLER_DEFINITIONS_H |
/* |
VLSI Solution microcontroller definitions for: |
VS1063, VS1053 (and VS8053), VS1033, VS1003, VS1103, VS1011. |
v1.01 2012-11-26 HH Added VS1053 recording registers, bug fixes |
v1.00 2012-11-23 HH Initial version |
*/ |
/* SCI registers */ |
#define SCI_MODE 0x00 |
#define SCI_STATUS 0x01 |
#define SCI_BASS 0x02 |
#define SCI_CLOCKF 0x03 |
#define SCI_DECODE_TIME 0x04 |
#define SCI_AUDATA 0x05 |
#define SCI_WRAM 0x06 |
#define SCI_WRAMADDR 0x07 |
#define SCI_HDAT0 0x08 /* VS1063, VS1053, VS1033, VS1003, VS1011 */ |
#define SCI_IN0 0x08 /* VS1103 */ |
#define SCI_HDAT1 0x09 /* VS1063, VS1053, VS1033, VS1003, VS1011 */ |
#define SCI_IN1 0x09 /* VS1103 */ |
#define SCI_AIADDR 0x0A |
#define SCI_VOL 0x0B |
#define SCI_AICTRL0 0x0C /* VS1063, VS1053, VS1033, VS1003, VS1011 */ |
#define SCI_MIXERVOL 0x0C /* VS1103 */ |
#define SCI_AICTRL1 0x0D /* VS1063, VS1053, VS1033, VS1003, VS1011 */ |
#define SCI_ADPCMRECCTL 0x0D /* VS1103 */ |
#define SCI_AICTRL2 0x0E |
#define SCI_AICTRL3 0x0F |
/* SCI register recording aliases */ |
#define SCI_RECQUALITY 0x07 /* (WRAMADDR) VS1063 */ |
#define SCI_RECDATA 0x08 /* (HDAT0) VS1063 */ |
#define SCI_RECWORDS 0x09 /* (HDAT1) VS1063 */ |
#define SCI_RECRATE 0x0C /* (AICTRL0) VS1063, VS1053 */ |
#define SCI_RECDIV 0x0C /* (AICTRL0) VS1033, VS1003 */ |
#define SCI_RECGAIN 0x0D /* (AICTRL1) VS1063, VS1053, VS1033, VS1003 */ |
#define SCI_RECMAXAUTO 0x0E /* (AICTRL2) VS1063, VS1053, VS1033 */ |
#define SCI_RECMODE 0x0F /* (AICTRL3) VS1063, VS1053 */ |
/* SCI_MODE bits */ |
#define SM_DIFF_B 0 |
#define SM_LAYER12_B 1 /* VS1063, VS1053, VS1033, VS1011 */ |
#define SM_RECORD_PATH_B 1 /* VS1103 */ |
#define SM_RESET_B 2 |
#define SM_CANCEL_B 3 /* VS1063, VS1053 */ |
#define SM_OUTOFWAV_B 3 /* VS1033, VS1003, VS1011 */ |
#define SM_OUTOFMIDI_B 3 /* VS1103 */ |
#define SM_EARSPEAKER_LO_B 4 /* VS1053, VS1033 */ |
#define SM_PDOWN_B 4 /* VS1003, VS1103 */ |
#define SM_TESTS_B 5 |
#define SM_STREAM_B 6 /* VS1053, VS1033, VS1003, VS1011 */ |
#define SM_ICONF_B 6 /* VS1103 */ |
#define SM_EARSPEAKER_HI_B 7 /* VS1053, VS1033 */ |
#define SM_DACT_B 8 |
#define SM_SDIORD_B 9 |
#define SM_SDISHARE_B 10 |
#define SM_SDINEW_B 11 |
#define SM_ENCODE_B 12 /* VS1063 */ |
#define SM_ADPCM_B 12 /* VS1053, VS1033, VS1003 */ |
#define SM_EARSPEAKER_1103_B 12 /* VS1103 */ |
#define SM_ADPCM_HP_B 13 /* VS1033, VS1003 */ |
#define SM_LINE1_B 14 /* VS1063, VS1053 */ |
#define SM_LINE_IN_B 14 /* VS1033, VS1003, VS1103 */ |
#define SM_CLK_RANGE_B 15 /* VS1063, VS1053, VS1033 */ |
#define SM_ADPCM_1103_B 15 /* VS1103 */ |
#define SM_DIFF (1<< 0) |
#define SM_LAYER12 (1<< 1) /* VS1063, VS1053, VS1033, VS1011 */ |
#define SM_RECORD_PATH (1<< 1) /* VS1103 */ |
#define SM_RESET (1<< 2) |
#define SM_CANCEL (1<< 3) /* VS1063, VS1053 */ |
#define SM_OUTOFWAV (1<< 3) /* VS1033, VS1003, VS1011 */ |
#define SM_OUTOFMIDI (1<< 3) /* VS1103 */ |
#define SM_EARSPEAKER_LO (1<< 4) /* VS1053, VS1033 */ |
#define SM_PDOWN (1<< 4) /* VS1003, VS1103 */ |
#define SM_TESTS (1<< 5) |
#define SM_STREAM (1<< 6) /* VS1053, VS1033, VS1003, VS1011 */ |
#define SM_ICONF (1<< 6) /* VS1103 */ |
#define SM_EARSPEAKER_HI (1<< 7) /* VS1053, VS1033 */ |
#define SM_DACT (1<< 8) |
#define SM_SDIORD (1<< 9) |
#define SM_SDISHARE (1<<10) |
#define SM_SDINEW (1<<11) |
#define SM_ENCODE (1<<12) /* VS1063 */ |
#define SM_ADPCM (1<<12) /* VS1053, VS1033, VS1003 */ |
#define SM_EARSPEAKER1103 (1<<12) /* VS1103 */ |
#define SM_ADPCM_HP (1<<13) /* VS1033, VS1003 */ |
#define SM_LINE1 (1<<14) /* VS1063, VS1053 */ |
#define SM_LINE_IN (1<<14) /* VS1033, VS1003, VS1103 */ |
#define SM_CLK_RANGE (1<<15) /* VS1063, VS1053, VS1033 */ |
#define SM_ADPCM_1103 (1<<15) /* VS1103 */ |
#define SM_ICONF_BITS 2 |
#define SM_ICONF_MASK 0x00c0 |
#define SM_EARSPEAKER_1103_BITS 2 |
#define SM_EARSPEAKER_1103_MASK 0x3000 |
/* SCI_STATUS bits */ |
#define SS_REFERENCE_SEL_B 0 /* VS1063, VS1053 */ |
#define SS_AVOL_B 0 /* VS1033, VS1003, VS1103, VS1011 */ |
#define SS_AD_CLOCK_B 1 /* VS1063, VS1053 */ |
#define SS_APDOWN1_B 2 |
#define SS_APDOWN2_B 3 |
#define SS_VER_B 4 |
#define SS_VCM_DISABLE_B 10 /* VS1063, VS1053 */ |
#define SS_VCM_OVERLOAD_B 11 /* VS1063, VS1053 */ |
#define SS_SWING_B 12 /* VS1063, VS1053 */ |
#define SS_DO_NOT_JUMP_B 15 /* VS1063, VS1053 */ |
#define SS_REFERENCE_SEL (1<< 0) /* VS1063, VS1053 */ |
#define SS_AVOL (1<< 0) /* VS1033, VS1003, VS1103, VS1011 */ |
#define SS_AD_CLOCK (1<< 1) /* VS1063, VS1053 */ |
#define SS_APDOWN1 (1<< 2) |
#define SS_APDOWN2 (1<< 3) |
#define SS_VER (1<< 4) |
#define SS_VCM_DISABLE (1<<10) /* VS1063, VS1053 */ |
#define SS_VCM_OVERLOAD (1<<11) /* VS1063, VS1053 */ |
#define SS_SWING (1<<12) /* VS1063, VS1053 */ |
#define SS_DO_NOT_JUMP (1<<15) /* VS1063, VS1053 */ |
#define SS_SWING_BITS 3 |
#define SS_SWING_MASK 0x7000 |
#define SS_VER_BITS 4 |
#define SS_VER_MASK 0x00f0 |
#define SS_AVOL_BITS 2 |
#define SS_AVOL_MASK 0x0003 |
#define SS_VER_VS1001 0x00 |
#define SS_VER_VS1011 0x10 |
#define SS_VER_VS1002 0x20 |
#define SS_VER_VS1003 0x30 |
#define SS_VER_VS1053 0x40 |
#define SS_VER_VS8053 0x40 |
#define SS_VER_VS1033 0x50 |
#define SS_VER_VS1063 0x60 |
#define SS_VER_VS1103 0x70 |
/* SCI_BASS bits */ |
#define ST_AMPLITUDE_B 12 |
#define ST_FREQLIMIT_B 8 |
#define SB_AMPLITUDE_B 4 |
#define SB_FREQLIMIT_B 0 |
#define ST_AMPLITUDE (1<<12) |
#define ST_FREQLIMIT (1<< 8) |
#define SB_AMPLITUDE (1<< 4) |
#define SB_FREQLIMIT (1<< 0) |
#define ST_AMPLITUDE_BITS 4 |
#define ST_AMPLITUDE_MASK 0xf000 |
#define ST_FREQLIMIT_BITS 4 |
#define ST_FREQLIMIT_MASK 0x0f00 |
#define SB_AMPLITUDE_BITS 4 |
#define SB_AMPLITUDE_MASK 0x00f0 |
#define SB_FREQLIMIT_BITS 4 |
#define SB_FREQLIMIT_MASK 0x000f |
/* SCI_CLOCKF bits */ |
#define SC_MULT_B 13 /* VS1063, VS1053, VS1033, VS1103, VS1003 */ |
#define SC_ADD_B 11 /* VS1063, VS1053, VS1033, VS1003 */ |
#define SC_FREQ_B 0 /* VS1063, VS1053, VS1033, VS1103, VS1003 */ |
#define SC_MULT (1<<13) /* VS1063, VS1053, VS1033, VS1103, VS1003 */ |
#define SC_ADD (1<<11) /* VS1063, VS1053, VS1033, VS1003 */ |
#define SC_FREQ (1<< 0) /* VS1063, VS1053, VS1033, VS1103, VS1003 */ |
#define SC_MULT_BITS 3 |
#define SC_MULT_MASK 0xe000 |
#define SC_ADD_BITS 2 |
#define SC_ADD_MASK 0x1800 |
#define SC_FREQ_BITS 11 |
#define SC_FREQ_MASK 0x07ff |
/* The following macro is for VS1063, VS1053, VS1033, VS1003, VS1103. |
Divide hz by two when calling if SM_CLK_RANGE = 1 */ |
#define HZ_TO_SC_FREQ(hz) (((hz)-8000000+2000)/4000) |
/* The following macro is for VS1011. |
The macro will automatically set the clock doubler if XTALI < 16 MHz */ |
#define HZ_TO_SCI_CLOCKF(hz) ((((hz)<16000000)?0x8000:0)+((hz)+1000)/2000) |
/* Following are for VS1003 and VS1033 */ |
#define SC_MULT_03_10X 0x0000 |
#define SC_MULT_03_15X 0x2000 |
#define SC_MULT_03_20X 0x4000 |
#define SC_MULT_03_25X 0x6000 |
#define SC_MULT_03_30X 0x8000 |
#define SC_MULT_03_35X 0xa000 |
#define SC_MULT_03_40X 0xc000 |
#define SC_MULT_03_45X 0xe000 |
/* Following are for VS1053 and VS1063 */ |
#define SC_MULT_53_10X 0x0000 |
#define SC_MULT_53_20X 0x2000 |
#define SC_MULT_53_25X 0x4000 |
#define SC_MULT_53_30X 0x6000 |
#define SC_MULT_53_35X 0x8000 |
#define SC_MULT_53_40X 0xa000 |
#define SC_MULT_53_45X 0xc000 |
#define SC_MULT_53_50X 0xe000 |
/* Following are for VS1003 and VS1033 */ |
#define SC_ADD_03_00X 0x0000 |
#define SC_ADD_03_05X 0x0800 |
#define SC_ADD_03_10X 0x1000 |
#define SC_ADD_03_15X 0x1800 |
/* Following are for VS1053 and VS1063 */ |
#define SC_ADD_53_00X 0x0000 |
#define SC_ADD_53_10X 0x0800 |
#define SC_ADD_53_15X 0x1000 |
#define SC_ADD_53_20X 0x1800 |
/* SCI_WRAMADDR bits */ |
#define SCI_WRAM_X_START 0x0000 |
#define SCI_WRAM_Y_START 0x4000 |
#define SCI_WRAM_I_START 0x8000 |
#define SCI_WRAM_IO_START 0xC000 |
#define SCI_WRAM_PARAMETRIC_START 0xC0C0 /* VS1063 */ |
#define SCI_WRAM_Y2_START 0xE000 /* VS1063 */ |
#define SCI_WRAM_X_OFFSET 0x0000 |
#define SCI_WRAM_Y_OFFSET 0x4000 |
#define SCI_WRAM_I_OFFSET 0x8000 |
#define SCI_WRAM_IO_OFFSET 0x0000 /* I/O addresses are @0xC000 -> no offset */ |
#define SCI_WRAM_PARAMETRIC_OFFSET (0xC0C0-0x1E00) /* VS1063 */ |
#define SCI_WRAM_Y2_OFFSET 0x0000 /* VS1063 */ |
/* SCI_VOL bits */ |
#define SV_LEFT_B 8 |
#define SV_RIGHT_B 0 |
#define SV_LEFT (1<<8) |
#define SV_RIGHT (1<<0) |
#define SV_LEFT_BITS 8 |
#define SV_LEFT_MASK 0xFF00 |
#define SV_RIGHT_BITS 8 |
#define SV_RIGHT_MASK 0x00FF |
/*Â SCI_MIXERVOL bits for VS1103 */ |
#define SMV_ACTIVE_B 15 |
#define SMV_GAIN3_B 10 |
#define SMV_GAIN2_B 5 |
#define SMV_GAIN1_B 0 |
#define SMV_ACTIVE (1<<15) |
#define SMV_GAIN3 (1<<10) |
#define SMV_GAIN2 (1<< 5) |
#define SMV_GAIN1 (1<< 0) |
#define SMV_GAIN3_BITS 5 |
#define SMV_GAIN3_MASK 0x7c00 |
#define SMV_GAIN2_BITS 5 |
#define SMV_GAIN2_MASK 0x04e0 |
#define SMV_GAIN1_BITS 5 |
#define SMV_GAIN1_MASK 0x001f |
/*Â SCI_ADPCMRECCTL bits for VS1103 */ |
#define SARC_DREQ512_B 8 |
#define SARC_OUTODADPCM_B 7 |
#define SARC_MANUALGAIN_B 6 |
#define SARC_GAIN4_B 0 |
#define SARC_DREQ512 (1<<8) |
#define SARC_OUTODADPCM (1<<7) |
#define SARC_MANUALGAIN (1<<6) |
#define SARC_GAIN4 (1<<0) |
#define SARC_GAIN4_BITS 6 |
#define SARC_GAIN4_MASK 0x003f |
/* SCI_RECQUALITY bits for VS1063 */ |
#define RQ_MODE_B 14 |
#define RQ_MULT_B 12 |
#define RQ_OGG_PAR_SERIAL_NUMBER_B 11 |
#define RQ_OGG_LIMIT_FRAME_LENGTH_B 10 |
#define RQ_MP3_NO_BIT_RESERVOIR_B 10 |
#define RQ_BITRATE_BASE_B 0 |
#define RQ_MODE (1<<14) |
#define RQ_MULT (1<<12) |
#define RQ_OGG_PAR_SERIAL_NUMBER (1<<11) |
#define RQ_OGG_LIMIT_FRAME_LENGTH (1<<10) |
#define RQ_MP3_NO_BIT_RESERVOIR (1<<10) |
#define RQ_BITRATE_BASE (1<< 0) |
#define RQ_MODE_BITS 2 |
#define RQ_MODE_MASK 0xc000 |
#define RQ_MULT_BITS 2 |
#define RQ_MULT_MASK 0x3000 |
#define RQ_BITRATE_BASE_BITS 9 |
#define RQ_BITRATE_BASE_MASK 0x01ff |
#define RQ_MODE_QUALITY 0x0000 |
#define RQ_MODE_VBR 0x4000 |
#define RQ_MODE_ABR 0x8000 |
#define RQ_MODE_CBR 0xc000 |
#define RQ_MULT_10 0x0000 |
#define RQ_MULT_100 0x1000 |
#define RQ_MULT_1000 0x2000 |
#define RQ_MULT_10000 0x3000 |
/* SCI_RECMODE bits for VS1063 */ |
#define RM_63_CODEC_B 15 |
#define RM_63_AEC_B 14 |
#define RM_63_UART_TX_B 13 |
#define RM_63_PAUSE_B 11 |
#define RM_63_NO_RIFF_B 10 |
#define RM_63_FORMAT_B 4 |
#define RM_63_ADC_MODE_B 0 |
#define RM_63_CODEC (1<<15) |
#define RM_63_AEC (1<<14) |
#define RM_63_UART_TX (1<<13) |
#define RM_63_PAUSE (1<<11) |
#define RM_63_NO_RIFF (1<<10) |
#define RM_63_FORMAT (1<< 4) |
#define RM_63_ADC_MODE (1<< 0) |
#define RM_63_FORMAT_BITS 4 |
#define RM_63_FORMAT_MASK 0x00f0 |
#define RM_63_ADCMODE_BITS 3 |
#define RM_63_ADCMODE_MASK 0x0007 |
#define RM_63_FORMAT_IMA_ADPCM 0x0000 |
#define RM_63_FORMAT_PCM 0x0010 |
#define RM_63_FORMAT_G711_ULAW 0x0020 |
#define RM_63_FORMAT_G711_ALAW 0x0030 |
#define RM_63_FORMAT_G722_ADPCM 0x0040 |
#define RM_63_FORMAT_OGG_VORBIS 0x0050 |
#define RM_63_FORMAT_MP3 0x0060 |
#define RM_63_ADC_MODE_JOINT_AGC_STEREO 0x0000 |
#define RM_63_ADC_MODE_DUAL_AGC_STEREO 0x0001 |
#define RM_63_ADC_MODE_LEFT 0x0002 |
#define RM_63_ADC_MODE_RIGHT 0x0003 |
#define RM_63_ADC_MODE_MONO 0x0004 |
/* SCI_RECMODE bits for VS1053 */ |
#define RM_53_FORMAT_B 2 |
#define RM_53_ADC_MODE_B 0 |
#define RM_53_FORMAT (1<< 2) |
#define RM_53_ADC_MODE (1<< 0) |
#define RM_53_ADCMODE_BITS 2 |
#define RM_53_ADCMODE_MASK 0x0003 |
#define RM_53_FORMAT_IMA_ADPCM 0x0000 |
#define RM_53_FORMAT_PCM 0x0004 |
#define RM_53_ADC_MODE_JOINT_AGC_STEREO 0x0000 |
#define RM_53_ADC_MODE_DUAL_AGC_STEREO 0x0001 |
#define RM_53_ADC_MODE_LEFT 0x0002 |
#define RM_53_ADC_MODE_RIGHT 0x0003 |
/* VS1063 definitions */ |
/* VS1063 / VS1053 Parametric */ |
#define PAR_CHIP_ID 0x1e00 /* VS1063, VS1053, 32 bits */ |
#define PAR_VERSION 0x1e02 /* VS1063, VS1053 */ |
#define PAR_CONFIG1 0x1e03 /* VS1063, VS1053 */ |
#define PAR_PLAY_SPEED 0x1e04 /* VS1063, VS1053 */ |
#define PAR_BITRATE_PER_100 0x1e05 /* VS1063 */ |
#define PAR_BYTERATE 0x1e05 /* VS1053 */ |
#define PAR_END_FILL_BYTE 0x1e06 /* VS1063, VS1053 */ |
#define PAR_RATE_TUNE 0x1e07 /* VS1063, 32 bits */ |
#define PAR_PLAY_MODE 0x1e09 /* VS1063 */ |
#define PAR_SAMPLE_COUNTER 0x1e0a /* VS1063, 32 bits */ |
#define PAR_VU_METER 0x1e0c /* VS1063 */ |
#define PAR_AD_MIXER_GAIN 0x1e0d /* VS1063 */ |
#define PAR_AD_MIXER_CONFIG 0x1e0e /* VS1063 */ |
#define PAR_PCM_MIXER_RATE 0x1e0f /* VS1063 */ |
#define PAR_PCM_MIXER_FREE 0x1e10 /* VS1063 */ |
#define PAR_PCM_MIXER_VOL 0x1e11 /* VS1063 */ |
#define PAR_EQ5_DUMMY 0x1e12 /* VS1063 */ |
#define PAR_EQ5_LEVEL1 0x1e13 /* VS1063 */ |
#define PAR_EQ5_FREQ1 0x1e14 /* VS1063 */ |
#define PAR_EQ5_LEVEL2 0x1e15 /* VS1063 */ |
#define PAR_EQ5_FREQ2 0x1e16 /* VS1063 */ |
#define PAR_JUMP_POINTS 0x1e16 /* VS1053 */ |
#define PAR_EQ5_LEVEL3 0x1e17 /* VS1063 */ |
#define PAR_EQ5_FREQ3 0x1e18 /* VS1063 */ |
#define PAR_EQ5_LEVEL4 0x1e19 /* VS1063 */ |
#define PAR_EQ5_FREQ4 0x1e1a /* VS1063 */ |
#define PAR_EQ5_LEVEL5 0x1e1b /* VS1063 */ |
#define PAR_EQ5_UPDATED 0x1e1c /* VS1063 */ |
#define PAR_SPEED_SHIFTER 0x1e1d /* VS1063 */ |
#define PAR_EARSPEAKER_LEVEL 0x1e1e /* VS1063 */ |
#define PAR_SDI_FREE 0x1e1f /* VS1063 */ |
#define PAR_AUDIO_FILL 0x1e20 /* VS1063 */ |
#define PAR_RESERVED0 0x1e21 /* VS1063 */ |
#define PAR_RESERVED1 0x1e22 /* VS1063 */ |
#define PAR_RESERVED2 0x1e23 /* VS1063 */ |
#define PAR_RESERVED3 0x1e24 /* VS1063 */ |
#define PAR_LATEST_SOF 0x1e25 /* VS1063, 32 bits */ |
#define PAR_LATEST_JUMP 0x1e26 /* VS1053 */ |
#define PAR_POSITION_MSEC 0x1e27 /* VS1063, VS1053, 32 bits */ |
#define PAR_RESYNC 0x1e29 /* VS1063, VS1053 */ |
/* The following addresses are shared between modes. */ |
/* Generic pointer */ |
#define PAR_GENERIC 0x1e2a /* VS1063, VS1053 */ |
/* Encoder mode */ |
#define PAR_ENC_TX_UART_DIV 0x1e2a /* VS1063 */ |
#define PAR_ENC_TX_UART_BYTE_SPEED 0x1e2b /* VS1063 */ |
#define PAR_ENC_TX_PAUSE_GPIO 0x1e2c /* VS1063 */ |
#define PAR_ENC_AEC_ADAPT_MULTIPLIER 0x1e2d /* VS1063 */ |
#define PAR_ENC_RESERVED 0x1e2e /* VS1063 */ |
#define PAR_ENC_CHANNEL_MAX 0x1e3c /* VS1063 */ |
#define PAR_ENC_SERIAL_NUMBER 0x1e3e /* VS1063 */ |
/* Decoding WMA */ |
#define PAR_WMA_CUR_PACKET_SIZE 0x1e2a /* VS1063, VS1053, 32 bits */ |
#define PAR_WMA_PACKET_SIZE 0x1e2c /* VS1063, VS1053, 32 bits */ |
/* Decoding AAC */ |
#define PAR_AAC_SCE_FOUND_MASK 0x1e2a /* VS1063, VS1053 */ |
#define PAR_AAC_CPE_FOUND_MASK 0x1e2b /* VS1063, VS1053 */ |
#define PAR_AAC_LFE_FOUND_MASK 0x1e2c /* VS1063, VS1053 */ |
#define PAR_AAC_PLAY_SELECT 0x1e2d /* VS1063, VS1053 */ |
#define PAR_AAC_DYN_COMPRESS 0x1e2e /* VS1063, VS1053 */ |
#define PAR_AAC_DYN_BOOST 0x1e2f /* VS1063, VS1053 */ |
#define PAR_AAC_SBR_AND_PS_STATUS 0x1e30 /* VS1063, VS1053 */ |
#define PAR_AAC_SBR_PS_FLAGS 0x1e31 /* VS1063 */ |
/* Decoding MIDI (VS1053) */ |
#define PAR_MIDI_BYTES_LEFT 0x1e2a /* VS1053, 32 bits */ |
/* Decoding Vorbis */ |
#define PAR_VORBIS_GAIN 0x1e2a 0x1e30 /* VS1063, VS1053 */ |
/* Bit definitions for parametric registers with bitfields */ |
#define PAR_CONFIG1_DIS_WMA_B 15 /* VS1063 */ |
#define PAR_CONFIG1_DIS_AAC_B 14 /* VS1063 */ |
#define PAR_CONFIG1_DIS_MP3_B 13 /* VS1063 */ |
#define PAR_CONFIG1_DIS_FLAC_B 12 /* VS1063 */ |
#define PAR_CONFIG1_DIS_CRC_B 8 /* VS1063 */ |
#define PAR_CONFIG1_AAC_PS_B 6 /* VS1063, VS1053 */ |
#define PAR_CONFIG1_AAC_SBR_B 4 /* VS1063, VS1053 */ |
#define PAR_CONFIG1_MIDI_REVERB_B 0 /* VS1053 */ |
#define PAR_CONFIG1_DIS_WMA (1<<15) /* VS1063 */ |
#define PAR_CONFIG1_DIS_AAC (1<<14) /* VS1063 */ |
#define PAR_CONFIG1_DIS_MP3 (1<<13) /* VS1063 */ |
#define PAR_CONFIG1_DIS_FLAC (1<<12) /* VS1063 */ |
#define PAR_CONFIG1_DIS_CRC (1<< 8) /* VS1063 */ |
#define PAR_CONFIG1_AAC_PS (1<< 6) /* VS1063, VS1053 */ |
#define PAR_CONFIG1_AAC_SBR (1<< 4) /* VS1063, VS1053 */ |
#define PAR_CONFIG1_MIDI_REVERB (1<< 0) /* VS1053 */ |
#define PAR_CONFIG1_AAC_PS_BITS 2 /* VS1063, VS1053 */ |
#define PAR_CONFIG1_AAC_PS_MASK 0x00c0 /* VS1063, VS1053 */ |
#define PAR_CONFIG1_AAC_SBR_BITS 2 /* VS1063, VS1053 */ |
#define PAR_CONFIG1_AAC_SBR_MASK 0x0030 /* VS1063, VS1053 */ |
#define PAR_CONFIG1_AAC_SBR_ALWAYS_UPSAMPLE 0x0000 /* VS1063, VS1053 */ |
#define PAR_CONFIG1_AAC_SBR_SELECTIVE_UPSAMPLE 0x0010 /* VS1063, VS1053 */ |
#define PAR_CONFIG1_AAC_SBR_NEVER_UPSAMPLE 0x0020 /* VS1063, VS1053 */ |
#define PAR_CONFIG1_AAC_SBR_DISABLE 0x0030 /* VS1063, VS1053 */ |
#define PAR_CONFIG1_AAC_PS_NORMAL 0x0000 /* VS1063, VS1053 */ |
#define PAR_CONFIG1_AAC_PS_DOWNSAMPLED 0x0040 /* VS1063, VS1053 */ |
#define PAR_CONFIG1_AAC_PS_DISABLE 0x00c0 /* VS1063, VS1053 */ |
#define PAR_PLAY_MODE_SPEED_SHIFTER_ENA_B 6 /* VS1063 */ |
#define PAR_PLAY_MODE_EQ5_ENA_B 5 /* VS1063 */ |
#define PAR_PLAY_MODE_PCM_MIXER_ENA_B 4 /* VS1063 */ |
#define PAR_PLAY_MODE_AD_MIXER_ENA_B 3 /* VS1063 */ |
#define PAR_PLAY_MODE_VU_METER_ENA_B 2 /* VS1063 */ |
#define PAR_PLAY_MODE_PAUSE_ENA_B 1 /* VS1063 */ |
#define PAR_PLAY_MODE_MONO_ENA_B 0 /* VS1063 */ |
#define PAR_PLAY_MODE_SPEED_SHIFTER_ENA (1<<6) /* VS1063 */ |
#define PAR_PLAY_MODE_EQ5_ENA (1<<5) /* VS1063 */ |
#define PAR_PLAY_MODE_PCM_MIXER_ENA (1<<4) /* VS1063 */ |
#define PAR_PLAY_MODE_AD_MIXER_ENA (1<<3) /* VS1063 */ |
#define PAR_PLAY_MODE_VU_METER_ENA (1<<2) /* VS1063 */ |
#define PAR_PLAY_MODE_PAUSE_ENA (1<<1) /* VS1063 */ |
#define PAR_PLAY_MODE_MONO_ENA (1<<0) /* VS1063 */ |
#define PAR_VU_METER_LEFT_BITS 8 /* VS1063 */ |
#define PAR_VU_METER_LEFT_MASK 0xFF00 /* VS1063 */ |
#define PAR_VU_METER_RIGHT_BITS 8 /* VS1063 */ |
#define PAR_VU_METER_RIGHT_MASK 0x00FF /* VS1063 */ |
#define PAR_AD_MIXER_CONFIG_MODE_B 2 /* VS1063 */ |
#define PAR_AD_MIXER_CONFIG_RATE_B 2 /* VS1063 */ |
#define PAR_AD_MIXER_CONFIG_MODE_BITS 2 /* VS1063 */ |
#define PAR_AD_MIXER_CONFIG_MODE_MASK 0x000c /* VS1063 */ |
#define PAR_AD_MIXER_CONFIG_RATE_BITS 2 /* VS1063 */ |
#define PAR_AD_MIXER_CONFIG_RATE_MASK 0x0003 /* VS1063 */ |
#define PAR_AD_MIXER_CONFIG_RATE_192K 0x0000 /* VS1063 */ |
#define PAR_AD_MIXER_CONFIG_RATE_96K 0x0001 /* VS1063 */ |
#define PAR_AD_MIXER_CONFIG_RATE_48K 0x0002 /* VS1063 */ |
#define PAR_AD_MIXER_CONFIG_RATE_24K 0x0003 /* VS1063 */ |
#define PAR_AD_MIXER_CONFIG_MODE_STEREO 0x0000 /* VS1063 */ |
#define PAR_AD_MIXER_CONFIG_MODE_MONO 0x0040 /* VS1063 */ |
#define PAR_AD_MIXER_CONFIG_MODE_LEFT 0x0080 /* VS1063 */ |
#define PAR_AD_MIXER_CONFIG_MODE_RIGHT 0x00c0 /* VS1063 */ |
#define PAR_AAC_SBR_AND_PS_STATUS_SBR_PRESENT_B 0 /* VS1063, VS1053 */ |
#define PAR_AAC_SBR_AND_PS_STATUS_UPSAMPLING_ACTIVE_B 1 /* VS1063, VS1053 */ |
#define PAR_AAC_SBR_AND_PS_STATUS_PS_PRESENT_B 2 /* VS1063, VS1053 */ |
#define PAR_AAC_SBR_AND_PS_STATUS_PS_ACTIVE_B 3 /* VS1063, VS1053 */ |
#define PAR_AAC_SBR_AND_PS_STATUS_SBR_PRESENT (1<<0) /* VS1063, VS1053 */ |
#define PAR_AAC_SBR_AND_PS_STATUS_UPSAMPLING_ACTIVE (1<<1) /* VS1063, VS1053 */ |
#define PAR_AAC_SBR_AND_PS_STATUS_PS_PRESENT (1<<2) /* VS1063, VS1053 */ |
#define PAR_AAC_SBR_AND_PS_STATUS_PS_ACTIVE (1<<3) /* VS1063, VS1053 */ |
#endif /* !VS10XX_MICROCONTROLLER_DEFINITIONS_H */ |
//MSP430 Projects/MSP430_G2231/.ccsproject |
---|
0,0 → 1,13 |
<?xml version="1.0" encoding="UTF-8" ?> |
<?ccsproject version="1.0"?> |
<projectOptions> |
<deviceVariant value="MSP430G2231"/> |
<deviceFamily value="MSP430"/> |
<codegenToolVersion value="4.2.1"/> |
<isElfFormat value="true"/> |
<connection value="common/targetdb/connections/TIMSP430-USB.xml"/> |
<linkerCommandFile value="lnk_msp430g2231.cmd"/> |
<rts value="libc.a"/> |
<templateProperties value="id=com.ti.common.project.core.emptyProjectWithMainTemplate_msp430,"/> |
<isTargetManual value="false"/> |
</projectOptions> |
//MSP430 Projects/MSP430_G2231/.cproject |
---|
0,0 → 1,174 |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
<?fileVersion 4.0.0?> |
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> |
<storageModule configRelations="2" moduleId="org.eclipse.cdt.core.settings"> |
<cconfiguration id="com.ti.ccstudio.buildDefinitions.MSP430.Debug.1717714940"> |
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.MSP430.Debug.1717714940" moduleId="org.eclipse.cdt.core.settings" name="Debug"> |
<externalSettings/> |
<extensions> |
<extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/> |
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
</extensions> |
</storageModule> |
<storageModule moduleId="cdtBuildSystem" version="4.0.0"> |
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.MSP430.Debug.1717714940" name="Debug" parent="com.ti.ccstudio.buildDefinitions.MSP430.Debug"> |
<folderInfo id="com.ti.ccstudio.buildDefinitions.MSP430.Debug.1717714940." name="/" resourcePath=""> |
<toolChain id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.DebugToolchain.146850848" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.linkerDebug.1780186084"> |
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1549834400" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> |
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=MSP430G2231"/> |
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/> |
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.5.0"/> |
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=lnk_msp430g2231.cmd"/> |
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/> |
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.326357711" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="4.2.1" valueType="string"/> |
<targetPlatform id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.targetPlatformDebug.1895956858" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.targetPlatformDebug"/> |
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.builderDebug.1754585480" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.builderDebug"/> |
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.compilerDebug.531914524" name="MSP430 Compiler" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.compilerDebug"> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.SILICON_VERSION.1517199032" name="Silicon version (--silicon_version, -v)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.SILICON_VERSION.msp" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DEFINE.881144352" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DEFINE" valueType="definedSymbols"> |
<listOptionValue builtIn="false" value="__MSP430G2231__"/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.PRINTF_SUPPORT.1082356269" name="Level of printf/scanf support required (--printf_support)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.PRINTF_SUPPORT" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.PRINTF_SUPPORT.minimal" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DEBUGGING_MODEL.1319552565" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ADVICE__POWER.1637126668" name="Enable checking of ULP power rules (--advice:power)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ADVICE__POWER" value="all" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WARNING.1777936979" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WARNING" valueType="stringList"> |
<listOptionValue builtIn="false" value="225"/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DISPLAY_ERROR_NUMBER.771900690" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WRAP.1055076613" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WRAP.off" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.INCLUDE_PATH.848646753" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.INCLUDE_PATH" valueType="includePath"> |
<listOptionValue builtIn="false" value=""${CCS_BASE_ROOT}/msp430/include""/> |
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ABI.92238021" name="Application binary interface [See 'General' page to edit] (--abi)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ABI.eabi" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.OPT_FOR_SPEED.1075654665" name="Speed vs. size trade-offs (--opt_for_speed, -mf)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.OPT_FOR_SPEED._none" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.OPT_LEVEL.884987588" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.OPT_LEVEL.off" valueType="enumerated"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__C_SRCS.682724297" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__C_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__CPP_SRCS.11272975" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__CPP_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM_SRCS.1057221103" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM2_SRCS.924106546" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM2_SRCS"/> |
</tool> |
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.linkerDebug.1780186084" name="MSP430 Linker" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.linkerDebug"> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.HEAP_SIZE.570465484" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.HEAP_SIZE" value="0" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.STACK_SIZE.305081286" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.STACK_SIZE" value="50" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.OUTPUT_FILE.924707837" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.OUTPUT_FILE" value=""${ProjName}.out"" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.MAP_FILE.1843983564" name="Input and output sections listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.XML_LINK_INFO.666623769" name="Detailed link information data-base into <file> (--xml_link_info, -xml_link_info)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.XML_LINK_INFO" value=""${ProjName}_linkInfo.xml"" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DISPLAY_ERROR_NUMBER.696296693" name="Emit diagnostic identifier numbers (--display_error_number)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DIAG_WRAP.734058359" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DIAG_WRAP.off" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.SEARCH_PATH.1051053460" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.SEARCH_PATH" valueType="libPaths"> |
<listOptionValue builtIn="false" value=""${CCS_BASE_ROOT}/msp430/include""/> |
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/> |
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.LIBRARY.1145017086" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.LIBRARY" valueType="libs"> |
<listOptionValue builtIn="false" value=""libc.a""/> |
</option> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD_SRCS.59953507" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD2_SRCS.247205793" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD2_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__GEN_CMDS.2124351984" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__GEN_CMDS"/> |
</tool> |
</toolChain> |
</folderInfo> |
</configuration> |
</storageModule> |
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> |
</cconfiguration> |
<cconfiguration id="com.ti.ccstudio.buildDefinitions.MSP430.Release.2034998959"> |
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.MSP430.Release.2034998959" moduleId="org.eclipse.cdt.core.settings" name="Release"> |
<externalSettings/> |
<extensions> |
<extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/> |
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
</extensions> |
</storageModule> |
<storageModule moduleId="cdtBuildSystem" version="4.0.0"> |
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.MSP430.Release.2034998959" name="Release" parent="com.ti.ccstudio.buildDefinitions.MSP430.Release"> |
<folderInfo id="com.ti.ccstudio.buildDefinitions.MSP430.Release.2034998959." name="/" resourcePath=""> |
<toolChain id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.ReleaseToolchain.920208389" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.linkerRelease.217262532"> |
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.722561821" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> |
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=MSP430G2231"/> |
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/> |
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.5.0"/> |
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=lnk_msp430g2231.cmd"/> |
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/> |
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.15371274" name="Compiler version" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="4.2.1" valueType="string"/> |
<targetPlatform id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.targetPlatformRelease.804208651" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.targetPlatformRelease"/> |
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.builderRelease.675291167" keepEnvironmentInBuildfile="false" name="GNU Make" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.builderRelease"/> |
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.compilerRelease.1840241482" name="MSP430 Compiler" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.compilerRelease"> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.SILICON_VERSION.1510169937" name="Silicon version (--silicon_version, -v)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.SILICON_VERSION.msp" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DEFINE.212188754" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DEFINE" valueType="definedSymbols"> |
<listOptionValue builtIn="false" value="__MSP430G2231__"/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.PRINTF_SUPPORT.1499457199" name="Level of printf/scanf support required (--printf_support)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.PRINTF_SUPPORT" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.PRINTF_SUPPORT.minimal" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ADVICE__POWER.1161138866" name="Enable checking of ULP power rules (--advice:power)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ADVICE__POWER" value="all" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WARNING.371670688" name="Treat diagnostic <id> as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WARNING" valueType="stringList"> |
<listOptionValue builtIn="false" value="225"/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DISPLAY_ERROR_NUMBER.1225606964" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WRAP.1829805380" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WRAP.off" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.INCLUDE_PATH.1180734321" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.INCLUDE_PATH" valueType="includePath"> |
<listOptionValue builtIn="false" value=""${CCS_BASE_ROOT}/msp430/include""/> |
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ABI.1350390050" name="Application binary interface [See 'General' page to edit] (--abi)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ABI.eabi" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.OPT_LEVEL.release.1866611488" name="Optimization level (--opt_level, -O)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.OPT_LEVEL.release" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.OPT_LEVEL.4" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.OPT_FOR_SPEED.1324145517" name="Speed vs. size trade-offs (--opt_for_speed, -mf)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.OPT_FOR_SPEED.5" valueType="enumerated"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__C_SRCS.846932216" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__C_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__CPP_SRCS.479801817" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__CPP_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM_SRCS.1153103285" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM2_SRCS.1238942611" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM2_SRCS"/> |
</tool> |
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.linkerRelease.217262532" name="MSP430 Linker" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.linkerRelease"> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.HEAP_SIZE.1356656737" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.HEAP_SIZE" value="0" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.STACK_SIZE.816520836" name="Set C system stack size (--stack_size, -stack)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.STACK_SIZE" value="50" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.OUTPUT_FILE.1286914459" name="Specify output file name (--output_file, -o)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.OUTPUT_FILE" value=""${ProjName}.out"" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.MAP_FILE.1352708858" name="Input and output sections listed into <file> (--map_file, -m)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.XML_LINK_INFO.288897381" name="Detailed link information data-base into <file> (--xml_link_info, -xml_link_info)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.XML_LINK_INFO" value=""${ProjName}_linkInfo.xml"" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DISPLAY_ERROR_NUMBER.1491803435" name="Emit diagnostic identifier numbers (--display_error_number)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DIAG_WRAP.670940753" name="Wrap diagnostic messages (--diag_wrap)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DIAG_WRAP.off" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.SEARCH_PATH.1996480053" name="Add <dir> to library search path (--search_path, -i)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.SEARCH_PATH" valueType="libPaths"> |
<listOptionValue builtIn="false" value=""${CCS_BASE_ROOT}/msp430/include""/> |
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/> |
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.LIBRARY.2060131035" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.LIBRARY" valueType="libs"> |
<listOptionValue builtIn="false" value=""libc.a""/> |
</option> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD_SRCS.1072781438" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD2_SRCS.774944175" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD2_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__GEN_CMDS.916203163" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__GEN_CMDS"/> |
</tool> |
</toolChain> |
</folderInfo> |
</configuration> |
</storageModule> |
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> |
</cconfiguration> |
</storageModule> |
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> |
<storageModule moduleId="cdtBuildSystem" version="4.0.0"> |
<project id="MSP430_G2231.com.ti.ccstudio.buildDefinitions.MSP430.ProjectType.1291860156" name="MSP430" projectType="com.ti.ccstudio.buildDefinitions.MSP430.ProjectType"/> |
</storageModule> |
<storageModule moduleId="scannerConfiguration"/> |
<storageModule moduleId="org.eclipse.cdt.core.language.mapping"> |
<project-mappings> |
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.asmSource" language="com.ti.ccstudio.core.TIASMLanguage"/> |
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cHeader" language="com.ti.ccstudio.core.TIGCCLanguage"/> |
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cSource" language="com.ti.ccstudio.core.TIGCCLanguage"/> |
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxHeader" language="com.ti.ccstudio.core.TIGPPLanguage"/> |
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxSource" language="com.ti.ccstudio.core.TIGPPLanguage"/> |
</project-mappings> |
</storageModule> |
<storageModule moduleId="null.endianPreference"/> |
<storageModule moduleId="cpuFamily"/> |
</cproject> |
//MSP430 Projects/MSP430_G2231/.launches/MSP430_G2231.launch |
---|
0,0 → 1,28 |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
<launchConfiguration type="com.ti.ccstudio.debug.launchType.device.debugging"> |
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_CPUS_WITH_PROJECT" value="<?xml version="1.0" encoding="UTF-8"?> <cpus_with_project> <id id="TI MSP430 USB1/MSP430" isa="MSP430"/> </cpus_with_project>"/> |
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_DEBUGGER_PROPERTIES.TI MSP430 USB1/MSP430" value="<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <PropertyValues> <property id="ConnectOnStartup"> <curValue>1</curValue> </property> <property id="EnableInstalledBreakpoint"> <curValue>1</curValue> </property> </PropertyValues> "/> |
<setAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_HIDE_CONFIG_ELEMENT_TYPES"> |
<setEntry value="BOARD"/> |
<setEntry value="BYPASSED_CPU"/> |
<setEntry value="CONNECTION"/> |
<setEntry value="DEVICE"/> |
<setEntry value="NON_DEBUG_CPU"/> |
<setEntry value="NO_DRIVER"/> |
<setEntry value="ROUTER"/> |
<setEntry value="SUBPATH"/> |
<setEntry value="SYSTEM"/> |
</setAttribute> |
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROGRAM.TI MSP430 USB1/MSP430" value="${build_artifact:MSP430_G2231}"/> |
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROJECT.TI MSP430 USB1/MSP430" value="MSP430_G2231"/> |
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_TARGET_CONFIG" value="${target_config_active_default:MSP430_G2231}"/> |
<stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.TI MSP430 USB1/MSP430" value="C:/Users\Kevin\Documents\Code\MSP430_G2231\Debug\MSP430_G2231.out"/> |
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> |
<listEntry value="/MSP430_G2231"/> |
</listAttribute> |
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> |
<listEntry value="4"/> |
</listAttribute> |
<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="com.ti.ccstudio.debug.sourceLocator"/> |
<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <sourceLookupDirector> <sourceContainers duplicates="false"> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;default/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.default"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;cpuSpecificContainer cpuName=&quot;TI MSP430 USB1/MSP430&quot;&gt;&#13;&#10;&lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;default/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;org.eclipse.debug.core.containerType.default&quot;/&gt;&#13;&#10;&lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;project name=&amp;quot;MSP430_G2231&amp;quot; referencedProjects=&amp;quot;true&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;org.eclipse.debug.core.containerType.project&quot;/&gt;&#13;&#10;&lt;/cpuSpecificContainer&gt;&#13;&#10;" typeId="com.ti.ccstudio.debug.containerType.cpu.specific"/> </sourceContainers> </sourceLookupDirector> "/> |
</launchConfiguration> |
//MSP430 Projects/MSP430_G2231/.project |
---|
0,0 → 1,27 |
<?xml version="1.0" encoding="UTF-8"?> |
<projectDescription> |
<name>MSP430_G2231</name> |
<comment></comment> |
<projects> |
</projects> |
<buildSpec> |
<buildCommand> |
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> |
<arguments> |
</arguments> |
</buildCommand> |
<buildCommand> |
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> |
<triggers>full,incremental,</triggers> |
<arguments> |
</arguments> |
</buildCommand> |
</buildSpec> |
<natures> |
<nature>com.ti.ccstudio.core.ccsNature</nature> |
<nature>org.eclipse.cdt.core.cnature</nature> |
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> |
<nature>org.eclipse.cdt.core.ccnature</nature> |
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> |
</natures> |
</projectDescription> |
//MSP430 Projects/MSP430_G2231/.settings/org.eclipse.cdt.codan.core.prefs |
---|
0,0 → 1,3 |
eclipse.preferences.version=1 |
inEditor=false |
onBuild=false |
//MSP430 Projects/MSP430_G2231/.settings/org.eclipse.cdt.debug.core.prefs |
---|
0,0 → 1,2 |
eclipse.preferences.version=1 |
org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker |
//MSP430 Projects/MSP430_G2231/.settings/org.eclipse.core.resources.prefs |
---|
0,0 → 1,71 |
eclipse.preferences.version=1 |
encoding//Debug/makefile=UTF-8 |
encoding//Debug/objects.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__0/makefile=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__0/objects.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__0/sources.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__0/subdir_rules.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__0/subdir_vars.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__1/makefile=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__1/objects.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__1/sources.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__1/subdir_rules.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__1/subdir_vars.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__2/makefile=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__2/objects.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__2/sources.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__2/subdir_rules.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__2/subdir_vars.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__3/makefile=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__3/objects.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__3/sources.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__3/subdir_rules.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__3/subdir_vars.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__4/makefile=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__4/objects.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__4/sources.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__4/subdir_rules.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__4/subdir_vars.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__5/makefile=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__5/objects.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__5/sources.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__5/subdir_rules.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_for_speed__5/subdir_vars.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__0/makefile=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__0/objects.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__0/sources.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__0/subdir_rules.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__0/subdir_vars.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__1/makefile=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__1/objects.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__1/sources.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__1/subdir_rules.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__1/subdir_vars.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__2/makefile=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__2/objects.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__2/sources.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__2/subdir_rules.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__2/subdir_vars.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__3/makefile=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__3/objects.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__3/sources.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__3/subdir_rules.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__3/subdir_vars.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__4/makefile=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__4/objects.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__4/sources.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__4/subdir_rules.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__4/subdir_vars.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__off/makefile=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__off/objects.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__off/sources.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__off/subdir_rules.mk=UTF-8 |
encoding//Debug/optimizerAssistant/opt_level__off/subdir_vars.mk=UTF-8 |
encoding//Debug/sources.mk=UTF-8 |
encoding//Debug/subdir_rules.mk=UTF-8 |
encoding//Debug/subdir_vars.mk=UTF-8 |
encoding//Release/makefile=UTF-8 |
encoding//Release/objects.mk=UTF-8 |
encoding//Release/sources.mk=UTF-8 |
encoding//Release/subdir_rules.mk=UTF-8 |
encoding//Release/subdir_vars.mk=UTF-8 |
//MSP430 Projects/MSP430_G2231/defines.h |
---|
0,0 → 1,17 |
#ifndef DEFINES_H_ |
#define DEFINES_H_ |
/* ------ Port Mapping ------ |
* 1.0 - XDCS |
* 1.1 - SDCS |
* 1.2 - ACCL INT |
* 1.3 - ACCL CS |
* 1.4 - SLEEP (active low) |
* 1.5 - SPI SCK |
* 1.6 - SPI MOSI |
* 1.7 - SPI MISO |
* 2.6 - AUDIO CS |
* 2.7 - AUDIO DREQ |
* ----------------------- */ |
#endif /* DEFINES_H_ */ |
//MSP430 Projects/MSP430_G2231/lnk_msp430g2231.cmd |
---|
0,0 → 1,132 |
/* ============================================================================ */ |
/* Copyright (c) 2013, Texas Instruments Incorporated */ |
/* All rights reserved. */ |
/* */ |
/* Redistribution and use in source and binary forms, with or without */ |
/* modification, are permitted provided that the following conditions */ |
/* are met: */ |
/* */ |
/* * Redistributions of source code must retain the above copyright */ |
/* notice, this list of conditions and the following disclaimer. */ |
/* */ |
/* * Redistributions in binary form must reproduce the above copyright */ |
/* notice, this list of conditions and the following disclaimer in the */ |
/* documentation and/or other materials provided with the distribution. */ |
/* */ |
/* * Neither the name of Texas Instruments Incorporated nor the names of */ |
/* its contributors may be used to endorse or promote products derived */ |
/* from this software without specific prior written permission. */ |
/* */ |
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" */ |
/* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, */ |
/* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */ |
/* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */ |
/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, */ |
/* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, */ |
/* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; */ |
/* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, */ |
/* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */ |
/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ |
/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ |
/* ============================================================================ */ |
/******************************************************************************/ |
/* lnk_msp430g2231.cmd - LINKER COMMAND FILE FOR LINKING MSP430G2231 PROGRAMS */ |
/* */ |
/* Usage: lnk430 <obj files...> -o <out file> -m <map file> lnk.cmd */ |
/* cl430 <src files...> -z -o <out file> -m <map file> lnk.cmd */ |
/* */ |
/*----------------------------------------------------------------------------*/ |
/* These linker options are for command line linking only. For IDE linking, */ |
/* you should set your linker options in Project Properties */ |
/* -c LINK USING C CONVENTIONS */ |
/* -stack 0x0100 SOFTWARE STACK SIZE */ |
/* -heap 0x0100 HEAP AREA SIZE */ |
/* */ |
/*----------------------------------------------------------------------------*/ |
/****************************************************************************/ |
/* SPECIFY THE SYSTEM MEMORY MAP */ |
/****************************************************************************/ |
MEMORY |
{ |
SFR : origin = 0x0000, length = 0x0010 |
PERIPHERALS_8BIT : origin = 0x0010, length = 0x00F0 |
PERIPHERALS_16BIT : origin = 0x0100, length = 0x0100 |
RAM : origin = 0x0200, length = 0x0080 |
INFOA : origin = 0x10C0, length = 0x0040 |
INFOB : origin = 0x1080, length = 0x0040 |
INFOC : origin = 0x1040, length = 0x0040 |
INFOD : origin = 0x1000, length = 0x0040 |
FLASH : origin = 0xF800, length = 0x07E0 |
INT00 : origin = 0xFFE0, length = 0x0002 |
INT01 : origin = 0xFFE2, length = 0x0002 |
INT02 : origin = 0xFFE4, length = 0x0002 |
INT03 : origin = 0xFFE6, length = 0x0002 |
INT04 : origin = 0xFFE8, length = 0x0002 |
INT05 : origin = 0xFFEA, length = 0x0002 |
INT06 : origin = 0xFFEC, length = 0x0002 |
INT07 : origin = 0xFFEE, length = 0x0002 |
INT08 : origin = 0xFFF0, length = 0x0002 |
INT09 : origin = 0xFFF2, length = 0x0002 |
INT10 : origin = 0xFFF4, length = 0x0002 |
INT11 : origin = 0xFFF6, length = 0x0002 |
INT12 : origin = 0xFFF8, length = 0x0002 |
INT13 : origin = 0xFFFA, length = 0x0002 |
INT14 : origin = 0xFFFC, length = 0x0002 |
RESET : origin = 0xFFFE, length = 0x0002 |
} |
/****************************************************************************/ |
/* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */ |
/****************************************************************************/ |
SECTIONS |
{ |
.bss : {} > RAM /* GLOBAL & STATIC VARS */ |
.data : {} > RAM /* GLOBAL & STATIC VARS */ |
.sysmem : {} > RAM /* DYNAMIC MEMORY ALLOCATION AREA */ |
.stack : {} > RAM (HIGH) /* SOFTWARE SYSTEM STACK */ |
.text : {} > FLASH /* CODE */ |
.cinit : {} > FLASH /* INITIALIZATION TABLES */ |
.const : {} > FLASH /* CONSTANT DATA */ |
.cio : {} > RAM /* C I/O BUFFER */ |
.pinit : {} > FLASH /* C++ CONSTRUCTOR TABLES */ |
.init_array : {} > FLASH /* C++ CONSTRUCTOR TABLES */ |
.mspabi.exidx : {} > FLASH /* C++ CONSTRUCTOR TABLES */ |
.mspabi.extab : {} > FLASH /* C++ CONSTRUCTOR TABLES */ |
.infoA : {} > INFOA /* MSP430 INFO FLASH MEMORY SEGMENTS */ |
.infoB : {} > INFOB |
.infoC : {} > INFOC |
.infoD : {} > INFOD |
/* MSP430 INTERRUPT VECTORS */ |
.int00 : {} > INT00 |
.int01 : {} > INT01 |
PORT1 : { * ( .int02 ) } > INT02 type = VECT_INIT |
PORT2 : { * ( .int03 ) } > INT03 type = VECT_INIT |
USI : { * ( .int04 ) } > INT04 type = VECT_INIT |
ADC10 : { * ( .int05 ) } > INT05 type = VECT_INIT |
.int06 : {} > INT06 |
.int07 : {} > INT07 |
TIMERA1 : { * ( .int08 ) } > INT08 type = VECT_INIT |
TIMERA0 : { * ( .int09 ) } > INT09 type = VECT_INIT |
WDT : { * ( .int10 ) } > INT10 type = VECT_INIT |
.int11 : {} > INT11 |
.int12 : {} > INT12 |
.int13 : {} > INT13 |
NMI : { * ( .int14 ) } > INT14 type = VECT_INIT |
.reset : {} > RESET /* MSP430 RESET VECTOR */ |
} |
/****************************************************************************/ |
/* INCLUDE PERIPHERALS MEMORY MAP */ |
/****************************************************************************/ |
-l msp430g2231.cmd |
//MSP430 Projects/MSP430_G2231/main.c |
---|
0,0 → 1,57 |
#include <msp430.h> |
#include "defines.h" |
#include "spi.h" |
int main(void) { |
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer |
/* --- Set Oscillator Settings (8Mhz) --------------- */ |
// Set DCO to 5, MOD to 0 |
DCOCTL = DCO2 | DCO0; |
// Set RSEL to 13 |
BCSCTL1 = RSEL3 | RSEL2 | RSEL0; |
// MCLK = DCO/1, SMCLK = MCLK/8 |
BCSCTL2 = SELM_0 | DIVM_0 | DIVS_3; |
// LFXT1 = VLOCLK, 1pF termination |
BCSCTL3 = LFXT1S_2 | XCAP_0; |
// Disable oscillator fault interrupt |
IE1 &= ~OFIE; |
/* -------------------------------------------------- */ |
/* --- Set Port Settings ---------------------------- */ |
// Set ports 1.5/1.6 as outputs |
// Set remaining ports as inputs |
P1DIR = BIT5 | BIT6; |
P2DIR = 0x00; |
// Enable pull-down resistors |
P1REN = ~(BIT5 | BIT6); |
P2REN = 0xFF; |
// Set initial port values |
P1OUT = 0x00; |
P2OUT = 0x00; |
/* -------------------------------------------------- */ |
/* --- Set USI Settings (SPI) ----------------------- */ |
// Enable SDA/SCL/SCLK ports, MSB->LSB, master mode, output enabled |
USICTL0 = USIPE7 | USIPE6 | USIPE5 | USIMST | USIOE; |
// I2C disabled, counter interrupt enabled |
USICTL1 = USIIE; |
// SMCLK/1, SMCLK source, idle low |
USICKCTL = USIDIV_0 | USISSEL_2; |
// Enable USI module (clear reset bit) |
USICTL0 &= ~USISWRST; |
/* -------------------------------------------------- */ |
// Write 0 to the counter to trigger the USI interrupt |
// USICNT = 0; |
// Go into low power mode with interrupts enabled |
_BIS_SR(LPM0_bits + GIE); |
} |
#pragma vector=USI_VECTOR |
__interrupt void USI_SPI_Vector(void) { |
char value = USISR; |
USISR = 0xAB; |
USICNT = 8; |
} |
//MSP430 Projects/MSP430_G2231/spi.c |
---|
0,0 → 1,3 |
#include "defines.h" |
#include "spi.h" |
//MSP430 Projects/MSP430_G2231/spi.h |
---|
0,0 → 1,13 |
#ifndef SPI_H_ |
#define SPI_H_ |
#define SPI_BUFFER_LENGTH 30 |
typedef struct { |
char writeBuffer[SPI_BUFFER_LENGTH]; |
char readBuffer[SPI_BUFFER_LENGTH]; |
} SPI_DATA; |
#endif /* SPI_H_ */ |
//MSP430 Projects/MSP430_G2231/targetConfigs/MSP430G2231.ccxml |
---|
0,0 → 1,12 |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
<configurations XML_version="1.2" id="configurations_0"> |
<configuration XML_version="1.2" id="configuration_0"> |
<instance XML_version="1.2" desc="TI MSP430 USB1" href="connections/TIMSP430-USB.xml" id="TI MSP430 USB1" xml="TIMSP430-USB.xml" xmlpath="connections"/> |
<connection XML_version="1.2" id="TI MSP430 USB1"> |
<instance XML_version="1.2" href="drivers/msp430_emu.xml" id="drivers" xml="msp430_emu.xml" xmlpath="drivers"/> |
<platform XML_version="1.2" id="platform_0"> |
<instance XML_version="1.2" desc="MSP430G2231" href="devices/MSP430G2231.xml" id="MSP430G2231" xml="MSP430G2231.xml" xmlpath="devices"/> |
</platform> |
</connection> |
</configuration> |
</configurations> |
//MSP430 Projects/MSP430_G2231/targetConfigs/readme.txt |
---|
0,0 → 1,9 |
The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based |
on the device and connection settings specified in your project on the Properties > General page. |
Please note that in automatic target-configuration management, changes to the project's device and/or |
connection settings will either modify an existing or generate a new target-configuration file. Thus, |
if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively, |
you may create your own target-configuration file for this project and manage it manually. You can |
always switch back to automatic target-configuration management by checking the "Manage the project's |
target-configuration automatically" checkbox on the project's Properties > General page. |
//MSP430 Projects/MSP430_G2553/.ccsproject |
---|
0,0 → 1,12 |
<?xml version="1.0" encoding="UTF-8" ?> |
<?ccsproject version="1.0"?> |
<projectOptions> |
<deviceVariant value="MSP430G2553"/> |
<deviceFamily value="MSP430"/> |
<codegenToolVersion value="4.2.1"/> |
<isElfFormat value="true"/> |
<connection value="common/targetdb/connections/TIMSP430-USB.xml"/> |
<linkerCommandFile value="lnk_msp430g2553.cmd"/> |
<rts value="libc.a"/> |
<templateProperties value="id=com.ti.common.project.core.emptyProjectWithMainTemplate_msp430,"/> |
</projectOptions> |
//MSP430 Projects/MSP430_G2553/.cproject |
---|
0,0 → 1,170 |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
<?fileVersion 4.0.0?> |
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> |
<storageModule configRelations="2" moduleId="org.eclipse.cdt.core.settings"> |
<cconfiguration id="com.ti.ccstudio.buildDefinitions.MSP430.Debug.287212409"> |
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.MSP430.Debug.287212409" moduleId="org.eclipse.cdt.core.settings" name="Debug"> |
<externalSettings/> |
<extensions> |
<extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/> |
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
</extensions> |
</storageModule> |
<storageModule moduleId="cdtBuildSystem" version="4.0.0"> |
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.MSP430.Debug.287212409" name="Debug" parent="com.ti.ccstudio.buildDefinitions.MSP430.Debug"> |
<folderInfo id="com.ti.ccstudio.buildDefinitions.MSP430.Debug.287212409." name="/" resourcePath=""> |
<toolChain id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.DebugToolchain.2031881865" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.linkerDebug.1652821382"> |
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.139183725" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> |
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=MSP430G2553"/> |
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/> |
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.5.0"/> |
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=lnk_msp430g2553.cmd"/> |
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/> |
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1350850756" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="4.2.1" valueType="string"/> |
<targetPlatform id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.targetPlatformDebug.1138103456" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.targetPlatformDebug"/> |
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.builderDebug.1587316478" name="GNU Make.Debug" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.builderDebug"/> |
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.compilerDebug.859618718" name="MSP430 Compiler" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.compilerDebug"> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.SILICON_VERSION.1604792218" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.SILICON_VERSION.msp" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DEFINE.830008209" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DEFINE" valueType="definedSymbols"> |
<listOptionValue builtIn="false" value="__MSP430G2553__"/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.PRINTF_SUPPORT.1349898631" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.PRINTF_SUPPORT" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.PRINTF_SUPPORT.minimal" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DEBUGGING_MODEL.1174227408" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ADVICE__POWER.90055694" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ADVICE__POWER" value="all" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WARNING.1716645974" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WARNING" valueType="stringList"> |
<listOptionValue builtIn="false" value="225"/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DISPLAY_ERROR_NUMBER.1553527993" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WRAP.573892370" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WRAP.off" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.INCLUDE_PATH.430823295" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.INCLUDE_PATH" valueType="includePath"> |
<listOptionValue builtIn="false" value=""${CCS_BASE_ROOT}/msp430/include""/> |
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ABI.1725422989" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ABI.eabi" valueType="enumerated"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__C_SRCS.1720079106" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__C_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__CPP_SRCS.594874118" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__CPP_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM_SRCS.293118877" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM2_SRCS.1782260791" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM2_SRCS"/> |
</tool> |
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.linkerDebug.1652821382" name="MSP430 Linker" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.linkerDebug"> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.HEAP_SIZE.188809151" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.HEAP_SIZE" value="80" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.STACK_SIZE.1352502926" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.STACK_SIZE" value="80" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.OUTPUT_FILE.2045788025" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.OUTPUT_FILE" value=""${ProjName}.out"" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.MAP_FILE.155833600" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.XML_LINK_INFO.442832269" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.XML_LINK_INFO" value=""${ProjName}_linkInfo.xml"" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DISPLAY_ERROR_NUMBER.62821435" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DIAG_WRAP.145637885" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DIAG_WRAP.off" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.SEARCH_PATH.1297533590" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.SEARCH_PATH" valueType="libPaths"> |
<listOptionValue builtIn="false" value=""${CCS_BASE_ROOT}/msp430/include""/> |
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/> |
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.LIBRARY.1015676856" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.LIBRARY" valueType="libs"> |
<listOptionValue builtIn="false" value=""libc.a""/> |
</option> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD_SRCS.1438388140" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD2_SRCS.1462562253" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD2_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__GEN_CMDS.1713680980" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__GEN_CMDS"/> |
</tool> |
</toolChain> |
</folderInfo> |
</configuration> |
</storageModule> |
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> |
</cconfiguration> |
<cconfiguration id="com.ti.ccstudio.buildDefinitions.MSP430.Release.248987470"> |
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.ti.ccstudio.buildDefinitions.MSP430.Release.248987470" moduleId="org.eclipse.cdt.core.settings" name="Release"> |
<externalSettings/> |
<extensions> |
<extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/> |
<extension id="com.ti.ccstudio.errorparser.CoffErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
<extension id="com.ti.ccstudio.errorparser.LinkErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
<extension id="com.ti.ccstudio.errorparser.AsmErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> |
</extensions> |
</storageModule> |
<storageModule moduleId="cdtBuildSystem" version="4.0.0"> |
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.MSP430.Release.248987470" name="Release" parent="com.ti.ccstudio.buildDefinitions.MSP430.Release"> |
<folderInfo id="com.ti.ccstudio.buildDefinitions.MSP430.Release.248987470." name="/" resourcePath=""> |
<toolChain id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.ReleaseToolchain.1340069191" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.linkerRelease.1657220614"> |
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1321081183" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> |
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=MSP430G2553"/> |
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/> |
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=5.5.0"/> |
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=lnk_msp430g2553.cmd"/> |
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/> |
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1148328024" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="4.2.1" valueType="string"/> |
<targetPlatform id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.targetPlatformRelease.2059339171" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.targetPlatformRelease"/> |
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.builderRelease.1385828872" name="GNU Make.Release" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.builderRelease"/> |
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.compilerRelease.1714575519" name="MSP430 Compiler" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.compilerRelease"> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.SILICON_VERSION.1905204539" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.SILICON_VERSION.msp" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DEFINE.691195899" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DEFINE" valueType="definedSymbols"> |
<listOptionValue builtIn="false" value="__MSP430G2553__"/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.PRINTF_SUPPORT.414078429" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.PRINTF_SUPPORT" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.PRINTF_SUPPORT.minimal" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ADVICE__POWER.1038845664" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ADVICE__POWER" value="all" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WARNING.1368965205" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WARNING" valueType="stringList"> |
<listOptionValue builtIn="false" value="225"/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DISPLAY_ERROR_NUMBER.1937273945" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WRAP.573317903" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.DIAG_WRAP.off" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.INCLUDE_PATH.859768893" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.INCLUDE_PATH" valueType="includePath"> |
<listOptionValue builtIn="false" value=""${CCS_BASE_ROOT}/msp430/include""/> |
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ABI.832200922" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compilerID.ABI.eabi" valueType="enumerated"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__C_SRCS.2129478782" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__C_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__CPP_SRCS.78889550" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__CPP_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM_SRCS.196436030" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM2_SRCS.1765516135" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.compiler.inputType__ASM2_SRCS"/> |
</tool> |
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.linkerRelease.1657220614" name="MSP430 Linker" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exe.linkerRelease"> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.HEAP_SIZE.966679378" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.HEAP_SIZE" value="80" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.STACK_SIZE.1559646215" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.STACK_SIZE" value="80" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.OUTPUT_FILE.1999240521" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.OUTPUT_FILE" value=""${ProjName}.out"" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.MAP_FILE.375286656" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.MAP_FILE" value=""${ProjName}.map"" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.XML_LINK_INFO.1895869163" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.XML_LINK_INFO" value=""${ProjName}_linkInfo.xml"" valueType="string"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DISPLAY_ERROR_NUMBER.526875589" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DIAG_WRAP.1725926473" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.DIAG_WRAP.off" valueType="enumerated"/> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.SEARCH_PATH.1252829955" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.SEARCH_PATH" valueType="libPaths"> |
<listOptionValue builtIn="false" value=""${CCS_BASE_ROOT}/msp430/include""/> |
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/> |
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> |
</option> |
<option id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.LIBRARY.1197773973" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.linkerID.LIBRARY" valueType="libs"> |
<listOptionValue builtIn="false" value=""libc.a""/> |
</option> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD_SRCS.1500473589" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD2_SRCS.1240284101" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__CMD2_SRCS"/> |
<inputType id="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__GEN_CMDS.908878949" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.MSP430_4.2.exeLinker.inputType__GEN_CMDS"/> |
</tool> |
</toolChain> |
</folderInfo> |
</configuration> |
</storageModule> |
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> |
</cconfiguration> |
</storageModule> |
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> |
<storageModule moduleId="cdtBuildSystem" version="4.0.0"> |
<project id="MSP430_G2553.com.ti.ccstudio.buildDefinitions.MSP430.ProjectType.1974314026" name="MSP430" projectType="com.ti.ccstudio.buildDefinitions.MSP430.ProjectType"/> |
</storageModule> |
<storageModule moduleId="scannerConfiguration"/> |
<storageModule moduleId="org.eclipse.cdt.core.language.mapping"> |
<project-mappings> |
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.asmSource" language="com.ti.ccstudio.core.TIASMLanguage"/> |
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cHeader" language="com.ti.ccstudio.core.TIGCCLanguage"/> |
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cSource" language="com.ti.ccstudio.core.TIGCCLanguage"/> |
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxHeader" language="com.ti.ccstudio.core.TIGPPLanguage"/> |
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxSource" language="com.ti.ccstudio.core.TIGPPLanguage"/> |
</project-mappings> |
</storageModule> |
<storageModule moduleId="null.endianPreference"/> |
<storageModule moduleId="cpuFamily"/> |
</cproject> |
//MSP430 Projects/MSP430_G2553/.launches/MSP430_G2553.launch |
---|
0,0 → 1,17 |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
<launchConfiguration type="com.ti.ccstudio.debug.launchType.device.debugging"> |
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_CPUS_WITH_PROJECT" value="<?xml version="1.0" encoding="UTF-8"?> <cpus_with_project> <id id="TI MSP430 USB1/MSP430" isa="MSP430"/> </cpus_with_project>"/> |
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_DEBUGGER_PROPERTIES.TI MSP430 USB1/MSP430" value="<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <PropertyValues> <property id="ConnectOnStartup"> <curValue>1</curValue> </property> <property id="EnableInstalledBreakpoint"> <curValue>1</curValue> </property> </PropertyValues> "/> |
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROGRAM.TI MSP430 USB1/MSP430" value="${build_artifact:MSP430_G2553}"/> |
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROJECT.TI MSP430 USB1/MSP430" value="MSP430_G2553"/> |
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_TARGET_CONFIG" value="${target_config_active_default:MSP430_G2553}"/> |
<stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.TI MSP430 USB1/MSP430" value="C:/Users\Kevin\Documents\Code\MSP430_G2553\Debug\MSP430_G2553.out"/> |
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> |
<listEntry value="/MSP430_G2553"/> |
</listAttribute> |
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> |
<listEntry value="4"/> |
</listAttribute> |
<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="com.ti.ccstudio.debug.sourceLocator"/> |
<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <sourceLookupDirector> <sourceContainers duplicates="false"> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;default/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.default"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;cpuSpecificContainer cpuName=&quot;TI MSP430 USB1/MSP430&quot;&gt;&#13;&#10;&lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;default/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;org.eclipse.debug.core.containerType.default&quot;/&gt;&#13;&#10;&lt;childContainerEntry childMemento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;project name=&amp;quot;MSP430_G2553&amp;quot; referencedProjects=&amp;quot;true&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; childType=&quot;org.eclipse.debug.core.containerType.project&quot;/&gt;&#13;&#10;&lt;/cpuSpecificContainer&gt;&#13;&#10;" typeId="com.ti.ccstudio.debug.containerType.cpu.specific"/> </sourceContainers> </sourceLookupDirector> "/> |
</launchConfiguration> |
//MSP430 Projects/MSP430_G2553/.project |
---|
0,0 → 1,27 |
<?xml version="1.0" encoding="UTF-8"?> |
<projectDescription> |
<name>MSP430_G2553</name> |
<comment></comment> |
<projects> |
</projects> |
<buildSpec> |
<buildCommand> |
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> |
<arguments> |
</arguments> |
</buildCommand> |
<buildCommand> |
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name> |
<triggers>full,incremental,</triggers> |
<arguments> |
</arguments> |
</buildCommand> |
</buildSpec> |
<natures> |
<nature>com.ti.ccstudio.core.ccsNature</nature> |
<nature>org.eclipse.cdt.core.cnature</nature> |
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> |
<nature>org.eclipse.cdt.core.ccnature</nature> |
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> |
</natures> |
</projectDescription> |
//MSP430 Projects/MSP430_G2553/.settings/org.eclipse.cdt.codan.core.prefs |
---|
0,0 → 1,3 |
eclipse.preferences.version=1 |
inEditor=false |
onBuild=false |
//MSP430 Projects/MSP430_G2553/.settings/org.eclipse.cdt.debug.core.prefs |
---|
0,0 → 1,2 |
eclipse.preferences.version=1 |
org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker |
//MSP430 Projects/MSP430_G2553/.settings/org.eclipse.core.resources.prefs |
---|
0,0 → 1,11 |
eclipse.preferences.version=1 |
encoding//Debug/makefile=UTF-8 |
encoding//Debug/objects.mk=UTF-8 |
encoding//Debug/sources.mk=UTF-8 |
encoding//Debug/subdir_rules.mk=UTF-8 |
encoding//Debug/subdir_vars.mk=UTF-8 |
encoding//Release/makefile=UTF-8 |
encoding//Release/objects.mk=UTF-8 |
encoding//Release/sources.mk=UTF-8 |
encoding//Release/subdir_rules.mk=UTF-8 |
encoding//Release/subdir_vars.mk=UTF-8 |
//MSP430 Projects/MSP430_G2553/lnk_msp430g2553.cmd |
---|
0,0 → 1,132 |
/* ============================================================================ */ |
/* Copyright (c) 2013, Texas Instruments Incorporated */ |
/* All rights reserved. */ |
/* */ |
/* Redistribution and use in source and binary forms, with or without */ |
/* modification, are permitted provided that the following conditions */ |
/* are met: */ |
/* */ |
/* * Redistributions of source code must retain the above copyright */ |
/* notice, this list of conditions and the following disclaimer. */ |
/* */ |
/* * Redistributions in binary form must reproduce the above copyright */ |
/* notice, this list of conditions and the following disclaimer in the */ |
/* documentation and/or other materials provided with the distribution. */ |
/* */ |
/* * Neither the name of Texas Instruments Incorporated nor the names of */ |
/* its contributors may be used to endorse or promote products derived */ |
/* from this software without specific prior written permission. */ |
/* */ |
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" */ |
/* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, */ |
/* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */ |
/* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */ |
/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, */ |
/* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, */ |
/* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; */ |
/* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, */ |
/* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */ |
/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ |
/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ |
/* ============================================================================ */ |
/******************************************************************************/ |
/* lnk_msp430g2553.cmd - LINKER COMMAND FILE FOR LINKING MSP430G2553 PROGRAMS */ |
/* */ |
/* Usage: lnk430 <obj files...> -o <out file> -m <map file> lnk.cmd */ |
/* cl430 <src files...> -z -o <out file> -m <map file> lnk.cmd */ |
/* */ |
/*----------------------------------------------------------------------------*/ |
/* These linker options are for command line linking only. For IDE linking, */ |
/* you should set your linker options in Project Properties */ |
/* -c LINK USING C CONVENTIONS */ |
/* -stack 0x0100 SOFTWARE STACK SIZE */ |
/* -heap 0x0100 HEAP AREA SIZE */ |
/* */ |
/*----------------------------------------------------------------------------*/ |
/****************************************************************************/ |
/* SPECIFY THE SYSTEM MEMORY MAP */ |
/****************************************************************************/ |
MEMORY |
{ |
SFR : origin = 0x0000, length = 0x0010 |
PERIPHERALS_8BIT : origin = 0x0010, length = 0x00F0 |
PERIPHERALS_16BIT : origin = 0x0100, length = 0x0100 |
RAM : origin = 0x0200, length = 0x0200 |
INFOA : origin = 0x10C0, length = 0x0040 |
INFOB : origin = 0x1080, length = 0x0040 |
INFOC : origin = 0x1040, length = 0x0040 |
INFOD : origin = 0x1000, length = 0x0040 |
FLASH : origin = 0xC000, length = 0x3FE0 |
INT00 : origin = 0xFFE0, length = 0x0002 |
INT01 : origin = 0xFFE2, length = 0x0002 |
INT02 : origin = 0xFFE4, length = 0x0002 |
INT03 : origin = 0xFFE6, length = 0x0002 |
INT04 : origin = 0xFFE8, length = 0x0002 |
INT05 : origin = 0xFFEA, length = 0x0002 |
INT06 : origin = 0xFFEC, length = 0x0002 |
INT07 : origin = 0xFFEE, length = 0x0002 |
INT08 : origin = 0xFFF0, length = 0x0002 |
INT09 : origin = 0xFFF2, length = 0x0002 |
INT10 : origin = 0xFFF4, length = 0x0002 |
INT11 : origin = 0xFFF6, length = 0x0002 |
INT12 : origin = 0xFFF8, length = 0x0002 |
INT13 : origin = 0xFFFA, length = 0x0002 |
INT14 : origin = 0xFFFC, length = 0x0002 |
RESET : origin = 0xFFFE, length = 0x0002 |
} |
/****************************************************************************/ |
/* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */ |
/****************************************************************************/ |
SECTIONS |
{ |
.bss : {} > RAM /* GLOBAL & STATIC VARS */ |
.data : {} > RAM /* GLOBAL & STATIC VARS */ |
.sysmem : {} > RAM /* DYNAMIC MEMORY ALLOCATION AREA */ |
.stack : {} > RAM (HIGH) /* SOFTWARE SYSTEM STACK */ |
.text : {} > FLASH /* CODE */ |
.cinit : {} > FLASH /* INITIALIZATION TABLES */ |
.const : {} > FLASH /* CONSTANT DATA */ |
.cio : {} > RAM /* C I/O BUFFER */ |
.pinit : {} > FLASH /* C++ CONSTRUCTOR TABLES */ |
.init_array : {} > FLASH /* C++ CONSTRUCTOR TABLES */ |
.mspabi.exidx : {} > FLASH /* C++ CONSTRUCTOR TABLES */ |
.mspabi.extab : {} > FLASH /* C++ CONSTRUCTOR TABLES */ |
.infoA : {} > INFOA /* MSP430 INFO FLASH MEMORY SEGMENTS */ |
.infoB : {} > INFOB |
.infoC : {} > INFOC |
.infoD : {} > INFOD |
/* MSP430 INTERRUPT VECTORS */ |
.int00 : {} > INT00 |
.int01 : {} > INT01 |
PORT1 : { * ( .int02 ) } > INT02 type = VECT_INIT |
PORT2 : { * ( .int03 ) } > INT03 type = VECT_INIT |
.int04 : {} > INT04 |
ADC10 : { * ( .int05 ) } > INT05 type = VECT_INIT |
USCIAB0TX : { * ( .int06 ) } > INT06 type = VECT_INIT |
USCIAB0RX : { * ( .int07 ) } > INT07 type = VECT_INIT |
TIMER0_A1 : { * ( .int08 ) } > INT08 type = VECT_INIT |
TIMER0_A0 : { * ( .int09 ) } > INT09 type = VECT_INIT |
WDT : { * ( .int10 ) } > INT10 type = VECT_INIT |
COMPARATORA : { * ( .int11 ) } > INT11 type = VECT_INIT |
TIMER1_A1 : { * ( .int12 ) } > INT12 type = VECT_INIT |
TIMER1_A0 : { * ( .int13 ) } > INT13 type = VECT_INIT |
NMI : { * ( .int14 ) } > INT14 type = VECT_INIT |
.reset : {} > RESET /* MSP430 RESET VECTOR */ |
} |
/****************************************************************************/ |
/* INCLUDE PERIPHERALS MEMORY MAP */ |
/****************************************************************************/ |
-l msp430g2553.cmd |
//MSP430 Projects/MSP430_G2553/main.c |
---|
0,0 → 1,66 |
#include <msp430.h> |
int main(void) { |
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer |
/* --- Set Oscillator Settings ---------------------- */ |
BCSCTL1 = XT2OFF; // Turn off XT2 oscillator, ACLK = low freq mode/1 |
BCSCTL1 = CALBC1_16MHZ; // Set DCO to callibrated 16Mhz |
DCOCTL = CALDCO_16MHZ; // Set DCO to callibrated 16Mhz |
BCSCTL2 = SELM_0 | DIVM_0 | DIVS_3; // MCLK = DCO/1, SMCLK = MCLK/8 |
BCSCTL3 = LFXT1S_0 | XCAP_2; // LFXT1 = 32.768khz, 10pF termination |
IE1 &= ~OFIE; // Disable oscillator fault interrupt |
/* -------------------------------------------------- */ |
// /* --- Set Timer Settings --------------------------- */ |
// // Timer A clock source = ACLK/1, continuous mode, interrupt enabled |
// TA0CTL = TASSEL_1 | ID_0 | MC_2 | TACLR | TAIE; |
// TACCTL0 = CCIE; // Enable timer A comparator 0 interrupt |
// TACCR0 = 32768; // Set initial comparator value |
// /* -------------------------------------------------- */ |
UCB0CTL0 = UCMSB+UCMST+UCMODE_0; // 3-pin, 8-bit SPI master |
UCB0CTL1 = UCSSEL_2+UCSWRST; // SMCLK |
UCB0BR0 = 2; // UCLK/2 |
UCB0BR1 = 0; |
//UCB0MCTL = 0; |
P1SEL |= BIT5 + BIT6 + BIT7; |
P1SEL2 |= BIT5 + BIT6 + BIT7; |
P1OUT |= BIT5 + BIT6 + BIT7; |
P1DIR |= BIT5 + BIT7; |
P1DIR &= ~BIT6; |
UCB0CTL1 &= ~UCSWRST; // **Initialize USCI state machine** |
// /* --- Set Port Settings ---------------------------- */ |
// // Set port direction to output |
// P1DIR = BIT0 | BIT6; |
// // Set initial port values |
// P1OUT = ~(BIT0 | BIT6); |
// /* -------------------------------------------------- */ |
// Go into low power mode with interrupts enabled |
// _BIS_SR(LPM1_bits + GIE); |
unsigned char c = 0; |
while (UC0IFG & UCB0TXIFG == 0); // wait while not ready for TX |
UCB0TXBUF = 0xAB; // write |
while (UC0IFG & UCB0RXIFG == 0); // wait for RX buffer (full) |
c = UCB0RXBUF; |
while(1); |
} |
//#pragma vector=TIMER0_A0_VECTOR |
//__interrupt void Timer0_A0(void) { |
// // This vector gets called on timer A comparator 0 interrupt |
// P1OUT ^= BIT0; // Toggle LED |
// TACCR0 += 32768; // Add offset to CCR0 |
// TACCTL0 &= ~CCIFG; // Reset the interrupt flag |
//} |
//#pragma vector=TIMER0_A1_VECTOR |
//__interrupt void Timer0_A1(void) { |
// // This vector gets called on timer A overflow and comparators 1 and 2 |
// P1OUT ^= BIT6; // Toggle LED |
// TACTL &= ~TAIFG; // Reset the interrupt flag |
//} |
//MSP430 Projects/MSP430_G2553/targetConfigs/MSP430G2553.ccxml |
---|
0,0 → 1,12 |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
<configurations XML_version="1.2" id="configurations_0"> |
<configuration XML_version="1.2" id="configuration_0"> |
<instance XML_version="1.2" desc="TI MSP430 USB1" href="connections/TIMSP430-USB.xml" id="TI MSP430 USB1" xml="TIMSP430-USB.xml" xmlpath="connections"/> |
<connection XML_version="1.2" id="TI MSP430 USB1"> |
<instance XML_version="1.2" href="drivers/msp430_emu.xml" id="drivers" xml="msp430_emu.xml" xmlpath="drivers"/> |
<platform XML_version="1.2" id="platform_0"> |
<instance XML_version="1.2" desc="MSP430G2553" href="devices/MSP430G2553.xml" id="MSP430G2553" xml="MSP430G2553.xml" xmlpath="devices"/> |
</platform> |
</connection> |
</configuration> |
</configurations> |
//MSP430 Projects/MSP430_G2553/targetConfigs/readme.txt |
---|
0,0 → 1,9 |
The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based |
on the device and connection settings specified in your project on the Properties > General page. |
Please note that in automatic target-configuration management, changes to the project's device and/or |
connection settings will either modify an existing or generate a new target-configuration file. Thus, |
if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively, |
you may create your own target-configuration file for this project and manage it manually. You can |
always switch back to automatic target-configuration management by checking the "Manage the project's |
target-configuration automatically" checkbox on the project's Properties > General page. |