KallistiOS  ##version##
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
vmu.h
Go to the documentation of this file.
1 /* KallistiOS ##version##
2 
3  dc/maple/vmu.h
4  Copyright (C)2000-2002 Jordan DeLong and Dan Potter
5  Copyright (C)2008 Donald Haase
6 
7 */
8 
9 /** \file dc/maple/vmu.h
10  \brief Definitions for using the VMU device.
11 
12  This file contains the definitions needed to access the Maple VMU device.
13  This includes all of the functionality of memory cards, including the
14  MAPLE_FUNC_MEMCARD, MAPLE_FUNC_LCD, and MAPLE_FUNC_CLOCK function codes.
15 
16  \author Jordan DeLong
17  \author Dan Potter
18  \author Donald Haase
19 */
20 
21 #ifndef __DC_MAPLE_VMU_H
22 #define __DC_MAPLE_VMU_H
23 
24 #include <sys/cdefs.h>
25 __BEGIN_DECLS
26 
27 #include <arch/types.h>
28 #include <dc/maple.h>
29 
30 /** \brief Make a VMU beep.
31 
32  This function sends a raw beep to a VMU, causing the speaker to emit a tone
33  noise. See http://dcemulation.org/phpBB/viewtopic.php?f=29&t=97048 for the
34  original information about beeping.
35 
36  \param dev The device to attempt to beep.
37  \param beep The tone to generate. Actual parameters unknown.
38  \retval MAPLE_EOK On success.
39  \retval MAPLE_EAGAIN If the command couldn't be sent. Try again later.
40  \retval MAPLE_ETIMEOUT If the command timed out while blocking.
41 */
42 int vmu_beep_raw(maple_device_t * dev, uint32 beep);
43 
44 /** \brief Display a 1bpp bitmap on a VMU screen.
45 
46  This function sends a raw bitmap to a VMU to display on its screen. This
47  bitmap is 1bpp, and is 48x32 in size.
48 
49  \param dev The device to draw to.
50  \param bitmap The bitmap to show.
51  \retval MAPLE_EOK On success.
52  \retval MAPLE_EAGAIN If the command couldn't be sent. Try again later.
53  \retval MAPLE_ETIMEOUT If the command timed out while blocking.
54 */
55 int vmu_draw_lcd(maple_device_t * dev, void *bitmap);
56 
57 /** \brief Read a block from a memory card.
58 
59  This function reads a raw block from a memory card. You most likely will not
60  ever use this directly, but rather will probably use the fs_vmu stuff.
61 
62  \param dev The device to read from.
63  \param blocknum The block number to read.
64  \param buffer The buffer to read into (512 bytes).
65  \retval MAPLE_EOK On success.
66  \retval MAPLE_ETIMEOUT If the command timed out while blocking.
67  \retval MAPLE_EFAIL On errors other than timeout.
68 */
69 int vmu_block_read(maple_device_t * dev, uint16 blocknum, uint8 *buffer);
70 
71 /** \brief Write a block to a memory card.
72 
73  This function writes a raw block to a memory card. You most likely will not
74  ever use this directly, but rather will probably use the fs_vmu stuff.
75 
76  \param dev The device to write to.
77  \param blocknum The block number to write.
78  \param buffer The buffer to write from (512 bytes).
79  \retval MAPLE_EOK On success.
80  \retval MAPLE_ETIMEOUT If the command timed out while blocking.
81  \retval MAPLE_EFAIL On errors other than timeout.
82 */
83 int vmu_block_write(maple_device_t * dev, uint16 blocknum, uint8 *buffer);
84 
85 /** \brief Set a Xwindows XBM on all VMUs.
86 
87  This function takes in a Xwindows XBM and sets the image on all VMUs. This
88  is a convenience function for vmu_draw_lcd() to broadcast across all VMUs.
89 
90  \param vmu_icon The icon to set.
91 */
92 void vmu_set_icon(const char *vmu_icon);
93 
94 /* \cond */
95 /* Init / Shutdown */
96 int vmu_init();
97 void vmu_shutdown();
98 /* \endcond */
99 
100 __END_DECLS
101 
102 #endif /* __DC_MAPLE_VMU_H */
103 
Common integer types.
void vmu_set_icon(const char *vmu_icon)
Set a Xwindows XBM on all VMUs.
One maple device.
Definition: maple.h:237
Maple Bus driver interface.
unsigned short uint16
16-bit unsigned integer
Definition: types.h:29
unsigned long uint32
32-bit unsigned integer
Definition: types.h:28
int vmu_block_read(maple_device_t *dev, uint16 blocknum, uint8 *buffer)
Read a block from a memory card.
unsigned char uint8
8-bit unsigned integer
Definition: types.h:30
int vmu_beep_raw(maple_device_t *dev, uint32 beep)
Make a VMU beep.
int vmu_block_write(maple_device_t *dev, uint16 blocknum, uint8 *buffer)
Write a block to a memory card.
int vmu_draw_lcd(maple_device_t *dev, void *bitmap)
Display a 1bpp bitmap on a VMU screen.