Lines Matching +full:pin +full:- +full:offset
4 * SPDX-License-Identifier: Apache-2.0
38 0x0642, /* 3: jmp x--, 2 [6] */
44 0x2020, /* 0: wait 0 pin, 0 */
47 0x0642, /* 3: jmp x--, 2 [6] */
48 0x00c8, /* 4: jmp pin, 8 */
50 0x20a0, /* 6: wait 1 pin, 0 */
58 uint32_t offset; in pio_uart_tx_init() local
62 return -EBUSY; in pio_uart_tx_init()
65 offset = pio_add_program(pio, RPI_PICO_PIO_GET_PROGRAM(uart_tx)); in pio_uart_tx_init()
75 offset + RPI_PICO_PIO_GET_WRAP_TARGET(uart_tx), in pio_uart_tx_init()
76 offset + RPI_PICO_PIO_GET_WRAP(uart_tx)); in pio_uart_tx_init()
80 pio_sm_init(pio, sm, offset, &sm_config); in pio_uart_tx_init()
89 uint32_t offset; in pio_uart_rx_init() local
92 return -EBUSY; in pio_uart_rx_init()
95 offset = pio_add_program(pio, RPI_PICO_PIO_GET_PROGRAM(uart_rx)); in pio_uart_rx_init()
105 offset + RPI_PICO_PIO_GET_WRAP_TARGET(uart_rx), in pio_uart_rx_init()
106 offset + RPI_PICO_PIO_GET_WRAP(uart_rx)); in pio_uart_rx_init()
108 pio_sm_init(pio, sm, offset, &sm_config); in pio_uart_rx_init()
116 const struct pio_uart_config *config = dev->config; in pio_uart_poll_in()
117 PIO pio = pio_rpi_pico_get_pio(config->piodev); in pio_uart_poll_in()
118 struct pio_uart_data *data = dev->data; in pio_uart_poll_in()
125 uart_rx_fifo_msb = (io_rw_8 *)&pio->rxf[data->rx_sm] + 3; in pio_uart_poll_in()
126 if (pio_sm_is_rx_fifo_empty(pio, data->rx_sm)) { in pio_uart_poll_in()
127 return -1; in pio_uart_poll_in()
137 const struct pio_uart_config *config = dev->config; in pio_uart_poll_out()
138 struct pio_uart_data *data = dev->data; in pio_uart_poll_out()
140 pio_sm_put_blocking(pio_rpi_pico_get_pio(config->piodev), data->tx_sm, (uint32_t)c); in pio_uart_poll_out()
145 const struct pio_uart_config *config = dev->config; in pio_uart_init()
146 struct pio_uart_data *data = dev->data; in pio_uart_init()
153 pio = pio_rpi_pico_get_pio(config->piodev); in pio_uart_init()
154 sm_clock_div = (float)clock_get_hz(clk_sys) / (CYCLES_PER_BIT * config->baudrate); in pio_uart_init()
156 retval = pio_rpi_pico_allocate_sm(config->piodev, &tx_sm); in pio_uart_init()
157 retval |= pio_rpi_pico_allocate_sm(config->piodev, &rx_sm); in pio_uart_init()
163 data->tx_sm = tx_sm; in pio_uart_init()
164 data->rx_sm = rx_sm; in pio_uart_init()
166 retval = pio_uart_tx_init(pio, tx_sm, config->tx_pin, sm_clock_div); in pio_uart_init()
171 retval = pio_uart_rx_init(pio, rx_sm, config->rx_pin, sm_clock_div); in pio_uart_init()
176 return pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); in pio_uart_init()