19 #include "bus_protocols/whd_bus_protocol_interface.h" 21 #ifndef INCLUDED_SDIO_WHD_BUS_PROTOCOL_H 22 #define INCLUDED_SDIO_WHD_BUS_PROTOCOL_H 31 #define BIT_MASK(x) ( (1 << x) - 1 ) 33 #define WHD_BUS_HEADER_SIZE (0) 35 #define WHD_BUS_SDIO_MAX_BACKPLANE_TRANSFER_SIZE (1536) 36 #define WHD_BUS_SDIO_BACKPLANE_READ_PADD_SIZE (0) 44 unsigned char stuff_bits;
45 unsigned int ocr : 24;
50 unsigned int _unique2 : 9;
51 unsigned int register_address : 17;
52 unsigned int _unique : 2;
53 unsigned int function_number : 3;
54 unsigned int rw_flag : 1;
60 unsigned int _stuff2 : 1;
61 unsigned int register_address : 17;
62 unsigned int _stuff : 1;
63 unsigned int raw_flag : 1;
64 unsigned int function_number : 3;
65 unsigned int rw_flag : 1;
70 unsigned int count : 9;
71 unsigned int register_address : 17;
72 unsigned int op_code : 1;
73 unsigned int block_mode : 1;
74 unsigned int function_number : 3;
75 unsigned int rw_flag : 1;
89 unsigned int ocr : 24;
90 unsigned int stuff_bits : 3;
91 unsigned int memory_present : 1;
92 unsigned int function_count : 3;
99 uint8_t response_flags;
105 uint16_t card_status;
119 SDIO_BLOCK_MODE = (0 << 2),
120 SDIO_BYTE_MODE = (1 << 2)
121 } sdio_transfer_mode_t;
125 SDIO_1B_BLOCK = 1, SDIO_2B_BLOCK = 2, SDIO_4B_BLOCK = 4, SDIO_8B_BLOCK = 8, SDIO_16B_BLOCK = 16,
126 SDIO_32B_BLOCK = 32, SDIO_64B_BLOCK = 64, SDIO_128B_BLOCK = 128, SDIO_256B_BLOCK = 256, SDIO_512B_BLOCK = 512,
127 SDIO_1024B_BLOCK = 1024, SDIO_2048B_BLOCK = 2048
132 RESPONSE_NEEDED, NO_RESPONSE
133 } sdio_response_needed_t;
141 #define WHD_BUS_STATS_INCREMENT_VARIABLE(bus_priv, var) \ 142 do { bus_priv->whd_bus_stats.var++; } while (0) 144 #define WHD_BUS_STATS_CONDITIONAL_INCREMENT_VARIABLE(bus_priv, condition, var) \ 145 do { if (condition){ bus_priv->whd_bus_stats.var++; }} while (0) 151 uint32_t cmd53_write;
153 uint32_t cmd53_read_fail;
154 uint32_t cmd53_write_fail;
157 uint32_t error_intrs;
158 uint32_t read_aborts;
175 uint8_t register_length, uint32_t value);
177 uint8_t register_length, uint8_t *value);
179 uint32_t address, uint8_t value_length, uint32_t value);
181 uint32_t address, uint8_t value_length, uint8_t *value);
186 whd_bus_function_t
function, uint32_t address, uint16_t size,
190 uint32_t size, uint8_t *data);
196 extern uint32_t whd_bus_sdio_packet_available_to_read(
whd_driver_t whd_driver);
202 #define DELAYED_BUS_RELEASE_SCHEDULE(whd_driver, schedule) \ 203 do { whd_delayed_bus_release_schedule_update(whd_driver, schedule); } while (0) 210 extern void whd_bus_sdio_init_stats(
whd_driver_t whd_driver);
214 uint8_t whd_bus_sdio_backplane_read_padd_size(
whd_driver_t whd_driver);
217 cy_semaphore_t *transceive_semaphore);
219 extern uint32_t whd_bus_sdio_get_max_transfer_size(
whd_driver_t whd_driver);
Provides abstract pointer type to act as instance for: driver, interface, buffer funcs, network funcs, resource funcs and bus funcs.
whd_bus_transfer_direction_t
Transfer direction for the WHD platform bus interface.
whd_bool_t
Boolean values.
uint32_t whd_result_t
WHD result is specified as uint32_t value.