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.h
- Revision:
- 14:062850afdf38
- Parent:
- 12:9f8c7f4da5f6
- Child:
- 15:83bbc18cccbc
diff -r 1faffc2dc651 -r 062850afdf38 i2c_mbed_fpga.h
--- a/i2c_mbed_fpga.h Fri Mar 26 14:27:37 2021 +0000
+++ b/i2c_mbed_fpga.h Thu Apr 22 11:35:17 2021 +0000
@@ -2,11 +2,11 @@
#define I2C_MBED_FPGA_H
#include "nv_bitfield_map.h"
-#include "nv_defines.h"
+#include "i2c_ram_defines.h"
#include "nv_defaults.h"
-#define I2C_SLAVE_ADDR 0x18<<1
+#define I2C_SLAVE_ADDR 0x6A<<1
//Class delclarations
class i2c_mbed_fpga {
@@ -15,8 +15,8 @@
/*constructor*/
// {p28:sda, p27:scl}
// {p9: sda, p10:scl}
- i2c_mbed_fpga(): i2c_master(p28, p27){
- i2c_master.frequency(70000);
+ i2c_mbed_fpga(): i2c_master(p9, p10){
+ i2c_master.frequency(100000);
nv_positin_val = NV_POSITION_DEFAULT;
nv_start_up_val = NV_START_UP_DEFAULT;
nv_wind_brake_val = NV_WIND_BRAKE_DEFAULT;
@@ -24,15 +24,13 @@
nv_spd_control_1_val = NV_SPD_CONTROL_1_DEFAULT;
nv_spd_control_2_val = NV_SPD_CONTROL_1_DEFAULT;
nv_gen_ctrl_val = NV_GEN_CTRL_DEFAULT;
- nv_comm_ctrl_val = NV_COMM_CTRL_DEFAULT;
+ nv_comm_ctrl_val = NV_COMM_CTRL_DEFAULT;
+ nv_application_cfg_val = NV_APPLICATION_CFG_DEFAULT;
};
int i2c_word_read(char *word);
- int i2c_word_read_by_byte(char *word);
int i2c_word_write(char *word);
- int i2c_word_write_by_byte(char *word);
- int i2c_word_safe_write(char *word);
-
+
int i2c_window_open();
int i2c_motor_start();
@@ -51,11 +49,15 @@
int i2c_set_single_pulse_start_up(unsigned int enbale, unsigned int mantisaa_3b, unsigned int exponent_3b);
int i2c_set_rough_gain(unsigned int rough_gain);
+ int i2c_set_ehp_reg_gain(unsigned int ehp_gain);
+ int i2c_set_fall_time_blank(unsigned int blank_time);
+
int i2c_set_comm_i_thres(unsigned int i_thr_low, unsigned int i_thr_high);
int i2c_set_comm_di_thres(unsigned int di_1st, unsigned int di_2nd);
int i2c_clear_spd_ctrl();
+ int i2c_set_input_mode(unsigned int mode);
int i2c_set_loop_mode(unsigned int openloop);
int i2c_set_curve_type(unsigned int curvetype);
int i2c_set_dc_ini(unsigned int ini);
@@ -72,7 +74,7 @@
unsigned int ram_open_duty_val;
unsigned int nv_gen_ctrl_val;
unsigned int nv_comm_ctrl_val;
-
+ unsigned int nv_application_cfg_val;
//Position Detection Task/Functions
};