Lines Matching refs:offset
132 static int add_program_at_offset_check(PIO pio, const pio_program_t *program, uint offset) { in add_program_at_offset_check() argument
133 valid_params_if(HARDWARE_PIO, offset < PIO_INSTRUCTION_COUNT); in add_program_at_offset_check()
134 valid_params_if(HARDWARE_PIO, offset + program->length <= PIO_INSTRUCTION_COUNT); in add_program_at_offset_check()
139 …if (program->origin >= 0 && (uint)program->origin != offset) return PICO_ERROR_BAD_ALIGNMENT; // t… in add_program_at_offset_check()
142 return (used_mask & (program_mask << offset)) ? PICO_ERROR_INSUFFICIENT_RESOURCES : PICO_OK; in add_program_at_offset_check()
153 bool pio_can_add_program_at_offset(PIO pio, const pio_program_t *program, uint offset) { in pio_can_add_program_at_offset() argument
155 bool rc = add_program_at_offset_check(pio, program, offset) == 0; in pio_can_add_program_at_offset()
160 static int add_program_at_offset(PIO pio, const pio_program_t *program, uint offset) { in add_program_at_offset() argument
161 int rc = add_program_at_offset_check(pio, program, offset); in add_program_at_offset()
165 …pio->instr_mem[offset + i] = pio_instr_bits_jmp != _pio_major_instr_bits(instr) ? instr : instr + … in add_program_at_offset()
168 _used_instruction_space[pio_get_index(pio)] |= program_mask << offset; in add_program_at_offset()
169 return (int)offset; in add_program_at_offset()
175 int offset = find_offset_for_program(pio, program); in pio_add_program() local
176 if (offset >= 0) { in pio_add_program()
177 offset = add_program_at_offset(pio, program, (uint) offset); in pio_add_program()
180 return offset; in pio_add_program()
183 int pio_add_program_at_offset(PIO pio, const pio_program_t *program, uint offset) { in pio_add_program_at_offset() argument
185 int rc = add_program_at_offset(pio, program, offset); in pio_add_program_at_offset()
395 …pio_claim_free_sm_and_add_program(const pio_program_t *program, PIO *pio, uint *sm, uint *offset) { in pio_claim_free_sm_and_add_program() argument
396 return pio_claim_free_sm_and_add_program_for_gpio_range(program, pio, sm, offset, 0, 0, false); in pio_claim_free_sm_and_add_program()
399 …m_for_gpio_range(const pio_program_t *program, PIO *pio, uint *sm, uint *offset, uint gpio_base, u… in pio_claim_free_sm_and_add_program_for_gpio_range() argument
437 *offset = (uint) rc; in pio_claim_free_sm_and_add_program_for_gpio_range()
455 void pio_remove_program_and_unclaim_sm(const pio_program_t *program, PIO pio, uint sm, uint offset)… in pio_remove_program_and_unclaim_sm() argument
458 pio_remove_program(pio, program, offset); in pio_remove_program_and_unclaim_sm()