Skip to content

Commit

Permalink
boards: mRo Control Zero F7 improve sensors power on timing
Browse files Browse the repository at this point in the history
  • Loading branch information
dagar committed Jun 24, 2020
1 parent 620916e commit c35f6a8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
10 changes: 5 additions & 5 deletions boards/mro/ctrl-zero-f7/init/rc.board_sensors
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
adc start

# Internal ICM-20602
icm20602 -s -R 8 start
icm20602 -s -b 1 -R 8 start

# Internal SPI bus BMI088 accel & gyro
bmi088 -A -R 8 -s start
bmi088 -G -R 8 -s start
bmi088 -A -s -b 5 -R 8 start
bmi088 -G -s -b 5 -R 8 start

# Internal ICM-20948 (with magnetometer)
icm20948 -s -R 8 -M start
icm20948 -s -b 1 -R 8 -M start

# Interal DPS310 (barometer)
dps310 -s start
dps310 -s -b 2 start
8 changes: 5 additions & 3 deletions boards/mro/ctrl-zero-f7/nuttx-config/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,15 +297,17 @@
* SPI6 Reserved
*
*/
#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 /* PA5 */
#define ADJ_SLEW_RATE(p) (((p) & ~GPIO_SPEED_MASK) | (GPIO_SPEED_2MHz))

#define GPIO_SPI1_SCK ADJ_SLEW_RATE(GPIO_SPI1_SCK_1) /* PA5 */
#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */
#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 /* PA7 */

#define GPIO_SPI2_SCK GPIO_SPI2_SCK_2 /* PB10 */
#define GPIO_SPI2_SCK ADJ_SLEW_RATE(GPIO_SPI2_SCK_2) /* PB10 */
#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 /* PB14 */
#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 /* PB15 */

#define GPIO_SPI5_SCK GPIO_SPI5_SCK_1 /* PF7 */
#define GPIO_SPI5_SCK ADJ_SLEW_RATE(GPIO_SPI5_SCK_1) /* PF7 */
#define GPIO_SPI5_MISO GPIO_SPI5_MISO_1 /* PF8 */
#define GPIO_SPI5_MOSI GPIO_SPI5_MOSI_1 /* PF9 */

Expand Down
8 changes: 0 additions & 8 deletions boards/mro/ctrl-zero-f7/src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ __END_DECLS
************************************************************************************/
__EXPORT void board_peripheral_reset(int ms)
{
/* set the peripheral rails off */
board_control_spi_sensors_power(false, 0xffff);

bool last = READ_VDD_3V3_SPEKTRUM_POWER_EN();
/* Keep Spektum on to discharge rail*/
VDD_3V3_SPEKTRUM_POWER_EN(false);
Expand All @@ -115,7 +112,6 @@ __EXPORT void board_peripheral_reset(int ms)

/* switch the peripheral rail back on */
VDD_3V3_SPEKTRUM_POWER_EN(last);
board_control_spi_sensors_power(true, 0xffff);
}

/************************************************************************************
Expand Down Expand Up @@ -162,9 +158,6 @@ stm32_boardinitialize(void)
const uint32_t gpio[] = PX4_GPIO_INIT_LIST;
px4_gpio_init(gpio, arraySize(gpio));

/* configure SPI interfaces */
px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, 0);

/* configure USB interfaces */
stm32_usbinitialize();
}
Expand Down Expand Up @@ -198,7 +191,6 @@ stm32_boardinitialize(void)
__EXPORT int board_app_initialize(uintptr_t arg)
{
/* Power on Interfaces */
px4_arch_gpiowrite(GPIO_VDD_3V3_SENSORS_EN, 1);
board_control_spi_sensors_power(true, 0xffff);
VDD_3V3_SPEKTRUM_POWER_EN(true);

Expand Down
1 change: 1 addition & 0 deletions src/drivers/imu/invensense/icm20948/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ px4_add_module(
MODULE drivers__imu__icm20948
MAIN icm20948
COMPILE_FLAGS
-DDEBUG_BUILD
SRCS
AKM_AK09916_registers.hpp
ICM20948.cpp
Expand Down
2 changes: 2 additions & 0 deletions src/drivers/imu/invensense/icm20948/ICM20948.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ ICM20948::ICM20948(I2CSPIBusOption bus_option, int bus, uint32_t device, enum Ro
_px4_accel(get_device_id(), ORB_PRIO_DEFAULT, rotation),
_px4_gyro(get_device_id(), ORB_PRIO_DEFAULT, rotation)
{
_debug_enabled = true;

if (drdy_gpio != 0) {
_drdy_interval_perf = perf_alloc(PC_INTERVAL, MODULE_NAME": DRDY interval");
}
Expand Down

0 comments on commit c35f6a8

Please sign in to comment.