Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: i2c_mbed_fpga.cpp
- Revision:
- 17:d7207b1132be
- Parent:
- 16:a0bfe33f8a4a
- Child:
- 20:26e934452728
--- a/i2c_mbed_fpga.cpp Fri May 21 12:42:56 2021 +0000
+++ b/i2c_mbed_fpga.cpp Thu May 27 12:21:37 2021 +0000
@@ -271,6 +271,21 @@
/** i2c to set the rough regulation gain
*/
+int i2c_mbed_fpga::i2c_force_rough_reg(unsigned int reg){
+ int ack = 0;
+ nv_gen_ctrl_val &= ~NV_ROUGH_REG_MASK;
+ nv_gen_ctrl_val |= reg << NV_ROUGH_REG_OFFSET;
+ char i2cMessage[3];
+ *(i2cMessage+0)= (char)(I2C_GEN_CTRL >> 0)& 0xff;
+ *(i2cMessage+1)= (char)(nv_gen_ctrl_val >> 8)& 0xff;
+ *(i2cMessage+2)= (char)(nv_gen_ctrl_val >> 0)& 0xff;
+ ack += i2c_word_write(i2cMessage);
+
+ return ack;
+}
+
+/** i2c to set the rough regulation gain
+*/
int i2c_mbed_fpga::i2c_set_rough_gain(unsigned int rough_gain){
int ack = 0;
nv_gen_ctrl_val &= ~NV_ROUGH_GAIN_MASK;