File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
ports/atmel-samd/common-hal/busio Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 2121#include "samd/dma.h"
2222#include "samd/sercom.h"
2323
24- void setup_pin (const mcu_pin_obj_t * pin , uint32_t pinmux ) {
25- gpio_set_pin_direction (pin -> number , GPIO_DIRECTION_OUT );
26- gpio_set_pin_pull_mode (pin -> number , GPIO_PULL_OFF );
27- gpio_set_pin_function (pin -> number , pinmux );
28- claim_pin (pin );
29- hri_port_set_PINCFG_DRVSTR_bit (PORT , (enum gpio_port )GPIO_PORT (pin -> number ), GPIO_PIN (pin -> number ));
30- }
24+ void setup_pin (const mcu_pin_obj_t * pin , uint32_t pinmux );
3125
3226void common_hal_busio_spi_construct (busio_spi_obj_t * self ,
3327 const mcu_pin_obj_t * clock , const mcu_pin_obj_t * mosi ,
@@ -323,3 +317,11 @@ uint8_t common_hal_busio_spi_get_polarity(busio_spi_obj_t *self) {
323317 void * hw = self -> spi_desc .dev .prvt ;
324318 return hri_sercomspi_get_CTRLA_CPOL_bit (hw );
325319}
320+
321+ void setup_pin (const mcu_pin_obj_t * pin , uint32_t pinmux ) {
322+ gpio_set_pin_direction (pin -> number , GPIO_DIRECTION_OUT );
323+ gpio_set_pin_pull_mode (pin -> number , GPIO_PULL_OFF );
324+ gpio_set_pin_function (pin -> number , pinmux );
325+ claim_pin (pin );
326+ hri_port_set_PINCFG_DRVSTR_bit (PORT , (enum gpio_port )GPIO_PORT (pin -> number ), GPIO_PIN (pin -> number ));
327+ }
You can’t perform that action at this time.
0 commit comments