This replaces the previous make-pin-table.py with an implementation based on boardgen.py. - MICROPY_PY_MACHINE_PIN_BOARD_CPU macro is removed. This isn't optional on other ports, so no need for it to be optional on SAMD. - pin_af_table is removed, and lookups just search the cpu dict instead (this saves N*wordsize bytes of firmware size to have this extra table). - pins.csv is now BOARD,CPU to match other ports. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
22 lines
676 B
C
22 lines
676 B
C
// pins_prefix.c becomes the initial portion of the generated pins file.
|
|
|
|
#include <stdio.h>
|
|
|
|
#include "py/obj.h"
|
|
#include "py/mphal.h"
|
|
#include "extmod/modmachine.h"
|
|
#include "pin_af.h"
|
|
#include "genhdr/pins.h"
|
|
|
|
#if defined(MCU_SAMD21)
|
|
|
|
#define PIN(p_name, p_eic, p_adc0, p_sercom1, p_sercom2, p_tcc1, p_tcc2) \
|
|
{{&machine_pin_type}, PIN_##p_name, MP_QSTR_##p_name, p_eic, p_adc0, p_sercom1, p_sercom2, p_tcc1, p_tcc2 }
|
|
|
|
#elif defined(MCU_SAMD51)
|
|
|
|
#define PIN(p_name, p_eic, p_adc0, p_adc1, p_sercom1, p_sercom2, p_tc, p_tcc1, p_tcc2) \
|
|
{{&machine_pin_type}, PIN_##p_name, MP_QSTR_##p_name, p_eic, p_adc0, p_adc1, p_sercom1, p_sercom2, p_tc, p_tcc1, p_tcc2 }
|
|
|
|
#endif
|