USB-LED-Fader/firmware/pwm_channels.h
2006-09-26 18:18:27 +00:00

40 lines
1.2 KiB
C

#ifndef pwm_Channels_h
#define pwm_Channels_h
/**
* \file pwm_channels.h
* \brief Manages the values of the displayed channels.
* \author Thomas Stegemann
* \version $Id: pwm_channels.h,v 1.1 2006/09/26 18:18:27 rschaten Exp $
*
* License: See documentation.
*
* - display the specified channels for a cycle of pwm_timer
* - before using the function show, init must be called
* - for every cycle of pwm_timer, show must be called
* - show buffers the selected channels, so it returns immediatly, as long as
* the internal buffer is not full
* - when the buffer is full the function blocks until another pwm_timer cycle
* has processed the current channels
*/
#include <stdint.h>
#include "channels.h"
/** Type to contain the brightness of one channel. */
typedef uint8_t pwm_Channels_Brightness;
/** Definition of the maximum brightness. */
enum { pwm_Channels_Brightness_Max = 31 };
/** Structure to contain the state of several channels. */
typedef struct S_pwm_Channels {
pwm_Channels_Brightness channel[CHANNELS]; /**< Array of channels. */
} pwm_Channels;
void pwm_Channels_init(void);
void pwm_Channels_cleanup(void);
void pwm_Channels_show(pwm_Channels channels);
#endif