Skip to content

Commit

Permalink
[BACKPORT] px4 mtd:Support FlexSPI attached Devices
Browse files Browse the repository at this point in the history
  • Loading branch information
davids5 committed Apr 30, 2024
1 parent a45e487 commit 9295b1a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ typedef struct {
I2C = 0,
SPI = 1,
ONCHIP = 2,
FLEXSPI = 3
} bus_type;

uint32_t devid;
Expand Down
2 changes: 2 additions & 0 deletions platforms/common/include/px4_platform_common/px4_mtd.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,6 @@ int px4_at24c_initialize(FAR struct i2c_master_s *dev,

void px4_at24c_deinitialize(void);

int flexspi_attach(mtd_instance_s *instance);

__END_DECLS
5 changes: 5 additions & 0 deletions platforms/nuttx/src/px4/common/px4_mtd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,11 @@ int px4_mtd_config(const px4_mtd_manifest_t *mft_mtd)

} else if (mtd_list->entries[num_entry]->device->bus_type == px4_mft_device_t::SPI) {
rv = ramtron_attach(*instances[i]);
#if defined(HAS_FLEXSPI)

} else if (mtd_list->entries[num_entry]->device->bus_type == px4_mft_device_t::FLEXSPI) {
rv = flexspi_attach(instances[i]);
#endif

} else if (mtd_list->entries[num_entry]->device->bus_type == px4_mft_device_t::ONCHIP) {
instances[i]->n_partitions_current++;
Expand Down

0 comments on commit 9295b1a

Please sign in to comment.