![]() |
Samsung Internal API reference
2.0
|
Data Structures | |
| struct | TEES_SPIConfig |
| Configuration of SPI device. More... | |
| struct | TEES_SPITransfer |
| Descriptor to transfer data over SPI. More... | |
Typedefs | |
| typedef struct __TEES_SPIHandlerImpl * | TEES_SPIHandler |
Functions | |
| TEE_Result | TEES_SPIDMAInit (uintptr_t address) |
| Initialize DMA for working with SPI device. More... | |
| TEE_Result | TEES_SPIInit (uint32_t port, const TEES_SPIConfig *cfg, TEES_SPIHandler *handler) |
| Initialize handler fields. More... | |
| TEE_Result | TEES_SPIExit (TEES_SPIHandler handler) |
| Free handler resource. More... | |
| TEE_Result | TEES_SPISetConfig (TEES_SPIHandler handler, const TEES_SPIConfig *cfg) |
| Initialize handler with configuration values. More... | |
| TEE_Result | TEES_SPISetClockSpeed (TEES_SPIHandler handler, uint32_t speedHz) |
| Set clock frequency rate. More... | |
| TEE_Result | TEES_SPISetBitsPerWord (TEES_SPIHandler handler, uint8_t bitsPerWord) |
| Set the number of bits that will be transferred per SPI rate. More... | |
| TEE_Result | TEES_SPISetDMAMode (TEES_SPIHandler handler, bool isEnabled) |
| Enable or disable DMA mode. More... | |
| TEE_Result | TEES_SPISetCPOL (TEES_SPIHandler handler, uint8_t cpol) |
| Set SPI clock polarity bit. More... | |
| TEE_Result | TEES_SPISetCPHA (TEES_SPIHandler handler, uint8_t cpha) |
| Set SPI clock phase bit. More... | |
| TEE_Result | TEES_SPIClockEnable (TEES_SPIHandler handler) |
| Not implemented. More... | |
| TEE_Result | TEES_SPIClockDisable (TEES_SPIHandler handler) |
| Not implemented. More... | |
| TEE_Result | TEES_SPIWrite (TEES_SPIHandler handler, TEES_SPITransfer *tx) |
| Transfer data from buffer bus to SPI. More... | |
| TEE_Result | TEES_SPIRead (TEES_SPIHandler handler, TEES_SPITransfer *rx) |
| Transfer data from SPI bus to buffer. More... | |
| TEE_Result | TEES_SPIWriteRead (TEES_SPIHandler handler, TEES_SPITransfer *tx, TEES_SPITransfer *rx) |
| Transfer data from buffer to SPI bus. More... | |
Provides set of functions to manipulate device connected with SPI bus.
| struct TEES_SPIConfig |
Configuration of SPI device.
| struct TEES_SPITransfer |
#include <tee_spi.h>
SPI handler structure
| TEE_Result TEES_SPIClockDisable | ( | TEES_SPIHandler | handler | ) |
#include <tee_spi.h>
Not implemented.
| [in] | handler | SPI handler which contains device descriptor. |
| TEE_Result TEES_SPIClockEnable | ( | TEES_SPIHandler | handler | ) |
#include <tee_spi.h>
Not implemented.
| [in] | handler | SPI handler which contains device descriptor. |
| TEE_Result TEES_SPIDMAInit | ( | uintptr_t | address | ) |
#include <tee_spi.h>
Initialize DMA for working with SPI device.
| [in] | address | DMA address base. |
| TEE_Result TEES_SPIExit | ( | TEES_SPIHandler | handler | ) |
#include <tee_spi.h>
Free handler resource.
| [in] | handler | SPI handler which contains device descriptor. |
Example:
| TEE_Result TEES_SPIInit | ( | uint32_t | port, |
| const TEES_SPIConfig * | cfg, | ||
| TEES_SPIHandler * | handler | ||
| ) |
#include <tee_spi.h>
Initialize handler fields.
| [in] | port | Number of SPI controller. |
| [in] | cfg | Pointer to SPI configuration for port initialisation. |
| [out] | handler | Pointer to SPI handler which contains device descriptor. |
| TEE_SUCCESS | on success. |
| TEE_ERROR_OUT_OF_MEMORY | on failure. |
Example:
| TEE_Result TEES_SPIRead | ( | TEES_SPIHandler | handler, |
| TEES_SPITransfer * | rx | ||
| ) |
#include <tee_spi.h>
Transfer data from SPI bus to buffer.
| [in] | handler | SPI handler which contains device descriptor. |
| [out] | rx | Pointer to buffer to store data. |
| TEE_SUCCESS | on success. |
| TEE_ERROR_GENERIC | on failure. |
Example:
| TEE_Result TEES_SPISetBitsPerWord | ( | TEES_SPIHandler | handler, |
| uint8_t | bitsPerWord | ||
| ) |
#include <tee_spi.h>
Set the number of bits that will be transferred per SPI rate.
| [in] | handler | SPI handler which contains device descriptor. |
| [in] | bitsPerWord | bits per word. |
Example:
| TEE_Result TEES_SPISetClockSpeed | ( | TEES_SPIHandler | handler, |
| uint32_t | speedHz | ||
| ) |
#include <tee_spi.h>
Set clock frequency rate.
| [in] | handler | SPI handler which contains device descriptor. |
| [in] | speedHz | Value of frequency rate. |
Example:
| TEE_Result TEES_SPISetConfig | ( | TEES_SPIHandler | handler, |
| const TEES_SPIConfig * | cfg | ||
| ) |
#include <tee_spi.h>
Initialize handler with configuration values.
| [in] | handler | SPI handler which contains device descriptor. |
| [in] | cfg | Pointer to SPI configuration for handler initialisation. |
Example:
| TEE_Result TEES_SPISetCPHA | ( | TEES_SPIHandler | handler, |
| uint8_t | cpha | ||
| ) |
#include <tee_spi.h>
Set SPI clock phase bit.
| [in] | handler | SPI handler which contains device descriptor. |
| [in] | cpha | Value of phase bit. |
Example:
| TEE_Result TEES_SPISetCPOL | ( | TEES_SPIHandler | handler, |
| uint8_t | cpol | ||
| ) |
#include <tee_spi.h>
Set SPI clock polarity bit.
| [in] | handler | SPI handler which contains device descriptor. |
| [in] | cpol | Value of polarity bit. |
Example:
| TEE_Result TEES_SPISetDMAMode | ( | TEES_SPIHandler | handler, |
| bool | isEnabled | ||
| ) |
#include <tee_spi.h>
Enable or disable DMA mode.
| [in] | handler | SPI handler which contains device descriptor. |
| [in] | isEnabled | true – enable, false - disable. |
Example:
| TEE_Result TEES_SPIWrite | ( | TEES_SPIHandler | handler, |
| TEES_SPITransfer * | tx | ||
| ) |
#include <tee_spi.h>
Transfer data from buffer bus to SPI.
| [in] | handler | SPI handler which contains device descriptor. |
| [in] | tx | Pointer to buffer to read data from. |
| TEE_SUCCESS | on success. |
| TEE_ERROR_GENERIC | on failure. |
| TEE_Result TEES_SPIWriteRead | ( | TEES_SPIHandler | handler, |
| TEES_SPITransfer * | tx, | ||
| TEES_SPITransfer * | rx | ||
| ) |
#include <tee_spi.h>
Transfer data from buffer to SPI bus.
| [in] | handler | SPI handler which contains device descriptor. |
| [in] | tx | Pointer to buffer to read data from. |
| [out] | rx | Pointer to buffer to store data. |
| TEE_SUCCESS | on success. |
| TEE_ERROR_BAD_PARAMETERS | rx and tx buffers have different size. |
Example: