I'm using HALCoGen 2.09.000 .
In the generated code spiInit(), i use this function to enable parity check and parity bits memroy mapped:
SPI_EnableRAMParityCheck(spiREG1);
/** - initalise buffer ram */
{ int i = 0;
if (10 > 0)
{
while (i < 10-1)
{
spiRAM1->tx[i++].control = (4 << 13) /* buffer mode */
| (1 << 12) /* hold chip select */
| (1 << 11) /* lock transmission */
| (0 << 8) /* data format */
| CS_0; /* chip select */
}
spiRAM1->tx[i++].control = (4 << 13) /* buffer mode */
| (0 << 12) /* chip select hold */
| (1 << 10) /* enable WDELAY */
| (0 << 8) /* data format */
| CS_0; /* chip select */
}
...
}
void SPI_EnableRAMParityCheck(spiBASE_t *spi)
{
spi->PTESTEN = 1; /* parity bits are memory mapped */
spi->EDEN = 0xA; /* parity error detection is enabled */
}
but while debugging, i didn't see the parity bits updated.
for example, spi1 tx memory 0xFF0E0000 value is 0x980E0000, the parity bit memeory 0xFF0E0000+0x400 value
is 0x01010101(this is the init parity bit value, i use the default odd parity detection in reg.0xFFFFFFDC).
Even i use spiSetData() to set the tx buffer, the parity bits still not updated, so, when i start spi communication
use spiTransfer(), the parity error detected. what's the problem? how to solve it? Much thanks.