Kamcho Library 02.00.03
lib.kamcho.02.00.03.287
|
Go to the source code of this file.
Data Structures | |
struct | SPI_Device_init_t |
A structure to represent SPI device initialization data. More... | |
struct | SPI_Device_t |
A structure to represent SPI device. More... | |
Macros | |
#define | SPI_BUFF_SIZE 16 |
Enumerations | |
enum | SPI_DEV_CLOCK_PHASE_t { SPI_DEV_CLOCK_PHASE0, SPI_DEV_CLOCK_PHASE1 } |
The enumeration of SPI phase. More... | |
enum | SPI_DEV_CLOCK_POLARITY_t { SPI_DEV_CLOCK_POLARITY0, SPI_DEV_CLOCK_POLARITY1 } |
The enumeration of DPI polarity. More... | |
enum | SPI_DEV_MODE_t { SPI_DEV_MODE_SLAVE, SPI_DEV_MODE_MASTER } |
The enumeration of SPI mode. More... | |
enum | { SPI_DEV_CLOCK_DIV2, SPI_DEV_CLOCK_DIV4, SPI_DEV_CLOCK_DIV8, SPI_DEV_CLOCK_DIV16, SPI_DEV_CLOCK_DIV32, SPI_DEV_CLOCK_DIV64, SPI_DEV_CLOCK_DIV128, SPI_DEV_CLOCK_DIV256, SPI_DEV_CLOCK_DIV512, SPI_DEV_CLOCK_DIV1024, SPI_DEV_CLOCK_DIV2048, SPI_DEV_CLOCK_DIV4096 } |
The enumeration of clock divider for SPI device. More... | |
Functions | |
void | SPI_DevSetClockDivider (uint8_t div) |
Set Clock Divider for SPI Device. More... | |
SPI_Device_t * | SPI_devRequest (const char *name) |
Request a SPI Device. More... | |
int32_t | SPI_devInit (SPI_Device_t *dev, SPI_Device_init_t *init) |
Initialize SPI device. More... | |
int32_t | SPI_devReadData (SPI_Device_t *dev, uint8_t cmd, uint8_t *data, uint32_t len) |
Read Data from SPI device. More... | |
int32_t | SPI_devWriteData (SPI_Device_t *dev, uint8_t cmd, uint8_t *data, uint32_t len) |
Write Data to SPI device. More... | |
This file is proprietary to Indie Semiconductor. All rights reserved. Reproduction or distribution, in whole or in part, is forbidden except by express written permission of Indie Semiconductor.
#define SPI_BUFF_SIZE 16 |
anonymous enum |
The enumeration of clock divider for SPI device.
enum SPI_DEV_MODE_t |
int32_t SPI_devInit | ( | SPI_Device_t * | dev, |
SPI_Device_init_t * | init | ||
) |
Initialize SPI device.
dev | The pointer to SPI device |
init | Pointer to the initialization data struct. |
int32_t SPI_devReadData | ( | SPI_Device_t * | dev, |
uint8_t | cmd, | ||
uint8_t * | data, | ||
uint32_t | len | ||
) |
Read Data from SPI device.
dev | The pointer to SPI device |
cmd | The enumeration of SPI command. |
data | Pointer to the returned data block from SPI device. |
len | The length of the data block to be returned from SPI device. |
SPI_Device_t* SPI_devRequest | ( | const char * | name | ) |
Request a SPI Device.
name | The name string of SPI device. |
void SPI_DevSetClockDivider | ( | uint8_t | div | ) |
Set Clock Divider for SPI Device.
div | The enumeration of the divider. |
int32_t SPI_devWriteData | ( | SPI_Device_t * | dev, |
uint8_t | cmd, | ||
uint8_t * | data, | ||
uint32_t | len | ||
) |
Write Data to SPI device.
dev | The pointer to SPI device |
cmd | The enumeration of SPI command. |
data | Pointer to the data block to be sent to SPI device. |
len | The length of the data block to be sent to SPI device. |