[update] DAC_modulized function ok

This commit is contained in:
JayC319
2022-07-14 18:11:22 +08:00
parent 9bfc251029
commit c8aeabdfeb
3 changed files with 5 additions and 22 deletions
@@ -41,7 +41,7 @@ int dac_write_mode(uint8_t dac0_enable, uint8_t dac1_enable, uint16_t volts);
int dac_write_through_mode(uint8_t dac0_enable, uint8_t dac1_enable, uint16_t volts);
#ifdef __cpluscplus
#ifdef __cplusplus
}
#endif
#endif //DAC_MAX5136_H
@@ -4,9 +4,9 @@
#define VERSION_DATE_YEAR 22
#define VERSION_DATE_MONTH 7
#define VERSION_DATE_DAY 13
#define VERSION_DATE_HOUR 15
#define VERSION_DATE_MINUTE 45
#define VERSION_DATE_DAY 14
#define VERSION_DATE_HOUR 18
#define VERSION_DATE_MINUTE 11
// this is NOT the version hash !!
// it's the last version hash
@@ -437,7 +437,7 @@ characteristic change event
EliteZM_pulsefly 0,2,1,7
**************************/
// product information
#define DEVICE_NAME "Elite-NTU"
#define DEVICE_NAME "Elite-EDC"
#define MAJOR_PRODUCT_NUMBER 0 // 0:Elite, 1:Neulive
#define MINOR_PRODUCT_NUMBER 2 // 1:Elite_legacy(Ori_Neulive) 2:Elite_zm 3:Elite_bat
#define MAJOR_VERSION_NUMBER 1
@@ -1385,7 +1385,6 @@ static void update_ZM_instruction(uint8 *ins) {
break;
}
case 0x61: {
dac_ldac_mode(ins[4], ins[5]);
break;
@@ -1412,28 +1411,12 @@ static void update_ZM_instruction(uint8 *ins) {
break;
}
case 0x66: {
uint16_t volts = (uint16_t)ins[6] << 8 | ins[7];
dac_write_through_mode(ins[4], ins[5], volts);
break;
}
case 0x67: { //0x3000FF 67 33 FFFF
uint8_t tx[250] = {0};
uint8_t rx[250] = {0};
memcpy(tx, &ins[4], 3);
PIN15_setOutputValue(E_PIN_CS_DAC, 0); // E_PIN_CS_DAC LOW
spi1_write(rx, tx, 3);
PIN15_setOutputValue(E_PIN_CS_DAC, 1); // E_PIN_CS_DAC HIGH
break;
}
}
break;
}