TCAN4550  1p2
TCAN4x5x_SPI.h File Reference
#include <driverlib.h>

Go to the source code of this file.

Macros

#define SPI_CS_GPIO_PORT   GPIO_PORT_P2
 
#define SPI_CS_GPIO_PIN   GPIO_PIN5
 
#define SPI_HW_ADDR   EUSCI_B0_BASE
 
#define WAIT_FOR_TRANSMIT   while (!(HWREG16(SPI_HW_ADDR + OFS_UCBxIFG) & UCTXIFG))
 
#define WAIT_FOR_IDLE   while ((HWREG16(SPI_HW_ADDR + OFS_UCBxSTATW) & UCBUSY))
 
#define AHB_WRITE_OPCODE   0x61
 
#define AHB_READ_OPCODE   0x41
 

Functions

void AHB_WRITE_32 (uint16_t address, uint32_t data)
 
void AHB_WRITE_BURST_START (uint16_t address, uint8_t words)
 
void AHB_WRITE_BURST_WRITE (uint32_t data)
 
void AHB_WRITE_BURST_END (void)
 
uint32_t AHB_READ_32 (uint16_t address)
 
void AHB_READ_BURST_START (uint16_t address, uint8_t words)
 
uint32_t AHB_READ_BURST_READ (void)
 
void AHB_READ_BURST_END (void)
 

Macro Definition Documentation

◆ AHB_READ_OPCODE

#define AHB_READ_OPCODE   0x41

Definition at line 62 of file TCAN4x5x_SPI.h.

Referenced by AHB_READ_BURST_START().

◆ AHB_WRITE_OPCODE

#define AHB_WRITE_OPCODE   0x61

Definition at line 61 of file TCAN4x5x_SPI.h.

Referenced by AHB_WRITE_BURST_START().

◆ SPI_CS_GPIO_PIN

#define SPI_CS_GPIO_PIN   GPIO_PIN5

◆ SPI_CS_GPIO_PORT

#define SPI_CS_GPIO_PORT   GPIO_PORT_P2

◆ SPI_HW_ADDR

#define SPI_HW_ADDR   EUSCI_B0_BASE

◆ WAIT_FOR_IDLE

#define WAIT_FOR_IDLE   while ((HWREG16(SPI_HW_ADDR + OFS_UCBxSTATW) & UCBUSY))

Definition at line 55 of file TCAN4x5x_SPI.h.

Referenced by AHB_READ_BURST_END(), AHB_READ_BURST_READ(), and AHB_WRITE_BURST_END().

◆ WAIT_FOR_TRANSMIT

#define WAIT_FOR_TRANSMIT   while (!(HWREG16(SPI_HW_ADDR + OFS_UCBxIFG) & UCTXIFG))

Function Documentation

◆ AHB_READ_32()

uint32_t AHB_READ_32 ( uint16_t  address)

◆ AHB_READ_BURST_END()

void AHB_READ_BURST_END ( void  )

◆ AHB_READ_BURST_READ()

uint32_t AHB_READ_BURST_READ ( void  )

◆ AHB_READ_BURST_START()

void AHB_READ_BURST_START ( uint16_t  address,
uint8_t  words 
)

◆ AHB_WRITE_32()

◆ AHB_WRITE_BURST_END()

void AHB_WRITE_BURST_END ( void  )

Definition at line 138 of file TCAN4x5x_SPI.c.

References SPI_CS_GPIO_PIN, SPI_CS_GPIO_PORT, and WAIT_FOR_IDLE.

Referenced by AHB_WRITE_32(), and TCAN4x5x_MCAN_WriteTXBuffer().

◆ AHB_WRITE_BURST_START()

void AHB_WRITE_BURST_START ( uint16_t  address,
uint8_t  words 
)

◆ AHB_WRITE_BURST_WRITE()

void AHB_WRITE_BURST_WRITE ( uint32_t  data)

Definition at line 118 of file TCAN4x5x_SPI.c.

References SPI_HW_ADDR, and WAIT_FOR_TRANSMIT.

Referenced by AHB_WRITE_32(), and TCAN4x5x_MCAN_WriteTXBuffer().