Main Page Data Structures File List Data Fields Globals Related Pages

# amd186.h File Reference

`#include <conio.h>`

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures
struct | DmaInfo
struct | DmaRegs
## Defines
#define | PCB_BASE 0xff00
#define | PCB_RELREG (PCB_BASE + 0xFE)
#define | PCB_RESCON (PCB_BASE + 0xF6)
#define | PCB_PRL (PCB_BASE + 0xF4)
#define | PCB_AUXCON (PCB_BASE + 0xF2)
#define | PCB_SYSCON (PCB_BASE + 0xF0)
#define | PCB_WDT (PCB_BASE + 0xE6)
#define | PCB_EDRAM (PCB_BASE + 0xE4)
#define | PCB_CDRAM (PCB_BASE + 0xE2)
#define | PCB_D1CON (PCB_BASE + 0xDA)
#define | PCB_D1TC (PCB_BASE + 0xD8)
#define | PCB_D1DSTH (PCB_BASE + 0xD6)
#define | PCB_D1DSTL (PCB_BASE + 0xD4)
#define | PCB_D1SRCH (PCB_BASE + 0xD2)
#define | PCB_D1SRCL (PCB_BASE + 0xD0)
#define | PCB_D0CON (PCB_BASE + 0xCA)
#define | PCB_D0TC (PCB_BASE + 0xC8)
#define | PCB_D0DSTH (PCB_BASE + 0xC6)
#define | PCB_D0DSTL (PCB_BASE + 0xC4)
#define | PCB_D0SRCH (PCB_BASE + 0xC2)
#define | PCB_D0SRCL (PCB_BASE + 0xC0)
#define | PCB_MPCS (PCB_BASE + 0xA8)
#define | PCB_MMCS (PCB_BASE + 0xA6)
#define | PCB_PACS (PCB_BASE + 0xA4)
#define | PCB_LMCS (PCB_BASE + 0xA2)
#define | PCB_UMCS (PCB_BASE + 0xA0)
#define | PCB_SP0BAUD (PCB_BASE + 0x88)
#define | PCB_SP0RD (PCB_BASE + 0x86)
#define | PCB_SP0TD (PCB_BASE + 0x84)
#define | PCB_SP0STS (PCB_BASE + 0x82)
#define | PCB_SP0CT (PCB_BASE + 0x80)
#define | PCB_PDATA1 (PCB_BASE + 0x7A)
#define | PCB_PDIR1 (PCB_BASE + 0x78)
#define | PCB_PIOMODE1 (PCB_BASE + 0x76)
#define | PCB_PDATA0 (PCB_BASE + 0x74)
#define | PCB_PDIR0 (PCB_BASE + 0x72)
#define | PCB_PIOMODE0 (PCB_BASE + 0x70)
#define | PCB_T2CON (PCB_BASE + 0x66)
#define | PCB_T2CMPA (PCB_BASE + 0x62)
#define | PCB_T2CNT (PCB_BASE + 0x60)
#define | PCB_T1CON (PCB_BASE + 0x5E)
#define | PCB_T1CMPB (PCB_BASE + 0x5C)
#define | PCB_T1CMPA (PCB_BASE + 0x5A)
#define | PCB_T1CNT (PCB_BASE + 0x58)
#define | PCB_T0CON (PCB_BASE + 0x56)
#define | PCB_T0CMPB (PCB_BASE + 0x54)
#define | PCB_T0CMPA (PCB_BASE + 0x52)
#define | PCB_T0CNT (PCB_BASE + 0x50)
#define | PCB_SP0CON (PCB_BASE + 0x44)
#define | PCB_SP1CON (PCB_BASE + 0x42)
#define | PCB_INT4CON (PCB_BASE + 0x40)
#define | PCB_INT3CON (PCB_BASE + 0x3E)
#define | PCB_INT2CON (PCB_BASE + 0x3C)
#define | PCB_INT1CON (PCB_BASE + 0x3A)
#define | PCB_T2INTCON (PCB_BASE + 0x3A)
#define | PCB_INT0CON (PCB_BASE + 0x38)
#define | PCB_T1INTCON (PCB_BASE + 0x38)
#define | PCB_DMA1CON (PCB_BASE + 0x36)
#define | PCB_INT6CON (PCB_BASE + 0x36)
#define | PCB_DMA0CON (PCB_BASE + 0x34)
#define | PCB_INT5CON (PCB_BASE + 0x34)
#define | PCB_TCUCON (PCB_BASE + 0x32)
#define | PCB_T0INTCON (PCB_BASE + 0x32)
#define | PCB_INTSTS (PCB_BASE + 0x30)
#define | PCB_REQST (PCB_BASE + 0x2E)
#define | PCB_INSERV (PCB_BASE + 0x2C)
#define | PCB_PRIMSK (PCB_BASE + 0x2A)
#define | PCB_IMASK (PCB_BASE + 0x28)
#define | PCB_POLLST (PCB_BASE + 0x26)
#define | PCB_POLL (PCB_BASE + 0x24)
#define | PCB_EOI (PCB_BASE + 0x22)
#define | PCB_INTVEC (PCB_BASE + 0x20)
#define | PCB_SP1BAUD (PCB_BASE + 0x18)
#define | PCB_SP1RD (PCB_BASE + 0x16)
#define | PCB_SP1TD (PCB_BASE + 0x14)
#define | PCB_SP1STS (PCB_BASE + 0x12)
#define | PCB_SP1CT (PCB_BASE + 0x10)
#define | DCON_BW 0x0001
#define | DCON_ST 0x0002
#define | DCON_CHG 0x0004
#define | DCON_EXT 0x0008
#define | DCON_TDRQ 0x0010
#define | DCON_P 0x0020
#define | DCON_SYN0 0x0040
#define | DCON_SYN1 0x0080
#define | DCON_INT 0x0100
#define | DCON_TC 0x0200
#define | DCON_SINC 0x0400
#define | DCON_SDEC 0x0800
#define | DCON_SMIO 0x1000
#define | DCON_DINC 0x2000
#define | DCON_DDEC 0x4000
#define | DCON_DMIO 0x8000
#define | DCON_UNSYNC 0
#define | DCON_SSYNC DCON_SYN0
#define | DCON_DSYNC DCON_SYN1
#define | DCON_START (DCON_CHG | DCON_ST)
#define | DCON_STOP (DCON_CHG)
#define | TCON_CONT 0x0001
#define | TCON_ALT 0x0002
#define | TCON_EXT 0x0004
#define | TCON_P 0x0008
#define | TCON_RTG 0x0010
#define | TCON_MC 0x0020
#define | TCON_RIU 0x1000
#define | TCON_INT 0x2000
#define | TCON_INH 0x4000
#define | TCON_EN 0x8000
#define | TCON_START (TCON_INH | TCON_EN)
#define | TCON_STOP (TCON_INH)
## Functions
unsigned long | AMD_GetPioData ()
| AMD PIO functions !!! USE WITH CAUTION !!!
unsigned long | AMD_GetPioDir ()
unsigned long | AMD_GetPioMode ()
void | AMD_PioHigh (const int pio)
void | AMD_PioLow (const int pio)
int | AMD_GetPio (const int pio)
void | AMD_TestPios ()
| Test the mapping between SC12 and AMD PIO pins.
void | AMD_SetPioData (unsigned long mask, unsigned long data)
| Set the AMD PIO Data register.
void | AMD_SetPioDir (unsigned long mask, unsigned long dir)
| Set the AMD PIO Direction register.
void | AMD_SetPioMode (unsigned long mask, unsigned long mode)
| Set the AMD PIO Mode register.
void | AMD_SetPcsWaitStates (int waitstates)
| Set PCS0-3 Chipselect Waitstates.
void | AMD_StartDma (int channel, DmaInfo *dma)
| Initiate a DMA Transfer.
void | AMD_StopDma (int channel)
| Immediately Stop a DMA Transfer.
void | AMD_GetDmaInfo (int channel, DmaInfo *dma)
| Get information about current DMA Transfer.
void | AMD_EnableDrq (int channel, int onoff)
void | REP_INSB (int port, void *dest, int numBytes)
| Wrapper for REP INSB instruction.
void | REP_INSW (int port, void *dest, int numWords)
| Wrapper for REP INSW instruction.
void | REP_OUTSB (int port, void *src, int numBytes)
| Wrapper for REP OUTSB instruction.
void | REP_OUTSW (int port, void *src, int numWords)
| Wrapper for REP OUTSW instruction.
void | usleep (unsigned us)
| Wait some microseconds.
## Variables
const unsigned long | AMD_PIOMASK [14]
| AMD186ED PIO masks for the SC12.
const unsigned int | AMD_PIOPIN [14]

## Define Documentation

#define DCON_BW 0x0001

| Definition at line 91 of file amd186.h. Referenced by RC_Init().

#define DCON_CHG 0x0004

| Definition at line 93 of file amd186.h.

#define DCON_DDEC 0x4000

| Definition at line 106 of file amd186.h.

#define DCON_DINC 0x2000

| Definition at line 105 of file amd186.h. Referenced by RC_Init().

#define DCON_DMIO 0x8000

| Definition at line 107 of file amd186.h. Referenced by AMD_GetDmaInfo(), AMD_StartDma(), and RC_Init().

#define DCON_DSYNC DCON_SYN1

| Definition at line 111 of file amd186.h. Referenced by VS_PlayMpegAsync().

#define DCON_EXT 0x0008

| Definition at line 94 of file amd186.h.

#define DCON_INT 0x0100

| Definition at line 99 of file amd186.h. Referenced by VS_PlayMpegAsync().

#define DCON_P 0x0020

| Definition at line 96 of file amd186.h. Referenced by RC_Init().

#define DCON_SDEC 0x0800

| Definition at line 102 of file amd186.h.

#define DCON_SINC 0x0400

| Definition at line 101 of file amd186.h. Referenced by VS_PlayMpegAsync().

#define DCON_SMIO 0x1000

| Definition at line 103 of file amd186.h. Referenced by AMD_GetDmaInfo(), AMD_StartDma(), and VS_PlayMpegAsync().

#define DCON_SSYNC DCON_SYN0

| Definition at line 110 of file amd186.h. Referenced by RC_Init().

#define DCON_ST 0x0002

| Definition at line 92 of file amd186.h. Referenced by AMD_GetDmaInfo(), and VS_IsPlaying().

#define DCON_START (DCON_CHG | DCON_ST)

| Definition at line 113 of file amd186.h. Referenced by AMD_GetDmaInfo(), AMD_StartDma(), and AMD_StopDma().

#define DCON_STOP (DCON_CHG)

| Definition at line 114 of file amd186.h. Referenced by AMD_GetDmaInfo(), AMD_StartDma(), and AMD_StopDma().

#define DCON_SYN0 0x0040

| Definition at line 97 of file amd186.h.

#define DCON_SYN1 0x0080

| Definition at line 98 of file amd186.h.

#define DCON_TC 0x0200

| Definition at line 100 of file amd186.h. Referenced by RC_Init(), and VS_PlayMpegAsync().

#define DCON_TDRQ 0x0010

| Definition at line 95 of file amd186.h.

#define DCON_UNSYNC 0

| Definition at line 109 of file amd186.h.

#define PCB_AUXCON (PCB_BASE + 0xF2)

| Definition at line 15 of file amd186.h.

#define PCB_BASE 0xff00

| Definition at line 10 of file amd186.h.

#define PCB_CDRAM (PCB_BASE + 0xE2)

| Definition at line 19 of file amd186.h.

#define PCB_D0CON (PCB_BASE + 0xCA)

| Definition at line 26 of file amd186.h. Referenced by AMD_GetDmaInfo(), AMD_StartDma(), and AMD_StopDma().

#define PCB_D0DSTH (PCB_BASE + 0xC6)

| Definition at line 28 of file amd186.h. Referenced by AMD_StartDma().

#define PCB_D0DSTL (PCB_BASE + 0xC4)

| Definition at line 29 of file amd186.h. Referenced by AMD_GetDmaInfo(), and AMD_StartDma().

#define PCB_D0SRCH (PCB_BASE + 0xC2)

| Definition at line 30 of file amd186.h. Referenced by AMD_GetDmaInfo(), and AMD_StartDma().

#define PCB_D0SRCL (PCB_BASE + 0xC0)

| Definition at line 31 of file amd186.h. Referenced by AMD_GetDmaInfo(), and AMD_StartDma().

#define PCB_D0TC (PCB_BASE + 0xC8)

| Definition at line 27 of file amd186.h. Referenced by AMD_GetDmaInfo(), and AMD_StartDma().

#define PCB_D1CON (PCB_BASE + 0xDA)

| Definition at line 20 of file amd186.h. Referenced by AMD_GetDmaInfo(), AMD_StartDma(), and AMD_StopDma().

#define PCB_D1DSTH (PCB_BASE + 0xD6)

| Definition at line 22 of file amd186.h. Referenced by AMD_StartDma().

#define PCB_D1DSTL (PCB_BASE + 0xD4)

| Definition at line 23 of file amd186.h. Referenced by AMD_GetDmaInfo(), and AMD_StartDma().

#define PCB_D1SRCH (PCB_BASE + 0xD2)

| Definition at line 24 of file amd186.h. Referenced by AMD_GetDmaInfo(), and AMD_StartDma().

#define PCB_D1SRCL (PCB_BASE + 0xD0)

| Definition at line 25 of file amd186.h. Referenced by AMD_GetDmaInfo(), and AMD_StartDma().

#define PCB_D1TC (PCB_BASE + 0xD8)

| Definition at line 21 of file amd186.h. Referenced by AMD_GetDmaInfo(), and AMD_StartDma().

#define PCB_DMA0CON (PCB_BASE + 0x34)

| Definition at line 70 of file amd186.h.

#define PCB_DMA1CON (PCB_BASE + 0x36)

| Definition at line 68 of file amd186.h.

#define PCB_EDRAM (PCB_BASE + 0xE4)

| Definition at line 18 of file amd186.h.

#define PCB_EOI (PCB_BASE + 0x22)

| Definition at line 81 of file amd186.h.

#define PCB_IMASK (PCB_BASE + 0x28)

| Definition at line 78 of file amd186.h.

#define PCB_INSERV (PCB_BASE + 0x2C)

| Definition at line 76 of file amd186.h.

#define PCB_INT0CON (PCB_BASE + 0x38)

| Definition at line 66 of file amd186.h.

#define PCB_INT1CON (PCB_BASE + 0x3A)

| Definition at line 64 of file amd186.h.

#define PCB_INT2CON (PCB_BASE + 0x3C)

| Definition at line 63 of file amd186.h.

#define PCB_INT3CON (PCB_BASE + 0x3E)

| Definition at line 62 of file amd186.h.

#define PCB_INT4CON (PCB_BASE + 0x40)

| Definition at line 61 of file amd186.h.

#define PCB_INT5CON (PCB_BASE + 0x34)

| Definition at line 71 of file amd186.h.

#define PCB_INT6CON (PCB_BASE + 0x36)

| Definition at line 69 of file amd186.h.

#define PCB_INTSTS (PCB_BASE + 0x30)

| Definition at line 74 of file amd186.h.

#define PCB_INTVEC (PCB_BASE + 0x20)

| Definition at line 82 of file amd186.h.

#define PCB_LMCS (PCB_BASE + 0xA2)

| Definition at line 35 of file amd186.h.

#define PCB_MMCS (PCB_BASE + 0xA6)

| Definition at line 33 of file amd186.h.

#define PCB_MPCS (PCB_BASE + 0xA8)

| Definition at line 32 of file amd186.h.

#define PCB_PACS (PCB_BASE + 0xA4)

| Definition at line 34 of file amd186.h. Referenced by AMD_SetPcsWaitStates().

#define PCB_PDATA0 (PCB_BASE + 0x74)

| Definition at line 45 of file amd186.h. Referenced by AMD_GetPio(), AMD_GetPioData(), AMD_PioHigh(), AMD_PioLow(), and AMD_SetPioData().

#define PCB_PDATA1 (PCB_BASE + 0x7A)

| Definition at line 42 of file amd186.h. Referenced by AMD_GetPio(), AMD_GetPioData(), AMD_PioHigh(), AMD_PioLow(), and AMD_SetPioData().

#define PCB_PDIR0 (PCB_BASE + 0x72)

| Definition at line 46 of file amd186.h. Referenced by AMD_GetPioDir(), and AMD_SetPioDir().

#define PCB_PDIR1 (PCB_BASE + 0x78)

| Definition at line 43 of file amd186.h. Referenced by AMD_GetPioDir(), and AMD_SetPioDir().

#define PCB_PIOMODE0 (PCB_BASE + 0x70)

| Definition at line 47 of file amd186.h. Referenced by AMD_GetPioMode(), and AMD_SetPioMode().

#define PCB_PIOMODE1 (PCB_BASE + 0x76)

| Definition at line 44 of file amd186.h. Referenced by AMD_GetPioMode(), and AMD_SetPioMode().

#define PCB_POLL (PCB_BASE + 0x24)

| Definition at line 80 of file amd186.h.

#define PCB_POLLST (PCB_BASE + 0x26)

| Definition at line 79 of file amd186.h.

#define PCB_PRIMSK (PCB_BASE + 0x2A)

| Definition at line 77 of file amd186.h.

#define PCB_PRL (PCB_BASE + 0xF4)

| Definition at line 14 of file amd186.h.

#define PCB_RELREG (PCB_BASE + 0xFE)

| Definition at line 12 of file amd186.h.

#define PCB_REQST (PCB_BASE + 0x2E)

| Definition at line 75 of file amd186.h.

#define PCB_RESCON (PCB_BASE + 0xF6)

| Definition at line 13 of file amd186.h.

#define PCB_SP0BAUD (PCB_BASE + 0x88)

| Definition at line 37 of file amd186.h.

#define PCB_SP0CON (PCB_BASE + 0x44)

| Definition at line 59 of file amd186.h.

#define PCB_SP0CT (PCB_BASE + 0x80)

| Definition at line 41 of file amd186.h.

#define PCB_SP0RD (PCB_BASE + 0x86)

| Definition at line 38 of file amd186.h.

#define PCB_SP0STS (PCB_BASE + 0x82)

| Definition at line 40 of file amd186.h.

#define PCB_SP0TD (PCB_BASE + 0x84)

| Definition at line 39 of file amd186.h.

#define PCB_SP1BAUD (PCB_BASE + 0x18)

| Definition at line 83 of file amd186.h.

#define PCB_SP1CON (PCB_BASE + 0x42)

| Definition at line 60 of file amd186.h.

#define PCB_SP1CT (PCB_BASE + 0x10)

| Definition at line 87 of file amd186.h.

#define PCB_SP1RD (PCB_BASE + 0x16)

| Definition at line 84 of file amd186.h.

#define PCB_SP1STS (PCB_BASE + 0x12)

| Definition at line 86 of file amd186.h.

#define PCB_SP1TD (PCB_BASE + 0x14)

| Definition at line 85 of file amd186.h.

#define PCB_SYSCON (PCB_BASE + 0xF0)

| Definition at line 16 of file amd186.h.

#define PCB_T0CMPA (PCB_BASE + 0x52)

| Definition at line 57 of file amd186.h.

#define PCB_T0CMPB (PCB_BASE + 0x54)

| Definition at line 56 of file amd186.h.

#define PCB_T0CNT (PCB_BASE + 0x50)

| Definition at line 58 of file amd186.h.

#define PCB_T0CON (PCB_BASE + 0x56)

| Definition at line 55 of file amd186.h.

#define PCB_T0INTCON (PCB_BASE + 0x32)

| Definition at line 73 of file amd186.h.

#define PCB_T1CMPA (PCB_BASE + 0x5A)

| Definition at line 53 of file amd186.h. Referenced by RC_Init().

#define PCB_T1CMPB (PCB_BASE + 0x5C)

| Definition at line 52 of file amd186.h.

#define PCB_T1CNT (PCB_BASE + 0x58)

| Definition at line 54 of file amd186.h. Referenced by RC_Init().

#define PCB_T1CON (PCB_BASE + 0x5E)

| Definition at line 51 of file amd186.h. Referenced by RC_Done(), and RC_Init().

#define PCB_T1INTCON (PCB_BASE + 0x38)

| Definition at line 67 of file amd186.h.

#define PCB_T2CMPA (PCB_BASE + 0x62)

| Definition at line 49 of file amd186.h. Referenced by ZTimer_Start(), and ZTimer_Stop().

#define PCB_T2CNT (PCB_BASE + 0x60)

| Definition at line 50 of file amd186.h. Referenced by ZTimer_Start(), and ZTimer_Stop().

#define PCB_T2CON (PCB_BASE + 0x66)

| Definition at line 48 of file amd186.h. Referenced by ZTimer_Start(), and ZTimer_Stop().

#define PCB_T2INTCON (PCB_BASE + 0x3A)

| Definition at line 65 of file amd186.h.

#define PCB_TCUCON (PCB_BASE + 0x32)

| Definition at line 72 of file amd186.h.

#define PCB_UMCS (PCB_BASE + 0xA0)

| Definition at line 36 of file amd186.h.

#define PCB_WDT (PCB_BASE + 0xE6)

| Definition at line 17 of file amd186.h.

#define TCON_ALT 0x0002

| Definition at line 118 of file amd186.h.

#define TCON_CONT 0x0001

| Definition at line 117 of file amd186.h. Referenced by RC_Init().

#define TCON_EN 0x8000

| Definition at line 126 of file amd186.h.

#define TCON_EXT 0x0004

| Definition at line 119 of file amd186.h.

#define TCON_INH 0x4000

| Definition at line 125 of file amd186.h.

#define TCON_INT 0x2000

| Definition at line 124 of file amd186.h. Referenced by RC_Init().

#define TCON_MC 0x0020

| Definition at line 122 of file amd186.h.

#define TCON_P 0x0008

| Definition at line 120 of file amd186.h.

#define TCON_RIU 0x1000

| Definition at line 123 of file amd186.h.

#define TCON_RTG 0x0010

| Definition at line 121 of file amd186.h.

#define TCON_START (TCON_INH | TCON_EN)

| Definition at line 128 of file amd186.h. Referenced by RC_Init(), ZTimer_Start(), and ZTimer_Stop().

#define TCON_STOP (TCON_INH)

| Definition at line 129 of file amd186.h. Referenced by RC_Done(), RC_Init(), and ZTimer_Start().

## Function Documentation

void AMD_EnableDrq | ( | int | channel,
|  | int | onoff
| ) |

| Definition at line 464 of file amd186.cpp. References AMD_SetPioDir(), and AMD_SetPioMode(). Referenced by RC_Init(), SCI_ReadReg(), SCI_WriteReg(), VS_PlayMpegAsync(), and VS_Reset().

void AMD_GetDmaInfo | ( | int | channel,
|  | DmaInfo * | dma
| ) |

  | Get information about current DMA Transfer. \note: in order to read the DMA status reliably, a running transfer will be interrupted while the registers are read. This might be an issue, if you do something very timing critical! Parameters:
  channel | DMA channel, either 0 or 1
  dma | pointer to DMAInfo structure. May not be null.
Definition at line 424 of file amd186.cpp. References DmaInfo::control, DCON_DMIO, DCON_SMIO, DCON_ST, DCON_START, DCON_STOP, DmaInfo::dstMem, DmaInfo::dstPort, DmaInfo::length, PCB_D0CON, PCB_D0DSTL, PCB_D0SRCH, PCB_D0SRCL, PCB_D0TC, PCB_D1CON, PCB_D1DSTL, PCB_D1SRCH, PCB_D1SRCL, PCB_D1TC, DmaInfo::srcMem, and DmaInfo::srcPort. Referenced by timerHandler(), and VS_IsPlaying().

int AMD_GetPio | ( | const int | pio | ) | `[inline]`

| Definition at line 217 of file amd186.h. References PCB_PDATA0, and PCB_PDATA1. Referenced by SCI_Read().

unsigned long AMD_GetPioData | ( |  | ) | `[inline]`

| AMD PIO functions !!! USE WITH CAUTION !!! You may have to enclose direct PIO writes in CLI/STI pairs to ensure that the BIOS doesn't interfere during the access. This may happen, because the current pio state gets read, processed and then written back. Mode Direction Function 0 0 Normal operation 0 1 PIO input with pullup/pulldown 1 0 PIO output 1 1 PIO input w/o pullup/pulldown Definition at line 185 of file amd186.h. References PCB_PDATA0, and PCB_PDATA1.

unsigned long AMD_GetPioDir | ( |  | ) | `[inline]`

| Definition at line 190 of file amd186.h. References PCB_PDIR0, and PCB_PDIR1. Referenced by AMD_TestPios().

unsigned long AMD_GetPioMode | ( |  | ) | `[inline]`

| Definition at line 195 of file amd186.h. References PCB_PIOMODE0, and PCB_PIOMODE1.

void AMD_PioHigh | ( | const int | pio | ) | `[inline]`

| Definition at line 201 of file amd186.h. References PCB_PDATA0, and PCB_PDATA1. Referenced by SCI_Read(), SCI_ReadReg(), SCI_Write(), and SCI_WriteReg().

void AMD_PioLow | ( | const int | pio | ) | `[inline]`

| Definition at line 209 of file amd186.h. References PCB_PDATA0, and PCB_PDATA1. Referenced by SCI_Read(), SCI_ReadReg(), SCI_Write(), and SCI_WriteReg().

void AMD_SetPcsWaitStates | ( | int | waitstates | ) |

  | Set PCS0-3 Chipselect Waitstates. Note that you cannot modify the PCS5 and 6 waitstates. The SC12 hardware manual says that they must remain set to 3 waitstates. Parameters:
  waitstates | number of waitstates, the value is rounded up, if there's no exact match. Possible values are 0, 1, 2, 3, 5, 7, 9 and 15
Definition at line 350 of file amd186.cpp. References PCB_PACS.

void AMD_SetPioData | ( | unsigned long | mask,
|  | unsigned long | data
| ) |

  | Set the AMD PIO Data register. Please see the AMD186ED user manual before using this function. Always remember that there is a strange mapping between the SC12 PIO pins and the real AMD ones Parameters:
  data | data bits to write
  mask | only bits contained in the mask are touched
See also: AMD_PIO Definition at line 212 of file amd186.cpp. References PCB_PDATA0, and PCB_PDATA1.

void AMD_SetPioDir | ( | unsigned long | mask,
|  | unsigned long | dir
| ) |

  | Set the AMD PIO Direction register. Please see the AMD186ED user manual before using this function. Always remember that there is a strange mapping between the SC12 PIO pins and the real AMD ones Parameters:
  dir | direction bits to write
  mask | only bits contained in the mask are touched
See also: AMD_PIO Definition at line 258 of file amd186.cpp. References PCB_PDIR0, and PCB_PDIR1. Referenced by AMD_EnableDrq().

void AMD_SetPioMode | ( | unsigned long | mask,
|  | unsigned long | mode
| ) |

  | Set the AMD PIO Mode register. Please see the AMD186ED user manual before using this function. Always remember that there is a strange mapping between the SC12 PIO pins and the real AMD ones Parameters:
  mode | mode bits to write
  mask | only bits contained in the mask are touched
See also: AMD_PIO Definition at line 304 of file amd186.cpp. References PCB_PIOMODE0, and PCB_PIOMODE1. Referenced by AMD_EnableDrq().

void AMD_StartDma | ( | int | channel,
|  | DmaInfo * | dma
| ) |

  | Initiate a DMA Transfer. Please read chapter 9 of the AMD 186ED user manual before using this function (the DMAInfo structure should be quite self-explanatory then) Parameters:
  channel | DMA channel, either 0 or 1
  dma | filled DMAInfo structure
Definition at line 372 of file amd186.cpp. References DmaInfo::control, DCON_DMIO, DCON_SMIO, DCON_START, DCON_STOP, DmaInfo::dstMem, DmaInfo::dstPort, DmaInfo::length, PCB_D0CON, PCB_D0DSTH, PCB_D0DSTL, PCB_D0SRCH, PCB_D0SRCL, PCB_D0TC, PCB_D1CON, PCB_D1DSTH, PCB_D1DSTL, PCB_D1SRCH, PCB_D1SRCL, PCB_D1TC, src, DmaInfo::srcMem, and DmaInfo::srcPort. Referenced by RC_Init(), timerHandler(), and VS_PlayMpegAsync().

void AMD_StopDma | ( | int | channel | ) |

  | Immediately Stop a DMA Transfer. Parameters:
  channel | DMA channel to stop, either 0 or 1
Definition at line 403 of file amd186.cpp. References DCON_START, DCON_STOP, PCB_D0CON, and PCB_D1CON. Referenced by RC_Done(), and VS_Stop().

void AMD_TestPios | ( |  | ) |

| Test the mapping between SC12 and AMD PIO pins. This function doesn't need to be called by a user program, and is only useful if there's a new, incompatible revision of the @chip. (as they always promise ;) Warning: this function should only be used without any external hardware connected. Definition at line 182 of file amd186.cpp. References AMD_GetPioDir(), pfe_enable_pio(), PIO_IPD, PIO_IPU, and PIO_O0.

void REP_INSB | ( | int | port,
|  | void * | dest,
|  | int | numBytes
| ) |

  | Wrapper for REP INSB instruction. Parameters:
  port | i/o port to read from
  dest | memory buffer to read to
  numBytes | number of bytes to transfer
Definition at line 32 of file amd186.cpp.

void REP_INSW | ( | int | port,
|  | void * | dest,
|  | int | numWords
| ) |

  | Wrapper for REP INSW instruction. Parameters:
  port | i/o port to read from
  dest | memory buffer to read to
  numWords | number of words to transfer
Definition at line 63 of file amd186.cpp.

void REP_OUTSB | ( | int | port,
|  | void * | src,
|  | int | numBytes
| ) |

  | Wrapper for REP OUTSB instruction. Parameters:
  port | i/o port to write to
  src | memory buffer to read from
  numBytes | number of bytes to transfer
Definition at line 94 of file amd186.cpp. References src.

void REP_OUTSW | ( | int | port,
|  | void * | src,
|  | int | numWords
| ) |

  | Wrapper for REP OUTSW instruction. Parameters:
  port | i/o port to write to
  src | memory buffer to read from
  numWords | number of words to transfer
Definition at line 125 of file amd186.cpp. References src.

void usleep | ( | unsigned | us | ) |

  | Wait some microseconds. This function has been tested on an IPC@Chip SC12 at 20MHz, and is not very accurate. You can time the actual delay by using the ZTimer functions. Note: for a value of 10000, the function actually waits 11149 microseconds. Parameters:
  us | time to wait in microseconds
Todo: re-calibrate this function (push/pop added) Definition at line 159 of file amd186.cpp. Referenced by SCI_ReadReg(), SCI_WriteReg(), and VS_Reset().

## Variable Documentation

const unsigned long AMD_PIOMASK[14]`[static]`

| Initial value:
     {
      0x00002000L, 0x00001000L, 0x00000004L, 0x00000008L,
      0x00020000L, 0x00080000L, 0x00040000L, 0x00800000L,
      0x00400000L, 0x00200000L, 0x00100000L, 0x08000000L,
      0x10000000L, 0x00000400L
    }
AMD186ED PIO masks for the SC12. Use with the AMD_PIO functions, generated by AMD_TestPIOs() Definition at line 157 of file amd186.h.

const unsigned int AMD_PIOPIN[14]`[static]`

| Initial value:
     {
      13, 12,  2,  3,
      17, 19, 18, 23,
      22, 21, 20, 27,
      28, 10
    }
Definition at line 164 of file amd186.h.