From 007878781c74e0e4213759d8ee07ee81b5342f5c Mon Sep 17 00:00:00 2001 From: Daniel Campora Date: Tue, 28 Jul 2015 23:03:53 +0200 Subject: [PATCH] cc3200: Rename pins from GPIO to just GP. This is how the names will be printed on the sticker that goes on top of the EMI shield. The shorter names also help saving a few bytes of RAM and ROM. --- cc3200/boards/LAUNCHXL/mpconfigboard.h | 10 ++--- cc3200/boards/WIPY/mpconfigboard.h | 6 +-- cc3200/boards/WIPY/pins.csv | 50 ++++++++++++------------ cc3200/boards/cc3200_af.csv | 54 +++++++++++++------------- cc3200/boards/make-pins.py | 14 +++---- cc3200/mods/pybadc.c | 8 ++-- cc3200/mods/pybpin.c | 18 ++++----- docs/library/pyb.ADC.rst | 2 +- docs/library/pyb.HeartBeat.rst | 8 ++-- docs/library/pyb.Pin.rst | 12 +++--- docs/library/pyb.SD.rst | 2 +- docs/wipy/general.rst | 8 ++-- docs/wipy/quickref.rst | 34 ++++++++-------- 13 files changed, 113 insertions(+), 113 deletions(-) diff --git a/cc3200/boards/LAUNCHXL/mpconfigboard.h b/cc3200/boards/LAUNCHXL/mpconfigboard.h index bf46b880d3..028cd9dee7 100644 --- a/cc3200/boards/LAUNCHXL/mpconfigboard.h +++ b/cc3200/boards/LAUNCHXL/mpconfigboard.h @@ -38,8 +38,8 @@ #define MICROPY_STDIO_UART 1 #define MICROPY_STDIO_UART_BAUD 115200 #define MICROPY_STDIO_UART_RX_BUF_SIZE 128 -#define MICROPY_STDIO_UART_TX_PIN (pin_GPIO1) -#define MICROPY_STDIO_UART_RX_PIN (pin_GPIO2) +#define MICROPY_STDIO_UART_TX_PIN (pin_GP1) +#define MICROPY_STDIO_UART_RX_PIN (pin_GP2) #define MICROPY_STDIO_UART_TX_PIN_AF PIN_MODE_3 #define MICROPY_STDIO_UART_RX_PIN_AF PIN_MODE_3 @@ -47,9 +47,9 @@ #define MICROPY_SAFE_BOOT_PRCM PRCM_GPIOA2 #define MICROPY_SYS_LED_PORT GPIOA1_BASE #define MICROPY_SAFE_BOOT_PORT GPIOA2_BASE -#define MICROPY_SYS_LED_GPIO pin_GPIO9 -#define MICROPY_SYS_LED_PIN_NUM PIN_64 // GPIO9 -#define MICROPY_SAFE_BOOT_PIN_NUM PIN_15 // GPIO22 +#define MICROPY_SYS_LED_GPIO pin_GP9 +#define MICROPY_SYS_LED_PIN_NUM PIN_64 // GP9 +#define MICROPY_SAFE_BOOT_PIN_NUM PIN_15 // GP22 #define MICROPY_SYS_LED_PORT_PIN GPIO_PIN_1 #define MICROPY_SAFE_BOOT_PORT_PIN GPIO_PIN_6 diff --git a/cc3200/boards/WIPY/mpconfigboard.h b/cc3200/boards/WIPY/mpconfigboard.h index 3246fce3e1..237df197c1 100644 --- a/cc3200/boards/WIPY/mpconfigboard.h +++ b/cc3200/boards/WIPY/mpconfigboard.h @@ -39,9 +39,9 @@ #define MICROPY_SAFE_BOOT_PRCM PRCM_GPIOA3 #define MICROPY_SYS_LED_PORT GPIOA3_BASE #define MICROPY_SAFE_BOOT_PORT GPIOA3_BASE -#define MICROPY_SYS_LED_GPIO pin_GPIO25 -#define MICROPY_SYS_LED_PIN_NUM PIN_21 // GPIO25 (SOP2) -#define MICROPY_SAFE_BOOT_PIN_NUM PIN_18 // GPIO28 +#define MICROPY_SYS_LED_GPIO pin_GP25 +#define MICROPY_SYS_LED_PIN_NUM PIN_21 // GP25 (SOP2) +#define MICROPY_SAFE_BOOT_PIN_NUM PIN_18 // GP28 #define MICROPY_SYS_LED_PORT_PIN GPIO_PIN_1 #define MICROPY_SAFE_BOOT_PORT_PIN GPIO_PIN_4 diff --git a/cc3200/boards/WIPY/pins.csv b/cc3200/boards/WIPY/pins.csv index 760bb15f98..c4e4376246 100644 --- a/cc3200/boards/WIPY/pins.csv +++ b/cc3200/boards/WIPY/pins.csv @@ -1,25 +1,25 @@ -L2,GPIO2 -L3,GPIO1 -L4,GPIO23 -L5,GPIO24 -L6,GPIO11 -L7,GPIO12 -L8,GPIO13 -L9,GPIO14 -L10,GPIO15 -L11,GPIO16 -L12,GPIO17 -L13,GPIO22 -L14,GPIO28 -R4,GPIO10 -R5,GPIO9 -R6,GPIO8 -R7,GPIO7 -R8,GPIO6 -R9,GPIO30 -R10,GPIO31 -R11,GPIO3 -R12,GPIO0 -R13,GPIO4 -R14,GPIO5 -HBL,GPIO25 +L2,GP2 +L3,GP1 +L4,GP23 +L5,GP24 +L6,GP11 +L7,GP12 +L8,GP13 +L9,GP14 +L10,GP15 +L11,GP16 +L12,GP17 +L13,GP22 +L14,GP28 +R4,GP10 +R5,GP9 +R6,GP8 +R7,GP7 +R8,GP6 +R9,GP30 +R10,GP31 +R11,GP3 +R12,GP0 +R13,GP4 +R14,GP5 +HBL,GP25 diff --git a/cc3200/boards/cc3200_af.csv b/cc3200/boards/cc3200_af.csv index 746a8b08c6..557dcfe92c 100644 --- a/cc3200/boards/cc3200_af.csv +++ b/cc3200/boards/cc3200_af.csv @@ -1,25 +1,25 @@ Pin,Name,Default,AF0,AF1,AF2,AF3,AF4,AF5,AF6,AF7,AF8,AF9,AF10,AF11,AF12,AF13,AF14,AF15,ADC -1,GPIO10,GPIO10,GPIO10,I2C_SCL,,GT_PWM06,,,SDCARD_CLK,UART1_TX,,,,,GT_CCP01,,,, -2,GPIO11,GPIO11,GPIO11,I2C_SDA,,GT_PWM07,pXCLK(XVCLK),,SDCARD_CMD,UART1_RX,,,,,GT_CCP02,McAFSX,,, -3,GPIO12,GPIO12,GPIO12,,,McACLK,pVS(VSYNC),I2C_SCL,,UART0_TX,,,,,GT_CCP03,,,, -4,GPIO13,GPIO13,GPIO13,,,,pHS(HSYNC),I2C_SDA,,UART0_RX,,,,,GT_CCP04,,,, -5,GPIO14,GPIO14,GPIO14,,,,pDATA8(CAM_D4),2C_SCL,,GSPI_CLK,,,,,GT_CCP05,,,, -6,GPIO15,GPIO15,GPIO15,,,,pDATA9(CAM_D5),I2C_SDA,,GSPI_MISO,,,,,,GT_CCP06,,, -7,GPIO16,GPIO16,GPIO16,,,,pDATA10(CAM_D6),UART1_TX,,GSPI_MOSI,,,,,,GT_CCP07,,, -8,GPIO17,GPIO17,GPIO17,,,,pDATA11(CAM_D7),UART1_RX,,GSPI_CS,,,,,,,,, +1,GP10,GP10,GP10,I2C_SCL,,GT_PWM06,,,SDCARD_CLK,UART1_TX,,,,,GT_CCP01,,,, +2,GP11,GP11,GP11,I2C_SDA,,GT_PWM07,pXCLK(XVCLK),,SDCARD_CMD,UART1_RX,,,,,GT_CCP02,McAFSX,,, +3,GP12,GP12,GP12,,,McACLK,pVS(VSYNC),I2C_SCL,,UART0_TX,,,,,GT_CCP03,,,, +4,GP13,GP13,GP13,,,,pHS(HSYNC),I2C_SDA,,UART0_RX,,,,,GT_CCP04,,,, +5,GP14,GP14,GP14,,,,pDATA8(CAM_D4),2C_SCL,,GSPI_CLK,,,,,GT_CCP05,,,, +6,GP15,GP15,GP15,,,,pDATA9(CAM_D5),I2C_SDA,,GSPI_MISO,,,,,,GT_CCP06,,, +7,GP16,GP16,GP16,,,,pDATA10(CAM_D6),UART1_TX,,GSPI_MOSI,,,,,,GT_CCP07,,, +8,GP17,GP17,GP17,,,,pDATA11(CAM_D7),UART1_RX,,GSPI_CS,,,,,,,,, 9,VDD_DIG1,VDD_DIG1,VDD_DIG1,,,,,,,,,,,,,,,, 10,VIN_IO1,VIN_IO1,VIN_IO1,,,,,,,,,,,,,,,, 11,FLASH_SPI_CLK,FLASH_SPI_CLK,FLASH_SPI_CLK,,,,,,,,,,,,,,,, 12,FLASH_SPI_DOUT,FLASH_SPI_DOUT,FLASH_SPI_DOUT,,,,,,,,,,,,,,,, 13,FLASH_SPI_DIN,FLASH_SPI_DIN,FLASH_SPI_DIN,,,,,,,,,,,,,,,, 14,FLASH_SPI_CS,FLASH_SPI_CS,FLASH_SPI_CS,,,,,,,,,,,,,,,, -15,GPIO22,GPIO22,GPIO22,,,,,GT_CCP04,,McAFSX,,,,,,,,, -16,GPIO23,TDI,GPIO23,TDI,UART1_TX,,,,,,,2C_SCL,,,,,,, -17,GPIO24,TDO,GPIO24,TDO,UART1_RX,,GT_CCP06,PWM0,McAFSX,,,I2C_SDA,,,,,,, -18,GPIO28,GPIO28,GPIO28,,,,,,,,,,,,,,,, +15,GP22,GP22,GP22,,,,,GT_CCP04,,McAFSX,,,,,,,,, +16,GP23,TDI,GP23,TDI,UART1_TX,,,,,,,2C_SCL,,,,,,, +17,GP24,TDO,GP24,TDO,UART1_RX,,GT_CCP06,PWM0,McAFSX,,,I2C_SDA,,,,,,, +18,GP28,GP28,GP28,,,,,,,,,,,,,,,, 19,TCK,TCK,,TCK,,,,,,,GT_PWM03,,,,,,,, -20,GPIO29,TMS,GPIO29,TMS,,,,,,,,,,,,,,, -21,GPIO25,SOP2,GPIO25,,McAFSX,,,,,,,GT_PWM02,,,,,,, +20,GP29,TMS,GP29,TMS,,,,,,,,,,,,,,, +21,GP25,SOP2,GP25,,McAFSX,,,,,,,GT_PWM02,,,,,,, 22,WLAN_XTAL_N,WLAN_XTAL_N,WLAN_XTAL_N,,,,,,,,,,,,,,,, 23,WLAN_XTAL_P,WLAN_XTAL_P,WLAN_XTAL_P,,,,,,,,,,,,,,,, 24,VDD_PLL,VDD_PLL,VDD_PLL,,,,,,,,,,,,,,,, @@ -43,24 +43,24 @@ Pin,Name,Default,AF0,AF1,AF2,AF3,AF4,AF5,AF6,AF7,AF8,AF9,AF10,AF11,AF12,AF13,AF1 42,DCDC_PA_OUT,DCDC_PA_O UT,DCDC_PA_O UT,,,,,,,,,,,,,,,, 43,DCDC_DIG_SW,DCDC_DIG_ SW,DCDC_DIG_ SW,,,,,,,,,,,,,,,, 44,VIN_DCDC_DIG,VIN_DCDC_ DIG,VIN_DCDC_ DIG,,,,,,,,,,,,,,,, -45,GPIO31,DCDC_ANA2_SW_P,GPIO31,,UART1_RX,,,,McAXR0,GSPI_CLK,,UART0_RX,,,McAFSX,,,, +45,GP31,DCDC_ANA2_SW_P,GP31,,UART1_RX,,,,McAXR0,GSPI_CLK,,UART0_RX,,,McAFSX,,,, 46,DCDC_ANA2_SW_N,DCDC_ANA2_SW_N,DCDC_ANA2_SW_N,,,,,,,,,,,,,,,, 47,VDD_ANA2,VDD_ANA2,VDD_ANA2,,,,,,,,,,,,,,,, 48,VDD_ANA1,VDD_ANA1,VDD_ANA1,,,,,,,,,,,,,,,, 49,VDD_RAM,VDD_RAM,VDD_RAM,,,,,,,,,,,,,,,, -50,GPIO0,GPIO0,GPIO0,,,UART0_RTS,McAXR0,,McAXR1,GT_CCP00,,GSPI_CS,UART1_RTS,,UART0_CTS,,,, +50,GP0,GP0,GP0,,,UART0_RTS,McAXR0,,McAXR1,GT_CCP00,,GSPI_CS,UART1_RTS,,UART0_CTS,,,, 51,RTC_XTAL_P,RTC_XTAL_P,RTC_XTAL_P,,,,,,,,,,,,,,,, -52,RTC_XTAL_N,RTC_XTAL_N,GPIO32,,McACLK,,McAXR0,,UART0_RTS,,GSPI_MOSI,,,,,,,, -53,GPIO30,GPIO30,GPIO30,,McACLK,McAFSX,GT_CCP05,,,GSPI_MISO,,UART0_TX,,,,,,, +52,RTC_XTAL_N,RTC_XTAL_N,GP32,,McACLK,,McAXR0,,UART0_RTS,,GSPI_MOSI,,,,,,,, +53,GP30,GP30,GP30,,McACLK,McAFSX,GT_CCP05,,,GSPI_MISO,,UART0_TX,,,,,,, 54,VIN_IO2,VIN_IO2,VIN_IO2,,,,,,,,,,,,,,,, -55,GPIO1,GPIO1,GPIO1,,,GSPI_MISO,pCLK (PIXCLK),,UART1_TX,GT_CCP01,,,,,,,,, +55,GP1,GP1,GP1,,,GSPI_MISO,pCLK (PIXCLK),,UART1_TX,GT_CCP01,,,,,,,,, 56,VDD_DIG2,VDD_DIG2,VDD_DIG2,,,,,,,,,,,,,,,, -57,GPIO2,GPIO2,GPIO2,,,UART0_RX,,,UART1_RX,GT_CCP02,,,,,,,,,ADC_CH0 -58,GPIO3,GPIO3,GPIO3,,,,pDATA7(CAM_D3),,UART1_TX,,,,,,,,,,ADC_CH1 -59,GPIO4,GPIO4,GPIO4,,,,pDATA6(CAM_D2),,UART1_RX,,,,,,,,,,ADC_CH2 -60,GPIO5,GPIO5,GPIO5,,,,pDATA5(CAM_D1),,McAXR1,GT_CCP05,,,,,,,,,ADC_CH3 -61,GPIO6,GPIO6,GPIO6,,,UART1_CTS,pDATA4(CAM_D0),UART0_RTS,UART0_CTS,GT_CCP06,,,,,,,,, -62,GPIO7,GPIO7,GPIO7,,,UART1_RTS,,,,,,,UART0_RTS,UART0_TX,,McACLKX,,, -63,GPIO8,GPIO8,GPIO8,,,,,,SDCARD_IRQ,McAFSX,,,,,GT_CCP06,,,, -64,GPIO9,GPIO9,GPIO9,,,GT_PWM05,,,SDCARD_DATA,McAXR0,,,,,GT_CCP00,,,, +57,GP2,GP2,GP2,,,UART0_RX,,,UART1_RX,GT_CCP02,,,,,,,,,ADC_CH0 +58,GP3,GP3,GP3,,,,pDATA7(CAM_D3),,UART1_TX,,,,,,,,,,ADC_CH1 +59,GP4,GP4,GP4,,,,pDATA6(CAM_D2),,UART1_RX,,,,,,,,,,ADC_CH2 +60,GP5,GP5,GP5,,,,pDATA5(CAM_D1),,McAXR1,GT_CCP05,,,,,,,,,ADC_CH3 +61,GP6,GP6,GP6,,,UART1_CTS,pDATA4(CAM_D0),UART0_RTS,UART0_CTS,GT_CCP06,,,,,,,,, +62,GP7,GP7,GP7,,,UART1_RTS,,,,,,,UART0_RTS,UART0_TX,,McACLKX,,, +63,GP8,GP8,GP8,,,,,,SDCARD_IRQ,McAFSX,,,,,GT_CCP06,,,, +64,GP9,GP9,GP9,,,GT_PWM05,,,SDCARD_DATA,McAXR0,,,,,GT_CCP00,,,, 65,GND_TAB,GND_TAB,GND_TAB,,,,,,,,,,,,,,,, diff --git a/cc3200/boards/make-pins.py b/cc3200/boards/make-pins.py index 4d9257afdf..ac1a80be9b 100644 --- a/cc3200/boards/make-pins.py +++ b/cc3200/boards/make-pins.py @@ -10,14 +10,14 @@ import csv def parse_port_pin(name_str): """Parses a string and returns a (port, gpio_bit) tuple.""" - if len(name_str) < 5: - raise ValueError("Expecting pin name to be at least 5 characters") - if name_str[:4] != 'GPIO': - raise ValueError("Expecting pin name to start with GPIO") - if not name_str[4:].isdigit(): + if len(name_str) < 3: + raise ValueError("Expecting pin name to be at least 3 characters") + if name_str[:2] != 'GP': + raise ValueError("Expecting pin name to start with GP") + if not name_str[2:].isdigit(): raise ValueError("Expecting numeric GPIO number") - port = int(int(name_str[4:]) / 8) - gpio_bit = 1 << int(int(name_str[4:]) % 8) + port = int(int(name_str[2:]) / 8) + gpio_bit = 1 << int(int(name_str[2:]) % 8) return (port, gpio_bit) diff --git a/cc3200/mods/pybadc.c b/cc3200/mods/pybadc.c index 0d7b753f19..1eb4b45efb 100644 --- a/cc3200/mods/pybadc.c +++ b/cc3200/mods/pybadc.c @@ -119,19 +119,19 @@ STATIC mp_obj_t adc_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_kw, switch (idx) { case 0: channel = ADC_CH_0; - pin = &pin_GPIO2; + pin = &pin_GP2; break; case 1: channel = ADC_CH_1; - pin = &pin_GPIO3; + pin = &pin_GP3; break; case 2: channel = ADC_CH_2; - pin = &pin_GPIO4; + pin = &pin_GP4; break; case 3: channel = ADC_CH_3; - pin = &pin_GPIO5; + pin = &pin_GP5; break; default: nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, mpexception_value_invalid_arguments)); diff --git a/cc3200/mods/pybpin.c b/cc3200/mods/pybpin.c index 6584198863..6bc430a14b 100644 --- a/cc3200/mods/pybpin.c +++ b/cc3200/mods/pybpin.c @@ -135,11 +135,11 @@ STATIC pybpin_wake_pin_t pybpin_wake_pin[PYBPIN_NUM_WAKE_PINS] = DEFINE PUBLIC FUNCTIONS ******************************************************************************/ void pin_init0(void) { - // assign GPIO10 and GPIO11 to the GPIO peripheral (the default is I2C), so that the I2C bus can + // assign GP10 and GP11 to the GPIO peripheral (the default is I2C), so that the I2C bus can // be assigned safely to any other pins (as recomended by the SDK release notes). Make them // inputs with pull-downs enabled to ensure they are not floating during LDPS and hibernate. - pin_config ((pin_obj_t *)&pin_GPIO10, PIN_MODE_0, GPIO_DIR_MODE_IN, PIN_TYPE_STD_PD, PIN_STRENGTH_2MA); - pin_config ((pin_obj_t *)&pin_GPIO11, PIN_MODE_0, GPIO_DIR_MODE_IN, PIN_TYPE_STD_PD, PIN_STRENGTH_2MA); + pin_config ((pin_obj_t *)&pin_GP10, PIN_MODE_0, GPIO_DIR_MODE_IN, PIN_TYPE_STD_PD, PIN_STRENGTH_2MA); + pin_config ((pin_obj_t *)&pin_GP11, PIN_MODE_0, GPIO_DIR_MODE_IN, PIN_TYPE_STD_PD, PIN_STRENGTH_2MA); } // C API used to convert a user-supplied pin name into an ordinal pin number. @@ -210,27 +210,27 @@ STATIC void pin_obj_configure (const pin_obj_t *self) { STATIC void pin_get_hibernate_pin_and_idx (const pin_obj_t *self, uint *hib_pin, uint *idx) { // pin_num is actually : (package_pin - 1) switch (self->pin_num) { - case 56: // GPIO2 + case 56: // GP2 *hib_pin = PRCM_HIB_GPIO2; *idx = 0; break; - case 58: // GPIO4 + case 58: // GP4 *hib_pin = PRCM_HIB_GPIO4; *idx = 1; break; - case 3: // GPIO13 + case 3: // GP13 *hib_pin = PRCM_HIB_GPIO13; *idx = 2; break; - case 7: // GPIO17 + case 7: // GP17 *hib_pin = PRCM_HIB_GPIO17; *idx = 3; break; - case 1: // GPIO11 + case 1: // GP11 *hib_pin = PRCM_HIB_GPIO11; *idx = 4; break; - case 16: // GPIO24 + case 16: // GP24 *hib_pin = PRCM_HIB_GPIO24; *idx = 5; break; diff --git a/docs/library/pyb.ADC.rst b/docs/library/pyb.ADC.rst index 36c376d375..02734e72f9 100644 --- a/docs/library/pyb.ADC.rst +++ b/docs/library/pyb.ADC.rst @@ -49,7 +49,7 @@ Constructors .. warning:: ADC pin input range is 0-1.4V (being 1.8V the absolute maximum that it - can withstand). When GPIO2, GPIO3, GPIO4 or GPIO5 are remapped to the + can withstand). When GP2, GP3, GP4 or GP5 are remapped to the ADC block, 1.8 V is the maximum. If these pins are used in digital mode, then the maximum allowed input is 3.6V. diff --git a/docs/library/pyb.HeartBeat.rst b/docs/library/pyb.HeartBeat.rst index 971f2e93ec..a50fc8a23e 100644 --- a/docs/library/pyb.HeartBeat.rst +++ b/docs/library/pyb.HeartBeat.rst @@ -5,8 +5,8 @@ class HeartBeat -- heart beat LED The HeartBeat class controls the heart beat led which by default flashes once every 5s. The user can disable the HeartBeat and then -is free to control this LED manually through GPIO25 using the Pin -class. The GPIO25 can also be remapped as a PWM output, an this +is free to control this LED manually through GP25 using the Pin +class. The GP25 can also be remapped as a PWM output, an this can be used to control the light intesity of the heart beat LED. Example usage:: @@ -39,8 +39,8 @@ Methods # disable the heart beat pyb.HeartBeat().disable() - # get the GPIO25 pin object - hbl = pyb.Pin('GPIO25') + # get the GP25 pin object + hbl = pyb.Pin('GP25') # toggle the led hbl.toggle() ... diff --git a/docs/library/pyb.Pin.rst b/docs/library/pyb.Pin.rst index 092af11c7a..00a65126d9 100644 --- a/docs/library/pyb.Pin.rst +++ b/docs/library/pyb.Pin.rst @@ -67,14 +67,14 @@ Usage Model: Board pins are identified by their string name:: - g = pyb.Pin('GPIO9', af=0, mode=pyb.Pin.IN, type=pyb.Pin.STD, strength=pyb.Pin.S2MA) + g = pyb.Pin('GP9', af=0, mode=pyb.Pin.IN, type=pyb.Pin.STD, strength=pyb.Pin.S2MA) You can also configure the Pin to generate interrupts. For instance:: def pincb(pin): print(pin.name()) - pin_int = pyb.Pin('GPIO10', af=0, mode=Pin.IN, type=pyb.Pin.STD_PD, strength=pyb.Pin.S2MA) + pin_int = pyb.Pin('GP10', af=0, mode=Pin.IN, type=pyb.Pin.STD_PD, strength=pyb.Pin.S2MA) pin_int.callback (mode=pyb.Pin.INT_RISING, handler=pincb) # the callback can be triggered manually pin_int.callback()() @@ -288,12 +288,12 @@ Methods board. Please note: - If ``wakes=pyb.Sleep.ACTIVE`` any pin can wake the board. - - If ``wakes=pyb.Sleep.SUSPENDED`` pins ``GPIO2``, ``GPIO4``, ``GPIO10``, - ``GPIO11``, GPIO17`` or ``GPIO24`` can wake the board. Note that only 1 + - If ``wakes=pyb.Sleep.SUSPENDED`` pins ``GP2``, ``GP4``, ``GP10``, + ``GP11``, GP17`` or ``GP24`` can wake the board. Note that only 1 of this pins can be enabled as a wake source at the same time, so, only the last enabled pin as a ``pyb.Sleep.SUSPENDED`` wake source will have effect. - - If ``wakes=pyb.Sleep.SUSPENDED`` pins ``GPIO2``, ``GPIO4``, ``GPIO10``, - ``GPIO11``, ``GPIO17`` and ``GPIO24`` can wake the board. In this case all of the + - If ``wakes=pyb.Sleep.SUSPENDED`` pins ``GP2``, ``GP4``, ``GP10``, + ``GP11``, ``GP17`` and ``GP24`` can wake the board. In this case all of the 6 pins can be enabled as a ``pyb.Sleep.HIBERNATE`` wake source at the same time. - Values can be ORed to make a pin generate interrupts in more than one power mode. diff --git a/docs/library/pyb.SD.rst b/docs/library/pyb.SD.rst index cbdfdfd04a..0746b435bf 100644 --- a/docs/library/pyb.SD.rst +++ b/docs/library/pyb.SD.rst @@ -15,7 +15,7 @@ Example usage:: # data, clk and cmd pins must be passed along with # their respective alternate functions - sd = pyb.SD('GPIO15', 8, 'GPIO10', 6, 'GPIO11', 6) + sd = pyb.SD('GP15', 8, 'GP10', 6, 'GP11', 6) sd.enable() # enable and mount the SD card sd.disable() # disable and unmount it diff --git a/docs/wipy/general.rst b/docs/wipy/general.rst index 976fb6891f..f7c867e0c7 100644 --- a/docs/wipy/general.rst +++ b/docs/wipy/general.rst @@ -35,21 +35,21 @@ If you power up normally, or press the reset button, the WiPy will boot into standard mode; the ``boot.py`` file will be executed first, then ``main.py`` will run. -You can override this boot sequence by pulling ``GPIO28`` **up** (connect +You can override this boot sequence by pulling ``GP28`` **up** (connect it to the 3v3 output pin) during reset. This procedure also allows going back in time to old firmware versions. The WiPy can hold up to 3 different firmware versions, which are: the factory firmware plus 2 user updates. -After reset, if ``GPIO28`` is held high, the heart beat LED will start flashing +After reset, if ``GP28`` is held high, the heart beat LED will start flashing slowly, if after 3 seconds the pin is still being held high, the LED will start blinking a bit faster and the WiPy will select the previous user update to boot. -If the previous user update is the desired firmware image, ``GPIO28`` must be +If the previous user update is the desired firmware image, ``GP28`` must be released before 3 more seconds elapse. If 3 seconds later the pin is still high, the factory firmware will be selected, the LED will flash quickly for 1.5 seconds and the WiPy will proceed to boot. The firmware selection mechanism is as follows: -**Safe Boot Pin** ``GPIO28`` **released during:** +**Safe Boot Pin** ``GP28`` **released during:** +-------------------------+-------------------------+----------------------------+ | 1st 3 secs window | 2nd 3 secs window | Final 1.5 secs window | diff --git a/docs/wipy/quickref.rst b/docs/wipy/quickref.rst index a8e0bdc98a..34517d2738 100644 --- a/docs/wipy/quickref.rst +++ b/docs/wipy/quickref.rst @@ -27,14 +27,14 @@ See :ref:`pyb.Pin `. :: from pyb import Pin - # initialize GPIO2 in gpio mode (af=0) and make it an output - p_out = Pin('GPIO2', af=0, mode=Pin.OUT) + # initialize GP2 in gpio mode (af=0) and make it an output + p_out = Pin('GP2', af=0, mode=Pin.OUT) p_out.high() p_out.low() p_out.toggle() - # make GPIO1 an input with the pull-up enabled - p_in = Pin('GPIO1', af = 0, mode=Pin.IN, type = Pin.STD_PU) + # make GP1 an input with the pull-up enabled + p_in = Pin('GP1', af = 0, mode=Pin.IN, type = Pin.STD_PU) p_in.value() # get value, 0 or 1 Timers @@ -50,7 +50,7 @@ See :ref:`pyb.Timer ` and :ref:`pyb.Pin `. :: tim_a.time() # get the value in microseconds tim_a.freq(1) # 1 Hz - p_out = Pin('GPIO2', af=0, mode=Pin.OUT) + p_out = Pin('GP2', af=0, mode=Pin.OUT) tim_a.callback(handler=lambda t: p_out.toggle()) PWM (pulse width modulation) @@ -61,8 +61,8 @@ See :ref:`pyb.Pin ` and :ref:`pyb.Timer `. :: from pyb import Timer from pyb import Pin - # assign GPIO25 to alternate function 5 (PWM) - p_out = Pin('GPIO25', af=9, type=Pin.STD) + # assign GP25 to alternate function 5 (PWM) + p_out = Pin('GP25', af=9, type=Pin.STD) # timer 2 in PWM mode and width must be 16 buts tim = Timer(2, mode=Timer.PWM, width=16) @@ -88,8 +88,8 @@ See :ref:`pyb.Pin ` and :ref:`pyb.UART `. :: from pyb import Pin, UART # first assign TX and RX to the correct pins - Pin('GPIO1', af=3, mode=Pin.STD_PU) # TX - Pin('GPIO2', af=3, mode=Pin.STD_PU) # RX + Pin('GP1', af=3, mode=Pin.STD_PU) # TX + Pin('GP2', af=3, mode=Pin.STD_PU) # RX uart = UART(1, 9600) uart.write('hello') @@ -103,10 +103,10 @@ See :ref:`pyb.Pin ` and :ref:`pyb.SPI `. :: from pyb import Pin, SPI # first assign CLK, MISO, MOSI, CS to the correct pins - Pin('GPIO14', af=7, mode=Pin.STD) # CLK - Pin('GPIO15', af=7, mode=Pin.STD) # MISO - Pin('GPIO16', af=7, mode=Pin.STD) # MOSI - Pin('GPIO17', af=7, mode=Pin.STD) # NSS/CS + Pin('GP14', af=7, mode=Pin.STD) # CLK + Pin('GP15', af=7, mode=Pin.STD) # MISO + Pin('GP16', af=7, mode=Pin.STD) # MOSI + Pin('GP17', af=7, mode=Pin.STD) # NSS/CS # configure the SPI master @ 2MHz spi = SPI(1, SPI.MASTER, baudrate=200000, polarity=0, phase=0) @@ -122,8 +122,8 @@ See :ref:`pyb.Pin ` and :ref:`pyb.I2C `. :: from pyb import Pin, I2C # first assign SCL and SDA to the correct pins - Pin('GPIO23', af=9, mode=Pin.STD_PU) # SCL - Pin('GPIO24', af=9, mode=Pin.STD_PU) # SDA + Pin('GP23', af=9, mode=Pin.STD_PU) # SCL + Pin('GP24', af=9, mode=Pin.STD_PU) # SDA # configure the I2C bus i2c = I2C(1, I2C.MASTER, baudrate=100000) @@ -174,7 +174,7 @@ See :ref:`pyb.SD `. :: # SD card pins need special configuration so we pass 'em to the constructor # data pin, data af, clock pin, clock af, cmd pin, cmd af - sd = pyb.SD('GPIO15', 8, 'GPIO10', 6, 'GPIO11', 6) + sd = pyb.SD('GP15', 8, 'GP10', 6, 'GP11', 6) sd.enable() WLAN (WiFi) @@ -220,7 +220,7 @@ See :ref:`pyb.HeartBeat `. :: from pyb import HeartBeat - # disable the heart beat indication (you are free to use this LED connected to GPIO25) + # disable the heart beat indication (you are free to use this LED connected to GP25) HeartBeat().disable() # enable the heart beat again HeartBeat().enable()