Renesas H8S/2378F Technické informace Strana 97

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 109
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 96
(2) ScoBitSet
The library transfer destination address is set in the FTDAR register and the SCO bit of the FCCS register is set to 1. At
least four NOP instructions are required after the SCO bit setting.
To determine whether a transfer error occurs, 0xFF is programmed in the library transfer destination address before
transfer and 0x00 is checked after transfer.
/*
////////////////////////
// ScoBitSet Function //
////////////////////////
*/
BYTE ScoBitSet(void)
{
/* Transmission error check initialization */
*((volatile unsigned char *)TRANS_RAM_ADDR) = 0xFF;
FTDAR = FTDAR_VALUE;
FCCS |= 0x01; /* SCO interruption */
nop();
nop();
nop();
nop();
/* Transmission error check */
if(0x00 == *((volatile unsigned char *)TRANS_RAM_ADDR)) {
return(NORMAL); /* Transmission normal end */
}
return(ABNORMAL); /* Transmission error */
}
TRANS_RAM_ADDR and FTDAR_VALUE are defined in KDevice.h as follows:
/* SCO define */
#define TRANS_RAM_ADDR 0xFF8000
#define FTDAR_VALUE 0x03 /* RAMTOP+16Kb */
89
Zobrazit stránku 96
1 2 ... 92 93 94 95 96 97 98 99 100 101 102 ... 108 109

Komentáře k této Příručce

Žádné komentáře