@@ -64,9 +64,8 @@ STATIC mp_int_t board_get_instance(size_t n_args, const mp_obj_t *args, const mp
64
64
}
65
65
#endif
66
66
67
- //| def I2C(instance: Optional[int] = 0 ) -> busio.I2C:
67
+ //| def I2C() -> busio.I2C:
68
68
//| """Returns the `busio.I2C` object for the board's designated I2C bus(es).
69
- //| If there is more than one default I2C bus, the buses are numbered starting at 0.
70
69
//| The object created is a singleton, and uses the default parameter values for `busio.I2C`."""
71
70
//| ...
72
71
//|
@@ -85,11 +84,13 @@ mp_obj_t board_i2c(size_t n_args, const mp_obj_t *args) {
85
84
return MP_ROM_NONE ;
86
85
}
87
86
#endif
88
- MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (board_i2c_obj , 0 , 1 , board_i2c );
87
+ STATIC mp_obj_t board_i2c_0 (void ) {
88
+ return board_i2c (0 , NULL );
89
+ }
90
+ MP_DEFINE_CONST_FUN_OBJ_0 (board_i2c_obj , board_i2c_0 );
89
91
90
- //| def SPI(instance: Optional[int] = 0 ) -> busio.SPI:
92
+ //| def SPI() -> busio.SPI:
91
93
//| """Returns the `busio.SPI` object for the board's designated SPI bus(es).
92
- //| If there is more than one default SPI bus, the buses are numbered starting at 0.
93
94
//| The object created is a singleton, and uses the default parameter values for `busio.SPI`."""
94
95
//| ...
95
96
//|
@@ -108,11 +109,13 @@ mp_obj_t board_spi(size_t n_args, const mp_obj_t *args) {
108
109
return MP_ROM_NONE ;
109
110
}
110
111
#endif
111
- MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (board_spi_obj , 0 , 1 , board_spi );
112
+ STATIC mp_obj_t board_spi_0 (void ) {
113
+ return board_spi (0 , NULL );
114
+ }
115
+ MP_DEFINE_CONST_FUN_OBJ_0 (board_spi_obj , board_spi_0 );
112
116
113
- //| def UART(instance: Optional[int] = 0 ) -> busio.UART:
117
+ //| def UART() -> busio.UART:
114
118
//| """Returns the `busio.UART` object for the board's designated UART bus(es).
115
- //| If there is more than one default UART bus, the buses are numbered starting at 0.
116
119
//| The object created is a singleton, and uses the default parameter values for `busio.UART`."""
117
120
//| ...
118
121
//|
@@ -131,7 +134,10 @@ mp_obj_t board_uart(size_t n_args, const mp_obj_t *args) {
131
134
return MP_ROM_NONE ;
132
135
}
133
136
#endif
134
- MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN (board_uart_obj , 0 , 1 , board_uart );
137
+ STATIC mp_obj_t board_uart_0 (void ) {
138
+ return board_uart (0 , NULL );
139
+ }
140
+ MP_DEFINE_CONST_FUN_OBJ_0 (board_uart_obj , board_uart_0 );
135
141
136
142
const mp_obj_module_t board_module = {
137
143
.base = { & mp_type_module },
0 commit comments