tools/boardgen.py: Add initial implementation of a common make-pins.py.

For now, this implements the functionality required for esp32 and rp2,
including support for numeric pins, rp2 alternate functions, and rp2
extended pins.

This also updates the rp2 port to use the same structure for pins.h and
pins.csv as for esp32, and moves the pin definitions directly into the
table (rather than having a table of pointers), which is a small code size
improvement.

Support for "hidden" pins in pins.csv is added (matching the stm32
implementation).

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
Jim Mussared
2023-08-07 17:08:10 +10:00
committed by Damien George
parent b0aec6a0ff
commit 4bd6ec9ae4
6 changed files with 667 additions and 475 deletions

View File

@@ -65,10 +65,10 @@ extern const mp_obj_type_t machine_pin_af_type;
#include "genhdr/pins.h"
extern const mp_obj_type_t pin_cpu_pins_obj_type;
extern const mp_obj_dict_t pin_cpu_pins_locals_dict;
extern const mp_obj_dict_t machine_pin_cpu_pins_locals_dict;
extern const mp_obj_type_t pin_board_pins_obj_type;
extern const mp_obj_dict_t pin_board_pins_locals_dict;
extern const mp_obj_dict_t machine_pin_board_pins_locals_dict;
void machine_pin_ext_init(void);
bool machine_pin_ext_is_adc_channel(const machine_pin_obj_t *self);