Update pin names

This commit is contained in:
Kevin Townsend 2018-02-13 18:17:31 +01:00
parent 5160dda473
commit b65e97bdb3
3 changed files with 48 additions and 290 deletions

View File

@ -1,191 +0,0 @@
// This file was automatically generated by make-pins.py
//
// --af nrf52_af.csv
// --board boards/pca10056/pins.csv
// --prefix boards/nrf52_prefix.c
// nrf52_prefix.c becomes the initial portion of the generated pins file.
#include <stdio.h>
#include "py/obj.h"
#include "py/mphal.h"
#include "pin.h"
#define AF(af_idx, af_fn, af_unit, af_type, af_ptr) \
{ \
{ &pin_af_type }, \
.name = MP_QSTR_AF ## af_idx ## _ ## af_fn ## af_unit, \
.idx = (af_idx), \
.fn = AF_FN_ ## af_fn, \
.unit = (af_unit), \
.type = AF_PIN_TYPE_ ## af_fn ## _ ## af_type, \
.af_fn = (af_ptr) \
}
#define PIN(p_port, p_pin, p_af, p_adc_channel) \
{ \
{ &mcu_pin_type }, \
.name = MP_QSTR_ ## p_port ## p_pin, \
.port = PORT_ ## p_port, \
.pin = (p_pin), \
.num_af = (sizeof(p_af) / sizeof(pin_af_obj_t)), \
/*.pin_mask = (1 << p_pin), */\
.af = p_af, \
.adc_channel = p_adc_channel,\
}
#define NO_ADC 0
const pin_obj_t pin_A0 = PIN(A, 0, NULL, 0);
const pin_obj_t pin_A1 = PIN(A, 1, NULL, 0);
const pin_obj_t pin_A2 = PIN(A, 2, NULL, SAADC_CH_PSELP_PSELP_AnalogInput0);
const pin_obj_t pin_A3 = PIN(A, 3, NULL, SAADC_CH_PSELP_PSELP_AnalogInput1);
const pin_obj_t pin_A4 = PIN(A, 4, NULL, SAADC_CH_PSELP_PSELP_AnalogInput2);
const pin_obj_t pin_A5 = PIN(A, 5, NULL, SAADC_CH_PSELP_PSELP_AnalogInput3);
const pin_obj_t pin_A6 = PIN(A, 6, NULL, 0);
const pin_obj_t pin_A7 = PIN(A, 7, NULL, 0);
const pin_obj_t pin_A8 = PIN(A, 8, NULL, 0);
const pin_obj_t pin_A9 = PIN(A, 9, NULL, 0);
const pin_obj_t pin_A10 = PIN(A, 10, NULL, 0);
const pin_obj_t pin_A11 = PIN(A, 11, NULL, 0);
const pin_obj_t pin_A12 = PIN(A, 12, NULL, 0);
const pin_obj_t pin_A13 = PIN(A, 13, NULL, 0);
const pin_obj_t pin_A14 = PIN(A, 14, NULL, 0);
const pin_obj_t pin_A15 = PIN(A, 15, NULL, 0);
const pin_obj_t pin_A16 = PIN(A, 16, NULL, 0);
const pin_obj_t pin_A17 = PIN(A, 17, NULL, 0);
const pin_obj_t pin_A18 = PIN(A, 18, NULL, 0);
const pin_obj_t pin_A19 = PIN(A, 19, NULL, 0);
const pin_obj_t pin_A20 = PIN(A, 20, NULL, 0);
const pin_obj_t pin_A21 = PIN(A, 21, NULL, 0);
const pin_obj_t pin_A22 = PIN(A, 22, NULL, 0);
const pin_obj_t pin_A23 = PIN(A, 23, NULL, 0);
const pin_obj_t pin_A24 = PIN(A, 24, NULL, 0);
const pin_obj_t pin_A25 = PIN(A, 25, NULL, 0);
const pin_obj_t pin_A26 = PIN(A, 26, NULL, 0);
const pin_obj_t pin_A27 = PIN(A, 27, NULL, 0);
const pin_obj_t pin_A28 = PIN(A, 28, NULL, SAADC_CH_PSELP_PSELP_AnalogInput4);
const pin_obj_t pin_A29 = PIN(A, 29, NULL, SAADC_CH_PSELP_PSELP_AnalogInput5);
const pin_obj_t pin_A30 = PIN(A, 30, NULL, SAADC_CH_PSELP_PSELP_AnalogInput6);
const pin_obj_t pin_A31 = PIN(A, 31, NULL, SAADC_CH_PSELP_PSELP_AnalogInput7);
const pin_obj_t pin_B0 = PIN(B, 0, NULL, 0);
const pin_obj_t pin_B1 = PIN(B, 1, NULL, 0);
const pin_obj_t pin_B2 = PIN(B, 2, NULL, 0);
const pin_obj_t pin_B3 = PIN(B, 3, NULL, 0);
const pin_obj_t pin_B4 = PIN(B, 4, NULL, 0);
const pin_obj_t pin_B5 = PIN(B, 5, NULL, 0);
const pin_obj_t pin_B6 = PIN(B, 6, NULL, 0);
const pin_obj_t pin_B7 = PIN(B, 7, NULL, 0);
const pin_obj_t pin_B8 = PIN(B, 8, NULL, 0);
const pin_obj_t pin_B9 = PIN(B, 9, NULL, 0);
const pin_obj_t pin_B10 = PIN(B, 10, NULL, 0);
const pin_obj_t pin_B11 = PIN(B, 11, NULL, 0);
const pin_obj_t pin_B12 = PIN(B, 12, NULL, 0);
const pin_obj_t pin_B13 = PIN(B, 13, NULL, 0);
const pin_obj_t pin_B14 = PIN(B, 14, NULL, 0);
const pin_obj_t pin_B15 = PIN(B, 15, NULL, 0);
STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_A0) },
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_A1) },
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_A2) },
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_A3) },
{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_A4) },
{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_A5) },
{ MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_A6) },
{ MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_A7) },
{ MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_A8) },
{ MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_A9) },
{ MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_A10) },
{ MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_A11) },
{ MP_ROM_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_A12) },
{ MP_ROM_QSTR(MP_QSTR_A13), MP_ROM_PTR(&pin_A13) },
{ MP_ROM_QSTR(MP_QSTR_A14), MP_ROM_PTR(&pin_A14) },
{ MP_ROM_QSTR(MP_QSTR_A15), MP_ROM_PTR(&pin_A15) },
{ MP_ROM_QSTR(MP_QSTR_A16), MP_ROM_PTR(&pin_A16) },
{ MP_ROM_QSTR(MP_QSTR_A17), MP_ROM_PTR(&pin_A17) },
{ MP_ROM_QSTR(MP_QSTR_A18), MP_ROM_PTR(&pin_A18) },
{ MP_ROM_QSTR(MP_QSTR_A19), MP_ROM_PTR(&pin_A19) },
{ MP_ROM_QSTR(MP_QSTR_A20), MP_ROM_PTR(&pin_A20) },
{ MP_ROM_QSTR(MP_QSTR_A21), MP_ROM_PTR(&pin_A21) },
{ MP_ROM_QSTR(MP_QSTR_A22), MP_ROM_PTR(&pin_A22) },
{ MP_ROM_QSTR(MP_QSTR_A23), MP_ROM_PTR(&pin_A23) },
{ MP_ROM_QSTR(MP_QSTR_A24), MP_ROM_PTR(&pin_A24) },
{ MP_ROM_QSTR(MP_QSTR_A25), MP_ROM_PTR(&pin_A25) },
{ MP_ROM_QSTR(MP_QSTR_A26), MP_ROM_PTR(&pin_A26) },
{ MP_ROM_QSTR(MP_QSTR_A27), MP_ROM_PTR(&pin_A27) },
{ MP_ROM_QSTR(MP_QSTR_A28), MP_ROM_PTR(&pin_A28) },
{ MP_ROM_QSTR(MP_QSTR_A29), MP_ROM_PTR(&pin_A29) },
{ MP_ROM_QSTR(MP_QSTR_A30), MP_ROM_PTR(&pin_A30) },
{ MP_ROM_QSTR(MP_QSTR_A31), MP_ROM_PTR(&pin_A31) },
{ MP_ROM_QSTR(MP_QSTR_B0), MP_ROM_PTR(&pin_B0) },
{ MP_ROM_QSTR(MP_QSTR_B1), MP_ROM_PTR(&pin_B1) },
{ MP_ROM_QSTR(MP_QSTR_B2), MP_ROM_PTR(&pin_B2) },
{ MP_ROM_QSTR(MP_QSTR_B3), MP_ROM_PTR(&pin_B3) },
{ MP_ROM_QSTR(MP_QSTR_B4), MP_ROM_PTR(&pin_B4) },
{ MP_ROM_QSTR(MP_QSTR_B5), MP_ROM_PTR(&pin_B5) },
{ MP_ROM_QSTR(MP_QSTR_B6), MP_ROM_PTR(&pin_B6) },
{ MP_ROM_QSTR(MP_QSTR_B7), MP_ROM_PTR(&pin_B7) },
{ MP_ROM_QSTR(MP_QSTR_B8), MP_ROM_PTR(&pin_B8) },
{ MP_ROM_QSTR(MP_QSTR_B9), MP_ROM_PTR(&pin_B9) },
{ MP_ROM_QSTR(MP_QSTR_B10), MP_ROM_PTR(&pin_B10) },
{ MP_ROM_QSTR(MP_QSTR_B11), MP_ROM_PTR(&pin_B11) },
{ MP_ROM_QSTR(MP_QSTR_B12), MP_ROM_PTR(&pin_B12) },
{ MP_ROM_QSTR(MP_QSTR_B13), MP_ROM_PTR(&pin_B13) },
{ MP_ROM_QSTR(MP_QSTR_B14), MP_ROM_PTR(&pin_B14) },
{ MP_ROM_QSTR(MP_QSTR_B15), MP_ROM_PTR(&pin_B15) },
};
MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table);
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_PA0), MP_ROM_PTR(&pin_A0) },
{ MP_ROM_QSTR(MP_QSTR_PA1), MP_ROM_PTR(&pin_A1) },
{ MP_ROM_QSTR(MP_QSTR_PA2), MP_ROM_PTR(&pin_A2) },
{ MP_ROM_QSTR(MP_QSTR_PA3), MP_ROM_PTR(&pin_A3) },
{ MP_ROM_QSTR(MP_QSTR_PA4), MP_ROM_PTR(&pin_A4) },
{ MP_ROM_QSTR(MP_QSTR_PA5), MP_ROM_PTR(&pin_A5) },
{ MP_ROM_QSTR(MP_QSTR_PA6), MP_ROM_PTR(&pin_A6) },
{ MP_ROM_QSTR(MP_QSTR_PA7), MP_ROM_PTR(&pin_A7) },
{ MP_ROM_QSTR(MP_QSTR_PA8), MP_ROM_PTR(&pin_A8) },
{ MP_ROM_QSTR(MP_QSTR_PA9), MP_ROM_PTR(&pin_A9) },
{ MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_A10) },
{ MP_ROM_QSTR(MP_QSTR_PA11), MP_ROM_PTR(&pin_A11) },
{ MP_ROM_QSTR(MP_QSTR_PA12), MP_ROM_PTR(&pin_A12) },
{ MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_A13) },
{ MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_A14) },
{ MP_ROM_QSTR(MP_QSTR_PA15), MP_ROM_PTR(&pin_A15) },
{ MP_ROM_QSTR(MP_QSTR_PA16), MP_ROM_PTR(&pin_A16) },
{ MP_ROM_QSTR(MP_QSTR_PA17), MP_ROM_PTR(&pin_A17) },
{ MP_ROM_QSTR(MP_QSTR_PA18), MP_ROM_PTR(&pin_A18) },
{ MP_ROM_QSTR(MP_QSTR_PA19), MP_ROM_PTR(&pin_A19) },
{ MP_ROM_QSTR(MP_QSTR_PA20), MP_ROM_PTR(&pin_A20) },
{ MP_ROM_QSTR(MP_QSTR_PA21), MP_ROM_PTR(&pin_A21) },
{ MP_ROM_QSTR(MP_QSTR_PA22), MP_ROM_PTR(&pin_A22) },
{ MP_ROM_QSTR(MP_QSTR_PA23), MP_ROM_PTR(&pin_A23) },
{ MP_ROM_QSTR(MP_QSTR_PA24), MP_ROM_PTR(&pin_A24) },
{ MP_ROM_QSTR(MP_QSTR_PA25), MP_ROM_PTR(&pin_A25) },
{ MP_ROM_QSTR(MP_QSTR_PA26), MP_ROM_PTR(&pin_A26) },
{ MP_ROM_QSTR(MP_QSTR_PA27), MP_ROM_PTR(&pin_A27) },
{ MP_ROM_QSTR(MP_QSTR_PA28), MP_ROM_PTR(&pin_A28) },
{ MP_ROM_QSTR(MP_QSTR_PA29), MP_ROM_PTR(&pin_A29) },
{ MP_ROM_QSTR(MP_QSTR_PA30), MP_ROM_PTR(&pin_A30) },
{ MP_ROM_QSTR(MP_QSTR_PA31), MP_ROM_PTR(&pin_A31) },
{ MP_ROM_QSTR(MP_QSTR_PB0), MP_ROM_PTR(&pin_B0) },
{ MP_ROM_QSTR(MP_QSTR_PB1), MP_ROM_PTR(&pin_B1) },
{ MP_ROM_QSTR(MP_QSTR_PB2), MP_ROM_PTR(&pin_B2) },
{ MP_ROM_QSTR(MP_QSTR_PB3), MP_ROM_PTR(&pin_B3) },
{ MP_ROM_QSTR(MP_QSTR_PB4), MP_ROM_PTR(&pin_B4) },
{ MP_ROM_QSTR(MP_QSTR_PB5), MP_ROM_PTR(&pin_B5) },
{ MP_ROM_QSTR(MP_QSTR_PB6), MP_ROM_PTR(&pin_B6) },
{ MP_ROM_QSTR(MP_QSTR_PB7), MP_ROM_PTR(&pin_B7) },
{ MP_ROM_QSTR(MP_QSTR_PB8), MP_ROM_PTR(&pin_B8) },
{ MP_ROM_QSTR(MP_QSTR_PB9), MP_ROM_PTR(&pin_B9) },
{ MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_B10) },
{ MP_ROM_QSTR(MP_QSTR_PB11), MP_ROM_PTR(&pin_B11) },
{ MP_ROM_QSTR(MP_QSTR_PB12), MP_ROM_PTR(&pin_B12) },
{ MP_ROM_QSTR(MP_QSTR_PB13), MP_ROM_PTR(&pin_B13) },
{ MP_ROM_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_B14) },
{ MP_ROM_QSTR(MP_QSTR_PB15), MP_ROM_PTR(&pin_B15) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

View File

@ -1,48 +1,48 @@
PA0,PA0
PA1,PA1
PA2,PA2,ADC0_IN0
PA3,PA3,ADC0_IN1
PA4,PA4,ADC0_IN2
PA5,PA5,ADC0_IN3
PA6,PA6
PA7,PA7
PA8,PA8
PA9,PA9
PA10,PA10
PA11,PA11
PA12,PA12
PA13,PA13
PA14,PA14
PA15,PA15
PA16,PA16
PA17,PA17
PA18,PA18
PA19,PA19
PA20,PA20
PA21,PA21
PA22,PA22
PA23,PA23
PA24,PA24
PA25,PA25
PA26,PA26
PA27,PA27
PA28,PA28,ADC0_IN4
PA29,PA29,ADC0_IN5
PA30,PA30,ADC0_IN6
PA31,PA31,ADC0_IN7
PB0,PB0
PB1,PB1
PB2,PB2
PB3,PB3
PB4,PB4
PB5,PB5
PB6,PB6
PB7,PB7
PB8,PB8
PB9,PB9
PB10,PB10
PB11,PB11
PB12,PB12
PB13,PB13
PB14,PB14
PB15,PB15
P0_00,PA0
P0_01,P0_01
P0_02,P0_02,ADC0_IN0
P0_03,P0_03,ADC0_IN1
P0_04,P0_04,ADC0_IN2
P0_05,P0_05,ADC0_IN3
P0_06,P0_06
P0_07,P0_07
P0_08,P0_08
P0_09,P0_09
P0_10,P0_10
P0_11,P0_11
P0_12,P0_12
P0_13,P0_13
P0_14,P0_14
P0_15,P0_15
P0_16,P0_16
P0_17,P0_17
P0_18,P0_18
P0_19,P0_19
P0_20,P0_20
P0_21,P0_21
P0_22,P0_22
P0_23,P0_23
P0_24,P0_24
P0_25,P0_25
P0_26,P0_26
P0_27,P0_27
P0_28,P0_28,ADC0_IN4
P0_29,P0_29,ADC0_IN5
P0_30,P0_30,ADC0_IN6
P0_31,P0_31,ADC0_IN7
P1_00,P1_00
P1_01,P1_01
P1_02,P1_02
P1_03,P1_03
P1_04,P1_04
P1_05,P1_05
P1_06,P1_06
P1_07,P1_07
P1_08,P1_08
P1_09,P1_09
P1_10,P1_10
P1_11,P1_11
P1_12,P1_12
P1_13,P1_13
P1_14,P1_14
P1_15,P1_15

1 PA0,PA0 P0_00,PA0
2 PA1,PA1 P0_01,P0_01
3 PA2,PA2,ADC0_IN0 P0_02,P0_02,ADC0_IN0
4 PA3,PA3,ADC0_IN1 P0_03,P0_03,ADC0_IN1
5 PA4,PA4,ADC0_IN2 P0_04,P0_04,ADC0_IN2
6 PA5,PA5,ADC0_IN3 P0_05,P0_05,ADC0_IN3
7 PA6,PA6 P0_06,P0_06
8 PA7,PA7 P0_07,P0_07
9 PA8,PA8 P0_08,P0_08
10 PA9,PA9 P0_09,P0_09
11 PA10,PA10 P0_10,P0_10
12 PA11,PA11 P0_11,P0_11
13 PA12,PA12 P0_12,P0_12
14 PA13,PA13 P0_13,P0_13
15 PA14,PA14 P0_14,P0_14
16 PA15,PA15 P0_15,P0_15
17 PA16,PA16 P0_16,P0_16
18 PA17,PA17 P0_17,P0_17
19 PA18,PA18 P0_18,P0_18
20 PA19,PA19 P0_19,P0_19
21 PA20,PA20 P0_20,P0_20
22 PA21,PA21 P0_21,P0_21
23 PA22,PA22 P0_22,P0_22
24 PA23,PA23 P0_23,P0_23
25 PA24,PA24 P0_24,P0_24
26 PA25,PA25 P0_25,P0_25
27 PA26,PA26 P0_26,P0_26
28 PA27,PA27 P0_27,P0_27
29 PA28,PA28,ADC0_IN4 P0_28,P0_28,ADC0_IN4
30 PA29,PA29,ADC0_IN5 P0_29,P0_29,ADC0_IN5
31 PA30,PA30,ADC0_IN6 P0_30,P0_30,ADC0_IN6
32 PA31,PA31,ADC0_IN7 P0_31,P0_31,ADC0_IN7
33 PB0,PB0 P1_00,P1_00
34 PB1,PB1 P1_01,P1_01
35 PB2,PB2 P1_02,P1_02
36 PB3,PB3 P1_03,P1_03
37 PB4,PB4 P1_04,P1_04
38 PB5,PB5 P1_05,P1_05
39 PB6,PB6 P1_06,P1_06
40 PB7,PB7 P1_07,P1_07
41 PB8,PB8 P1_08,P1_08
42 PB9,PB9 P1_09,P1_09
43 PB10,PB10 P1_10,P1_10
44 PB11,PB11 P1_11,P1_11
45 PB12,PB12 P1_12,P1_12
46 PB13,PB13 P1_13,P1_13
47 PB14,PB14 P1_14,P1_14
48 PB15,PB15 P1_15,P1_15

View File

@ -1,51 +0,0 @@
extern const pin_obj_t pin_A0;
extern const pin_obj_t pin_A1;
extern const pin_obj_t pin_A2;
extern const pin_obj_t pin_A3;
extern const pin_obj_t pin_A4;
extern const pin_obj_t pin_A5;
extern const pin_obj_t pin_A6;
extern const pin_obj_t pin_A7;
extern const pin_obj_t pin_A8;
extern const pin_obj_t pin_A9;
extern const pin_obj_t pin_A10;
extern const pin_obj_t pin_A11;
extern const pin_obj_t pin_A12;
extern const pin_obj_t pin_A13;
extern const pin_obj_t pin_A14;
extern const pin_obj_t pin_A15;
extern const pin_obj_t pin_A16;
extern const pin_obj_t pin_A17;
extern const pin_obj_t pin_A18;
extern const pin_obj_t pin_A19;
extern const pin_obj_t pin_A20;
extern const pin_obj_t pin_A21;
extern const pin_obj_t pin_A22;
extern const pin_obj_t pin_A23;
extern const pin_obj_t pin_A24;
extern const pin_obj_t pin_A25;
extern const pin_obj_t pin_A26;
extern const pin_obj_t pin_A27;
extern const pin_obj_t pin_A28;
extern const pin_obj_t pin_A29;
extern const pin_obj_t pin_A30;
extern const pin_obj_t pin_A31;
extern const pin_obj_t pin_B0;
extern const pin_obj_t pin_B1;
extern const pin_obj_t pin_B2;
extern const pin_obj_t pin_B3;
extern const pin_obj_t pin_B4;
extern const pin_obj_t pin_B5;
extern const pin_obj_t pin_B6;
extern const pin_obj_t pin_B7;
extern const pin_obj_t pin_B8;
extern const pin_obj_t pin_B9;
extern const pin_obj_t pin_B10;
extern const pin_obj_t pin_B11;
extern const pin_obj_t pin_B12;
extern const pin_obj_t pin_B13;
extern const pin_obj_t pin_B14;
extern const pin_obj_t pin_B15;
extern const pin_obj_t * const pin_adc1[];
extern const pin_obj_t * const pin_adc2[];
extern const pin_obj_t * const pin_adc3[];