firmware of NBCTRLV1 / AYC01

Dependencies:   SDFileSystemEx mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers nlg_mini.h Source File

nlg_mini.h

00001 //
00002 // nlg_mini.h
00003 //
00004 
00005 #ifndef __NLG_MINI_H__
00006 #define __NLG_MINI_H__
00007 
00008 #define CMD_PSG  0x00
00009 #define CMD_OPM  0x01
00010 #define CMD_OPM2 0x02
00011 #define CMD_FM1  0x01
00012 #define CMD_FM2  0x02
00013 
00014 
00015 #define CMD_IRQ  0x80
00016 
00017 #define CMD_CTC0 0x81
00018 #define CMD_CTC3 0x82
00019 
00020 #define NLG_VER (110)
00021 #define NLG_BASECLK (4000000)
00022 
00023 #define NLG_OK (0)
00024 #define NLG_FILEERR (-1)
00025 #define NLG_UNK_FORMAT (-2)
00026 
00027 
00028 /* NLGを処理するための構造体 */
00029 typedef struct
00030 {
00031   FILE *fp;
00032 
00033   int version;
00034 
00035   int baseclk;
00036   int tick;
00037   int tick_us;
00038 
00039   int length;
00040 
00041   int ctc0;
00042   int ctc3;
00043 
00044 } NLG_CTX;
00045 
00046 int OpenNLG(NLG_CTX *np, const char *filename);
00047 void CloseNLG(NLG_CTX *np);
00048 int ReadNLG(NLG_CTX *np);
00049 long TellNLG(NLG_CTX *np);
00050 void SeekNLG(NLG_CTX *np, long pos);
00051 int GetTickUsNLG(NLG_CTX *np);
00052 void SetCTC0_NLG(NLG_CTX *np, int value);
00053 void SetCTC3_NLG(NLG_CTX *np, int value);
00054 int GetLengthNLG(NLG_CTX *np);
00055 int GetBaseClkNLG(NLG_CTX *np);
00056 
00057 #endif