@@ -76,23 +76,23 @@ typedef enum
76
76
77
77
/** SDHC interrupt triggers */
78
78
typedef enum {
79
- CYHAL_SDHC_CMD_COMPLETE , //!> Command Complete
80
- CYHAL_SDHC_XFER_COMPLETE , //!> Host read/write transfer is complete
81
- CYHAL_SDHC_BGAP_EVENT , //!> This bit is set when both read/write transaction is stopped
82
- CYHAL_SDHC_DMA_INTERRUPT , //!> Host controller detects an SDMA Buffer Boundary during transfer
83
- CYHAL_SDHC_BUF_WR_READY , //!> This bit is set if the Buffer Write Enable changes from 0 to 1
84
- CYHAL_SDHC_BUF_RD_READY , //!> This bit is set if the Buffer Read Enable changes from 0 to 1
85
- CYHAL_SDHC_CARD_INSERTION , //!> This bit is set if the Card Inserted in the Present State
86
- CYHAL_SDHC_CARD_REMOVAL , //!> This bit is set if the Card Inserted in the Present State
87
- CYHAL_SDHC_CARD_INTERRUPT , //!> The synchronized value of the DAT[1] interrupt input for SD mode
88
- CYHAL_SDHC_INT_A ,
89
- CYHAL_SDHC_INT_B ,
90
- CYHAL_SDHC_INT_C ,
91
- CYHAL_SDHC_RE_TUNE_EVENT , //!> This bit is set if the Re-Tuning Request changes from 0 to 1
92
- CYHAL_SDHC_FX_EVENT , //!> This status is set when R[14] of response register is set to 1
93
- CYHAL_SDHC_CQE_EVENT , //!> This status is set if Command Queuing/Crypto event has occurred
94
- CYHAL_SDHC_ERR_INTERRUPT , //!> If any of the bits in the Error Interrupt Status register are set
95
- CYHAL_SDHC_ALL_INTERRUPTS , //!> Is used to enable/disable all interrupts
79
+ CYHAL_SDHC_CMD_COMPLETE = 0x0001 , //!> Command Complete
80
+ CYHAL_SDHC_XFER_COMPLETE = 0x0002 , //!> Host read/write transfer is complete
81
+ CYHAL_SDHC_BGAP_EVENT = 0x0004 , //!> This bit is set when both read/write transaction is stopped at the block gap
82
+ CYHAL_SDHC_DMA_INTERRUPT = 0x0008 , //!> Host controller detects an SDMA Buffer Boundary during transfer
83
+ CYHAL_SDHC_BUF_WR_READY = 0x0010 , //!> This bit is set if the Buffer Write Enable changes from 0 to 1
84
+ CYHAL_SDHC_BUF_RD_READY = 0x0020 , //!> This bit is set if the Buffer Read Enable changes from 0 to 1
85
+ CYHAL_SDHC_CARD_INSERTION = 0x0040 , //!> This bit is set if the Card Inserted in the Present State register changes from 0 to 1.
86
+ CYHAL_SDHC_CARD_REMOVAL = 0x0080 , //!> This bit is set if the Card Inserted in the Present State register changes from 1 to 0.
87
+ CYHAL_SDHC_CARD_INTERRUPT = 0x0100 , //!> The synchronized value of the DAT[1] interrupt input for SD mode
88
+ CYHAL_SDHC_INT_A = 0x0200 ,
89
+ CYHAL_SDHC_INT_B = 0x0400 ,
90
+ CYHAL_SDHC_INT_C = 0x0800 ,
91
+ CYHAL_SDHC_RE_TUNE_EVENT = 0x1000 , //!> This bit is set if the Re-Tuning Request changes from 0 to 1
92
+ CYHAL_SDHC_FX_EVENT = 0x2000 , //!> This status is set when R[14] of response register is set to 1
93
+ CYHAL_SDHC_CQE_EVENT = 0x4000 , //!> This status is set if Command Queuing/Crypto event has occurred
94
+ CYHAL_SDHC_ERR_INTERRUPT = 0x8000 , //!> If any of the bits in the Error Interrupt Status register are set
95
+ CYHAL_SDHC_ALL_INTERRUPTS = 0xFFFF , //!> Is used to enable/disable all interrupts
96
96
} cyhal_sdhc_event_t ;
97
97
98
98
/** \} group_hal_sdhc_enums */
@@ -121,7 +121,7 @@ typedef struct
121
121
{
122
122
bool enableLedControl ; //!< Drive one IO to indicate when the card is being accessed
123
123
bool lowVoltageSignaling ; //!< Whether 1.8V signaling is supported
124
- bool isEmmc ; //!< true if eMMC card, other way false
124
+ bool isEmmc ; //!< true if eMMC card, otherwise false
125
125
uint8_t busWidth ; //!< The desired bus width
126
126
} cyhal_sdhc_config_t ;
127
127
@@ -186,7 +186,7 @@ void cyhal_sdhc_free(cyhal_sdhc_t *obj);
186
186
* @param[in] obj The SDHC object
187
187
* @param[in] address The address to read data from
188
188
* @param[out] data Pointer to the byte-array of data to read from the device
189
- * @param[in,out] length Number of bytes to read, updated with the number actually read
189
+ * @param[in,out] length Number of 512 byte blocks to read, updated with the number actually read
190
190
* @return The status of the read request
191
191
*/
192
192
cy_rslt_t cyhal_sdhc_read (const cyhal_sdhc_t * obj , uint32_t address , uint8_t * data , size_t * length );
@@ -196,7 +196,7 @@ cy_rslt_t cyhal_sdhc_read(const cyhal_sdhc_t *obj, uint32_t address, uint8_t *da
196
196
* @param[in] obj The SDHC object
197
197
* @param[in] address The address to write data to
198
198
* @param[in] data Pointer to the byte-array of data to write to the device
199
- * @param[in,out] length Number of bytes to read , updated with the number actually read
199
+ * @param[in,out] length Number of 512 byte blocks to write , updated with the number actually written
200
200
* @return The status of the write request
201
201
*/
202
202
cy_rslt_t cyhal_sdhc_write (const cyhal_sdhc_t * obj , uint32_t address , const uint8_t * data , size_t * length );
@@ -205,7 +205,7 @@ cy_rslt_t cyhal_sdhc_write(const cyhal_sdhc_t *obj, uint32_t address, const uint
205
205
*
206
206
* @param[in] obj The SDHC object
207
207
* @param[in] startAddr Is the address of the first byte to erase
208
- * @param[in] length The number of bytes (starting at startAddr) to erase
208
+ * @param[in] length Number of 512 byte blocks (starting at startAddr) to erase
209
209
* @return The status of the erase request
210
210
*/
211
211
cy_rslt_t cyhal_sdhc_erase (const cyhal_sdhc_t * obj , uint32_t startAddr , size_t length );
@@ -215,7 +215,7 @@ cy_rslt_t cyhal_sdhc_erase(const cyhal_sdhc_t *obj, uint32_t startAddr, size_t l
215
215
* @param[in] obj The SDHC object that holds the transfer information
216
216
* @param[in] address The address to read data from
217
217
* @param[out] data The receive buffer
218
- * @param[in,out] length Number of bytes to read, updated with the number actually read
218
+ * @param[in,out] length Number of 512 byte blocks to read, updated with the number actually read
219
219
* @return The status of the read_async request
220
220
*/
221
221
cy_rslt_t cyhal_sdhc_read_async (const cyhal_sdhc_t * obj , uint32_t address , uint8_t * data , size_t * length );
@@ -225,7 +225,7 @@ cy_rslt_t cyhal_sdhc_read_async(const cyhal_sdhc_t *obj, uint32_t address, uint8
225
225
* @param[in] obj The SDHC object that holds the transfer information
226
226
* @param[in] address The address to write data to
227
227
* @param[in] data The transmit buffer
228
- * @param[in,out] length Number of bytes to read , updated with the number actually read
228
+ * @param[in,out] length The number of 512 byte blocks to write , updated with the number actually written
229
229
* @return The status of the write_async request
230
230
*/
231
231
cy_rslt_t cyhal_sdhc_write_async (const cyhal_sdhc_t * obj , uint32_t address , const uint8_t * data , size_t * length );
0 commit comments