Kinetis SDK v.1.3 API Reference Manual
Rev. 0
Freescale Semiconductor, Inc.
|
#include "fsl_device_registers.h"
#include <stdint.h>
#include <stdbool.h>
Functions | |
Configuration | |
void | SPI_HAL_Init (SPI_Type *base) |
Restores the SPI to the reset configuration. More... | |
static void | SPI_HAL_Enable (SPI_Type *base) |
Enables the SPI peripheral. More... | |
static void | SPI_HAL_Disable (SPI_Type *base) |
Disables the SPI peripheral. More... | |
uint32_t | SPI_HAL_SetBaud (SPI_Type *base, uint32_t bitsPerSec, uint32_t sourceClockInHz) |
Sets the SPI baud rate in bits per second. More... | |
static void | SPI_HAL_SetBaudDivisors (SPI_Type *base, uint32_t prescaleDivisor, uint32_t rateDivisor) |
Configures the baud rate divisors manually. More... | |
static void | SPI_HAL_SetMasterSlave (SPI_Type *base, spi_master_slave_mode_t mode) |
Configures the SPI for master or slave. More... | |
static bool | SPI_HAL_IsMaster (SPI_Type *base) |
Returns whether the SPI module is in master mode. More... | |
void | SPI_HAL_SetSlaveSelectOutputMode (SPI_Type *base, spi_ss_output_mode_t mode) |
Sets how the slave select output operates. More... | |
void | SPI_HAL_SetDataFormat (SPI_Type *base, spi_clock_polarity_t polarity, spi_clock_phase_t phase, spi_shift_direction_t direction) |
Sets the polarity, phase, and shift direction. More... | |
static uint32_t | SPI_HAL_GetDataRegAddr (SPI_Type *base) |
Gets the SPI data register address for DMA operation. More... | |
void | SPI_HAL_SetPinMode (SPI_Type *base, spi_pin_mode_t mode) |
Sets the SPI pin mode. More... | |
Interrupts | |
void | SPI_HAL_SetIntMode (SPI_Type *base, spi_interrupt_source_t interrupt, bool enable) |
Enables or disables the SPI interrupts. More... | |
static void | SPI_HAL_SetReceiveAndFaultIntCmd (SPI_Type *base, bool enable) |
Enables or disables the SPI receive buffer/FIFO full and mode fault interrupt. More... | |
static void | SPI_HAL_SetTransmitIntCmd (SPI_Type *base, bool enable) |
Enables or disables the SPI transmit buffer/FIFO empty interrupt. More... | |
static void | SPI_HAL_SetMatchIntCmd (SPI_Type *base, bool enable) |
Enables or disables the SPI match interrupt. More... | |
Status | |
static bool | SPI_HAL_GetIntStatusFlag (SPI_Type *base, spi_int_status_flag_t flag) |
Gets the SPI interrupt status flag state. More... | |
static bool | SPI_HAL_IsReadBuffFullPending (SPI_Type *base) |
Checks whether the read buffer/FIFO is full. More... | |
static bool | SPI_HAL_IsTxBuffEmptyPending (SPI_Type *base) |
Checks whether the transmit buffer/FIFO is empty. More... | |
static bool | SPI_HAL_IsModeFaultPending (SPI_Type *base) |
Checks whether a mode fault occurred. More... | |
void | SPI_HAL_ClearModeFaultFlag (SPI_Type *base) |
Clears the mode fault flag. More... | |
static bool | SPI_HAL_IsMatchPending (SPI_Type *base) |
Checks whether the data received matches the previously-set match value. More... | |
void | SPI_HAL_ClearMatchFlag (SPI_Type *base) |
Clears the match flag. More... | |
Data transfer | |
static uint8_t | SPI_HAL_ReadData (SPI_Type *base) |
Reads a byte from the data buffer. More... | |
static void | SPI_HAL_WriteData (SPI_Type *base, uint8_t data) |
Writes a byte into the data buffer. More... | |
void | SPI_HAL_WriteDataBlocking (SPI_Type *base, uint8_t data) |
Writes a byte into the data buffer and waits till complete to return. More... | |
Match byte | |
static void | SPI_HAL_SetMatchValue (SPI_Type *base, uint8_t matchByte) |
Sets the value which triggers the match interrupt. More... | |