Bouffalo SDK  1.0
Bouffalolab Software Development Kit
bflb_wo.h
Go to the documentation of this file.
1 #ifndef _BFLB_WO_H
2 #define _BFLB_WO_H
3 
4 #include "bflb_core.h"
5 
17 #define WO_MODE_WRITE 0
18 #define WO_MODE_SET_CLR 1
26 #define WO_INT_END (1 << 0)
27 #define WO_INT_FIFO (1 << 1)
28 #define WO_INT_FER (1 << 2)
42 struct bflb_wo_cfg_s {
43  uint16_t code_total_cnt;
44  uint8_t code0_first_cnt;
45  uint8_t code1_first_cnt;
48  uint8_t idle_level;
49  uint8_t fifo_threshold;
50  uint8_t mode;
51 };
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
64 void bflb_wo_pin_init(struct bflb_device_s *dev, uint8_t pin, uint8_t mode);
65 
72 void bflb_wo_init(struct bflb_device_s *dev, struct bflb_wo_cfg_s *cfg);
73 
79 void bflb_wo_enable(struct bflb_device_s *dev);
80 
86 void bflb_wo_disable(struct bflb_device_s *dev);
87 
94 uint32_t bflb_wo_get_fifo_available_cnt(struct bflb_device_s *dev);
95 
104 uint32_t bflb_wo_push_fifo(struct bflb_device_s *dev, uint16_t *data, uint32_t len);
105 
111 void bflb_wo_clear_fifo(struct bflb_device_s *dev);
112 
118 void bflb_wo_enable_dma(struct bflb_device_s *dev);
119 
125 void bflb_wo_disable_dma(struct bflb_device_s *dev);
126 
133 uint32_t bflb_wo_get_int_status(struct bflb_device_s *dev);
134 
141 void bflb_wo_int_mask(struct bflb_device_s *dev, uint32_t int_type);
142 
149 void bflb_wo_int_unmask(struct bflb_device_s *dev, uint32_t int_type);
150 
157 void bflb_wo_int_clear(struct bflb_device_s *dev, uint32_t int_type);
158 
166 void bflb_wo_uart_init(struct bflb_device_s *dev, uint32_t baudrate, uint8_t pin);
167 
174 void bflb_wo_uart_putchar(struct bflb_device_s *dev, uint8_t ch);
175 
183 void bflb_wo_uart_put(struct bflb_device_s *dev, uint8_t *data, uint32_t len);
184 
185 #ifdef __cplusplus
186 }
187 #endif
188 
189 #endif /* _BFLB_WO_H */
void bflb_wo_int_clear(struct bflb_device_s *dev, uint32_t int_type)
Clear wo interrupt status.
void bflb_wo_uart_put(struct bflb_device_s *dev, uint8_t *data, uint32_t len)
Put a block of data on wo uart. This is a poll api.
void bflb_wo_uart_init(struct bflb_device_s *dev, uint32_t baudrate, uint8_t pin)
Initialize wo uart.
WO configuration structure.
Definition: bflb_wo.h:42
uint8_t code0_first_level
Definition: bflb_wo.h:46
void bflb_wo_pin_init(struct bflb_device_s *dev, uint8_t pin, uint8_t mode)
Initialize wo pin.
void bflb_wo_int_unmask(struct bflb_device_s *dev, uint32_t int_type)
Enable or unmask wo interrupt.
uint8_t idle_level
Definition: bflb_wo.h:48
uint8_t mode
Definition: bflb_wo.h:50
uint32_t bflb_wo_get_fifo_available_cnt(struct bflb_device_s *dev)
Get the count of available space in fifo.
void bflb_wo_int_mask(struct bflb_device_s *dev, uint32_t int_type)
Disable or mask wo interrupt.
void bflb_wo_enable(struct bflb_device_s *dev)
Enable wo.
uint32_t bflb_wo_push_fifo(struct bflb_device_s *dev, uint16_t *data, uint32_t len)
Put len count of data on wo.
void bflb_wo_uart_putchar(struct bflb_device_s *dev, uint8_t ch)
Put one char on wo uart.
void bflb_wo_disable_dma(struct bflb_device_s *dev)
Disable wo dma.
uint8_t fifo_threshold
Definition: bflb_wo.h:49
uint8_t code1_first_cnt
Definition: bflb_wo.h:45
uint32_t bflb_wo_get_int_status(struct bflb_device_s *dev)
Get wo interrupt status.
void bflb_wo_enable_dma(struct bflb_device_s *dev)
Enable wo dma.
uint8_t code0_first_cnt
Definition: bflb_wo.h:44
uint8_t code1_first_level
Definition: bflb_wo.h:47
void bflb_wo_disable(struct bflb_device_s *dev)
Disable wo.
void bflb_wo_init(struct bflb_device_s *dev, struct bflb_wo_cfg_s *cfg)
Initialize wo.
uint16_t code_total_cnt
Definition: bflb_wo.h:43
void bflb_wo_clear_fifo(struct bflb_device_s *dev)
Clear wo fifo.