Bouffalo SDK  1.0
Bouffalolab Software Development Kit
bflb_sdio2.h
Go to the documentation of this file.
1 
37 #ifndef _BFLB_SDIO2_H
38 #define _BFLB_SDIO2_H
39 
40 #include "bflb_core.h"
41 
42 /* SDIO2 buffer size */
43 #define SDIO2_DEFAULT_SIZE_MAX (1024 * 2)
44 
45 /* No modification */
46 #define SDIO2_SIZE_CONSULT_MULTIPLE (256)
47 #define SDIO2_BYTE_MOD_SIZE_MAX (512)
48 #define SDIO2_MAX_PORT_NUM 16
49 
50 /* card to host interrupt event */
51 #define SDIO2_HOST_INT_EVENT_DNLD_RDY (1 << 0)
52 #define SDIO2_HOST_INT_EVENT_UPLD_RDY (1 << 1)
53 #define SDIO2_HOST_INT_EVENT_CIS_RDY (1 << 2)
54 #define SDIO2_HOST_INT_EVENT_IO_RDY (1 << 3)
55 
56 typedef struct
57 {
58  uint16_t buff_len;
59  uint16_t data_len;
60  void *buff;
61  void *user_arg;
63 
64 #ifdef __cplusplus
65 extern "C" {
66 #endif
67 
68 /* initialization */
69 int bflb_sdio2_init(struct bflb_device_s *dev, uint32_t dnld_size_max);
72 
73 /* get trans max size */
76 
77 /* attach dnld/upld buff */
80 
81 /* get dnld/upld info */
86 
87 /* isr callback attach */
88 int bflb_sdio2_dnld_irq_attach(struct bflb_device_s *dev, void (*callback)(void *arg, bflb_sdio2_trans_desc_t *trans_desc), void *arg);
89 int bflb_sdio2_upld_irq_attach(struct bflb_device_s *dev, void (*callback)(void *arg, bflb_sdio2_trans_desc_t *trans_desc), void *arg);
90 int bflb_sdio2_error_irq_attach(struct bflb_device_s *dev, void (*callback)(void *arg, bflb_sdio2_trans_desc_t *trans_desc), void *arg);
91 
92 /* trigger host interrupt event */
93 int bflb_sdio2_trig_host_int(struct bflb_device_s *dev, uint32_t event);
94 
95 #ifdef __cplusplus
96 }
97 #endif
98 
99 #endif /* _BFLB_SDIO3_H */
int bflb_sdio2_trig_host_int(struct bflb_device_s *dev, uint32_t event)
int bflb_sdio2_upld_port_push(struct bflb_device_s *dev, bflb_sdio2_trans_desc_t *trans_desc)
int bflb_sdio2_get_dnld_max_size(struct bflb_device_s *dev)
int bflb_sdio2_upld_irq_attach(struct bflb_device_s *dev, void(*callback)(void *arg, bflb_sdio2_trans_desc_t *trans_desc), void *arg)
int bflb_sdio2_init(struct bflb_device_s *dev, uint32_t dnld_size_max)
int bflb_sdio2_dnld_irq_attach(struct bflb_device_s *dev, void(*callback)(void *arg, bflb_sdio2_trans_desc_t *trans_desc), void *arg)
int bflb_sdio2_dnld_get_waiting(struct bflb_device_s *dev)
int bflb_sdio2_get_upld_max_size(struct bflb_device_s *dev)
int bflb_sdio2_get_block_size(struct bflb_device_s *dev)
int bflb_sdio2_upld_get_waiting(struct bflb_device_s *dev)
int bflb_sdio2_error_irq_attach(struct bflb_device_s *dev, void(*callback)(void *arg, bflb_sdio2_trans_desc_t *trans_desc), void *arg)
int bflb_sdio2_dnld_port_push(struct bflb_device_s *dev, bflb_sdio2_trans_desc_t *trans_desc)
int bflb_sdio2_upld_get_available(struct bflb_device_s *dev)
int bflb_sdio2_dnld_get_available(struct bflb_device_s *dev)
int bflb_sdio2_check_host_ready(struct bflb_device_s *dev)