@@ -85,6 +85,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(spitarget_spi_target___exit___obj, 4,
85
85
//| If a packet has already been queued for this SPI bus but has not yet been transferred, an error will be raised.
86
86
//|
87
87
//| :param bytearray miso_packet: Packet data to be sent from secondary to main on next request."""
88
+ //| :param bytearray mosi_packet: Packet to be filled with data from main on next request."""
88
89
//|
89
90
STATIC mp_obj_t spitarget_spi_target_load_packet (size_t n_args , const mp_obj_t * pos_args , mp_map_t * kw_args ) {
90
91
mp_check_self (mp_obj_is_type (pos_args [0 ], & spitarget_spi_target_type ));
@@ -115,14 +116,14 @@ STATIC mp_obj_t spitarget_spi_target_load_packet(size_t n_args, const mp_obj_t *
115
116
}
116
117
STATIC MP_DEFINE_CONST_FUN_OBJ_KW (spitarget_spi_target_load_packet_obj , 1 , spitarget_spi_target_load_packet );
117
118
118
- //| def try_transfer (self, *, timeout: float = -1) -> bool:
119
+ //| def wait_transfer (self, *, timeout: float = -1) -> bool:
119
120
//| """Wait for an SPI transfer from the main device.
120
121
//|
121
122
//| :param float timeout: Timeout in seconds. Zero means wait forever, a negative value means check once
122
123
//| :return: True if the transfer is complete, or False if no response received before the timeout
123
124
//| :rtype: ~bool"""
124
125
//|
125
- STATIC mp_obj_t spitarget_spi_target_try_transfer (size_t n_args , const mp_obj_t * pos_args , mp_map_t * kw_args ) {
126
+ STATIC mp_obj_t spitarget_spi_target_wait_transfer (size_t n_args , const mp_obj_t * pos_args , mp_map_t * kw_args ) {
126
127
mp_check_self (mp_obj_is_type (pos_args [0 ], & spitarget_spi_target_type ));
127
128
spitarget_spi_target_obj_t * self = MP_OBJ_TO_PTR (pos_args [0 ]);
128
129
if (common_hal_spitarget_spi_target_deinited (self )) {
@@ -160,14 +161,14 @@ STATIC mp_obj_t spitarget_spi_target_try_transfer(size_t n_args, const mp_obj_t
160
161
161
162
return mp_const_false ;
162
163
}
163
- STATIC MP_DEFINE_CONST_FUN_OBJ_KW (spitarget_spi_target_try_transfer_obj , 1 , spitarget_spi_target_try_transfer );
164
+ STATIC MP_DEFINE_CONST_FUN_OBJ_KW (spitarget_spi_target_wait_transfer_obj , 1 , spitarget_spi_target_wait_transfer );
164
165
165
166
STATIC const mp_rom_map_elem_t spitarget_spi_target_locals_dict_table [] = {
166
167
{ MP_ROM_QSTR (MP_QSTR_deinit ), MP_ROM_PTR (& spitarget_spi_target_deinit_obj ) },
167
168
{ MP_ROM_QSTR (MP_QSTR___enter__ ), MP_ROM_PTR (& default___enter___obj ) },
168
169
{ MP_ROM_QSTR (MP_QSTR___exit__ ), MP_ROM_PTR (& spitarget_spi_target___exit___obj ) },
169
170
{ MP_ROM_QSTR (MP_QSTR_load_packet ), MP_ROM_PTR (& spitarget_spi_target_load_packet_obj ) },
170
- { MP_ROM_QSTR (MP_QSTR_try_transfer ), MP_ROM_PTR (& spitarget_spi_target_try_transfer_obj ) },
171
+ { MP_ROM_QSTR (MP_QSTR_wait_transfer ), MP_ROM_PTR (& spitarget_spi_target_wait_transfer_obj ) },
171
172
172
173
};
173
174
0 commit comments