Hi,
I am writing programme in CCS for spi, I facing some problem in getting required output.
This is the my code:
**************************************************
#include <c6x.h>
#include <stdint.h>
#include <evmc66x_spi.h>
#include <stdio.h>
#include <cslr_spi.h>
#include <platform.h>
SPI_STATUS status1, status2;
void main(void) {
while(1){
uint8_t array1[] = {0xAA ,0x55, 0xFF };
uint8_t* ptr1;
ptr1 = &array1[0];
printf("1\n");
status1 =spi_claim(0,10000000);
printf("2\n");
status2 = spi_xfer(0x00000003,0,ptr1,0);
printf("3\n");
spi_release();
printf("4");
}
}
***************************************************
With this code I am expecting array1 data at master o/p pin.
void Osal_platformSpiCsEnter(void)
{
/* Get the hardware semaphore.
*
* Acquire Multi core CPPI synchronization lock
*/
while ((CSL_semAcquireDirect (PLATFORM_SPI_HW_SEM)) == 0);
return;
}
void Osal_platformSpiCsExit (void)
{
/* Release the hardware semaphore
*
* Release multi-core lock.
*/
CSL_semReleaseSemaphore (PLATFORM_SPI_HW_SEM);
return;
}
I am not understanding here CSL_semAcquireDirect function unable to return the value 1, means Resource was available and has been allocated to the Master. Can any body what wrong with my code.
thank you.
regards,
chandu.