File tree 1 file changed +10
-4
lines changed
ports/nrf/common-hal/busio 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -137,11 +137,17 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, const mcu_pin_obj_t *
137
137
138
138
nrfx_twim_config_t config = NRFX_TWIM_DEFAULT_CONFIG (scl -> number , sda -> number );
139
139
140
- // change freq. only if it's less than the default 400K
141
- if (frequency < 100000 ) {
142
- config .frequency = NRF_TWIM_FREQ_100K ;
143
- } else if (frequency < 250000 ) {
140
+ #if defined(TWIM_FREQUENCY_FREQUENCY_K1000 )
141
+ if (frequency >= 1000000 ) {
142
+ config .frequency = NRF_TWIM_FREQ_1000K ;
143
+ } else
144
+ #endif
145
+ if (frequency >= 400000 ) {
146
+ config .frequency = NRF_TWIM_FREQ_400K ;
147
+ } else if (frequency >= 250000 ) {
144
148
config .frequency = NRF_TWIM_FREQ_250K ;
149
+ } else {
150
+ config .frequency = NRF_TWIM_FREQ_100K ;
145
151
}
146
152
147
153
self -> scl_pin_number = scl -> number ;
You can’t perform that action at this time.
0 commit comments