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.

Meaning (intended use) of HALCoGen defines I2C_TXDMA, I2C_RXDMA

Other Parts Discussed in Thread: HALCOGEN

Hi,

HALCoGen comes with a file i2c.h for TMS570 (folder HALCoGen\v04.05.02\drivers\TMS570LC4357ZWT\I2C570v000) which defines

enum i2cDMA {
    I2C_TXDMA   = 0x20U, 
    I2C_RXDMA   = 0x10U 
};

I was tempted to use I2C_RXDMA in configuring DREQASI

	dmaREG->DREQASI[0] |= I2C_RXDMA<<(24-8*DMA_CH2); // wrong!!

According to the TMS570 Data Sheet, Section 6.16.2, however, the DMA Request Lines are 10 and 11 for the I2C receive and transmit event, respectively. I searched i2c.c and example code for references to these named constants and found nothing.

	dmaREG->DREQASI[0] |= 10<<(24-8*DMA_CH2); // should work

Regards

Rainald

  • Not really sure what those are intended for.
    I can ask but they are just enum so if their values don't make sense I would just ignore them.
    You can add your own enum to the header file in the USERCODE sections if you like.
  • Hi Rainald,

    The enum i2cDMA was used in our legacy I2C driver and of no use in the current version. This has to be removed from the header file. The enum is not used in any of the driver files. It has nothing to do with DREQASI configuration.

    Also if you have noticed there is no direct API supporting I2C support for DMA in HALCoGen.

    Currently we recommend user to directly write to "I2C DMA Control Register" to enable TX and RX DMA