sim: add the simulated lower-half FOC device

This commit is contained in:
raiden00pl
2021-03-01 21:11:08 +01:00
committed by Xiang Xiao
parent a5a435e98f
commit 168355a40b
5 changed files with 726 additions and 0 deletions
+7
View File
@@ -618,4 +618,11 @@ config SIM_UART3_NAME
default "/dev/ttySIM3"
depends on SIM_UART_NUMBER >= 4
config SIM_MOTOR_FOC
bool "Simulated FOC device"
default n
depends on MOTOR_FOC
---help---
Build a simulated lower-half FOC device
endif # ARCH_SIM
+4
View File
@@ -174,6 +174,10 @@ ifeq ($(CONFIG_ARCH_ROMGETC),y)
CSRCS += up_romgetc.c
endif
ifeq ($(CONFIG_SIM_MOTOR_FOC),y)
CSRCS += up_foc.c
endif
ifeq ($(CONFIG_SIM_NETDEV_TAP),y)
CSRCS += up_netdriver.c
HOSTCFLAGS += -DNETDEV_BUFSIZE=$(CONFIG_NET_ETH_PKTSIZE)
File diff suppressed because it is too large Load Diff
+6
View File
@@ -128,6 +128,12 @@ void up_idle(void)
up_timer_update();
#endif
#ifdef CONFIG_SIM_MOTOR_FOC
/* Update simulated FOC device */
sim_foc_update();
#endif
}
#endif /* !CONFIG_SMP */
+8
View File
@@ -440,5 +440,13 @@ int sim_i2cbus_uninitialize(struct i2c_master_s *dev);
void up_stack_color(void *stackbase, size_t nbytes);
#endif
/* up_foc.c *****************************************************************/
#ifdef CONFIG_MOTOR_FOC
struct foc_dev_s;
FAR struct foc_dev_s *sim_foc_initialize(int inst);
void sim_foc_update(void);
#endif
#endif /* __ASSEMBLY__ */
#endif /* __ARCH_SIM_SRC_UP_INTERNAL_H */