CC3200 Peripheral Driver Library User's Guide
1.2.0
|
Functions | |
void | SDHostInit (unsigned long ulBase) |
void | SDHostCmdReset (unsigned long ulBase) |
long | SDHostCmdSend (unsigned long ulBase, unsigned long ulCmd, unsigned ulArg) |
tBoolean | SDHostDataNonBlockingWrite (unsigned long ulBase, unsigned long ulData) |
void | SDHostDataWrite (unsigned long ulBase, unsigned long ulData) |
void | SDHostDataRead (unsigned long ulBase, unsigned long *pulData) |
tBoolean | SDHostDataNonBlockingRead (unsigned long ulBase, unsigned long *pulData) |
void | SDHostIntRegister (unsigned long ulBase, void(*pfnHandler)(void)) |
void | SDHostIntUnregister (unsigned long ulBase) |
void | SDHostIntEnable (unsigned long ulBase, unsigned long ulIntFlags) |
void | SDHostIntDisable (unsigned long ulBase, unsigned long ulIntFlags) |
unsigned long | SDHostIntStatus (unsigned long ulBase) |
void | SDHostIntClear (unsigned long ulBase, unsigned long ulIntFlags) |
void | SDHostCardErrorMaskSet (unsigned long ulBase, unsigned long ulErrMask) |
unsigned long | SDHostCardErrorMaskGet (unsigned long ulBase) |
void | SDHostSetExpClk (unsigned long ulBase, unsigned long ulSDHostClk, unsigned long ulCardClk) |
void | SDHostRespGet (unsigned long ulBase, unsigned long ulRespnse[4]) |
void | SDHostBlockSizeSet (unsigned long ulBase, unsigned short ulBlkSize) |
void | SDHostBlockCountSet (unsigned long ulBase, unsigned short ulBlkCount) |
void SDHostBlockCountSet | ( | unsigned long | ulBase, |
unsigned short | ulBlkCount | ||
) |
Set the block size and count for data transfer
ulBase | is the base address of SDHost module |
ulBlkCount | is the number of blocks |
This function sets block count for the data transfer. This needs to be set for each block transfer.
void SDHostBlockSizeSet | ( | unsigned long | ulBase, |
unsigned short | ulBlkSize | ||
) |
Set the block size for data transfer
ulBase | is the base address of SDHost module |
ulBlkSize | is the transfer block size in bytes |
This function sets the block size the data transfer.
The parameter ulBlkSize is size of each data block in bytes. This should be in range 0 - 2^10.
unsigned long SDHostCardErrorMaskGet | ( | unsigned long | ulBase | ) |
Gets the card status error mask.
ulBase | is the base address of SDHost module |
This function gets the card status error mask for response type R1, R1b, R5, R5b and R6 response.
void SDHostCardErrorMaskSet | ( | unsigned long | ulBase, |
unsigned long | ulErrMask | ||
) |
Sets the card status error mask.
ulBase | is the base address of SDHost module |
ulErrMask | is the bit mask of card status errors to be enabled |
This function sets the card status error mask for response type R1, R1b, R5, R5b and R6 response. The parameter ulErrMask is the bit mask of card status errors to be enabled, if the corresponding bits in the 'card status' field of a respose are set then the host controller indicates a card error interrupt status. Only bits referenced as type E (error) in status field in the response can set a card status error.
void SDHostCmdReset | ( | unsigned long | ulBase | ) |
Resets SDHost command line
ulBase | is the base address of SDHost module. |
This function assers a soft reset for the command line
long SDHostCmdSend | ( | unsigned long | ulBase, |
unsigned long | ulCmd, | ||
unsigned | ulArg | ||
) |
Sends command over SDHost interface
ulBase | is the base address of SDHost module. |
ulCmd | is the command to send. |
ulArg | is the argument for the command. |
This function send command to the attached card over the SDHost interface.
The ulCmd parameter can be one of SDHOST_CMD_0 to SDHOST_CMD_63. It can be logically ORed with one or more of the following:
The parameter ulArg is the argument for the command
tBoolean SDHostDataNonBlockingRead | ( | unsigned long | ulBase, |
unsigned long * | pulData | ||
) |
Reads single data word from the SDHost read buffer
ulBase | is the base address of SDHost module. |
pulData | is pointer to read data variable. |
This function reads a data word from the SDHost read buffer. The function returns true if there was data available in to buffer else returns false.
tBoolean SDHostDataNonBlockingWrite | ( | unsigned long | ulBase, |
unsigned long | ulData | ||
) |
Writes a data word into the SDHost write buffer.
ulBase | is the base address of SDHost module. |
ulData | is data word to be transfered. |
This function writes a single data word into the SDHost write buffer. The function returns true if there was a space available in the buffer else returns false.
void SDHostDataRead | ( | unsigned long | ulBase, |
unsigned long * | pulData | ||
) |
Waits for a data word from the SDHost read buffer
ulBase | is the base address of SDHost module. |
pulData | is pointer to read data variable. |
This function reads a single data word from the SDHost read buffer. If there is no data available in the buffer the function will wait until a data word is received before returning.
void SDHostDataWrite | ( | unsigned long | ulBase, |
unsigned long | ulData | ||
) |
Waits to write a data word into the SDHost write buffer.
ulBase | is the base address of SDHost module. |
ulData | is data word to be transfered. |
This function writes ulData into the SDHost write buffer. If there is no space in the write buffer this function waits until there is a space available before returning.
void SDHostInit | ( | unsigned long | ulBase | ) |
Configures SDHost module.
ulBase | is the base address of SDHost module. |
This function configures the SDHost module, enabling internal sub-modules.
void SDHostIntClear | ( | unsigned long | ulBase, |
unsigned long | ulIntFlags | ||
) |
Clears the individual interrupt sources.
ulBase | is the base address of SDHost module. |
ulIntFlags | is a bit mask of the interrupt sources to be cleared. |
The specified SDHost interrupt sources are cleared, so that they no longer assert. This function must be called in the interrupt handler to keep the interrupt from being recognized again immediately upon exit.
The ulIntFlags parameter has the same definition as the ulIntFlags parameter to SDHostIntEnable().
void SDHostIntDisable | ( | unsigned long | ulBase, |
unsigned long | ulIntFlags | ||
) |
Enable individual interrupt source for the specified SDHost
ulBase | is the base address of SDHost module. |
ulIntFlags | is a bit mask of the interrupt sources to be enabled. |
This function disables the indicated SDHost interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
The ulIntFlags parameter has the same definition as the ulIntFlags parameter to SDHostIntEnable().
void SDHostIntEnable | ( | unsigned long | ulBase, |
unsigned long | ulIntFlags | ||
) |
Enable individual interrupt source for the specified SDHost
ulBase | is the base address of SDHost module. |
ulIntFlags | is a bit mask of the interrupt sources to be enabled. |
This function enables the indicated SDHost interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
The ulIntFlags parameter is the logical OR of any of the following:
SDHOST_INT_DMAWR Write DMA done interrupt
Note that SDHOST_INT_ERRI can only be used with
void SDHostIntRegister | ( | unsigned long | ulBase, |
void(*)(void) | pfnHandler | ||
) |
Registers the interrupt handler for SDHost interrupt
ulBase | is the base address of SDHost module |
pfnHandler | is a pointer to the function to be called when the SDHost interrupt occurs. |
This function does the actual registering of the interrupt handler. This function enables the global interrupt in the interrupt controller; specific SDHost interrupts must be enabled via SDHostIntEnable(). It is the interrupt handler's responsibility to clear the interrupt source.
unsigned long SDHostIntStatus | ( | unsigned long | ulBase | ) |
Gets the current interrupt status.
ulBase | is the base address of SDHost module. |
This function returns the interrupt status for the specified SDHost.
void SDHostIntUnregister | ( | unsigned long | ulBase | ) |
Unregisters the interrupt handler for SDHost interrupt
ulBase | is the base address of SDHost module |
This function does the actual unregistering of the interrupt handler. It clears the handler to be called when a SDHost interrupt occurs. This function also masks off the interrupt in the interrupt controller so that the interrupt handler no longer is called.
void SDHostRespGet | ( | unsigned long | ulBase, |
unsigned long | ulRespnse[4] | ||
) |
Get the response for the last command.
ulBase | is the base address of SDHost module |
ulRespnse | is 128-bit response. |
This function gets the response from the SD card for the last command send.
void SDHostSetExpClk | ( | unsigned long | ulBase, |
unsigned long | ulSDHostClk, | ||
unsigned long | ulCardClk | ||
) |
Sets the SD Card clock.
ulBase | is the base address of SDHost module |
ulSDHostClk | is the rate of clock supplied to SDHost module |
ulCardClk | is the required SD interface clock |
This function configures the SDHost interface to supply the specified clock to the connected card.