mirror of
https://github.com/apache/nuttx.git
synced 2026-05-26 10:46:28 +08:00
sim: add the simulated lower-half FOC device
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
@@ -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 */
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user