Mercurial > hg > beaglert
comparison include/Utilities.h @ 68:59edd5780fef
Changed d-box code to run cleanly when built on board. Updated Makefile to add ne10 include path on board. Some extra docs in Utilities.h
author | andrewm |
---|---|
date | Fri, 17 Jul 2015 16:57:08 +0100 |
parents | 74a44c3d91f0 |
children | d837fb676977 |
comparison
equal
deleted
inserted
replaced
67:472e892c6e41 | 68:59edd5780fef |
---|---|
30 #if 1 | 30 #if 1 |
31 // Note: pinMode(), analogWrite() and digitalWrite() should be able to be called from setup() | 31 // Note: pinMode(), analogWrite() and digitalWrite() should be able to be called from setup() |
32 // Likewise, thread launch should be able to be called from setup() | 32 // Likewise, thread launch should be able to be called from setup() |
33 // Also, make volume change functions callable from render() thread -- as an aux task? | 33 // Also, make volume change functions callable from render() thread -- as an aux task? |
34 | 34 |
35 /** | |
36 * \brief Read an analog input, specifying the frame number (when to read) and the channel. | |
37 * | |
38 * This function returns the value of an analog input, at the time indicated by \c frame. | |
39 * The returned value ranges from 0 to 1, corresponding to a voltage range of 0 to 4.096V. | |
40 * | |
41 * \param context The I/O data structure which is passed by BeagleRT to render(). | |
42 * \param frame Which frame (i.e. what time) to read the analog input. Valid values range | |
43 * from 0 to (context->analogFrames - 1). | |
44 * \param channel Which analog input to read. Valid values are between 0 and | |
45 * (context->analogChannels - 1), typically 0 to 7 by default. | |
46 * \return Value of the analog input, range 0 to 1. | |
47 */ | |
35 float analogReadFrame(BeagleRTContext *context, int frame, int channel); | 48 float analogReadFrame(BeagleRTContext *context, int frame, int channel); |
49 | |
50 /** | |
51 * \brief Write an analog output, specifying the frame number (when to write) and the channel. | |
52 * | |
53 * This function sets the value of an analog output, at the time indicated by \c frame. Valid | |
54 * values are between 0 and 1, corresponding to the range 0 to 5V. | |
55 * | |
56 * The value written will persist for all future frames if BEAGLERT_FLAG_ANALOG_OUTPUTS_PERSIST | |
57 * is set in context->flags. This is the default behaviour. | |
58 * | |
59 * \param context The I/O data structure which is passed by BeagleRT to render(). | |
60 * \param frame Which frame (i.e. what time) to write the analog output. Valid values range | |
61 * from 0 to (context->analogFrames - 1). | |
62 * \param channel Which analog output to write. Valid values are between 0 and | |
63 * (context->analogChannels - 1), typically 0 to 7 by default. | |
64 * \param value Value to write to the output, range 0 to 1. | |
65 */ | |
36 void analogWriteFrame(BeagleRTContext *context, int frame, int channel, float value); | 66 void analogWriteFrame(BeagleRTContext *context, int frame, int channel, float value); |
67 | |
68 /** | |
69 * \brief Write an analog output, specifying the frame number (when to write) and the channel. | |
70 * | |
71 * This function sets the value of an analog output, at the time indicated by \c frame. Valid | |
72 * values are between 0 and 1, corresponding to the range 0 to 5V. | |
73 * | |
74 * Unlike analogWriteFrame(), the value written will affect \b only the frame specified, with | |
75 * future values unchanged. This is more efficient than analogWriteFrame() so is better suited | |
76 * to applications where every frame will be written to a different value. If | |
77 * BEAGLERT_FLAG_ANALOG_OUTPUTS_PERSIST is not set within context->flags, then | |
78 * analogWriteFrameOnce() and analogWriteFrame() are equivalent. | |
79 * | |
80 * \param context The I/O data structure which is passed by BeagleRT to render(). | |
81 * \param frame Which frame (i.e. what time) to write the analog output. Valid values range | |
82 * from 0 to (context->analogFrames - 1). | |
83 * \param channel Which analog output to write. Valid values are between 0 and | |
84 * (context->analogChannels - 1), typically 0 to 7 by default. | |
85 * \param value Value to write to the output, range 0 to 1. | |
86 */ | |
37 void analogWriteFrameOnce(BeagleRTContext *context, int frame, int channel, float value); | 87 void analogWriteFrameOnce(BeagleRTContext *context, int frame, int channel, float value); |
38 | 88 |
39 int digitalReadFrame(BeagleRTContext *context, int frame, int channel); | 89 int digitalReadFrame(BeagleRTContext *context, int frame, int channel); |
40 void digitalWriteFrame(BeagleRTContext *context, int frame, int channel, int value); | 90 void digitalWriteFrame(BeagleRTContext *context, int frame, int channel, int value); |
41 void digitalWriteFrameOnce(BeagleRTContext *context, int frame, int channel, int value); | 91 void digitalWriteFrameOnce(BeagleRTContext *context, int frame, int channel, int value); |