Users Manual

19/05/2019 Pyboard D-series reference Pyboard D-series 1.0 documentation
https://pybd.io/hw/pybd_sfxw.html 5/8
TherearetwoUSBinterfaces:FSandHS.TheUSBHSportisthemainoneandisavailable
onthePYBDitself.TheFSportismadeavailableontheWBUS‑DIP28adapter.Bydefault
theUSBporttousewillbeauto‑detectedbasedonthepresenceofacablepluggedin.Itcan
beselectedmanually,egin
boot.py :
import pyb
pyb.usb_mode('VCP+MSC', port=-1) # default, auto-detect port
pyb.usb_mode('VCP+MSC', port=0) # select FS port
pyb.usb_mode('VCP+MSC', port=1) # select HS port
pyb.usb_mode() canbecalledatanyme,fromanyscript,butisusuallyputin boot.py to
configuretheUSBasearlyaspossibleinthebootsequence.Youcanuse
pyb.usb_mode(None)
tocompletelydisableandturnofftheUSBperipheral(thissavespower).
WhenMSCmodeisenabledtheconnectedPCwillbeabletoseethefilesystemofthe
PYBD.Bydefaultthisistheinternal2MiBflash,unlessanSDcardisinsertedinwhichcaseit
istheSDcard.Thiscanbeselectedmanuallyviathe
msc keywordargumentwhichshould
beatupleorlistofoneelement,forexample:
pyb.usb_mode('VCP+MSC', msc=(pyb.Flash(),)) # expose internal flash to the PC
pyb.usb_mode('VCP+MSC', msc=(pyb.SDCard(),)) # expose SD card to the PC
pyb.usb_mode('VCP+MSC', msc=(pyb.MMCard(),)) # expose MMC to the PC
WiFi control
Inyour
boot.py fileyoushouldconfigurethecountryfortheallowedWiFichannelsinyour
region:
import pyb
pyb.country('US') # 2-char code, eg: US, GB, DE, NL, FR, AU, CA
TousetheWiFistaoninterface: