77 lines
2.3 KiB
C
77 lines
2.3 KiB
C
#include "dac_drv_if.h"
|
|
|
|
#include "nrf_log.h"
|
|
|
|
#define CTRL_B_LDAC 0x01
|
|
#define CTRL_B_CLR 0x02
|
|
#define CTRL_B_POW_CTRL 0x03
|
|
#define CTRL_B_LINEARITY 0x05
|
|
#define CTRL_B_WRT(_d0, _d1) (0x10 | ((_d1) << 1) | (_d0))
|
|
#define CTRL_B_WRT_THR(_d0, _d1) (0x30 | ((_d1) << 1) | (_d0))
|
|
|
|
#define DATA_B_LDAC(_d0, _d1) ((_d1) << 9 | (_d0) << 8)
|
|
#define DATA_B_POW_CT(_d0, _d1, _rd) ((_d1) << 9 | (_d0) << 8 | (_rd) << 7)
|
|
#define DATA_B_LINE(_en) ((_en) << 9)
|
|
#define CTRL_B_LDAC 0x01
|
|
#define CTRL_B_CLR 0x02
|
|
#define CTRL_B_POW_CTRL 0x03
|
|
#define CTRL_B_LINEARITY 0x05
|
|
#define CTRL_B_WRT(_d0, _d1) (0x10 | ((_d1) << 1) | (_d0))
|
|
#define CTRL_B_WRT_THR(_d0, _d1) (0x30 | ((_d1) << 1) | (_d0))
|
|
|
|
#define DATA_B_LDAC(_d0, _d1) ((_d1) << 9 | (_d0) << 8)
|
|
#define DATA_B_POW_CT(_d0, _d1, _rd) ((_d1) << 9 | (_d0) << 8 | (_rd) << 7)
|
|
#define DATA_B_LINE(_en) ((_en) << 9)
|
|
|
|
static int max5136_ldac_mode(uint32_t channel_mask)
|
|
{
|
|
NRF_LOG_INFO("%s() is unimplemented.", __FUNCTION__);
|
|
return 0;
|
|
}
|
|
|
|
static int max5136_clear_mode(void)
|
|
{
|
|
NRF_LOG_INFO("%s() is unimplemented.", __FUNCTION__);
|
|
return 0;
|
|
}
|
|
|
|
static int max5136_power_control_mode(uint32_t channel_mask, uint32_t ready_enable)
|
|
{
|
|
NRF_LOG_INFO("%s() is unimplemented.", __FUNCTION__);
|
|
return 0;
|
|
}
|
|
|
|
static int max5136_linearity_mode(uint32_t linear_enable)
|
|
{
|
|
NRF_LOG_INFO("%s() is unimplemented.", __FUNCTION__);
|
|
return 0;
|
|
}
|
|
|
|
static int max5136_write_mode(uint32_t channel_mask, int32_t volts)
|
|
{
|
|
NRF_LOG_INFO("%s() is unimplemented.", __FUNCTION__);
|
|
return 0;
|
|
}
|
|
|
|
static int max5136_write_through_mode(uint32_t channel_mask, int32_t volts)
|
|
{
|
|
NRF_LOG_INFO("%s() is unimplemented.", __FUNCTION__);
|
|
return 0;
|
|
}
|
|
|
|
static int max5136_init(void)
|
|
{
|
|
NRF_LOG_INFO("%s() is unimplemented.", __FUNCTION__);
|
|
return 0;
|
|
}
|
|
|
|
dac_drv_if_t max5316_drv = {
|
|
.init = max5136_init,
|
|
.ldac_mode = max5136_ldac_mode,
|
|
.clear_mode = max5136_clear_mode,
|
|
.power_control_mode = max5136_power_control_mode,
|
|
.linearity_mode = max5136_linearity_mode,
|
|
.write_mode = max5136_write_mode,
|
|
.write_through_mode = max5136_write_through_mode,
|
|
};
|