192 lines
8.6 KiB
C
192 lines
8.6 KiB
C
// 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);
|