#include "Cpu.h"
#include <stdio.h>
#include "pin_mux.h"
#include "clockMan1.h"
#include "lpspiCom1.h"
#include "dmaController1.h"
void chipselect();
void chipdeselect();
volatile int exit_code = 0;
uint8_t rx_buffer[10];
uint8_t tx_buffer[10]={1,2,3};
void chipselect()
{
PINS_DRV_ClearPins(PTC_BASE, 14);
}
void chipdeselect()
{
PINS_DRV_SetPins(PTC_BASE, 14);
}
int main(void)
{
/* Write your local variable definition here */
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
#ifdef PEX_RTOS_INIT
PEX_RTOS_INIT(); /* Initialization of the selected RTOS. Macro is defined by the RTOS component. */
#endif
while(1)
{
CLOCK_SYS_Init(g_clockManConfigsArr,NUM_OF_PERIPHERAL_CLOCKS_0,g_clockManCallbacksArr,CLOCK_MANAGER_CALLBACK_CNT);
CLOCK_SYS_UpdateConfiguration(0,CLOCK_MANAGER_POLICY_AGREEMENT);
PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);
LPSPI_DRV_MasterInit(LPSPICOM1, &lpspiCom1State, &lpspiCom1_MasterConfig0);
LPSPI_DRV_SlaveInit(LPSPICOM1, &lpspiCom1State, &lpspiCom1_SlaveConfig0);
chipselect();
// LPSPI_DRV_MasterTransfer(LPSPICOM1, tx_buffer, rx_buffer, 100U);
LPSPI_DRV_MasterTransferBlocking(LPSPICOM1, tx_buffer, rx_buffer, 100U, NULL);
// LPSPI_DRV_ReadRXBuffer(LPSPICOM1);
LPSPI_DRV_SlaveTransfer(LPSPICOM1, tx_buffer, rx_buffer, 100U);
// LPSPI_DRV_ReadRXBuffer(LPSPICOM1);
chipdeselect();
}
/* For example: for(;;) { } */
/*** Don't write any code pass this line, or it will be deleted during code generation. ***/
/*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
#ifdef PEX_RTOS_START
PEX_RTOS_START(); /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
#endif
/*** End of RTOS startup code. ***/
/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
for(;;) {
if(exit_code != 0) {
break;
}
}
return exit_code;
/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
}
I am not getting output for this program. suggest me the solution.
Regards,
veeraju