slau358q.pdf - 第115页

www.ti.com MSP-GANG.dll Description 115 SLAU358Q – September 2011 – Revised October 2019 Submit Documentation Feedback Copyright © 2011–2019, Texas Instruments Incorporated Dynamic Link Library for MSP-GANG Programmer { …

100%1 / 142
MSP-GANG.dll Description
www.ti.com
114
SLAU358QSeptember 2011Revised October 2019
Submit Documentation Feedback
Copyright © 2011–2019, Texas Instruments Incorporated
Dynamic Link Library for MSP-GANG Programmer
4.2.38 MSPGANG_GetInfoMemory, MSPGANG_SetInfoMemory
Reads or writes 128 bytes to the internal Information memory. Information memory contains configuration
data such as LCD contrast and USB port configuration, and it is not intended to be modified by the user.
Use the GUI software to set the Information memory.
Syntax
LONG MSPGANG_GetInfoMemory(BYTE page, BYTE *data)
LONG MSPGANG_SetInfoMemory(BYTE page, BYTE *data)
Arguments
BYTE page Page info 0 or 1
BYTE *data Pointer to or from data buffer
Result
LONG Error code
4.2.39 MSPGANG_Get_qty_MCU_Type, MSPGANG_Set_MCU_Type,
MSPGANG_Get_MCU_TypeName, MSPGANG_Get_qty_MCU_Family,
MSPGANG_Get_MCU_FamilyName, MSPGANG_Get_MCU_Name
Set of functions that return the names of all supported MCUs, including the family, group, and MCU name.
Syntax
LONG WINAPI MSPGANG_Get_qty_MCU_Type( void );
LONG WINAPI MSPGANG_Set_MCU_Type( int type );
LONG WINAPI MSPGANG_Get_MCU_TypeName( LONG index, LPTSTR name );
LONG WINAPI MSPGANG_Get_qty_MCU_Family( void );
LONG WINAPI MSPGANG_Get_MCU_FamilyName( LONG index, LPTSTR name );
LONG WINAPI MSPGANG_Get_MCU_Name( LONG group_index, LONG index, LPTSTR name );
Use these functions in the following order:
typedef struct
{
int no;
char name[24];
} MCU_FAMILY;
MCU_FAMILY MCU_family_list[30];
typedef struct
{
int index;
char name[24];
} MCU_NAME;
MCU_NAME MCU_name_list[100];
n = MSPGANG_Get_qty_MCU_Family(); //get no of MCU groups
for(k=0; k<n; k++)
{
P = MSPGANG_Get_MCU_FamilyName(k, MCU_family_list[k].name);
If(p == 0) break;
MCU_family_list[k].no = p;
}
The following names and numbers are received using the previous functions:
MCU_Family_list
{ 1, " MSP430" },
www.ti.com
MSP-GANG.dll Description
115
SLAU358QSeptember 2011Revised October 2019
Submit Documentation Feedback
Copyright © 2011–2019, Texas Instruments Incorporated
Dynamic Link Library for MSP-GANG Programmer
{ 0x20, " MSP430FR" },
{ 0x10, " CC430" },
{ 0x80, " MSP432" },
MCU_Group_list
{ 1, 1, " MSP430F1xx" },
{ 20, 1, " MSP430F2xx" },
{ 22, 1, " MSP430AFE2xx" },
{ 21, 1, " MSP430G2xx" },
{ 23, 1, " MSP430i2xx" },
{ 25, 1, " MSP430Txxx" },
{ 40, 1, " MSP430F4xx" },
{ 41, 1, " MSP430FE4xx" },
{ 42, 1, " MSP430FG4xx" },
{ 43, 1, " MSP430FW4xx" },
{ 50, 1, " MSP430F5xx" },
{ 60, 1, " MSP430F6xx" },
{ 62, 1, " MSP430FG6xx" },
{ 55, 0x20, " MSP430FR2xx" },
{ 56, 0x20, " MSP430FR4xx" },
{ 57, 0x20, " MSP430FR5xx" },
{ 67, 0x20, " MSP430FR6xx" },
{ 51, 0x10, " CC-430F5xx" },
{ 61, 0x10, " CC-430F6xx" },
{ 0x84,0x80, " MSP432P4xx" },
{ 0x85,0x80, " MSP432E4xx" },
List of the MCU names in a selected group can be found as follows (in this example, a list of the MCUs
from the MSP430F5xx group (group number 50)):
for(n = 0; n< 100; n++) MCU_name_list[n].index = 0;
for(n = 0; n< 100; n++)
{
p = MSPGANG_Get_MCU_Name(50, n, MCU_name_list[n].name);
if(p == 0) break;
MCU_name_list[n].index = n;
}
4.2.40 MSPGANG_Set_MCU_Name
The MSPGANG_Set_MCU_Name allows to select desired target MCU.
Syntax
LONG MSPGANG_Set_MCU_Name(LPTSTR name);
Arguments
LPTSTR MCU_name MCU name, the same as it is listed in the GUI software
Result
LONG Error code
MSP-GANG.dll Description
www.ti.com
116
SLAU358QSeptember 2011Revised October 2019
Submit Documentation Feedback
Copyright © 2011–2019, Texas Instruments Incorporated
Dynamic Link Library for MSP-GANG Programmer
4.2.41 MSPGANG_HW_devices
The MSPGANG_HW_devices function scanning all available COM ports and saving information about
these ports in following structure.
#define MAX_COM_SIZE 60
#define HW_NAME_SIZE 30
typedef union
{
unsigned char bytes[HW_NAME_SIZE];
struct
{
unsigned short ComNo;
char ComName[7];
char description[HW_NAME_SIZE-2-7];
}x;
}COM_PORTS_DEF;
COM_PORTS_DEF *AvailableComPorts = NULL;
MSPGANG_HW_devices(MAX_COM_SIZE, (void **) &AvailableComPorts));
If detected, USB VCP information is placed at the first location.
Syntax
LONG MSPGANG_HW_devices(LONG max, void **AvailableComPorts)
Arguments
LONG max
void **AvailableComPorts
Result
LONG Error code