This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/LAUNCHXL-CC2640R2: How can i add TI Drivers sample code (SPI, IO Interrupt ... ) into simple_peripheral project?

Part Number: LAUNCHXL-CC2640R2

Tool/software: TI-RTOS

Hi

I working with simple_peripheral project, spimaster project.

I done programming in each project.

then how can add spymaster code into simple_peripheral proiect?

each code are seem to different structure.... plz help 

  • Hi Kim,

    This depends on what you aim to achieve and how you are using the SPI driver for example.
    I would recommend you start with separating out the SPI part into it's own task (which should already be the case if you based it on spimaster) and start it alongside the BLE task.

    You would have to go from using the posix way of creating a task, i recommend you look into the "SimplePeripheral_createTask" function to get an idea on how to do this.
  • thank you for reply my question.
    you mean that create new task in ble project for using spi driver project?
    then I have to make function like "void SimplePeripheral_createTask"

    void SPIMaster_createTask(void)
    {
    Task_Params taskParams;

    // Configure task
    Task_Params_init(&taskParams);
    taskParams.stack = spTaskStack;
    taskParams.stackSize = SP_TASK_STACK_SIZE;
    taskParams.priority = SP_TASK_PRIORITY;

    Task_construct(&spTask2, SPI_mainTask, &taskParams, NULL);
    }



    and then put mainThread function which is in SPIMaster in to SPI_mainTask function.
    is it right??
  • That is correct. Keep in mind that you also need to define a new stack for the task as you can't use the same stack (spTaskStack) for two tasks.