本文整理汇总了C++中SetSDATAStrong函数的典型用法代码示例。如果您正苦于以下问题:C++ SetSDATAStrong函数的具体用法?C++ SetSDATAStrong怎么用?C++ SetSDATAStrong使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetSDATAStrong函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fProgramTargetBlock
signed char fProgramTargetBlock(unsigned char bBankNumber,
unsigned char bBlockNumber)
{
SendVector(set_block_num, num_bits_set_block_num);
/* Set the drive here because SendByte() does not.*/
SetSDATAStrong();
SendByte(bBlockNumber, 8);
SendByte(set_block_num_end, 3);
/*Send the program-block vector. */
SendVector(program, num_bits_program);
/*wait for acknowledge from target. */
fIsError = fDetectHiLoTransition();
if (fIsError != 0)
return BLOCK_ERROR;
/*Send the Wait-For-Poll-End vector*/
SendVector(wait_and_poll_end, num_bits_wait_and_poll_end);
return PASS;
/*
PTJ: Don't do READ-STATUS here because that will
PTJ: require that we return multiple error values, if error occurs
*/
}
示例2: fProgramTargetBlock
// ============================================================================
// fProgramTargetBlock()
// Program one block with data that has been loaded into a RAM buffer in the
// target device.
// Returns:
// 0 if successful
// BLOCK_ERROR if timed out on handshake to the device.
// ============================================================================
signed char fProgramTargetBlock(unsigned char bBankNumber,
unsigned char bBlockNumber)
{
SendVector(tsync_enable, num_bits_tsync_enable);
SendVector(set_block_num, num_bits_set_block_num);
// Set the drive here because SendByte() does not.
SetSDATAStrong();
SendByte(bBlockNumber, 8);
SendByte(set_block_num_end, 3);
SendVector(tsync_disable, num_bits_tsync_disable); //PTJ:
// Send the program-block vector.
SendVector(program_and_verify, num_bits_program_and_verify); //PTJ: PROGRAM-AND-VERIFY
// wait for acknowledge from target.
if ((fIsError = fDetectHiLoTransition())) {
return (BLOCK_ERROR);
}
// Send the Wait-For-Poll-End vector
SendVector(wait_and_poll_end, num_bits_wait_and_poll_end);
return (PASS);
//PTJ: Don't do READ-STATUS here because that will
//PTJ: require that we return multiple error values, if error occurs
}
示例3: LoadTarget
/*============================================================================
LoadTarget()
Transfers data from array in Host to RAM buffer in the target.
Returns the checksum of the data.
============================================================================*/
unsigned int iLoadTarget(void)
{
unsigned char bTemp;
unsigned int iChecksumData = 0;
/*Set SDATA to Strong Drive here because SendByte() does not */
SetSDATAStrong();
bTargetAddress = 0x00;
bTargetDataPtr = 0x00;
while (bTargetDataPtr < TargetDatabufLen) {
bTemp = abTargetDataOUT[bTargetDataPtr];
iChecksumData += bTemp;
SendByte(write_byte_start, 5);
SendByte(bTargetAddress, 6);
SendByte(bTemp, 8);
SendByte(write_byte_end, 3);
bTargetAddress += 4;
bTargetDataPtr++;
}
return iChecksumData;
}
示例4: LoadTarget
/*============================================================================
LoadTarget()
Transfers data from array in Host to RAM buffer in the target.
Returns the checksum of the data.
============================================================================*/
unsigned int iLoadTarget(void)
{
unsigned char bTemp;
unsigned int iChecksumData = 0;
/*Set SDATA to Strong Drive here because SendByte() does not */
SetSDATAStrong();
bTargetAddress = 0x00;
bTargetDataPtr = 0x00;
while (bTargetDataPtr < TargetDatabufLen) {
bTemp = abTargetDataOUT[bTargetDataPtr];
iChecksumData += bTemp;
SendByte(write_byte_start, 4);
/*PTJ: we need to be able to write 128 bytes from address 0x80 to 0xFF*/
SendByte(bTargetAddress, 7);
/*PTJ: we need to be able to write 128 bytes from address 0x80 to 0xFF*/
SendByte(bTemp, 8);
SendByte(write_byte_end, 3);
bTargetAddress += 2;
/*PTJ: inc by 2 in order to support a 128 byte address
space, MSB~1 for address*/
bTargetDataPtr++;
}
return iChecksumData;
}
示例5: fSecureTargetFlash
// ============================================================================
// fSecureTargetFlash()
// Before calling, load the array, abTargetDataOUT, with the desired security
// settings using LoadArrayWithSecurityData(StartAddress,Length,SecurityType).
// The can be called multiple times with different SecurityTypes as needed for
// particular Flash Blocks. Or set them all the same using the call below:
// LoadArrayWithSecurityData(0,SECURITY_BYTES_PER_BANK, 0);
// Returns:
// 0 if successful
// SECURITY_ERROR if timed out on handshake to the device.
// ============================================================================
signed char fSecureTargetFlash(void)
{
unsigned char bTemp;
// Transfer the temporary RAM array into the target
bTargetAddress = 0x00;
bTargetDataPtr = 0x00;
SetSDATAStrong();
while(bTargetDataPtr < SECURITY_BYTES_PER_BANK) {
bTemp = abTargetDataOUT[bTargetDataPtr];
SendByte(write_byte_start,4);
SendByte(bTargetAddress, 7);
SendByte(bTemp, 8);
SendByte(write_byte_end, 3);
// SendBytes() uses MSBits, so increment the address by '2' to put
// the 0..n address into the seven MSBit locations
bTargetAddress += 2; //PTJ: inc by 2 in order to support a 128 byte address space
bTargetDataPtr++;
}
SendVector(secure, num_bits_secure); //PTJ:
if ((fIsError = fDetectHiLoTransition()) != PASS) {
return(SECURITY_ERROR);
}
SendVector(wait_and_poll_end, num_bits_wait_and_poll_end);
return(PASS);
}
示例6: fProgramTargetBlock
/* ============================================================================
// fProgramTargetBlock()
// Program one block with data that has been loaded into a RAM buffer in the
// target device.
// Returns:
// 0 if successful
// BLOCK_ERROR if timed out on handshake to the device.
============================================================================*/
signed char fProgramTargetBlock(unsigned char bBankNumber, unsigned char bBlockNumber)
{
/* TSYNC should still be set when entering this function so this call is not necessary but added for insurance
// SendVector(tsync_enable, num_bits_tsync_enable); // t
*/
SendVector(set_block_num, num_bits_set_block_num);
/* Set the drive here because SendByte() does not. */
SetSDATAStrong();
SendByte(bBlockNumber, 8);
SendByte(set_block_num_end, 3);
SendVector(tsync_disable, num_bits_tsync_disable);
/* Send the program-and-verify vector. */
SendVector(program_and_verify, num_bits_program_and_verify);
/* wait for acknowledge from target. */
fIsError = fDetectHiLoTransition();
if (fIsError)
return BLOCK_ERROR;
/* Send the Wait-For-Poll-End vector */
SendVector(wait_and_poll_end, num_bits_wait_and_poll_end);
return PASS;
/* Don't do READ-STATUS here because that will
// require that we return multiple error values, if error occurs
*/
}
示例7: fSecureTargetFlash
signed char fSecureTargetFlash(void)
{
unsigned char bTemp;
bTargetAddress = 0x00;
bTargetDataPtr = 0x00;
SetSDATAStrong();
while (bTargetDataPtr < SecurityBytesPerBank) {
bTemp = abTargetDataOUT[bTargetDataPtr];
SendByte(write_byte_start, 5);
SendByte(bTargetAddress, 6);
SendByte(bTemp, 8);
SendByte(write_byte_end, 3);
bTargetAddress += 4;
bTargetDataPtr++;
}
SendVector(secure, num_bits_secure);
fIsError = fDetectHiLoTransition();
if (fIsError != 0)
return SECURITY_ERROR;
SendVector(wait_and_poll_end, num_bits_wait_and_poll_end);
return PASS;
}
示例8: fVerifyTargetBlock
// ============================================================================
// fVerifyTargetBlock()
// Verify the block just written to. This can be done byte-by-byte before the
// protection bits are set.
// Returns:
// 0 if successful
// BLOCK_ERROR if timed out on handshake to the device.
// ============================================================================
signed char fVerifyTargetBlock(unsigned char bBankNumber,
unsigned char bBlockNumber)
{
SendVector(set_block_number, 11);
//Set the drive here because SendByte() does not
SetSDATAStrong();
SendByte(bBlockNumber, 8);
SendByte(set_block_number_end, 3);
SendVector(verify_setup_v, num_bits_verify_setup);
if ((fIsError = fDetectHiLoTransition())) {
return (BLOCK_ERROR);
}
SendVector(wait_and_poll_end, num_bits_wait_and_poll_end);
bTargetAddress = 0;
bTargetDataPtr = 0;
while (bTargetDataPtr < TARGET_DATABUFF_LEN) {
//Send Read Byte vector and then get a byte from Target
SendVector(read_byte_v, 4); //PTJ 308: this was changed from sending the first 5 bits to sending the first 4
// Set the drive here because SendByte() does not
SetSDATAStrong();
SendByte(bTargetAddress, 6);
RunClock(2); // Run two SCLK cycles between writing and reading
SetSDATAHiZ(); // Set to HiZ so Target can drive SDATA
bTargetDataIN = bReceiveByte();
RunClock(1);
SendVector(read_byte_v + 1, 1); // Send the ReadByte Vector End
// Test the Byte that was read from the Target against the original
// value (already in the 128-Byte array "abTargetDataOUT[]"). If it
// matches, then bump the address & pointer,loop-back and continue.
// If it does NOT match abort the loop and return an error.
if (bTargetDataIN != abTargetDataOUT[bTargetDataPtr])
return (BLOCK_ERROR);
bTargetDataPtr++;
// Increment the address by four to accomodate 6-Bit addressing
// (puts the 6-bit address into MSBit locations for "SendByte()").
bTargetAddress += 4;
}
return (PASS);
}
示例9: SetBankNumber
/* ============================================================================
// SetBankNumber()
// Set the bank number in the target device.
// Returns:
// none
// ==========================================================================*/
void SetBankNumber(unsigned char bBankNumber)
{
/*Send the bank-select vector.*/
SendVector(set_bank_number, 33);
/* Set the drive here because SendByte() does not.*/
SetSDATAStrong();
SendByte(bBankNumber, 8);
SendVector(set_bank_number_end, 25);
}
示例10: fReadCalRegisters
/* PTJ: =======================================================================
// fReadCalRegisters()
// PTJ: use this to read some cal registers that should be loaded by
Calibrate1 in id_setup_1
// Returns:
// 0 if successful
// _____ if timed out on handshake to the device.
// ==========================================================================*/
signed char fReadCalRegisters(void)
{
SendVector(tsync_enable, num_bits_tsync_enable);
SendVector(Switch_Bank1, 22);
SendVector(read_IMOtrim, 11);/* Read-MSB Vector is the first 11-Bits*/
RunClock(2);/* Two SCLK cycles between write & read*/
bTargetStatus[0] = bReceiveByte();
RunClock(1);
/*Set SDATA to Strong Drive here because SendByte() does not*/
SetSDATAStrong();
SendByte(read_reg_end, 1);
SendVector(read_SPCtrim, 11);/* Read-MSB Vector is the first 11-Bits*/
RunClock(2);/* Two SCLK cycles between write & read*/
bTargetStatus[1] = bReceiveByte();
RunClock(1);
/* Set SDATA to Strong Drive here because SendByte() does not*/
SetSDATAStrong();
SendByte(read_reg_end, 1);
SendVector(read_VBGfinetrim, 11);/* Read-MSB Vector is the first
11-Bits*/
RunClock(2);/* Two SCLK cycles between write & read*/
bTargetStatus[2] = bReceiveByte();
RunClock(1);
/*Set SDATA to Strong Drive here because SendByte() does not*/
SetSDATAStrong();
SendByte(read_reg_end, 1);
SendVector(Switch_Bank0, 22);
SendVector(tsync_disable, num_bits_tsync_disable);
if (bTargetStatus[0] == target_status00_v) {
return PASS;
/*PTJ: Status = 00 means Success, the SROM function
did what it was supposed to*/
}
return PASS;
}
示例11: SendVector
/*============================================================================
SendVector()
This routine sends the vector specifed. All vectors constant strings found
in ISSP_Vectors.h. The data line is returned to HiZ after the vector is
sent.
bVect a pointer to the vector to be sent.
nNumBits the number of bits to be sent.
bCurrByte scratch var to keep the byte to be sent.
There is no returned value.
============================================================================
*/
void SendVector(const unsigned char *bVect, unsigned int iNumBits)
{
SetSDATAStrong();
while (iNumBits > 0) {
if (iNumBits >= 8) {
SendByte(*(bVect), 8);
iNumBits -= 8;
bVect++;
} else {
SendByte(*(bVect), iNumBits);
iNumBits = 0;
}
}
SetSDATAHiZ();
}
示例12: fReadByteLoop
signed char fReadByteLoop(unsigned int blknum)
{
bTargetAddress = 0;
bTargetDataPtr = 0;
while(bTargetDataPtr < TARGET_DATABUFF_LEN)
{
//Send Read Byte vector and then get a byte from Target
SendVector(read_byte_v, 4);
// Set the drive here because SendByte() does not
SetSDATAStrong();
SendByte(bTargetAddress,7);
RunClock(2); // Run two SCLK cycles between writing and reading
SetSDATAHiZ(); // Set to HiZ so Target can drive SDATA
bTargetDataIN = bReceiveByte();
RunClock(1);
SendVector(read_byte_v + 1, 1); // Send the ReadByte Vector End
// Test the Byte that was read from the Target against the original
// value (already in the 128-Byte array "abTargetDataOUT[]"). If it
// matches, then bump the address & pointer,loop-back and continue.
// If it does NOT match abort the loop and return and error.
//if (bTargetDataIN != abTargetDataOUT[bTargetDataPtr])
if (bTargetDataIN != pSocData[blknum*TARGET_DATABUFF_LEN + bTargetDataPtr])
{
#ifdef TX_ON
UART_PutCRLF();
UART_CPutString("bTargetDataIN : ");
UART_PutHexByte(bTargetDataIN);
UART_CPutString(" abTargetDataOUT : ");
UART_PutHexByte(pSocData[blknum*TARGET_DATABUFF_LEN + bTargetDataPtr]);
#endif
return(BLOCK_ERROR);
}
bTargetDataPtr++;
// Increment the address by 2 to accomodate 7-Bit addressing
// (puts the 7-bit address into MSBit locations for "SendByte()").
bTargetAddress += 2;
}
return(PASS);
}
示例13: fVerifySetup
signed char fVerifySetup(unsigned char bBankNumber, unsigned char bBlockNumber)
{
SendVector(set_block_num, num_bits_set_block_num);
/* Set the drive here because SendByte() does not */
SetSDATAStrong();
SendByte(bBlockNumber, 8);
SendByte(set_block_num_end, 3);
SendVector(verify_setup, num_bits_my_verify_setup);
fIsError = fDetectHiLoTransition();
if (fIsError != 0)
return VERIFY_ERROR;
SendVector(wait_and_poll_end, num_bits_wait_and_poll_end);
return PASS;
}
示例14: iLoadTarget
/* ============================================================================
// LoadTarget()
// Transfers data from array in Host to RAM buffer in the target.
// Returns the checksum of the data.
============================================================================*/
unsigned int iLoadTarget(void)
{
unsigned char bTemp;
unsigned int iChecksumData = 0;
SendVector(tsync_enable, num_bits_tsync_enable);
SendVector(read_write_setup, num_bits_read_write_setup);
/* Set SDATA to Strong Drive here because SendByte() does not */
SetSDATAStrong();
/* Transfer the temporary RAM array into the target.
// In this section, a 128-Byte array was specified by #define, so the entire
// 128-Bytes are written in this loop.
*/
bTargetAddress = 0x00;
bTargetDataPtr = 0x00;
while (bTargetDataPtr < TARGET_DATABUFF_LEN) {
bTemp = abTargetDataOUT[bTargetDataPtr]; /* PROGRAM_DATA; */
iChecksumData += bTemp;
SendByte(write_byte_start, 4); /* we need to be able to write 128 bytes from address 0x80 to 0xFF */
SendByte(bTargetAddress, 7); /* we need to be able to write 128 bytes from address 0x80 to 0xFF */
SendByte(bTemp, 8);
SendByte(write_byte_end, 3);
/* !!!NOTE:
// SendByte() uses MSbits, so inc by '2' to put the 0..128 address into
// the seven MSBit locations.
//
// This can be confusing, but check the logic:
// The address is only 7-Bits long. The SendByte() subroutine will
// send however-many bits, BUT...always reads them bits from left-to-
// right. So in order to pass a value of 0..128 as the address using
// SendByte(), we have to left justify the address by 1-Bit.
// This can be done easily by incrementing the address each time by
// '2' rather than by '1'.
*/
bTargetAddress += 2; /* inc by 2 in order to support a 128 byte address space */
bTargetDataPtr++;
}
return iChecksumData;
}
示例15: fReadByteLoop
signed char fReadByteLoop(void)
{
/* char x = 0; //wly */
bTargetAddress = 0;
bTargetDataPtr = 0;
/* pr_info("wly: fReadByteLoop"); */
SendVector(tsync_enable, num_bits_tsync_enable);
SendVector(read_write_setup, num_bits_read_write_setup);
while (bTargetDataPtr < TARGET_DATABUFF_LEN) {
/* Send Read Byte vector and then get a byte from Target */
SendVector(read_byte_v, 4);
/* Set the drive here because SendByte() does not */
SetSDATAStrong();
SendByte(bTargetAddress, 7);
RunClock(2); /* Run two SCLK cycles between writing and reading */
SetSDATAHiZ(); /* Set to HiZ so Target can drive SDATA */
bTargetDataIN = bReceiveByte();
RunClock(1);
SendVector(read_byte_v + 1, 1); /* Send the ReadByte Vector End */
/* Test the Byte that was read from the Target against the original
// value (already in the 128-Byte array "abTargetDataOUT[]"). If it
// matches, then bump the address & pointer,loop-back and continue.
// If it does NOT match abort the loop and return and error.
//pr_info("wly: bTargetDataIN=%x, %x\n", bTargetDataIN, abTargetDataOUT[bTargetDataPtr]);
*/
if (bTargetDataIN != abTargetDataOUT[bTargetDataPtr])
return BLOCK_ERROR;
bTargetDataPtr++;
/* Increment the address by 2 to accomodate 7-Bit addressing
// (puts the 7-bit address into MSBit locations for "SendByte()").
*/
bTargetAddress += 2;
}
SendVector(tsync_disable, num_bits_tsync_disable);
return PASS;
}