123

Dependencies:   mbed

Fork of LG by igor Apu

DeviceDither.h

Committer:
Diletant
Date:
2016-05-09
Revision:
156:e68ee0bcdcda
Parent:
149:abbf7663d27d
Child:
161:efd949e8d536

File content as of revision 156:e68ee0bcdcda:

#ifndef __DEVICE_DITHER_H__
#define __DEVICE_DITHER_H__

typedef struct _DeviceDitherSettings {
  uint32_t rise;
  uint32_t fall;
  uint8_t enabled;  //dither on/off
} DeviceDitherSettings;

typedef struct _DeviceDitherState {
  uint32_t counter; //10 mks resolution counter, zeroed at each dither half period
  uint32_t rise;    //rising edge position in 10 mks resolution ticks
  uint32_t fall;    //falling edge position in 10 mks resolution ticks
  uint8_t enabled;  //dither on/off
  uint8_t pin1;     //pin 1 state
  uint8_t pin2;     //pin 2 state
} DeviceDitherState;

typedef struct _DeviceDither {
  DeviceDitherSettings settings;
  DeviceDitherState state;
} DeviceDither;

void InitDitherWithDefaults(void);
void InitDither(void);
void DeviceStartDither(void);
void DeviceDitherCycle(void);

#endif  /* __DEVICE_DITHER_H__ */