Dynamically switch between USB CDC (Communications Device Class) mode and USB MSC (Mass Storage Class) mode

Is it possible to dynamically switch between USB CDC (Communications Device Class) mode and USB MSC (Mass Storage Class) mode on the nRF52840? If so, could you outline the steps or best practices for implementing this functionality within the firmware?

Related