1use crate::cd;
7use crate::periph::Cd;
8
9fn token() -> Cd {
11 unsafe { Cd::steal() }
14}
15
16#[deprecated(note = "moved to `psx_io::cd::PlayPosition`")]
18pub type PlayPosition = cd::PlayPosition;
19#[deprecated(note = "moved to `psx_io::cd::SectorPollError`")]
21pub type SectorPollError = cd::SectorPollError;
22
23#[deprecated(note = "moved to `psx_io::cd::try_command`")]
25#[inline(always)]
26pub fn try_command(command: u8, params: &[u8], spin_limit: u32) -> Option<cd::Response> {
27 token().try_command(command, params, spin_limit)
28}
29
30#[deprecated(note = "moved to `psx_io::cd::irq_flag_value`")]
32#[inline(always)]
33pub fn irq_flag_value() -> u8 {
34 token().irq_flag_value()
35}
36
37#[deprecated(note = "moved to `psx_io::cd::acknowledge_irq`")]
39#[inline(always)]
40pub fn acknowledge_irq(bits: u8) {
41 token().acknowledge_irq(bits)
42}
43
44#[deprecated(note = "moved to `psx_io::cd::discard_response`")]
46#[inline(always)]
47pub fn discard_response() {
48 token().discard_response()
49}
50
51#[deprecated(note = "moved to `psx_io::cd::dispatch_command`")]
53#[inline(always)]
54pub fn dispatch_command(command: u8, params: &[u8], spin_limit: u32) -> Option<u8> {
55 token().dispatch_command(command, params, spin_limit)
56}
57
58#[deprecated(note = "moved to `psx_io::cd::restore_irq_output`")]
60#[inline(always)]
61pub fn restore_irq_output(saved: u8) {
62 token().restore_irq_output(saved)
63}
64
65#[deprecated(note = "moved to `psx_io::cd::poll_data_sector`")]
67#[inline(always)]
68pub fn poll_data_sector() -> Result<bool, cd::SectorPollError> {
69 token().poll_data_sector()
70}
71
72#[deprecated(note = "renamed to `psx_io::cd::try_status`")]
74#[inline(always)]
75pub fn try_get_stat(spin_limit: u32) -> Option<cd::Response> {
76 token().try_status(spin_limit)
77}
78
79#[deprecated(note = "moved to `psx_io::cd::try_set_mode`")]
81#[inline(always)]
82pub fn try_set_mode(mode: u8, spin_limit: u32) -> Option<cd::Response> {
83 token().try_set_mode(mode, spin_limit)
84}
85
86#[deprecated(note = "renamed to `psx_io::cd::try_set_target_lba`")]
88#[inline(always)]
89pub fn try_set_loc_lba(lba: u32, spin_limit: u32) -> Option<cd::Response> {
90 token().try_set_target_lba(lba, spin_limit)
91}
92
93#[deprecated(note = "renamed to `psx_io::cd::try_unmute`")]
95#[inline(always)]
96pub fn try_demute(spin_limit: u32) -> Option<cd::Response> {
97 token().try_unmute(spin_limit)
98}
99
100#[deprecated(note = "use `Cd::try_pause` with the `Cd` token")]
102#[inline(always)]
103pub fn try_pause(spin_limit: u32) -> Option<cd::Response> {
104 token().try_pause(spin_limit)
105}
106
107#[deprecated(note = "moved to `psx_io::cd::try_pause_until_complete`")]
109#[inline(always)]
110pub fn try_pause_until_complete(spin_limit: u32) -> bool {
111 token().try_pause_until_complete(spin_limit)
112}
113
114#[deprecated(note = "moved to `psx_io::cd::bin_to_bcd`")]
116#[inline(always)]
117pub const fn bin_to_bcd(v: u8) -> u8 {
118 cd::bin_to_bcd(v)
119}
120
121#[deprecated(note = "moved to `psx_io::cd::bcd_to_bin`")]
123#[inline(always)]
124pub const fn bcd_to_bin(v: u8) -> u8 {
125 cd::bcd_to_bin(v)
126}
127
128#[deprecated(note = "renamed to `psx_io::cd::try_play_position`")]
130#[inline(always)]
131pub fn try_get_loc_p(spin_limit: u32) -> Option<cd::Response> {
132 token().try_play_position(spin_limit)
133}
134
135#[deprecated(note = "use `Cd::set_audio_mixer` with the `Cd` token")]
137#[inline(always)]
138pub fn set_audio_mixer(left_to_left: u8, left_to_right: u8, right_to_right: u8, right_to_left: u8) {
139 token().set_audio_mixer(left_to_left, left_to_right, right_to_right, right_to_left)
140}
141
142#[deprecated(note = "moved to `psx_hw::cd::BASE`")]
144pub const BASE: u32 = psx_hw::cd::BASE;
145
146#[deprecated(note = "moved to `psx_hw::cd::MODE_CDDA`")]
148pub const MODE_CDDA: u8 = psx_hw::cd::MODE_CDDA;
149
150#[deprecated(note = "moved to `psx_hw::cd::MODE_AUTO_PAUSE`")]
152pub const MODE_AUTO_PAUSE: u8 = psx_hw::cd::MODE_AUTO_PAUSE;
153
154#[deprecated(note = "moved to `psx_hw::cd::MODE_DOUBLE_SPEED`")]
156pub const MODE_DOUBLE_SPEED: u8 = psx_hw::cd::MODE_DOUBLE_SPEED;
157
158#[deprecated(note = "moved to `psx_hw::cd::CMD_SETLOC`")]
160pub const CMD_SETLOC: u8 = psx_hw::cd::CMD_SETLOC;
161
162#[deprecated(note = "moved to `psx_hw::cd::CMD_READN`")]
164pub const CMD_READN: u8 = psx_hw::cd::CMD_READN;
165
166#[deprecated(note = "moved to `psx_hw::cd::CMD_GETSTAT`")]
168pub const CMD_GETSTAT: u8 = psx_hw::cd::CMD_GETSTAT;
169
170#[deprecated(note = "moved to `psx_hw::cd::CMD_PAUSE`")]
172pub const CMD_PAUSE: u8 = psx_hw::cd::CMD_PAUSE;
173
174#[deprecated(note = "moved to `psx_hw::cd::CMD_SETMODE`")]
176pub const CMD_SETMODE: u8 = psx_hw::cd::CMD_SETMODE;
177
178#[deprecated(note = "moved to `psx_hw::cd::CMD_SEEKL`")]
180pub const CMD_SEEKL: u8 = psx_hw::cd::CMD_SEEKL;