ao-tools/lib: Add loading support for 32-bit ihx files
[fw/altos] / README
1         AltOS - 8051 operating system for Altus-Metrum projects
2
3 Copyright and License
4
5         Copyright © 2009 Keith Packard <keithp@keithp.com>
6
7         This program is free software; you can redistribute it and/or modify
8         it under the terms of the GNU General Public License as published by
9         the Free Software Foundation; version 2 of the License.
10
11         This program is distributed in the hope that it will be useful, but
12         WITHOUT ANY WARRANTY; without even the implied warranty of
13         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14         General Public License for more details.
15
16         You should have received a copy of the GNU General Public License along
17         with this program; if not, write to the Free Software Foundation, Inc.,
18         59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
19
20 Tasking API:
21
22          * Multi-tasking
23          * Non-preemptive
24          * Unix-style sleep/wakeup scheduling
25          * Strict round-robin, no priorities
26
27         uint8_t ao_sleep(void *wchan)
28
29                 Puts current task to sleep. Will wake up when wchan is
30                 signalled (returning 0), or when an alarm has expired
31                 (returning 1).
32         
33         void ao_wakeup(void *wchan)
34
35                 Wakeup all tasks sleeping on wchan
36
37         void ao_add_task(struct ao_task *task, void (*start)(void))
38
39                 Adds a task to the queue of available tasks
40
41         void ao_start_scheduler(void)
42
43                 Invokes the scheduler, starting the operating system
44
45         void ao_yield(void)
46
47                 Switches to another task which is ready to run. Allows
48                 tasks which want to run for a while to give up the CPU
49                 without needing to sleep
50
51         void ao_panic(uint8_t reason)
52
53                 Any fatal error should call this function, which can
54                 display the error code in some cryptic fashion.
55
56         void ao_wake_task(struct ao_task *task)
57
58                 Wake the task as if the wchan it is waiting on had
59                 been signalled.
60
61         void ao_alarm(uint16_t delay)
62
63                 Queue an alarm to expire 'delay' ticks in the future.
64                 The alarm will cause the task to wake from ao_sleep
65                 and return 1. Alarms are cancelled if the task is
66                 awoken by ao_wakeup or ao_wake_task.
67
68         void ao_exit(void)
69
70                 Stop the current task and remove it from the list of
71                 available tasks.
72
73 Timer API
74
75          * Regular timer ticks (at 100Hz, by default)
76          * All time values are in ticks
77
78          uint16_t ao_time(void)
79
80                 Returns the curent tick count
81
82         void ao_delay(uint16_t delay)
83
84                 Suspend task execution for 'delay' ticks.
85
86 DMA API
87
88          * Static DMA entry allocation
89
90         uint8_t ao_dma_alloc(uint8_t *done)
91
92                 Allocates one of the 5 DMA units on the cc1111
93                 processor. When this DMA unit is finished, it will
94                 set *done to 1 and wakeup anyone waiting on that.
95
96         void ao_dma_set_transfer(uint8_t id, void *src, void *dst,
97                                  uint16_t count, uint8_t cfg0, uint8_t cfg1)
98
99                 Prepares the specified DMA unit for operation.
100
101         void ao_dma_start(uint8_t id)
102
103                 Start DMA on the specified channel.
104
105         void ao_dma_trigger(uint8_t id)
106
107                 Manually trigger a DMA channel
108
109         void ao_dma_abort(uint8_t id)
110
111                 Abort a pending DMA transfer, signalling
112                 that by setting the associated 'done' to
113                 AO_DMA_ABORTED and waking any task
114                 sleeping on that.