no-OS
stm32_uart.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef _STM32_UART_H_
40 #define _STM32_UART_H_
41 
42 #include <stdint.h>
43 #include <stdbool.h>
44 #include "no_os_uart.h"
45 #include "no_os_irq.h"
46 #include "stm32_hal.h"
47 
54  UART_HandleTypeDef *huart;
56  uint32_t timeout;
57 };
58 
65  UART_HandleTypeDef *huart;
67  uint32_t timeout;
72 };
73 
77 extern const struct no_os_uart_platform_ops stm32_uart_ops;
78 
79 #endif
no_os_alloc.h
no_os_uart_init_param::parity
enum no_os_uart_parity parity
Definition: no_os_uart.h:128
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:161
NO_OS_EVT_UART_RX_COMPLETE
@ NO_OS_EVT_UART_RX_COMPLETE
Definition: no_os_irq.h:70
uart_rx_callback
void uart_rx_callback(void *context)
Definition: stm32_uart.c:51
no_os_uart_init_param::extra
void * extra
Definition: no_os_uart.h:133
no_os_callback_desc
Structure describing a callback to be registered.
Definition: no_os_irq.h:148
NO_OS_UART_STOP_1_BIT
@ NO_OS_UART_STOP_1_BIT
Definition: no_os_uart.h:100
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:98
lf256fifo_init
int lf256fifo_init(struct lf256fifo **)
no_os_uart_init_param::size
enum no_os_uart_size size
Definition: no_os_uart.h:126
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:163
no_os_uart_desc::baud_rate
uint32_t baud_rate
Definition: no_os_uart.h:150
no_os_uart_init_param::irq_id
uint32_t irq_id
Definition: no_os_uart.h:120
no_os_calloc
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:60
stm32_uart_desc::huart
UART_HandleTypeDef * huart
Definition: stm32_uart.h:65
no_os_uart_desc::device_id
uint8_t device_id
Definition: no_os_uart.h:144
stm32_uart_desc::timeout
uint32_t timeout
Definition: stm32_uart.h:67
stm32_uart_desc::nvic
struct no_os_irq_ctrl_desc * nvic
Definition: stm32_uart.h:69
no_os_callback_desc::peripheral
enum no_os_irq_peripheral peripheral
Definition: no_os_irq.h:156
stm32_uart_init_param
Specific initialization parameters for stm32 UART.
Definition: stm32_uart.h:52
lf256fifo_read
int lf256fifo_read(struct lf256fifo *, uint8_t *)
no_os_uart_desc
Stucture holding the UART descriptor.
Definition: no_os_uart.h:140
no_os_uart_init_param::asynchronous_rx
bool asynchronous_rx
Definition: no_os_uart.h:122
stm32_uart_ops
const struct no_os_uart_platform_ops stm32_uart_ops
STM32 platform specific UART platform ops structure.
Definition: stm32_uart.c:303
stm32_uart.h
Header file of UART driver for STM32.
no_os_uart_desc::extra
void * extra
Definition: no_os_uart.h:153
stm32_irq.h
Header file for stm32 irq specifics.
no_os_callback_desc::ctx
void * ctx
Definition: no_os_irq.h:152
stm32_uart_desc
stm32 platform specific UART descriptor
Definition: stm32_uart.h:63
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:118
no_os_irq_init_param::platform_ops
const struct no_os_irq_platform_ops * platform_ops
Definition: no_os_irq.h:117
no_os_uart_desc::rx_fifo
struct lf256fifo * rx_fifo
Definition: no_os_uart.h:148
stm32_uart_init_param::timeout
uint32_t timeout
Definition: stm32_uart.h:56
lf256fifo_write
int lf256fifo_write(struct lf256fifo *, uint8_t)
stm32_irq_ops
const struct no_os_irq_platform_ops stm32_irq_ops
stm32 specific IRQ platform ops structure
Definition: stm32_irq.c:689
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:51
no_os_callback_desc::handle
void * handle
Definition: no_os_irq.h:158
no_os_callback_desc::callback
void(* callback)(void *context)
Definition: no_os_irq.h:150
no_os_uart_init_param::baud_rate
uint32_t baud_rate
Definition: no_os_uart.h:124
no_os_uart_init_param::stop
enum no_os_uart_stop stop
Definition: no_os_uart.h:130
NO_OS_UART_CS_9
@ NO_OS_UART_CS_9
Definition: no_os_uart.h:74
stm32_uart_ops
const struct no_os_uart_platform_ops stm32_uart_ops
STM32 specific UART platform ops structure.
Definition: stm32_uart.c:303
no_os_callback_desc::event
enum no_os_irq_event event
Definition: no_os_irq.h:154
NO_OS_UART_PAR_EVEN
@ NO_OS_UART_PAR_EVEN
Definition: no_os_uart.h:91
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:146
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:75
NULL
#define NULL
Definition: wrapper.h:64
no_os_uart_init_param
Structure holding the parameters for UART initialization.
Definition: no_os_uart.h:116
stm32_uart_init_param::huart
UART_HandleTypeDef * huart
Definition: stm32_uart.h:54
no_os_irq_init_param
Structure holding the initial parameters for Interrupt Request.
Definition: no_os_irq.h:113
NO_OS_UART_PAR_NO
@ NO_OS_UART_PAR_NO
Definition: no_os_uart.h:83
NO_OS_UART_IRQ
@ NO_OS_UART_IRQ
Definition: no_os_irq.h:92
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:77
no_os_uart_init_param::device_id
uint8_t device_id
Definition: no_os_uart.h:118
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:187
NO_OS_UART_PAR_ODD
@ NO_OS_UART_PAR_ODD
Definition: no_os_uart.h:89
no_os_uart.h
Header file of UART interface.
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:204
no_os_irq_ctrl_desc
Definition: no_os_irq.h:129
stm32_uart_desc::rx_callback
struct no_os_callback_desc rx_callback
Definition: stm32_uart.h:71
NO_OS_UART_CS_8
@ NO_OS_UART_CS_8
Definition: no_os_uart.h:72
stm32_hal.h
errno.h
Error macro definition for ARM Compiler.