comparison include/Utilities.h @ 303:421a69d42943 prerelease

Changed BeagleRT -> Bela in defines and thread names; some preliminary mux capelet stuff
author andrewm
date Fri, 27 May 2016 17:40:44 +0100
parents e4392164b458
children 1feb9c23ac57
comparison
equal deleted inserted replaced
302:b26e7c61e3b6 303:421a69d42943
121 * \brief Write an analog output, specifying the frame number (when to write) and the channel. 121 * \brief Write an analog output, specifying the frame number (when to write) and the channel.
122 * 122 *
123 * This function sets the value of an analog output, at the time indicated by \c frame. Valid 123 * This function sets the value of an analog output, at the time indicated by \c frame. Valid
124 * values are between 0 and 1, corresponding to the range 0 to 5V. 124 * values are between 0 and 1, corresponding to the range 0 to 5V.
125 * 125 *
126 * The value written will persist for all future frames if BEAGLERT_FLAG_ANALOG_OUTPUTS_PERSIST 126 * The value written will persist for all future frames if BELA_FLAG_ANALOG_OUTPUTS_PERSIST
127 * is set in context->flags. This is the default behaviour. 127 * is set in context->flags. This is the default behaviour.
128 * 128 *
129 * \param context The I/O data structure which is passed by Bela to render(). 129 * \param context The I/O data structure which is passed by Bela to render().
130 * \param frame Which frame (i.e. what time) to write the analog output. Valid values range 130 * \param frame Which frame (i.e. what time) to write the analog output. Valid values range
131 * from 0 to (context->analogFrames - 1). 131 * from 0 to (context->analogFrames - 1).
142 * values are between 0 and 1, corresponding to the range 0 to 5V. 142 * values are between 0 and 1, corresponding to the range 0 to 5V.
143 * 143 *
144 * Unlike analogWriteFrame(), the value written will affect \b only the frame specified, with 144 * Unlike analogWriteFrame(), the value written will affect \b only the frame specified, with
145 * future values unchanged. This is faster than analogWriteFrame() so is better suited 145 * future values unchanged. This is faster than analogWriteFrame() so is better suited
146 * to applications where every frame will be written to a different value. If 146 * to applications where every frame will be written to a different value. If
147 * BEAGLERT_FLAG_ANALOG_OUTPUTS_PERSIST is not set within context->flags, then 147 * BELA_FLAG_ANALOG_OUTPUTS_PERSIST is not set within context->flags, then
148 * analogWriteFrameOnce() and analogWriteFrame() are equivalent. 148 * analogWriteFrameOnce() and analogWriteFrame() are equivalent.
149 * 149 *
150 * \param context The I/O data structure which is passed by Bela to render(). 150 * \param context The I/O data structure which is passed by Bela to render().
151 * \param frame Which frame (i.e. what time) to write the analog output. Valid values range 151 * \param frame Which frame (i.e. what time) to write the analog output. Valid values range
152 * from 0 to (context->analogFrames - 1). 152 * from 0 to (context->analogFrames - 1).
356 // analogWriteFrame() 356 // analogWriteFrame()
357 // 357 //
358 // Sets a given analog output channel to a value for the current frame and, if persistent outputs are 358 // Sets a given analog output channel to a value for the current frame and, if persistent outputs are
359 // enabled, for all subsequent frames 359 // enabled, for all subsequent frames
360 static inline void analogWriteFrame(BelaContext *context, int frame, int channel, float value) { 360 static inline void analogWriteFrame(BelaContext *context, int frame, int channel, float value) {
361 if(context->flags & BEAGLERT_FLAG_ANALOG_OUTPUTS_PERSIST) { 361 if(context->flags & BELA_FLAG_ANALOG_OUTPUTS_PERSIST) {
362 for(unsigned int f = frame; f < context->analogFrames; f++) 362 for(unsigned int f = frame; f < context->analogFrames; f++)
363 context->analogOut[frame * context->analogChannels + channel] = value; 363 context->analogOut[frame * context->analogChannels + channel] = value;
364 } 364 }
365 else 365 else
366 context->analogOut[frame * context->analogChannels + channel] = value; 366 context->analogOut[frame * context->analogChannels + channel] = value;