summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorRobert Hak <adiamas@rockbox.org>2002-08-21 11:02:36 +0000
committerRobert Hak <adiamas@rockbox.org>2002-08-21 11:02:36 +0000
commite532316e92a2afdf6b6f85a22adbc58859c3c55c (patch)
tree99b740cd9ce1575b8f7b4bc535f4aff6af78ba58 /firmware
parent71f2567f106103a90820c15a9b609ac684b25e02 (diff)
downloadrockbox-e532316e92a2afdf6b6f85a22adbc58859c3c55c.tar.gz
rockbox-e532316e92a2afdf6b6f85a22adbc58859c3c55c.zip
moved these files to /docs
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1867 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/API276
-rw-r--r--firmware/CONFIG25
-rw-r--r--firmware/CONTRIBUTING42
-rw-r--r--firmware/CREDITS36
4 files changed, 0 insertions, 379 deletions
diff --git a/firmware/API b/firmware/API
deleted file mode 100644
index dfa6690260..0000000000
--- a/firmware/API
+++ /dev/null
@@ -1,276 +0,0 @@
1$Id$
2 __________ __ ___.
3 Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 \/ \/ \/ \/ \/
8
9 API summmary
10
11[ This is still pretty rough and basic. Extend! ]
12
13LCD
14
15 #include <lcd.h>
16
17 Generic
18
19 Most LCD functions are specific for which output we work with, due to the
20 huge differences.
21
22 lcd_init() - init the LCD stuff
23 lcd_clear_display() - clear the whole display
24 lcd_backlight(on) - set backlight on/off
25 lcd_puts(x,y,string) write a string at given character position
26
27 Recorder
28
29 All the functions operate on a display buffer. You make the buffer get
30 shown on screen by calling lcd_update().
31
32 lcd_update() update the LCD according to the internal buffer.
33
34
35 lcd_update_rect(int x, int y, int height, int width)
36
37 Update the given rectangle to the LCD. Give arguments measured in
38 pixels. Notice that the smallest vertical resolution in updates that the
39 hardware supports is even 8 pixels. This function will adjust to those.
40
41 lcd_setfont(int font) set default font
42 lcd_setmargins(int x, int y) set top/left margins
43 lcd_putsxy(x,y,string,font) put a string at given position, using a
44 specific font
45 lcd_bitmap(src,x,y,width,height,clear) put a bitmap at given position
46 lcd_clearrect(x,y,width,height) clear a rectangle area
47 lcd_fillrect(x,y,width,height) fill a rectangle area
48 lcd_drawrect(x,y,width,height) draw a rectangle
49 lcd_invertrect(x,y,width,height) revert the graphics of the given area
50 lcd_drawline(x1,y1,x2,y2) draw a line between the coordinates
51 lcd_drawpixel(x,y) put a pixel on the given coordinate
52 lcd_clearpixel(x,y) clear the pixel at the given coordinate
53 lcd_fontsize(font,width,height) return the width and height of the font
54
55 Player
56
57 lcd_define_pattern(which,pattern,lenth) define a custom pattern
58
59Buttons
60
61 #include <button.h>
62
63 These functions work the same regardless of which keypad you have, but they
64 return a different set of values. Note that the Recorder keypad has 10
65 keys, while the Player keypad only features 6.
66
67 int button_get(bool block)
68
69 Returns a bitmask for which keys were pressed. If 'block' is set TRUE it
70 won't return until a key is pressed.
71
72Files
73
74 (These functions are POSIX look-alikes)
75
76 #include <file.h>
77
78 int open(const char *path, int oflag);
79
80 The open() function establishes the connection between a file and a file
81 descriptor. It creates an open file descrip- tion that refers to a file
82 and a file descriptor that refers to that open file description. The file
83 descriptor is used by other I/O functions to refer to that file.
84
85 int read(int fildes, void *buf, size_t nbyte);
86
87 The read() function attempts to read nbyte bytes from the file associated
88 with the open file descriptor, fildes, into the buffer pointed to by buf.
89
90 int lseek(int fildes, off_t offset, int whence);
91
92 The lseek() function sets the file pointer associated with the open file
93 descriptor specified by fildes as follows:
94
95 o If whence is SEEK_SET, the pointer is set to offset
96 bytes.
97
98 o If whence is SEEK_CUR, the pointer is set to its
99 current location plus offset.
100
101 o If whence is SEEK_END, the pointer is set to the size
102 of the file plus offset.
103
104 int write(int fildes, const void *buf, size_t nbyte);
105
106 NOT CURRENTLY SUPPORTED.
107
108 write writes up to count bytes to the file referenced by the file
109 descriptor fd from the buffer starting at buf.
110
111 int close(int fildes);
112
113 The close() function will deallocate the file descriptor indicated by
114 fildes. To deallocate means to make the file descriptor available for
115 return by subsequent calls to open(2) or other functions that allocate
116 file descriptors.
117
118 int rename(const char *old, const char *new);
119
120 NOT CURRENTLY SUPPORTED.
121
122 The rename() function changes the name of a file. The old argument points
123 to the pathname of the file to be renamed. The new argument points to the
124 new pathname of the file.
125
126 int remove(const char *pathname);
127
128 NOT CURRENTLY SUPPORTED.
129
130 remove deletes a name from the filesystem. It calls unlink for files,
131 and rmdir for directories.
132
133
134Directories
135
136 #include <dir.h>
137
138 DIR *opendir(const char *name);
139
140 The opendir() function opens a directory stream corresponding to the
141 directory name, and returns a pointer to the directory stream. The
142 stream is positioned at the first entry in the directory.
143
144 struct dirent *readdir(DIR *dir);
145
146 The readdir() function returns a pointer to a dirent structure
147 representing the next directory entry in the directory stream pointed to
148 by dir. It returns NULL on reaching the end-of-file or if an error
149 occurred.
150
151 Add a description of the struct here.
152
153 int closedir(DIR *dir);
154
155 The closedir() function closes the directory stream associated with dir.
156 The directory stream descriptor dir is not available after this call.
157
158
159String/Memory
160
161 #include <string.h>
162
163 strcmp()
164 strcpy()
165 memcpy()
166 memset()
167 ...
168
169Memory allocation
170
171 #include <dmalloc.h>
172
173 void *malloc(size_t size);
174
175 malloc() allocates size bytes and returns a pointer to the allocated
176 memory. The memory is not cleared.
177
178 void free(void *ptr);
179
180 free() frees the memory space pointed to by ptr, which must have been
181 returned by a previous call to malloc(), calloc() or realloc().
182 Otherwise, or if free(ptr) has already been called before, undefined
183 behaviour occurs.
184
185 void *realloc(void *ptr, size_t size);
186
187 realloc() changes the size of the memory block pointed to by ptr to size
188 bytes. The contents will be unchanged to the minimum of the old and new
189 sizes; newly allocated memory will be uninitialized. If ptr is NULL, the
190 call is equivalent to malloc(size); if size is equal to zero, the call is
191 equivalent to free(ptr). Unless ptr is NULL, it must have been returned
192 by an earlier call to malloc(), calloc() or realloc().
193
194 void *calloc(size_t nmemb, size_t size);
195
196 calloc() allocates memory for an array of nmemb elements of size bytes
197 each and returns a pointer to the allocated memory. The memory is set to
198 zero.
199
200ID3
201
202 #include <id3.h>
203 bool mp3info(mp3entry *entry, char *filename);
204
205 Return FALSE if successful. The given mp3entry is then filled in with
206 whatever id3 info it could find about the given file.
207
208Various
209
210 #include <kernel.h>
211
212 void kernel_init(void)
213
214 Inits the kernel and starts the tick interrupt
215
216 void sleep(ticks)
217
218 Sleep a specified number of ticks, we have HZ ticks per second.
219
220 void yield(void)
221
222 Let another thread run. This should be used as soon as you have to "wait"
223 for something or similar, and also if you do anything that takes "a long
224 time". This function is the entire foundation that our "cooperative
225 multitasking" is based on. Use it.
226
227 int set_irq_level(int level)
228
229 Sets the interrupt level (0 = lowest, 15 = highest) and returns the
230 previous level.
231
232 void queue_init(struct event_queue *q)
233
234 Initialize an event queue. The maximum number of events in a queue is
235 QUEUE_LENGTH-1.
236
237 void queue_wait(struct event_queue *q, struct event *ev)
238
239 Receive an event in a queue, blocking the thread if the queue is empty.
240
241 void queue_post(struct event_queue *q, int id, void *data)
242
243 Post an event to a queue.
244 NOTE: Negative event ID's are for system use only!!!
245
246 bool queue_empty(struct event_queue* q)
247
248 Returns true if the queue is empty.
249
250 int queue_broadcast(int id, void *data)
251
252 Posts an event in all queues that has been initiated with queue_init().
253 Returns the number of queues that were posted to.
254
255 int tick_add_task(void (*f)(void))
256
257 Add a task to the tick task queue. The argument is a pointer to a
258 function that will be called every tick interrupt.
259 At most MAX_NUM_TICK_TASKS can be active at the same time.
260
261 int tick_remove_task(void (*f)(void))
262
263 Remove a task from the task queue.
264
265 void mutex_init(struct mutex *m)
266
267 Initialize a mutex.
268
269 void mutex_lock(struct mutex *m)
270
271 Lock a mutex. This will block the thread if the mutex is already locked.
272 Note that you will geta deadlock if you lock the mutex twice!
273
274void mutex_unlock(struct mutex *m)
275
276 Unlock a mutex.
diff --git a/firmware/CONFIG b/firmware/CONFIG
deleted file mode 100644
index 3e38f9bad9..0000000000
--- a/firmware/CONFIG
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 * Config template file. Contains and describes all possibile config
3 * items. Don't actually use this file, this is plain documentation.
4 */
5
6/* define this if you have recording possibility */
7#define HAVE_RECORDING 1
8
9/* define this if you have a bitmap LCD display */
10#define HAVE_LCD_BITMAP 1
11
12/* define this if you have a charcell LCD display */
13#define HAVE_LCD_CHARCELLS 1
14
15/* define this if you have a post-4.50 charcell LCD display */
16#define HAVE_NEW_CHARCELL_LCD 1
17
18/* define this if you have the Recorder's 10-key keyboard */
19#define HAVE_RECORDER_KEYPAD 1
20
21/* define this if you have the Player's keyboard */
22#define HAVE_PLAYER_KEYPAD 1
23
24/* define this if you compile a simulator (no actual HW) */
25#define SIMULATOR 1
diff --git a/firmware/CONTRIBUTING b/firmware/CONTRIBUTING
deleted file mode 100644
index dce0227d25..0000000000
--- a/firmware/CONTRIBUTING
+++ /dev/null
@@ -1,42 +0,0 @@
1$Id$
2
3In order for the project to run as smoothly as possible, it's best if all
4contributors adhere to a few simple conventions:
5
6Language
7--------
8Write all code in C. Sometimes assembly is faster, but C is always more
9readable and maintainable.
10
11Language features
12-----------------
13Write normal C code. Don't redefine the language. No new types (structs are
14structs, not typedefs), no C++isms or Javaisms. Also, avoid using "const".
15
16Names
17-----
18Variables and function names should be all lower case.
19Preprocessor symbols should be all uppercase.
20
21Style
22-----
23When changing code, follow the code style of the file you are editing.
24
25When writing new files, you may use the brace placement style of your choice.
26
27Always indent your code with four spaces. Don't use TAB characters, as that
28will mess up code display in CVS, printing, and a zillion other places.
29
30Keep lines below 80 columns length. Use whitespace and newlines to make the
31code easy to browse/read.
32
33Text format
34-----------
35Use "unix style" line feeds: "LF" only. Do not use "CR+LF".
36
37Patches
38-------
39Create a patch using 'cvs diff -ub'. Trim your patches so they only contain
40relevant changes.
41Submit all patches to the mailing list. Put [PATCH] first on the subject line
42of your mail. If the patch is very large (>50k), gzip it before you send it.
diff --git a/firmware/CREDITS b/firmware/CREDITS
deleted file mode 100644
index 316f334907..0000000000
--- a/firmware/CREDITS
+++ /dev/null
@@ -1,36 +0,0 @@
1People that have contributed to the project, one way or another. Friends!
2
3Björn Stenberg Originator, project manager, code
4Linus Nielsen Feltzing Electronics, code
5Andy Choi Checksums
6Andrew Jamieson Schematics, electronics
7Paul Suade Serial port setup
8Joachim Schiffer Schematics, electronics
9Daniel Stenberg Code
10Alan Korr Code
11Gary Czvitkovicz Code
12Stuart Martin Code
13Felix Arends Code
14Ulf Ralberg Thread embryo
15David Härdeman Initial ID3 code
16Thomas Saeys Logo
17Grant Wier Code
18Julien Labruyére Donated Archos Player
19Nicolas Sauzede Display research
20Robert Hak Code, documentation, sarcasm
21Dave Chapman Code
22Stefan Meyer Code
23Eric Linenberg Code
24Tom Cvitan Web design
25Magnus Öman Font
26Jerome Kuptz Code
27Julien Boissinot Code, Sound research
28Nuutti Kotivuori Code
29Heikki Hannikainen Code
30Hardeep Sidhu Code
31Markus Braun Code
32Justin Heiner Code
33Magnus Holmgren Code
34Bill Napier Build fixes
35George Styles Code
36Mats Lidell Code \ No newline at end of file