21 HW Processor (HWP) and Sound Output
21-8
Seiko Epson Corporation
S1C31D50/D51 TECHNICAL MANUAL
(Rev. 2.00)
Sound play commands
Table 21.4.1.1 lists the sound play function commands.
Table 21.4.1.1 List of Sound Play Commands
Command
Function
Issuable state
Transit
destination state
Sound Start
Start playback output
sp_state_idle sp_state_play
Sound Stop Immediately
Stop playback output immediately
sp_state_play,
sp_state pause,
sp_state_mute
sp_state_idle
Sound Stop after Current
Phrase
Stop playback output after ending current phrase sp_state_play,
sp_state pause,
sp_state_mute
sp_state_idle
Pause Immediately
Pause playback output immediately
sp_state_play sp_state_pause
Pause after Current Phrase
Pause playback output after ending current phrase sp_state_play sp_state_pause
Release Pause
Release pause state
sp_state_pause sp_state_play
Mute Immediately
Mute playback output immediately
sp_state_play sp_state_mute
Mute after Current Phrase
Mute playback output after ending current phrase sp_state_play sp_state_mute
Release Mute
Release mute state
sp_state_mute sp_state_play
Each sound play command can be issued in the specific states. Follow the procedure below to issue a command.
1. Confirm that the STATE_
n
.STATE[15:0] bits = issuable state.
2. Confirm that the STATUS.READY bit = 1.
(Command acceptable)
3. Configure the sound play function registers required to execute the command (if necessary).
4. Set the COMMAND_
n
.COMMAND[7:0] bits.
(Select command)
5. Write 1 to the HWPCMDTRG.HWP0TRG bit.
(Trigger to issue command)
6. Wait until the HWPINTF.HWP0IF bit is set to 1 (interrupt).
(Occurrence of state transition)
7. Confirm that the STATE_
n
.STATE[15:0] bits = transit destination state (if necessary).
Playback start/stop
Single channel playback output start procedure
The following shows a Ch.
n
playback output start procedure:
1. Confirm that the STATE_
n
.STATE[15:0] bits = 0x0001 (sp_state_idle).
2. Confirm that the STATUS.READY bit = 1.
(Command acceptable)
3. Configure the following sound play register bits:
- Set the COMMAND_
n
.COMMAND[7:0] bits to 0x01.
(Select Sound Start command)
- Set the COMMAND_
n
.OPTION[7:0] bits.
(Select gapless play option)
- SENTENCE_
n
.SENTENCE_NO[15:0] bits
(Specify sentence number)
- VOLUME_
n
.VOLUME[15:0] bits
(Specify volume level)
- REPEAT_
n
.REPEAT[15:0] bits
(Specify repeat count)
- SPEED_0.SPEED[15:0] bits
(Specify playback speed, Ch.0 only)
4. Write 1 to the HWPCMDTRG.HWP0TRG bit.
(Trigger to issue command)
5. Wait until the HWPINTF.HWP0IF bit is set to 1 (interrupt).
(Occurrence of state transition)
The HWP starts sound data output of the specified sentence number from this point.
6. Confirm that the STATE_
n
.STATE[15:0] bits = 0x0002 (sp_state_play) as necessary.
7. Write 0 to the HWPINTF.HWP0IF bit.
(Clear interrupt flag)
:
Playback is in progress.
:
8. Wait until the HWPINTF.HWP0IF bit is set to 1 (interrupt).
(Occurrence of state transition)
9. Confirm that the STATE_
n
.STATE[15:0] bits = 0x0001 (sp_state_idle) as necessary.
When the sound data ends, playback output is automatically terminated and the sound play function transits
to sp_state_idle state.