acsim_mios_h
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| acsim_mios_h [2006/08/09 11:19] – added toolbox header audiocommander | acsim_mios_h [2007/11/17 16:47] (current) – move acsim.zip to "acsim" namespace smashtv | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | This page is part of the [[mios_c_simulator_-_debugger]] | ||
| + | |||
| + | [[acsim_console_h|ACSim_console.h]]\\ | ||
| + | [[acsim_console_c|ACSim_console.c]]\\ | ||
| + | |||
| + | **[[acsim_mios_h|ACSim_mios.h]]**\\ | ||
| + | [[acsim_mios_c|ACSim_mios.c]]\\ | ||
| + | |||
| + | [[acsim_toolbox_h|ACSim_toolbox.h]]\\ | ||
| + | [[acsim_toolbox_c|ACSim_toolbox.c]]\\ | ||
| + | [[acmididefines|ACMidiDefines.h]]\\ | ||
| + | \\ | ||
| + | This code is for viewing only and may not be up to date. You can download the files in a zip file {{acsim: | ||
| + | \\ | ||
| + | \\ | ||
| + | <code c> | ||
| + | /* | ||
| + | | ||
| + | | ||
| + | * | ||
| + | | ||
| + | | ||
| + | * | ||
| + | */ | ||
| + | |||
| + | /* | ||
| + | * Released under GNU General Public License | ||
| + | * http:// | ||
| + | | ||
| + | * This program is free software; you can redistribute it and/or modify it under the terms | ||
| + | * of the GNU General Public License as published by the Free Software Foundation | ||
| + | * | ||
| + | * YOU ARE ALLOWED TO COPY AND CHANGE | ||
| + | * BUT YOU MUST RELEASE THE SOURCE TOO (UNDER GNU GPL) IF YOU RELEASE YOUR PRODUCT | ||
| + | * YOU ARE NOT ALLOWED TO USE IT WITHIN PROPRIETARY CLOSED-SOURCE PROJECTS | ||
| + | */ | ||
| + | |||
| + | |||
| + | #ifndef _ACSIM_MIOS_H | ||
| + | #define _ACSIM_MIOS_H | ||
| + | |||
| + | |||
| + | |||
| + | #import < | ||
| + | |||
| + | #import " | ||
| + | |||
| + | |||
| + | |||
| + | #define __wparam | ||
| + | #define code const | ||
| + | |||
| + | |||
| + | |||
| + | // MIOS definitions | ||
| + | #define MIOS_MIDI_INTERFACE_COMMON 0x00 | ||
| + | #define MIOS_MIDI_INTERFACE_TO_HOST 0x01 | ||
| + | |||
| + | #define MIOS_MIDI_MERGER_DISABLED 0x00 | ||
| + | #define MIOS_MIDI_MERGER_ENABLED 0x01 | ||
| + | #define MIOS_MIDI_MERGER_MBLINK_EP 0x02 | ||
| + | #define MIOS_MIDI_MERGER_MBLINK_FP 0x03 | ||
| + | |||
| + | #define MIOS_ENC_SPEED_SLOW 0x00 | ||
| + | #define MIOS_ENC_SPEED_NORMAL 0x01 | ||
| + | #define MIOS_ENC_SPEED_FAST 0x02 | ||
| + | |||
| + | #define MIOS_LCD_TYPE_CLCD 0x00 | ||
| + | #define MIOS_LCD_TYPE_GLCD0 0x01 | ||
| + | #define MIOS_LCD_TYPE_GLCD1 0x02 | ||
| + | #define MIOS_LCD_TYPE_GLCD2 0x03 | ||
| + | #define MIOS_LCD_TYPE_GLCD3 0x04 | ||
| + | #define MIOS_LCD_TYPE_GLCD4 0x05 | ||
| + | #define MIOS_LCD_TYPE_MLCD 0x06 | ||
| + | #define MIOS_LCD_TYPE_GLCD_CUSTOM 0x07 | ||
| + | |||
| + | #define MIOS_GLCD_FONT 0x28fc | ||
| + | |||
| + | |||
| + | // structures of the CFG and STAT bytes | ||
| + | typedef union { | ||
| + | struct { | ||
| + | unsigned ALL:8; | ||
| + | }; | ||
| + | struct { | ||
| + | unsigned LCD_TYPE: | ||
| + | unsigned USE_GLCD: | ||
| + | unsigned MERGER: | ||
| + | unsigned MBLINK: | ||
| + | unsigned TO_HOST: | ||
| + | unsigned FRQ_20MHz: | ||
| + | }; | ||
| + | } mios_box_cfg0_t; | ||
| + | |||
| + | typedef union { | ||
| + | struct { | ||
| + | unsigned ALL:8; | ||
| + | }; | ||
| + | struct { | ||
| + | unsigned BS_A: | ||
| + | unsigned BS_DIS_VERIFY: | ||
| + | unsigned IIC_STRETCH_CLK: | ||
| + | unsigned :1; | ||
| + | unsigned :1; | ||
| + | unsigned :1; | ||
| + | }; | ||
| + | } mios_box_cfg1_t; | ||
| + | |||
| + | typedef union { | ||
| + | struct { | ||
| + | unsigned ALL:8; | ||
| + | }; | ||
| + | struct { | ||
| + | unsigned BS_AVAILABLE: | ||
| + | unsigned MBLINK_TUNNEL_PASS: | ||
| + | unsigned SUSPEND_ALL: | ||
| + | unsigned SUSPEND_USER: | ||
| + | unsigned AUTOREPEAT: | ||
| + | unsigned MLCD_TRANSFER: | ||
| + | unsigned :1; | ||
| + | unsigned :1; | ||
| + | }; | ||
| + | } mios_box_stat_t; | ||
| + | |||
| + | // debug related structures | ||
| + | typedef union { | ||
| + | struct { | ||
| + | unsigned ALL:8; | ||
| + | }; | ||
| + | struct { | ||
| + | unsigned TIMER_ENABLED: | ||
| + | unsigned free:7; | ||
| + | }; | ||
| + | } debug_user_timer_t; | ||
| + | |||
| + | // mios tables | ||
| + | extern const unsigned char MIOS_MPROC_EVENT_TABLE[2*128]; | ||
| + | extern const unsigned char MIOS_ENC_PIN_TABLE[2*64]; | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | #pragma mark pic18f typedefs | ||
| + | // " | ||
| + | typedef union { | ||
| + | struct { | ||
| + | unsigned RC0:1; | ||
| + | unsigned RC1:1; | ||
| + | unsigned RC2:1; | ||
| + | unsigned RC3:1; | ||
| + | unsigned RC4:1; | ||
| + | unsigned RC5:1; | ||
| + | unsigned RC6:1; | ||
| + | unsigned RC7:1; | ||
| + | }; | ||
| + | struct { | ||
| + | unsigned T1OSO:1; | ||
| + | unsigned T1OSI:1; | ||
| + | unsigned :1; | ||
| + | unsigned SCK:1; | ||
| + | unsigned SDI:1; | ||
| + | unsigned SDO:1; | ||
| + | unsigned TX:1; | ||
| + | unsigned RX:1; | ||
| + | }; | ||
| + | struct { | ||
| + | unsigned T1CKI:1; | ||
| + | unsigned CCP2:1; | ||
| + | unsigned CCP1:1; | ||
| + | unsigned SCL:1; | ||
| + | unsigned SDA:1; | ||
| + | unsigned :1; | ||
| + | unsigned CK:1; | ||
| + | unsigned DT:1; | ||
| + | }; | ||
| + | } __PORTCbits_t; | ||
| + | |||
| + | typedef union { | ||
| + | struct { | ||
| + | unsigned RD0:1; | ||
| + | unsigned RD1:1; | ||
| + | unsigned RD2:1; | ||
| + | unsigned RD3:1; | ||
| + | unsigned RD4:1; | ||
| + | unsigned RD5:1; | ||
| + | unsigned RD6:1; | ||
| + | unsigned RD7:1; | ||
| + | }; | ||
| + | struct { | ||
| + | unsigned AD0:1; | ||
| + | unsigned AD1:1; | ||
| + | unsigned AD2:1; | ||
| + | unsigned AD3:1; | ||
| + | unsigned AD4:1; | ||
| + | unsigned AD5:1; | ||
| + | unsigned AD6:1; | ||
| + | unsigned AD7:1; | ||
| + | }; | ||
| + | } __PORTDbits_t; | ||
| + | |||
| + | typedef union { | ||
| + | struct { | ||
| + | unsigned RBIF:1; | ||
| + | unsigned INT0F:1; | ||
| + | unsigned T0IF:1; | ||
| + | unsigned RBIE:1; | ||
| + | unsigned INT0E:1; | ||
| + | unsigned T0IE:1; | ||
| + | unsigned PEIE:1; | ||
| + | unsigned GIE:1; | ||
| + | }; | ||
| + | } __INTCONbits_t; | ||
| + | |||
| + | |||
| + | |||
| + | #pragma mark debug typedefs | ||
| + | // bankstick | ||
| + | typedef struct { | ||
| + | unsigned char buffer[DEBUG_BANKSTICK_SIZE]; | ||
| + | } debug_bankstick_t; | ||
| + | |||
| + | |||
| + | |||
| + | #pragma mark mios globals | ||
| + | // mios globals | ||
| + | extern mios_box_stat_t MIOS_BOX_STAT; | ||
| + | // " | ||
| + | extern __PORTCbits_t PORTCbits; | ||
| + | extern __PORTDbits_t PORTDbits; | ||
| + | extern __INTCONbits_t INTCONbits; | ||
| + | // HLP | ||
| + | extern unsigned char MIOS_PARAMETER1; | ||
| + | extern unsigned char MIOS_PARAMETER2; | ||
| + | extern unsigned char MIOS_PARAMETER3; | ||
| + | |||
| + | |||
| + | #pragma mark debug globals | ||
| + | // export globals | ||
| + | extern debug_user_timer_t debug_user_timer; | ||
| + | |||
| + | extern unsigned char debug_ain_lastPin; | ||
| + | extern unsigned int debug_ain_value[32]; | ||
| + | extern unsigned char debug_din_lastPin; | ||
| + | extern unsigned char debug_din_value[32]; | ||
| + | extern unsigned int debug_enc_value[32]; | ||
| + | |||
| + | extern unsigned char debug_bankstick_ctrl; | ||
| + | extern debug_bankstick_t debug_bankstick[DEBUG_BANKSTICK_NUM]; | ||
| + | |||
| + | extern unsigned int debug_MIDI_byteNum; | ||
| + | extern unsigned int debug_IIC_byteNum; | ||
| + | |||
| + | |||
| + | #endif /* _ACSIM_MIOS_H */ | ||
| + | </ | ||
