Part Number: TM4C1292NCPDT
Tool/software: TI-RTOS
Hi,
I have created a driver file with the available TI RTOS driver calls for SPI and I2C as Below,
SPI.c File
spi_call()
{
SPI_HANDLE = SPI_open(SPI_BASEADDRESS, &SPI_PARAMETER);
SPI_transfer(SPI_HANDLE, &SPI_TRANSACTION);
SPI_close(SPI_HANDLE);
}
I2C.c FIle
i2c_call()
{
I2C_HANDLE = I2C_open(I2C_BASEADDRESS, I2C_PARAMETER);
I2C_transfer(I2C_HANDLE, I2C_TRANSACTION)
I2C_close(I2C_HANDLE);
}
My question:
1. Can I pass different base addresses like SPI0_BASE, SPI1_BASE to access both the SPI simultaneously with the single spi_call() function. Same for I2C.
2. Is it internally taken care for locking mechanism? or I need to implement Semaphore inside the spi_call() and i2c_call() functions.
Regards,
Manohar