Skip to content
Open
12 changes: 7 additions & 5 deletions scm_v3c/scm3c_hw_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1597,27 +1597,29 @@ void enable_1mhz_ble_ASC() {
void disable_1mhz_ble_ASC() {
scm3c_hw_interface_vars.ASC[32] |= 0x00060000;
}

void set_PA_supply(unsigned int code) {
// 7-bit setting (between 0 and 127)
// MSB is a "panic" bit that engages the high-voltage settings
unsigned int code_ASC = ((~code)&0x0000007F) << 13;
scm3c_hw_interface_vars.ASC[30] &= 0xFFF01FFF;
scm3c_hw_interface_vars.ASC[30] |= code_ASC;

}

void set_LO_supply(unsigned int code, unsigned char panic) {
// 7-bit setting (between 0 and 127)
// MSB is a "panic" bit that engages the high-voltage settings
unsigned int code_ASC = ((~code)&0x0000007F) << 5;
scm3c_hw_interface_vars.ASC[30] &= 0xFFFFF017;
scm3c_hw_interface_vars.ASC[30] &= 0xFFFFF01F;
scm3c_hw_interface_vars.ASC[30] |= code_ASC;
}

void set_DIV_supply(unsigned int code, unsigned char panic) {
// 7-bit setting (between 0 and 127)
// MSB is a "panic" bit that engages the high-voltage settings
unsigned int code_ASC = ((~code)&0x0000007F) << 5;
scm3c_hw_interface_vars.ASC[30] &= 0xFFF01FFF;
scm3c_hw_interface_vars.ASC[30] |= code_ASC;
unsigned int code_ASC = ((~code)&0x0000007F) << 13;
scm3c_hw_interface_vars.ASC[31] &= 0xFFF01FFF;
scm3c_hw_interface_vars.ASC[31] |= code_ASC;
}

void prescaler(int code) {
Expand Down