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