Kinetis SDK v.1.2 Demo Applications User's Guide  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
driver_examples/spi/spi_polling/master/main.c File Reference
#include <string.h>
#include "fsl_spi_master_driver.h"
#include "fsl_clock_manager.h"
#include "fsl_debug_console.h"
#include "board.h"
#include <stdio.h>

Macros

#define SPI_MASTER_INSTANCE
 
#define TRANSFER_SIZE
 
#define TRANSFER_BAUDRATE
 
#define MASTER_TRANSFER_TIMEOUT
 

Functions

int main (void)
 Function prototype for main function. More...
 

Variables

const uint32_t g_spiFifoSize [SPI_INSTANCE_COUNT]
 
SPI_Type *const g_spiBase [SPI_INSTANCE_COUNT]
 Table of base pointers for SPI instances. More...
 
uint8_t s_spiSinkBuffer [TRANSFER_SIZE]
 Buffer for storing data received by the SPI slave driver. More...
 
uint8_t s_spiSourceBuffer [TRANSFER_SIZE]
 Buffer that supplies data to be transmitted with the SPI slave driver. More...
 

Macro Definition Documentation

#define MASTER_TRANSFER_TIMEOUT
#define SPI_MASTER_INSTANCE
#define TRANSFER_BAUDRATE
#define TRANSFER_SIZE

Function Documentation

int main ( void  )

Function prototype for main function.

Function prototype for main function.

This function used the input of user as trigger to start the measurement. When user press any key, the conversion will begin, then print converted value and current temperature of the chip.

Function prototype for main function.

Run a simple application which enables watchdog, then continuously refreshes the watchdog to prevent CPU reset Upon SW1 button push, the watchdog will expire after approximately 1 seconds and chip will reset.

Function prototype for main function.

This function uses terminal to enter DAC value and convert this value to DAC output.

Function prototype for main function.

This function use DMA peripheral to transfer two buffers

Function prototype for main function.

Thid function uses DSPI master to send an array to slave and receive the array back from slave, thencompare whether the two buffers are the same.

Function prototype for main function.

This function sends back received buffer from master through DSPI interface.

Function prototype for main function.

This function sends an array through DSPI loopback interface and compare it with received buffer whether they are the same.

Function prototype for main function.

This function use EDMA peripheral to transfer two buffers

Function prototype for main function.

This function use EWM as a watchdog for an external circuit. when the counter reaches high value, EWM enter interrupt.

Function prototype for main function.

This function uses SSD to demonstrate flash mode:

  • Check flash information.
  • Erase a sector and verify.
  • Program a sector and verify.

Function prototype for main function.

This function use PWM to controll brightness of a LED. LED is brighter and then dimmer, continuously.

Function prototype for main function.

This function toogles LED1 when press SW.

Function prototype for main function.

This function uses PDB to generate a constant period of time. Each time, PDB expires, interrupt occurres.

Function prototype for main function.

Example single timer period and interrupt on multiple channels

Function prototype for main function.

This function demostrates how to use RTC as an alarm clock.

Parameters
receiveBuffBuffer used to hold received data

Return code from each SSD function

Address of the target location

Return protection status

Number of longword or phrase to be verified

0=normal, 1=user, 2=factory - margin read for reading

Indicate LED is brighter or dimmer

Use LPTMR in Time Counter mode

When hit compare value, set counter back to zero

bypass prescaler

use 1kHz Low Power Clock

< Enables slcd clock from osc

< SLCD starts fault detection and caused an LCD interrupt later

< SLCD starts blinking mode

< SLCD stops blinking mode

< SLCD starts blank display mode

< SLCD stops blank display mode

Variable Documentation

SPI_Type* const g_spiBase[SPI_INSTANCE_COUNT]
const uint32_t g_spiFifoSize[SPI_INSTANCE_COUNT]
uint8_t s_spiSinkBuffer[TRANSFER_SIZE]
uint8_t s_spiSourceBuffer[TRANSFER_SIZE]