Changeset 904b1bc in mainline for uspace/drv/audio/sb16/dsp_commands.h


Ignore:
Timestamp:
2018-05-22T10:36:58Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a4eb3ba2
Parents:
4f8772d4
git-author:
Jiri Svoboda <jiri@…> (2018-05-21 17:36:30)
git-committer:
Jiri Svoboda <jiri@…> (2018-05-22 10:36:58)
Message:

Fix remaining ccheck issues.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/audio/sb16/dsp_commands.h

    r4f8772d4 r904b1bc  
    3838/** See Sound Blaster Series HW programming Guide Chapter 6. */
    3939typedef enum dsp_command {
    40         DIRECT_8B_OUTPUT = 0x10, /* Followed by unsigned byte of digital data,
    41                                   * software controls sampling rate */
    42         DIRECT_8B_INPUT = 0x20,  /* Same as DIRECT_8B_OUTPUT but for input */
    43 
    44         TRANSFER_TIME_CONSTANT = 0x40, /* Followed by time constant.
    45                                         * TC = 65536 - (256 000 000 /
    46                                         *   (channels * sampling rate))
    47                                         * Send only high byte */
    48 
    49         SINGLE_DMA_8B_OUTPUT = 0x14, /* Followed by length.high and length.low
    50                                       * starts single-cycle DMA, length is -1 */
    51         SINGLE_DMA_8B_INPUT = 0x24,  /* Same as SINGLE_DMA_8B_OUTPUT, but for
    52                                       * input */
    53         SINGLE_DMA_8B_ADPCM_2B_OUT = 0x16, /* Starts single-cycle DMA using
    54                                             * Creative ADPSM 8->2 bit compressed
    55                                             * data, Followed by length.low
    56                                             * and length.high. Length is -1 */
    57         SINGLE_DMA_8B_ADPCM_2B_OUT_REF = 0x17, /* Starts single-cycle DMA using
    58                                                 * DPSM 8->2 bit compressed data
    59                                                 * with reference byte.
    60                                                 * Followed by length.low and
    61                                                 * length.high. Length is -1 */
    62         SINGLE_DMA_8B_ADPCM_4B_OUT = 0x74, /* Same as
    63                                             * SINGLE_DMA_8B_ADPCM_2B_OUT */
    64         SINGLE_DMA_8B_ADPCM_4B_OUT_REF = 0x75, /* Same as
    65                                                 * SINGLE_DMA_8B_ADPCM_2B_OUT_REF
    66                                                 */
    67         SINGLE_DMA_8B_ADPCM_3B_OUT = 0x76, /* Same as
    68                                             * SINGLE_DMA_8B_ADPCM_2B_OUT */
    69         SINGLE_DMA_8B_ADPCM_3B_OUT_REF = 0x77, /* Same as
    70                                                 * SINGLE_DMA_8B_ADPCM_2B_OUT_REF
    71                                                 */
    72 
    73         DMA_8B_PAUSE = 0xd0, /* Stop sending DMA request,
    74                               * works for SINGLE and AUTO */
    75         DMA_8B_CONTINUE = 0xd4, /* Resume transfers paused by DMA_8B_PAUSE */
    76 
    77         SPEAKER_ON = 0xd1,  /* Connect speaker via internal amplifier,
    78                              * has no effect on 4.xx */
    79         SPEAKER_OFF = 0xd3, /* Disconnect output from the amplifier,
    80                              * has no effect on 4.xx */
    81 
    82         MIDI_POLLING = 0x30, /* Read DSP for MIDI data */
    83         MIDI_INTERRUPT = 0x31, /* Start interrupt mode, interrupt will be
    84                                 * generated when there is in-bound data.
    85                                 * To exit send again */
    86         MIDI_OUTPUT = 0x38, /* Followed by midi_data */
    87 
    88         PAUSE = 0x80, /* Followed by duration.low, duration.high. Duration is -1
    89                        * In the units of sampling period. Generates interrupt
    90                        * at the end of period */
    91         DSP_VERSION = 0xe1, /* Read 2 bytes, major and minor number */
    92 
    93         AUTO_DMA_8B_OUTPUT = 0x1c, /* Starts auto-init DMA mode using 8-bit
    94                                     * Interrupt after every block.
    95                                     * To terminate, switch to single or use
    96                                     * EXIT command*/
    97         AUTO_DMA_8B_INPUT = 0x2c, /* Same as AUTO_DMA_8B_OUTPUT, but for input*/
    98         AUTO_DMA_8B_ADPCM_2B_REF = 0x1f, /* Same as AUTO_DMA_8B_OUTPUT, but use
    99                                           * 8->2bit ADPCM audio format */
    100         AUTO_DMA_8B_ADPCM_4B_REF = 0x7d, /* Same as AUTO_DMA_8B_ADPCM_2B_REF */
    101         AUTO_DMA_8B_ADPCM_3B_REF = 0x7f, /* Same as AUTO_DMA_8B_ADPCM_2B_REF */
    102 
    103         DMA_8B_EXIT = 0xda, /* Ends DMA transfer and terminates I/O process */
    104 
    105         BLOCK_TRANSFER_SIZE = 0x48, /* Followed by size.low, size.high
    106                                      * Used with HIGH_SPEED AUTO_DMA */
    107 
    108         UART_MIDI_POLLING = 0x34, /* Start UART MIDI polling mode, read and
    109                                    * write from/to DSP is interpreted as
    110                                    * read/write from/to MIDI.
    111                                    * To exit use reset signal. Note that reset
    112                                    * will restore previous state and won't do
    113                                    * complete reset */
    114         UART_MIDI_INTERRUPT = 0x35, /* Same as UART_MIDI_POLLING, but use
    115                                      * interrupts instead of polling. */
    116         UART_MIDI_POLLING_TS = 0x36, /* Add time stamp to inbound data, the
    117                                       * order is time.low time.mid time.high
    118                                       * data */
    119         UART_MIDI_INTERRUPT_TS = 0x37, /* Same as UART_MIDI_POLLING_TS, but use
    120                                         * interrupts instead of polling */
    121 
    122         SPEAKER_STATUS = 0xd8, /* 0xff means amp is on, 0x00 means it's off */
    123 
    124         AUTO_DMA_8B_HIGH_OUTPUT = 0x90, /* DSP will generate interrupt after
    125                                          * every block. No other commands are
    126                                          * accepted in this mode. To exit
    127                                          * the mode send RESET command.
    128                                          * Note that reset will restore
    129                                          * previous state. */
    130         AUTO_DMA_8B_HIGH_INPUT = 0x98, /* Same as AUTO_DMA_8B_HIGH_OUTPUT */
    131         SINGLE_DMA_8B_HIGH_OUTPUT = 0x91, /* Transfer one block and exit,
    132                                            * generates interrupt */
    133         SINGLE_DMA_8B_HIGH_INPUT = 0x99, /* Same as SINGLE_DMA_8B_HIGH_OUTPUT */
    134 
    135         SET_MONO_INPUT = 0xa0, /* Mono mode is the default, only on 3.xx */
    136         SET_STEREO_INPUT = 0xa8, /* Switch to stereo recording, only on 3.xx */
    137 
    138         SET_SAMPLING_RATE_OUTPUT = 0x41, /* Followed by sapling rate
    139                                           * 5000 to 45000 Hz, inclusive */
    140         SET_SAMPLING_RATE_INPUT = 0x42, /* Same as SET_SAMPLING_RATE_OUTPUT */
    141 
    142         SINGLE_DMA_16B_DA = 0xb0,     /* Followed by mode, size.low, size.high*/
    143         SINGLE_DMA_16B_DA_FIFO = 0xb2,/* mode format is:                      */
    144         AUTO_DMA_16B_DA = 0xb4,       /*    0x00 - unsigned mono              */
    145         AUTO_DMA_16B_DA_FIFO = 0xb6,  /*    0x10 - signed mono                */
    146         SINGLE_DMA_16B_AD = 0xb8,     /*    0x20 - unsigned stereo            */
    147         SINGLE_DMA_16B_AD_FIFO = 0xba,/*    0x30 - signed stereo              */
    148         AUTO_DMA_16B_AD = 0xbc,       /* Size is -1. Terminate by EXIT        */
    149         AUTO_DMA_16B_AD_FIFO = 0xbe,  /* or switch to SINGLE_DMA              */
    150 
    151         SINGLE_DMA_8B_DA = 0xc0,     /* Followed by mode, size.low, size.high */
    152         SINGLE_DMA_8B_DA_FIFO = 0xc2,/* mode format is:                       */
    153         AUTO_DMA_8B_DA = 0xc4,       /*    0x00 - unsigned mono               */
    154         AUTO_DMA_8B_DA_FIFO = 0xc6,  /*    0x10 - signed mono                 */
    155         SINGLE_DMA_8B_AD = 0xc8,     /*    0x20 - unsigned stereo             */
    156         SINGLE_DMA_8B_AD_FIFO = 0xca,/*    0x30 - signed stereo               */
    157         AUTO_DMA_8B_AD = 0xcc,       /* Size is -1. Terminate by EXIT         */
    158         AUTO_DMA_8B_AD_FIFO = 0xce,  /* or switch to SINGLE_DMA               */
    159 
    160         DMA_16B_PAUSE = 0xd5,/* Stop sending DMA request, both SINGLE and AUTO*/
    161         DMA_16B_CONTINUE = 0xd6, /* Resume requests paused by DMA_16B_PAUSE */
    162         DMA_16B_EXIT = 0xd9, /* Ends DMA transfer and terminates I/O process */
     40        /*
     41         * Followed by unsigned byte of digital data,
     42         * software controls sampling rate
     43         */
     44        DIRECT_8B_OUTPUT = 0x10,
     45        /* Same as DIRECT_8B_OUTPUT but for input */
     46        DIRECT_8B_INPUT = 0x20,
     47
     48        /*
     49         * Followed by time constant.
     50         * TC = 65536 - (256 000 000 /
     51         *   (channels * sampling rate))
     52         * Send only high byte
     53         */
     54        TRANSFER_TIME_CONSTANT = 0x40,
     55
     56        /*
     57         * Followed by length.high and length.low
     58         * starts single-cycle DMA, length is -1
     59         */
     60        SINGLE_DMA_8B_OUTPUT = 0x14,
     61        /*
     62         * Same as SINGLE_DMA_8B_OUTPUT, but for
     63         * input
     64         */
     65        SINGLE_DMA_8B_INPUT = 0x24,
     66        /*
     67         * Starts single-cycle DMA using
     68         * Creative ADPSM 8->2 bit compressed
     69         * data, Followed by length.low
     70         * and length.high. Length is -1
     71         */
     72        SINGLE_DMA_8B_ADPCM_2B_OUT = 0x16,
     73        /*
     74         * Starts single-cycle DMA using
     75         * DPSM 8->2 bit compressed data
     76         * with reference byte.
     77         * Followed by length.low and
     78         * length.high. Length is -1
     79         */
     80        SINGLE_DMA_8B_ADPCM_2B_OUT_REF = 0x17,
     81        /*
     82         * Same as
     83         * SINGLE_DMA_8B_ADPCM_2B_OUT
     84         */
     85        SINGLE_DMA_8B_ADPCM_4B_OUT = 0x74,
     86        /*
     87         * Same as
     88         * SINGLE_DMA_8B_ADPCM_2B_OUT_REF
     89         */
     90        SINGLE_DMA_8B_ADPCM_4B_OUT_REF = 0x75,
     91        /*
     92         * Same as
     93         * SINGLE_DMA_8B_ADPCM_2B_OUT
     94         */
     95        SINGLE_DMA_8B_ADPCM_3B_OUT = 0x76,
     96        /*
     97         * Same as
     98         * SINGLE_DMA_8B_ADPCM_2B_OUT_REF
     99         */
     100        SINGLE_DMA_8B_ADPCM_3B_OUT_REF = 0x77,
     101        /*
     102         * Stop sending DMA request,
     103         * works for SINGLE and AUTO
     104         */
     105        DMA_8B_PAUSE = 0xd0,
     106        /* Resume transfers paused by DMA_8B_PAUSE */
     107        DMA_8B_CONTINUE = 0xd4,
     108
     109        /*
     110         * Connect speaker via internal amplifier,
     111         * has no effect on 4.xx
     112         */
     113        SPEAKER_ON = 0xd1,
     114        /*
     115         * Disconnect output from the amplifier,
     116         * has no effect on 4.xx
     117         */
     118        SPEAKER_OFF = 0xd3,
     119
     120        /* Read DSP for MIDI data */
     121        MIDI_POLLING = 0x30,
     122        /*
     123         * Start interrupt mode, interrupt will be
     124         * generated when there is in-bound data.
     125         * To exit send again
     126         */
     127        MIDI_INTERRUPT = 0x31,
     128        /* Followed by midi_data */
     129        MIDI_OUTPUT = 0x38,
     130
     131        /*
     132         * Followed by duration.low, duration.high. Duration is -1
     133         * In the units of sampling period. Generates interrupt
     134         * at the end of period
     135         */
     136        PAUSE = 0x80,
     137        /* Read 2 bytes, major and minor number */
     138        DSP_VERSION = 0xe1,
     139
     140        /*
     141         * Starts auto-init DMA mode using 8-bit
     142         * Interrupt after every block.
     143         * To terminate, switch to single or use
     144         * EXIT command
     145         */
     146        AUTO_DMA_8B_OUTPUT = 0x1c,
     147        /* Same as AUTO_DMA_8B_OUTPUT, but for input */
     148        AUTO_DMA_8B_INPUT = 0x2c,
     149        /*
     150         * Same as AUTO_DMA_8B_OUTPUT, but use
     151         * 8->2bit ADPCM audio format
     152         */
     153        AUTO_DMA_8B_ADPCM_2B_REF = 0x1f,
     154        /* Same as AUTO_DMA_8B_ADPCM_2B_REF */
     155        AUTO_DMA_8B_ADPCM_4B_REF = 0x7d,
     156        /* Same as AUTO_DMA_8B_ADPCM_2B_REF */
     157        AUTO_DMA_8B_ADPCM_3B_REF = 0x7f,
     158
     159        /* Ends DMA transfer and terminates I/O process */
     160        DMA_8B_EXIT = 0xda,
     161
     162        /*
     163         * Followed by size.low, size.high
     164         * Used with HIGH_SPEED AUTO_DMA
     165         */
     166        BLOCK_TRANSFER_SIZE = 0x48,
     167        /*
     168         * Start UART MIDI polling mode, read and
     169         * write from/to DSP is interpreted as
     170         * read/write from/to MIDI.
     171         * To exit use reset signal. Note that reset
     172         * will restore previous state and won't do
     173         * complete reset
     174         */
     175        UART_MIDI_POLLING = 0x34,
     176        /*
     177         * Same as UART_MIDI_POLLING, but use
     178         * interrupts instead of polling.
     179         */
     180        UART_MIDI_INTERRUPT = 0x35,
     181        /*
     182         * Add time stamp to inbound data, the
     183         * order is time.low time.mid time.high
     184         * data
     185         */
     186        UART_MIDI_POLLING_TS = 0x36,
     187        /*
     188         * Same as UART_MIDI_POLLING_TS, but use
     189         * interrupts instead of polling
     190         */
     191        UART_MIDI_INTERRUPT_TS = 0x37,
     192
     193        /* 0xff means amp is on, 0x00 means it's off */
     194        SPEAKER_STATUS = 0xd8,
     195
     196        /*
     197         * DSP will generate interrupt after
     198         * every block. No other commands are
     199         * accepted in this mode. To exit
     200         * the mode send RESET command.
     201         * Note that reset will restore
     202         * previous state.
     203         */
     204        AUTO_DMA_8B_HIGH_OUTPUT = 0x90,
     205        /* Same as AUTO_DMA_8B_HIGH_OUTPUT */
     206        AUTO_DMA_8B_HIGH_INPUT = 0x98,
     207        /*
     208         * Transfer one block and exit,
     209         * generates interrupt
     210         */
     211        SINGLE_DMA_8B_HIGH_OUTPUT = 0x91,
     212        /* Same as SINGLE_DMA_8B_HIGH_OUTPUT */
     213        SINGLE_DMA_8B_HIGH_INPUT = 0x99,
     214
     215        /* Mono mode is the default, only on 3.xx */
     216        SET_MONO_INPUT = 0xa0,
     217        /* Switch to stereo recording, only on 3.xx */
     218        SET_STEREO_INPUT = 0xa8,
     219
     220        /*
     221         * Followed by sapling rate
     222         * 5000 to 45000 Hz, inclusive
     223         */
     224        SET_SAMPLING_RATE_OUTPUT = 0x41,
     225        /* Same as SET_SAMPLING_RATE_OUTPUT */
     226        SET_SAMPLING_RATE_INPUT = 0x42,
     227
     228        /*
     229         * Followed by mode, size.low, size.high
     230         * mode format is:
     231         *    0x00 - unsigned mono
     232         *    0x10 - signed mono
     233         *    0x20 - unsigned stereo
     234         *    0x30 - signed stereo
     235         * Size is -1. Terminate AUTO_DMA by EXIT
     236         * or switch to SINGLE_DMA
     237         */
     238        SINGLE_DMA_16B_DA = 0xb0,
     239        SINGLE_DMA_16B_DA_FIFO = 0xb2,
     240        AUTO_DMA_16B_DA = 0xb4,
     241        AUTO_DMA_16B_DA_FIFO = 0xb6,
     242        SINGLE_DMA_16B_AD = 0xb8,
     243        SINGLE_DMA_16B_AD_FIFO = 0xba,
     244        AUTO_DMA_16B_AD = 0xbc,
     245        AUTO_DMA_16B_AD_FIFO = 0xbe,
     246
     247        /*
     248         * Followed by mode, size.low, size.high
     249         * mode format is:
     250         *    0x00 - unsigned mono
     251         *    0x10 - signed mono
     252         *    0x20 - unsigned stereo
     253         *    0x30 - signed stereo
     254         * Size is -1. Terminate AUTO_DMA by EXIT
     255         * or switch to SINGLE_DMA
     256         */
     257        SINGLE_DMA_8B_DA = 0xc0,
     258        SINGLE_DMA_8B_DA_FIFO = 0xc2,
     259        AUTO_DMA_8B_DA = 0xc4,
     260        AUTO_DMA_8B_DA_FIFO = 0xc6,
     261        SINGLE_DMA_8B_AD = 0xc8,
     262        SINGLE_DMA_8B_AD_FIFO = 0xca,
     263        AUTO_DMA_8B_AD = 0xcc,
     264        AUTO_DMA_8B_AD_FIFO = 0xce,
     265
     266        /* Stop sending DMA request, both SINGLE and AUTO */
     267        DMA_16B_PAUSE = 0xd5,
     268        /* Resume requests paused by DMA_16B_PAUSE */
     269        DMA_16B_CONTINUE = 0xd6,
     270        /* Ends DMA transfer and terminates I/O process */
     271        DMA_16B_EXIT = 0xd9,
    163272} dsp_command_t;
    164273
Note: See TracChangeset for help on using the changeset viewer.