Skip to content

Commit

Permalink
fix(PeriphDrivers): Add SPI hardware SS control function for AI87 (#1142
Browse files Browse the repository at this point in the history
)

Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
  • Loading branch information
hfakkiz committed Aug 28, 2024
1 parent 040f0e4 commit ffba0a1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Libraries/PeriphDrivers/Include/MAX78002/spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,18 @@ unsigned int MXC_SPI_ReadRXFIFO(mxc_spi_regs_t *spi, unsigned char *bytes, unsig
* @return Success/Fail, see \ref MXC_Error_Codes for a list of return codes.
*/
int MXC_SPI_SetDefaultTXData(mxc_spi_regs_t *spi, unsigned int defaultTXData);

/**
* @brief Enable/Disable HW CS control feature.
*
* Depending on the application, the user might need to manually drive the slave select pin.
* The SPI driver automatically drives the SS pin and this function enables/disables this
* feature.
*
* @param spi Pointer to SPI registers (selects the SPI block used.)
* @param state Non-zero values: enable HW SS mode. Zero: disable HW SS mode.
*/
void MXC_SPI_HWSSControl(mxc_spi_regs_t *spi, int state);
//////<<< Previous Implementation

/* ** DMA Functions ** */
Expand Down
5 changes: 5 additions & 0 deletions Libraries/PeriphDrivers/Source/SPI/spi_ai87.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,11 @@ void MXC_SPI_AsyncHandler(mxc_spi_regs_t *spi)
MXC_SPI_RevA1_AsyncHandler((mxc_spi_reva_regs_t *)spi);
}

void MXC_SPI_HWSSControl(mxc_spi_regs_t *spi, int state)
{
MXC_SPI_RevA1_HWSSControl((mxc_spi_reva_regs_t *)spi, state);
}

/* ** SPI v2 functions to prevent build errors ** */

int MXC_SPI_Config(mxc_spi_cfg_t *cfg)
Expand Down
5 changes: 5 additions & 0 deletions Libraries/PeriphDrivers/Source/SPI/spi_ai87_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,3 +812,8 @@ int MXC_SPI_SetDefaultTXData(mxc_spi_regs_t *spi, unsigned int defaultTXData)
{
return MXC_SPI_RevA2_SetDummyTX((mxc_spi_reva_regs_t *)spi, defaultTXData);
}

void MXC_SPI_HWSSControl(mxc_spi_regs_t *spi, int state)
{
MXC_ASSERT(0);
}

0 comments on commit ffba0a1

Please sign in to comment.