You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.1 KiB
C++
64 lines
1.1 KiB
C++
/*
|
|
* ExtDAC.h
|
|
*
|
|
* Author: Aleksey Gerasimenko
|
|
* gerasimenko.aleksey.n@gmail.com
|
|
*/
|
|
|
|
#include "PERIPHERY/PeripheryMap.h"
|
|
|
|
#include "RUDRIVEFRAMEWORK/DataType.h"
|
|
#include "RUDRIVEFRAMEWORK/SystemDefinitions.h"
|
|
|
|
#ifndef PERIPHERY_EXTDAC_H_
|
|
#define PERIPHERY_EXTDAC_H_
|
|
|
|
namespace PERIPHERY
|
|
{
|
|
|
|
|
|
struct DataDACCreator
|
|
{
|
|
int16_t offset_a;
|
|
int16_t offset_b;
|
|
int16_t offset_c;
|
|
int16_t offset_d;
|
|
int16_t channel_a;
|
|
int16_t channel_b;
|
|
int16_t channel_c;
|
|
int16_t channel_d;
|
|
DataDACCreator():
|
|
offset_a((int16_t)2048),
|
|
offset_b((int16_t)2048),
|
|
offset_c((int16_t)2048),
|
|
offset_d((int16_t)2048),
|
|
channel_a((int16_t)0),
|
|
channel_b((int16_t)0),
|
|
channel_c((int16_t)0),
|
|
channel_d((int16_t)0)
|
|
{}
|
|
};//DataDACCreator
|
|
|
|
|
|
|
|
class ExtDAC
|
|
{
|
|
private:
|
|
uint16_t *p_channel_a;
|
|
uint16_t *p_channel_b;
|
|
uint16_t *p_channel_c;
|
|
uint16_t *p_channel_d;
|
|
public:
|
|
ExtDAC();
|
|
void setup(uint16_t *memzone);
|
|
public:
|
|
void write_data(int16_t data_a, int16_t data_b, int16_t data_c, int16_t data_d);
|
|
public:
|
|
|
|
|
|
};
|
|
|
|
} /* namespace PERIPHERY */
|
|
|
|
#endif /* PERIPHERY_EXTDAC_H_ */
|