#include "AT89C51ED2-SFR.h"
Include dependency graph for board.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Classes | |
union | Temp |
Generic temp variable for non-reentrant main routines. More... | |
Defines | |
#define | MP3_XRESET P2_4 |
Chip Reset. | |
#define | Mp3PutInReset() {MP3_XRESET=1;} |
Put the MP3 player chip in reset. | |
#define | Mp3ReleaseFromReset() {MP3_XRESET=0;} |
Release the MP3 player chip from reset. | |
#define | MP3_XCS P2_3 |
Control Chip Select (for accessing SPI Control/Status registers). | |
#define | Mp3SelectControl() {MP3_XCS=0;} |
Pull the VS10xx Control Chip Select line Low. | |
#define | Mp3DeselectControl() {MP3_XCS=1;} |
Pull the VS10xx Control Chip Select line High. | |
#define | MP3_XDCS P2_5 |
Data Chip Select / BSYNC. | |
#define | MP3_DREQ P3_2 |
Data Request: Player asks for more data. | |
#define | RED_LED P3_3 |
Red LED in multicolor LED, 0 = on, 1 = off. | |
#define | GREEN_LED P3_7 |
Green LED in multicolor LED, 0 = on, 1 = off. | |
#define | LED_ON 0 |
LED is active low. | |
#define | LED_OFF 1 |
LED is inactive high. | |
#define | KEY_BUTTON !(P1_2) |
Center push-button, 1 when pressed. | |
#define | KEY_FARRIGHT !(P1_1) |
Far-left key, 1 when pressed. | |
#define | KEY_RIGHT !(P1_0) |
Left key, 1 when pressed. | |
#define | KEY_LEFT !(P1_3) |
Right key, 1 when pressed. | |
#define | KEY_FARLEFT !(P3_4) |
Far-right key, 1 when pressed. | |
#define | LCD_DATABUS P0 |
LCD Data pins are connected to DATA bus (P0). | |
#define | LCD_RS P2_0 |
LCD Register Select: 0=Control, 1=Data. | |
#define | LCD_ENABLE P2_2 |
LCD Clock Pulse (Active high). | |
#define | LCD_RW 0 |
LCD is only in write mode, read not possible. | |
#define | LCD_COMMAND_MODE 0 |
LCD RS is 0 in LCD Command Mode. | |
#define | LCD_DATA_MODE 1 |
LCD RS is 1 in LCD Data Mode. | |
#define | RSEN P2_1 |
RS-232 Buffer Enable. | |
#define | YES 1 |
YES = 1. | |
#define | NO 0 |
NO = 0. | |
#define | MMC_OFF P2_7 |
MMC Off (MMC Power Off). | |
#define | MMC_XCS P2_6 |
MMC Chip Select (Active Low). | |
#define | MMC_SELECTED 0 |
MMC is selected when MMC_XCS is low. | |
#define | MMC_NOT_SELECTED 1 |
MMC is not selected when MMC_XCS is high. | |
#define | MMCSelect() {MMC_XCS = MMC_SELECTED;} |
Pull the VS10xx Data Chip Select line Low. | |
#define | MMCDeselect() {MMC_XCS = MMC_NOT_SELECTED;} |
Pull the VS10xx Data Chip Select line High. | |
#define | ClearPCAOverflow() {CCON &= 0x7f;} |
Clear PCA core counter overflow flag. | |
#define | PCARun() {CCON |= 0x40;} |
Start Programmable Counter Array core counter. | |
#define | PCAHalt() {CCON &= 0xBF;} |
Stop Programmable Counter Array core counter. | |
#define | PCAHaltAndClearOV() {CCON &= 0x3F;} |
Stop PCA core counter and clear overflow flag. | |
#define | SetPCAValue(v) {CH = ((unsigned)(v)) >> 8; CL = (v) & 0xff;} |
Set PCA core counter value. | |
#define | SetPCADelayValue(microseconds) {SetPCAValue(65535-(unsigned int)((microseconds)/0.4069010));} |
Calculate and set Time-Until-Overflow to PCA in microseconds. | |
#define | InitiateDelay(microseconds) {PCAHaltAndClearOV(); SetPCADelayValue(microseconds); PCARun();} |
Initiate Delay of n microseconds. | |
#define | WaitOutDelay() {while (!(CCON & 0x80));} |
Busy loop until the end of the delay time. | |
#define | SPISetFastClock() {SPCON=0x71;} /* 0x73 is much slower than 71*/ |
switch to fast SPI Clock | |
#define | SPIWait() {while(!(SPSTA & 0x80));;} |
Wait for SPI ready to send a new character (previous sent). | |
#define | SPIPutChar(c) {SPIWait();SPDAT=(c);} |
Wait for SPI ready, then initiate character sending. | |
#define | SPIPutCharWithoutWaiting(c) {SPDAT=(c);} |
Initiate SPI character sending. | |
#define | SPI_RESULT_BYTE SPDAT |
SPI data return register. | |
#define | Public |
"Public" has no code meaning but it is meant for the programmer to remember that this function is called from outside the module | |
Functions | |
void | Mp3SelectData () |
Pull the VS10xx Data Chip Select line Low. | |
void | Mp3DeselectData () |
Pull the VS10xx Data Chip Select line High. | |
unsigned char | SPIGetChar () |
Send 8 ones to SPI bus and receive the result byte. | |
void | SPI8Clocks (unsigned char nClocks) |
Send nClocks x 8 clock transitions with MOSI=1 (0xff). | |
void | Delay (int milliseconds) |
Busy loop delay function. | |
void | InitBoard () |
Startup initialization of the microcontroller board. | |
Variables | |
Temp | temp |
Generic temp variable for non-reentrant main routines. |
--Define PCB2 for Evakit PCB V2.0+ Board related utility functions such as delay()
Required modules: -
Board Description:
VLSI Solution VS1011/VS1012/ Standard LCD Module: Tianma TM161A
Definition in file board.h.
|
Clear PCA core counter overflow flag.
|
|
Green LED in multicolor LED, 0 = on, 1 = off.
Definition at line 71 of file board.h. Referenced by GetAVIBlock(), Record(), and VsSineTest(). |
|
Initiate Delay of n microseconds.
Definition at line 200 of file board.h. Referenced by Delay(), InitBoard(), LcdFadeIn(), LcdFadeOut(), LcdPutChar(), and LcdReset(). |
|
Center push-button, 1 when pressed.
Definition at line 85 of file board.h. Referenced by AvailableProcessorTime(), ConsoleDecipherMMCResponse(), main(), and Record(). |
|
Far-right key, 1 when pressed.
Definition at line 100 of file board.h. Referenced by AvailableProcessorTime(), and main(). |
|
Far-left key, 1 when pressed.
Definition at line 88 of file board.h. Referenced by AvailableProcessorTime(), and main(). |
|
Right key, 1 when pressed.
Definition at line 94 of file board.h. Referenced by main(). |
|
Left key, 1 when pressed.
Definition at line 91 of file board.h. Referenced by main(). |
|
LCD RS is 0 in LCD Command Mode.
Definition at line 125 of file board.h. Referenced by LcdPutCommand(). |
|
LCD RS is 1 in LCD Data Mode.
Definition at line 128 of file board.h. Referenced by LcdPutChar(). |
|
LCD Data pins are connected to DATA bus (P0).
Definition at line 113 of file board.h. Referenced by LcdPutChar(), and LcdPutCommand(). |
|
LCD Clock Pulse (Active high).
Definition at line 119 of file board.h. Referenced by LcdPutChar(), LcdPutCommand(), and LcdReset(). |
|
LCD Register Select: 0=Control, 1=Data.
Definition at line 116 of file board.h. Referenced by LcdPutChar(), and LcdPutCommand(). |
|
LCD is only in write mode, read not possible.
|
|
LED is inactive high.
Definition at line 77 of file board.h. Referenced by GetAVIBlock(), Record(), and VsSineTest(). |
|
LED is active low.
Definition at line 74 of file board.h. Referenced by GetAVIBlock(), and Record(). |
|
MMC is not selected when MMC_XCS is high.
|
|
MMC Off (MMC Power Off).
Definition at line 152 of file board.h. Referenced by InitBoard(), and InitMMC(). |
|
MMC is selected when MMC_XCS is low.
|
|
MMC Chip Select (Active Low).
|
|
Pull the VS10xx Data Chip Select line High.
Definition at line 168 of file board.h. Referenced by InitMMC(), MmcCommand(), MmcWaitForData(), ReadPhysicalSector(), SeekSector(), and WritePhysicalSector(). |
|
Pull the VS10xx Data Chip Select line Low.
Definition at line 165 of file board.h. Referenced by InitMMC(), MmcCommand(), and ReadPhysicalSector(). |
|
Data Request: Player asks for more data.
Definition at line 60 of file board.h. Referenced by GetAVIBlock(), Mp3ReadRegister(), Mp3SoftReset(), and Record(). |
|
Control Chip Select (for accessing SPI Control/Status registers).
|
|
Data Chip Select / BSYNC.
Definition at line 43 of file board.h. Referenced by GetAVIBlock(). |
|
Chip Reset.
Definition at line 25 of file board.h. Referenced by InitBoard(). |
|
Pull the VS10xx Control Chip Select line High.
Definition at line 40 of file board.h. Referenced by Mp3ReadRegister(), and Record(). |
|
Put the MP3 player chip in reset.
Definition at line 28 of file board.h. Referenced by Mp3ReadRegister(). |
|
Release the MP3 player chip from reset.
Definition at line 31 of file board.h. Referenced by Mp3ReadRegister(). |
|
Pull the VS10xx Control Chip Select line Low.
|
|
NO = 0.
Definition at line 149 of file board.h. Referenced by InitMMC(). |
|
Stop Programmable Counter Array core counter.
|
|
Stop PCA core counter and clear overflow flag.
|
|
Start Programmable Counter Array core counter.
|
|
"Public" has no code meaning but it is meant for the programmer to remember that this function is called from outside the module
Definition at line 270 of file board.h. Referenced by BuildFragmentTable(), DumpDiskSector(), FGetChar(), InitFileSystem(), InitMMC(), InitStorage(), OpenFile(), PrepareToReadDiskSector(), ReadDiskSector(), ReadPhysicalSector(), SeekSector(), and WriteDiskSector(). |
|
Red LED in multicolor LED, 0 = on, 1 = off.
Definition at line 68 of file board.h. Referenced by Record(), and VsSineTest(). |
|
RS-232 Buffer Enable.
|
|
Calculate and set Time-Until-Overflow to PCA in microseconds.
|
|
Set PCA core counter value.
|
|
SPI data return register.
Definition at line 231 of file board.h. Referenced by LoadUserPatch(), MmcCommand(), PerformBlockRead(), and SPIGetChar(). |
|
Wait for SPI ready, then initiate character sending.
Definition at line 225 of file board.h. Referenced by AvailableProcessorTime(), GetAVIBlock(), InitMMC(), and MmcCommand(). |
|
Initiate SPI character sending.
Definition at line 228 of file board.h. Referenced by GetAVIBlock(), InitMMC(), MmcCommand(), Mp3ReadRegister(), PerformBlockRead(), SPI8Clocks(), SPIGetChar(), and WritePhysicalSector(). |
|
switch to fast SPI Clock
|
|
Wait for SPI ready to send a new character (previous sent).
Definition at line 222 of file board.h. Referenced by AvailableProcessorTime(), GetAVIBlock(), InitMMC(), MmcCommand(), PerformBlockRead(), SPI8Clocks(), SPIGetChar(), and WritePhysicalSector(). |
|
Busy loop until the end of the delay time. In the delay system, the PCA core counter is used for hardware timing. First call InitiateDelay to put the counter running. Next do whatever work you can do while the delay is lasting. Lastly call WaitOutDelay to busy loop until the hardware says that the delay time has passed. This allows interrupt routines etc. to run during the delay without wasting unnecessary cycles at the delay loop.
Definition at line 211 of file board.h. Referenced by Delay(), LcdPutChar(), LcdPutCommand(), and LcdReset(). |
|
YES = 1.
Definition at line 146 of file board.h. Referenced by InitMMC(). |
|
Busy loop delay function. Creates n times 1 ms hardware delays Definition at line 35 of file board.c. References InitiateDelay, and WaitOutDelay. Referenced by InitMMC(), LcdPrintGenericResult(), LoadPatch(), MmcCommand(), Mp3ReadRegister(), RebootMMC(), and Record().
|
|
Startup initialization of the microcontroller board.
Definition at line 43 of file board.c. References InitiateDelay, MMC_OFF, and MP3_XRESET. Referenced by main().
|
|
Pull the VS10xx Data Chip Select line High.
Definition at line 92 of file board.c. References Mp3WriteRegister, and SPI_MODE. Referenced by GetAVIBlock(), and Mp3ReadRegister().
|
|
Pull the VS10xx Data Chip Select line Low.
Definition at line 87 of file board.c. References Mp3WriteRegister, and SPI_MODE. Referenced by GetAVIBlock().
|
|
Send nClocks x 8 clock transitions with MOSI=1 (0xff).
Definition at line 26 of file board.c. References SPIPutCharWithoutWaiting, and SPIWait. Referenced by MmcCommand(), MmcWaitForData(), ReadPhysicalSector(), RebootMMC(), and WritePhysicalSector().
|
|
Send 8 ones to SPI bus and receive the result byte.
Definition at line 18 of file board.c. References SPI_RESULT_BYTE, SPIPutCharWithoutWaiting, and SPIWait. Referenced by ConsoleDecipherMMCResponse(), MmcCommand(), MmcGetData(), MmcWaitForData(), and WritePhysicalSector().
|
|
Generic temp variable for non-reentrant main routines.
|