Kinetis SDK v.1.3 API Reference Manual
Rev. 0
Freescale Semiconductor, Inc.
|
#include <stdint.h>
#include <stdbool.h>
#include "fsl_device_registers.h"
Data Structures | |
struct | dspi_data_format_config_t |
DSPI data format settings configuration structure. More... | |
struct | dspi_baud_rate_divisors_t |
DSPI baud rate divisors settings configuration structure. More... | |
struct | dspi_command_config_t |
DSPI command and data configuration structure. More... | |
Functions | |
Configuration | |
void | DSPI_HAL_Init (SPI_Type *base) |
Restores the DSPI to reset the configuration. More... | |
static void | DSPI_HAL_Enable (SPI_Type *base) |
Enables the DSPI peripheral and sets the MCR MDIS to 0. More... | |
static void | DSPI_HAL_Disable (SPI_Type *base) |
Disables the DSPI peripheral, sets MCR MDIS to 1. More... | |
uint32_t | DSPI_HAL_SetBaudRate (SPI_Type *base, dspi_ctar_selection_t whichCtar, uint32_t bitsPerSec, uint32_t sourceClockInHz) |
Sets the DSPI baud rate in bits per second. More... | |
void | DSPI_HAL_SetBaudDivisors (SPI_Type *base, dspi_ctar_selection_t whichCtar, const dspi_baud_rate_divisors_t *divisors) |
Configures the baud rate divisors manually. More... | |
static void | DSPI_HAL_SetMasterSlaveMode (SPI_Type *base, dspi_master_slave_mode_t mode) |
Configures the DSPI for master or slave. More... | |
static bool | DSPI_HAL_IsMaster (SPI_Type *base) |
Returns whether the DSPI module is in master mode. More... | |
static void | DSPI_HAL_SetContinuousSckCmd (SPI_Type *base, bool enable) |
Configures the DSPI for the continuous SCK operation. More... | |
static void | DSPI_HAL_SetRxFifoOverwriteCmd (SPI_Type *base, bool enable) |
Configures the DSPI received FIFO overflow overwrite enable. More... | |
void | DSPI_HAL_SetPcsPolarityMode (SPI_Type *base, dspi_which_pcs_config_t pcs, dspi_pcs_polarity_config_t activeLowOrHigh) |
Configures the DSPI peripheral chip select polarity. More... | |
void | DSPI_HAL_SetFifoCmd (SPI_Type *base, bool enableTxFifo, bool enableRxFifo) |
Enables (or disables) the DSPI FIFOs. More... | |
void | DSPI_HAL_SetFlushFifoCmd (SPI_Type *base, bool enableFlushTxFifo, bool enableFlushRxFifo) |
Flushes the DSPI FIFOs. More... | |
static void | DSPI_HAL_SetDatainSamplepointMode (SPI_Type *base, dspi_master_sample_point_t samplePnt) |
Configures the time when the DSPI master samples SIN in the Modified Transfer Format. More... | |
static void | DSPI_HAL_StartTransfer (SPI_Type *base) |
Starts the DSPI transfers, clears HALT bit in MCR. More... | |
static void | DSPI_HAL_StopTransfer (SPI_Type *base) |
Stops (halts) DSPI transfers, sets HALT bit in MCR. More... | |
dspi_status_t | DSPI_HAL_SetDataFormat (SPI_Type *base, dspi_ctar_selection_t whichCtar, const dspi_data_format_config_t *config) |
Configures the data format for a particular CTAR. More... | |
void | DSPI_HAL_SetDelay (SPI_Type *base, dspi_ctar_selection_t whichCtar, uint32_t prescaler, uint32_t scaler, dspi_delay_type_t whichDelay) |
Manually configures the delay prescaler and scaler for a particular CTAR. More... | |
uint32_t | DSPI_HAL_CalculateDelay (SPI_Type *base, dspi_ctar_selection_t whichCtar, dspi_delay_type_t whichDelay, uint32_t sourceClockInHz, uint32_t delayInNanoSec) |
Calculates the delay prescaler and scaler based on the desired delay input in nanoseconds. More... | |
static uint32_t | DSPI_HAL_GetMasterPushrRegAddr (SPI_Type *base) |
Gets the DSPI master PUSHR data register address for DMA operation. More... | |
static uint32_t | DSPI_HAL_GetSlavePushrRegAddr (SPI_Type *base) |
Gets the DSPI slave PUSHR data register address for DMA operation. More... | |
static uint32_t | DSPI_HAL_GetPoprRegAddr (SPI_Type *base) |
Gets the DSPI POPR data register address for DMA operation. More... | |
Interrupts | |
void | DSPI_HAL_SetTxFifoFillDmaIntMode (SPI_Type *base, dspi_dma_or_int_mode_t mode, bool enable) |
Configures the DSPI Tx FIFO fill request to generate DMA or interrupt requests. More... | |
void | DSPI_HAL_SetRxFifoDrainDmaIntMode (SPI_Type *base, dspi_dma_or_int_mode_t mode, bool enable) |
Configures the DSPI Rx FIFO Drain request to generate DMA or interrupt requests. More... | |
void | DSPI_HAL_SetIntMode (SPI_Type *base, dspi_status_and_interrupt_request_t interruptSrc, bool enable) |
Configures the DSPI interrupts. More... | |
static bool | DSPI_HAL_GetIntMode (SPI_Type *base, dspi_status_and_interrupt_request_t interruptSrc) |
Gets DSPI interrupt configuration, returns if interrupt request is enabled or disabled. More... | |
Status | |
static bool | DSPI_HAL_GetStatusFlag (SPI_Type *base, dspi_status_and_interrupt_request_t statusFlag) |
Gets the DSPI status flag state. More... | |
static void | DSPI_HAL_ClearStatusFlag (SPI_Type *base, dspi_status_and_interrupt_request_t statusFlag) |
Clears the DSPI status flag. More... | |
Data transfer | |
static uint32_t | DSPI_HAL_ReadData (SPI_Type *base) |
Reads data from the data buffer. More... | |
static void | DSPI_HAL_WriteDataSlavemode (SPI_Type *base, uint32_t data) |
Writes data into the data buffer, slave mode. More... | |
void | DSPI_HAL_WriteDataSlavemodeBlocking (SPI_Type *base, uint32_t data) |
Writes data into the data buffer, slave mode and waits till data was transmitted and return. More... | |
void | DSPI_HAL_WriteDataMastermode (SPI_Type *base, dspi_command_config_t *command, uint16_t data) |
Writes data into the data buffer, master mode. More... | |
void | DSPI_HAL_WriteDataMastermodeBlocking (SPI_Type *base, dspi_command_config_t *command, uint16_t data) |
Writes data into the data buffer, master mode and waits till complete to return. More... | |
static void | DSPI_HAL_WriteCmdDataMastermode (SPI_Type *base, uint32_t data) |
Writes a 32-bit data word (16-bit command appended with 16-bit data) into the data buffer, master mode. More... | |
void | DSPI_HAL_WriteCmdDataMastermodeBlocking (SPI_Type *base, uint32_t data) |
Writes a 32-bit data word (16-bit command appended with 16-bit data) into the data buffer, master mode and waits till complete to return. More... | |
static uint32_t | DSPI_HAL_GetTransferCount (SPI_Type *base) |
Gets the transfer count. More... | |
static void | DSPI_HAL_PresetTransferCount (SPI_Type *base, uint16_t presetValue) |
Pre-sets the transfer count. More... | |
uint32_t | DSPI_HAL_GetFormattedCommand (SPI_Type *base, dspi_command_config_t *command) |
Returns the DSPI command word formatted to the PUSHR data register bit field. More... | |