Set frequency default 60Mhz

This commit is contained in:
gamblor21 2021-03-07 12:12:25 -06:00
parent 1658fe04f9
commit b02b1e9979
2 changed files with 1 additions and 5 deletions

View File

@ -47,10 +47,6 @@ void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t* sel
const mcu_pin_obj_t* data0, const mcu_pin_obj_t* command, const mcu_pin_obj_t* chip_select,
const mcu_pin_obj_t* write, const mcu_pin_obj_t* read, const mcu_pin_obj_t* reset, uint32_t frequency) {
// If we did not set frequency guess at 60Mhz
if (frequency == 0)
frequency = 60000000;
uint8_t data_pin = data0->number;
for (uint8_t i = 0; i < 8; i++) {
if (!pin_number_is_free(data_pin + i)) {

View File

@ -68,7 +68,7 @@ STATIC mp_obj_t displayio_parallelbus_make_new(const mp_obj_type_t *type, size_t
{ MP_QSTR_write, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED },
{ MP_QSTR_read, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED },
{ MP_QSTR_reset, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED },
{ MP_QSTR_frequency, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0 } },
{ MP_QSTR_frequency, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 60000000 } },
};
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);