Difference between revisions of "Minimig Board v1.0 mcu firmware"
Jump to navigation
Jump to search
(MCU firmware overview) |
(→main.c) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | ata18.c | + | == ata18.c == |
:Read single block (with block-size set by CMD16 to 512 by default) | :Read single block (with block-size set by CMD16 to 512 by default) | ||
::AtaReadSector( lba, ReadData ) | ::AtaReadSector( lba, ReadData ) | ||
− | :Write: 512 Byte-Mode, this will not work (read MMC and SD-card specs) with any | + | :Write: 512 Byte-Mode, this will not work (read MMC and SD-card specs) with any other sector/block size then 512 |
− | other sector/block size then 512 | ||
::AtaWriteSector( lba, WriteData ) | ::AtaWriteSector( lba, WriteData ) | ||
− | fat1618_2.c | + | == fat1618_2.c == |
:Card present check. If present check valid FAT16 primary partition. | :Card present check. If present check valid FAT16 primary partition. | ||
::FindDrive2() | ::FindDrive2() | ||
Line 16: | Line 15: | ||
::FileRead2(file) | ::FileRead2(file) | ||
− | hardware.c | + | == hardware.c == |
:Disable A/D, Setup ports, Serial 115200 bps | :Disable A/D, Setup ports, Serial 115200 bps | ||
::HardwareInit() | ::HardwareInit() | ||
Line 24: | Line 23: | ||
::ShiftFpga(data) | ::ShiftFpga(data) | ||
− | main.c | + | == main.c == |
− | + | directory[] filled with filenames from the SD/MMC flashcard.<br> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | osd.c | + | PIC Hardware init.<br> |
+ | SD-Card init.<br> | ||
+ | Check for FAT16 card present.<br> | ||
+ | Configure FPGA.<br> | ||
+ | Load kickstart.<br> | ||
+ | Continously check for FPGA commands and run them. | ||
+ | :main() | ||
+ | User interface. Controlled via up, down, select, menu commands received from OsdGetCtrl() | ||
+ | :User() | ||
+ | Insert floppy image pointed to to by global <file> into <drive> | ||
+ | :InsertFloppy( drive ) | ||
+ | Commands::Get track status, Read track, Write track | ||
+ | :HandleFpgaCmd(c1,c2) | ||
+ | Transfer rom image from MMC to FPGA | ||
+ | :ReadRom() | ||
+ | Read track to FPGA. | ||
+ | :ReadTrack(drive) | ||
+ | Write track from FPGA. | ||
+ | :WriteTrack(drive) | ||
+ | Open a file | ||
+ | :Open(name) | ||
+ | Send sector data to FPGA. Translates into Amiga floppy format sector. No insertion of clock bits. | ||
+ | :SectorToFpga(sector,track) | ||
+ | |||
+ | == osd.c == | ||
:Write string to OSD | :Write string to OSD | ||
::OsdWrite(n,s) | ::OsdWrite(n,s) |
Latest revision as of 06:23, 24 August 2007
Contents
ata18.c
- Read single block (with block-size set by CMD16 to 512 by default)
- AtaReadSector( lba, ReadData )
- Write: 512 Byte-Mode, this will not work (read MMC and SD-card specs) with any other sector/block size then 512
- AtaWriteSector( lba, WriteData )
fat1618_2.c
- Card present check. If present check valid FAT16 primary partition.
- FindDrive2()
- Scan directory
- FileSearch2(file, mode)
- Point to next sector in file
- FileNextSector2(file)
- Read sector into buffer
- FileRead2(file)
hardware.c
- Disable A/D, Setup ports, Serial 115200 bps
- HardwareInit()
- Send SPI?
- SPI(byte)
- Send byte to FPGA configuration
- ShiftFpga(data)
main.c
directory[] filled with filenames from the SD/MMC flashcard.
PIC Hardware init.
SD-Card init.
Check for FAT16 card present.
Configure FPGA.
Load kickstart.
Continously check for FPGA commands and run them.
- main()
User interface. Controlled via up, down, select, menu commands received from OsdGetCtrl()
- User()
Insert floppy image pointed to to by global <file> into <drive>
- InsertFloppy( drive )
Commands::Get track status, Read track, Write track
- HandleFpgaCmd(c1,c2)
Transfer rom image from MMC to FPGA
- ReadRom()
Read track to FPGA.
- ReadTrack(drive)
Write track from FPGA.
- WriteTrack(drive)
Open a file
- Open(name)
Send sector data to FPGA. Translates into Amiga floppy format sector. No insertion of clock bits.
- SectorToFpga(sector,track)
osd.c
- Write string to OSD
- OsdWrite(n,s)
- Clear buffer
- OsdClear()
- Enable OSD
- OsdEnable()
- Disable OSD
- OsdDisable()
- Get key
- OsdGetCtrl()