no-OS
pico_uart.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef _PICO_UART_H_
34 #define _PICO_UART_H_
35 
36 /******************************************************************************/
37 /***************************** Include Files **********************************/
38 /******************************************************************************/
39 
40 #include "no_os_uart.h"
41 #include "no_os_irq.h"
42 #include "hardware/uart.h"
43 
44 /******************************************************************************/
45 /*************************** Types Declarations *******************************/
46 /******************************************************************************/
47 
54  uart_inst_t *uart_instance;
59 };
60 
64 enum uart_tx_gp {
65  /* UART0 available configurations */
69  /* UART1 available configurations */
72 };
73 
77 enum uart_rx_gp {
78  /* UART0 available configurations */
82  /* UART1 available configurations */
85 };
86 
95 };
96 
100 extern const struct no_os_uart_platform_ops pico_uart_ops;
101 
102 #endif
pico_uart.h
Header file of UART driver for pico.
no_os_alloc.h
no_os_uart_init_param::parity
enum no_os_uart_parity parity
Definition: no_os_uart.h:122
lf256fifo_remove
void lf256fifo_remove(struct lf256fifo *fifo)
no_os_uart_platform_ops
Structure holding UART function pointers that point to the platform specific function.
Definition: no_os_uart.h:155
NO_OS_EVT_UART_RX_COMPLETE
@ NO_OS_EVT_UART_RX_COMPLETE
Definition: no_os_irq.h:64
no_os_uart_init_param::extra
void * extra
Definition: no_os_uart.h:127
no_os_callback_desc
Structure describing a callback to be registered.
Definition: no_os_irq.h:142
UART0_RX_GP1
@ UART0_RX_GP1
Definition: pico_uart.h:79
NO_OS_UART_STOP_1_BIT
@ NO_OS_UART_STOP_1_BIT
Definition: no_os_uart.h:94
no_os_irq.h
Header file of IRQ interface.
no_os_irq_register_callback
int32_t no_os_irq_register_callback(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, struct no_os_callback_desc *callback_desc)
Register a callback to handle the irq events.
Definition: no_os_irq.c:92
lf256fifo_init
int lf256fifo_init(struct lf256fifo **)
no_os_uart_init_param::size
enum no_os_uart_size size
Definition: no_os_uart.h:120
pico_uart_desc::uart_instance
uart_inst_t * uart_instance
Definition: pico_uart.h:54
uart_tx_gp
uart_tx_gp
Available GP config for UART TX.
Definition: pico_uart.h:64
UART1_RX_GP9
@ UART1_RX_GP9
Definition: pico_uart.h:84
UART1_TX_GP8
@ UART1_TX_GP8
Definition: pico_uart.h:71
no_os_uart_platform_ops::init
int32_t(* init)(struct no_os_uart_desc **, struct no_os_uart_init_param *)
Definition: no_os_uart.h:157
NO_OS_UART_CS_5
@ NO_OS_UART_CS_5
Definition: no_os_uart.h:60
UART0_TX_GP16
@ UART0_TX_GP16
Definition: pico_uart.h:68
pico_uart_init_param::uart_tx_pin
enum uart_tx_gp uart_tx_pin
Definition: pico_uart.h:92
no_os_uart_init_param::irq_id
uint32_t irq_id
Definition: no_os_uart.h:114
uart_rx_gp
uart_rx_gp
Available GP config for UART RX.
Definition: pico_uart.h:77
pico_irq_ops
const struct no_os_irq_platform_ops pico_irq_ops
pico specific IRQ platform ops structure
Definition: pico_irq.c:416
no_os_uart_desc::device_id
uint8_t device_id
Definition: no_os_uart.h:138
UART0_TX_GP12
@ UART0_TX_GP12
Definition: pico_uart.h:67
UART0_RX_GP17
@ UART0_RX_GP17
Definition: pico_uart.h:81
lf256fifo_read
int lf256fifo_read(struct lf256fifo *, uint8_t *)
no_os_uart_desc
Stucture holding the UART descriptor.
Definition: no_os_uart.h:134
no_os_error.h
Error codes definition.
no_os_uart_init_param::asynchronous_rx
bool asynchronous_rx
Definition: no_os_uart.h:116
pico_uart_init_param::uart_rx_pin
enum uart_rx_gp uart_rx_pin
Definition: pico_uart.h:94
uart_rx_callback
void uart_rx_callback(void *context)
UART RX callback handler.
Definition: pico_uart.c:55
UART0_TX_GP0
@ UART0_TX_GP0
Definition: pico_uart.h:66
pico_uart_ops
const struct no_os_uart_platform_ops pico_uart_ops
pico specific UART platform ops structure
Definition: pico_uart.c:299
UART0_RX_GP13
@ UART0_RX_GP13
Definition: pico_uart.h:80
no_os_uart_desc::extra
void * extra
Definition: no_os_uart.h:147
no_os_irq_unregister_callback
int32_t no_os_irq_unregister_callback(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, struct no_os_callback_desc *callback_desc)
Unregisters a generic IRQ handling function.
Definition: no_os_irq.c:112
no_os_irq_init_param::platform_ops
const struct no_os_irq_platform_ops * platform_ops
Definition: no_os_irq.h:111
no_os_uart_desc::rx_fifo
struct lf256fifo * rx_fifo
Definition: no_os_uart.h:142
UART1_TX_GP4
@ UART1_TX_GP4
Definition: pico_uart.h:70
lf256fifo_write
int lf256fifo_write(struct lf256fifo *, uint8_t)
no_os_irq_ctrl_init
int32_t no_os_irq_ctrl_init(struct no_os_irq_ctrl_desc **desc, const struct no_os_irq_init_param *param)
Initialize the IRQ interrupts.
Definition: no_os_irq.c:45
pico_uart_ops
const struct no_os_uart_platform_ops pico_uart_ops
pico platform specific UART platform ops structure
Definition: pico_uart.c:299
no_os_callback_desc::callback
void(* callback)(void *context)
Definition: no_os_irq.h:144
no_os_uart_init_param::baud_rate
uint32_t baud_rate
Definition: no_os_uart.h:118
no_os_uart_init_param::stop
enum no_os_uart_stop stop
Definition: no_os_uart.h:124
no_os_malloc
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
NO_OS_UART_PAR_EVEN
@ NO_OS_UART_PAR_EVEN
Definition: no_os_uart.h:85
no_os_lf256fifo.h
SPSC lock-free fifo of fixed size (256), specialized for UART.
no_os_uart_desc::irq_id
uint32_t irq_id
Definition: no_os_uart.h:140
NO_OS_UART_CS_7
@ NO_OS_UART_CS_7
Definition: no_os_uart.h:64
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
NO_OS_UART_CS_6
@ NO_OS_UART_CS_6
Definition: no_os_uart.h:62
UART1_RX_GP5
@ UART1_RX_GP5
Definition: pico_uart.h:83
pico_uart_desc::nvic
struct no_os_irq_ctrl_desc * nvic
Definition: pico_uart.h:56
NULL
#define NULL
Definition: wrapper.h:64
no_os_uart_init_param
Structure holding the parameters for UART initialization.
Definition: no_os_uart.h:110
no_os_irq_init_param
Structure holding the initial parameters for Interrupt Request.
Definition: no_os_irq.h:107
NO_OS_UART_PAR_NO
@ NO_OS_UART_PAR_NO
Definition: no_os_uart.h:77
NO_OS_UART_IRQ
@ NO_OS_UART_IRQ
Definition: no_os_irq.h:86
no_os_irq_ctrl_remove
int32_t no_os_irq_ctrl_remove(struct no_os_irq_ctrl_desc *desc)
Free the resources allocated by no_os_irq_ctrl_init().
Definition: no_os_irq.c:71
pico_irq.h
Header file for pico irq specifics.
no_os_uart_init_param::device_id
uint8_t device_id
Definition: no_os_uart.h:112
no_os_irq_enable
int32_t no_os_irq_enable(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
Enable specific interrupt.
Definition: no_os_irq.c:181
pico_uart_desc
pico platform specific UART descriptor
Definition: pico_uart.h:52
NO_OS_UART_PAR_ODD
@ NO_OS_UART_PAR_ODD
Definition: no_os_uart.h:83
no_os_uart.h
Header file of UART interface.
pico_uart_desc::rx_callback
struct no_os_callback_desc rx_callback
Definition: pico_uart.h:58
no_os_irq_disable
int32_t no_os_irq_disable(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
Disable specific interrupt.
Definition: no_os_irq.c:198
no_os_irq_ctrl_desc
Definition: no_os_irq.h:123
NO_OS_UART_CS_8
@ NO_OS_UART_CS_8
Definition: no_os_uart.h:66
pico_uart_init_param
Additional UART config parameters.
Definition: pico_uart.h:90