![]() |
PDL for FM4
Version1.2
Peripheral Driverl Library for FM4
|
Copyright (C) 2014 Spansion LLC. All Rights Reserved.
This software is owned and published by: Spansion LLC, 915 DeGuigne Dr. Sunnyvale, CA 94088-3453 ("Spansion").
BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
This software contains source code for use with Spansion components. This software is licensed by Spansion to be adapted only for use in systems utilizing Spansion components. Spansion shall not be responsible for misuse or illegal use of this software for devices not supported herein. Spansion is providing this software "AS IS" and will not be responsible for issues arising from incorrect user implementation of the software.
SPANSION MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE, REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS), ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED WARRANTY OF NONINFRINGEMENT. SPANSION SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT, NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA, SAVINGS OR PROFITS, EVEN IF SPANSION HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED FROM, THE SOFTWARE.
This software may be replicated in part or whole for the licensed use, with the restriction that this Disclaimer and Copyright notice must be included with each copy of this software, whether used in part or whole, at all times.
History
Implementations in PDL:
| ADC | Analog Digital Cionverter |
| BT | Base Time |
| CAN | Controller Area Network |
| CLK | Clock Module |
| CRC | Cyclic Redundancy Check |
| CR | High-CR trimming |
| CSV | Clock supervisor |
| DAC | Digital Analog Converter |
| DMA | Direc Memory Access |
| DT | Dual Timer |
| DTSC | Descriptor System data Transfer Controller |
| EXINT | External Interrupt |
| EXTIF | External Bus Inerface |
| Flash | Main/Work Flash operation |
| GPIO | General Purpose Inoput/Output Ports (only header file) |
| LPM | Low Power Modes |
| LVD | Low Voltage Detection |
| MFS | Multi Function Serial Interface |
| MFT | Multi Function Timer |
| PPG | Programmable Pulse Generator |
| QPRC | Quad Decoder and Position/Revolution Counter |
| RESET | Reset Cause Register |
| RTC | Real Time Clock |
| SDIF | SD Card Interface |
| UID | Unique ID |
| USB | Universal Serial Bus |
| WC | Watch Counter |
| WDG | Watch Dog Timer (Hardware/Software) |
USB Middleware:
| USB Device | CDC Com - Virtual Com Port |
| USB Device | HID Com - Data Communicaton |
| USB Device | HID Joystick |
| USB Device | HID Keyboard |
| USB Device | HID Mouse |
| USB Device | LibUSB |
| USB Device | Printer Class |
| USB Host | HID Com - Data Communicaton |
| USB Host | HID Keyboard |
| USB Host | HID Mouse |
| USB Host | Mass Storage |
Examples:
adc_scan_irq_bt ADC scan sample with interrupt mode triggered by base timer
adc_scan_dma Usage of ADC together with DMA in demand transfer mode
adc_scan_irq_sw ADC scan conversion with usage of interrupt callback triggered by software
adc_scan_irq_mft ADC scan conversion with usage of interrupt callback triggered by MFT
adc_scan_polling_sw ADC scan conversion with polling for finished conversion triggered by software
adc_prio_irq_sw ADC priority conversion with usage of interrupt callback triggered by software
adc_prio_polling_sw ADC priority conversion with polling for finished conversion triggered by software
bt_iomode Base Timer IO modes demonstration
bt_ppg Base Timer configured as Programmable Pulse Generator
bt_pwc Base Timer configured as Pulse Width Counter
bt_pwm Base Timer configured as Pulse With Modulator
bt_rt Base Timer configured as Reload Timer
can_simple CAN communication with CANoe
clk_gating Clock gating setting
clk_init User clock initialization
cr_trimming CR trimming procedure demonstration
crc_16_32 Calculation of CRC-16 and CRC-32
csv_reset CSV reset demonstration when main/sub clock frequency is abnormal
fcs_int FCS interrupt demonstration when main clock frequency is abnormal
fcs_reset CSV reset demonstration when main clock frequency is abnormal
dac_sine_wave DAC channels generate sine wave tones
dma_software The DMA perform a sotware block transfer (For demand transfer see ADC)
dstc_hw_transfer DSTC triggered by peripheral (BT0)
dstc_sw_transfer DSTC software transfer
dt_unuse_int Dual Timer configured as periodic mode for ch.0 and one-shot mode for ch.1 with usage interruption callback
dt_use_int Dual Timer configured as periodic mode for ch.0 and one-shot mode for ch.1 with polling for interruption
sw_transfer Perform DSTC transfer by software trigger
hw_transfer Perform DSTC transfer by hardware trigger
exint_simple Simple external interrupt occurence demonstration
main_flash_test Main Flash operation test
work_flash_test Work Flash operation test
gpio_parameterized_ports New macros with aibility of port parameterization
gpio_ports Simple Port setting and Port read-out
lpm_bu_reg Reading and writing to Backup Registers
lpm_sleep_stop MCU is set to sleep and stop mode, EXINT0 wakes up MCU
lvd_unuse_int_27 LVD interrupts when voltage is vicinity of 2.7 volts. Interruption detection uses polling
lvd_unuse_int_28 LVD interrupts when voltage is vicinity of 2.8 volts. Interruption detection uses polling
lvd_unuse_int_30 LVD interrupts when voltage is vicinity of 3.0 volts. Interruption detection uses polling
lvd_use_int_26 LVD interrupts when voltage is vicinity of 2.6 volts. Interruption detection uses callback
lvd_use_int_28 LVD interrupts when voltage is vicinity of 2.8 volts. Interruption detection uses callback
lvd_use_int_32 LVD interrupts when voltage is vicinity of 3.2 volts. Interruption detection uses callback
mfs_csio_normal_master_unuse_int MFS performs as CSIO master mode by unusing interruption
mfs_csio_normal_master_unuse_int_with_tmr MFS performs as CSIO master mode by unusing interruption and using timer mode
mfs_csio_normal_master_use_int MFS performs as CSIO master mode by using interruption
mfs_csio_normal_master_use_int_with_tmr MFS performs as CSIO master mode by using interruption and using timer mode
mfs_csio_normal_slave_use_int MFS performs as CSIO slave mode by using interruption
mfs_csio_spi_master_unuse_int MFS performs as SPI master mode by unusing interruption and controling CS by GPIO
mfs_csio_spi_master_unuse_int_with_cs MFS performs as SPI master mode by unusing interruption and controling CS by peripheral
mfs_csio_spi_master_use_int MFS performs as SPI master mode by using interruption and controling CS by GPIO
mfs_csio_spi_master_use_int_with_cs MFS performs as SPI master mode by using interruption and controling CS by peripheral
mfs_csio_spi_slave_use_int MFS performs as SPI slave mode by using interruption and unusing CS peripheral
mfs_csio_spi_slave_use_int_with_cs MFS performs as SPI slave mode by using interruption and using CS peripheral
mfs_lin MFS performs as LIN master and slave mode communicating on same MCU
mfs_uart_unuse_int MFS performs as UART normal mode by unusing interruption
mfs_uart_use_int MFS performs as UART normal mode by using interruption
mfs_csio_normal_master_unuse_int MFS performs as CSIO master mode by unusing interruption
mfs_csio_normal_master_unuse_int_with_tmr MFS performs as CSIO master mode by unusing interruption and using timer mode
mfs_csio_normal_master_use_int MFS performs as CSIO master mode by using interruption
mfs_csio_normal_master_use_int_with_tmr MFS performs as CSIO master mode by using interruption and using timer mode
mfs_csio_normal_slave_use_int MFS performs as CSIO slave mode by using interruption
mfs_csio_spi_master_unuse_int MFS performs as SPI master mode by unusing interruption and controling CS by GPIO
mfs_csio_spi_master_unuse_int_with_cs MFS performs as SPI master mode by unusing interruption and controling CS by peripheral
mfs_csio_spi_master_use_int MFS performs as SPI master mode by using interruption and controling CS by GPIO
mfs_csio_spi_master_use_int_with_cs MFS performs as SPI master mode by using interruption and controling CS by peripheral
mfs_csio_spi_slave_use_int MFS performs as SPI slave mode by using interruption and unusing CS peripheral
mfs_csio_spi_slave_use_int_with_cs MFS performs as SPI slave mode by using interruption and using CS peripheral
mfs_lin MFS performs as LIN master and slave mode communicating on same MCU
mfs_uart_unuse_int MFS performs as UART normal mode by unusing interruption
mfs_uart_use_int MFS performs as UART normal mode by using interruption
frt_int Free-run Timer function with usage of zero/peak match interrupt callback
frt_polling Free-run Timer function with polling for zero/peak match
icu_int Input Captuer Unit function with usage of interrupt callback
icu_polling Input Captuer Unit function with polling for capture completion
ocu_ch_linked Perform 2 change linked mode of Output Compare Unit
ocu_ch_single Perform 1-change/low-active/high-active mode of Output Compare Unit
wfg_nzcl_dtif_dttix_trig Perform DTIF interrupt triggered DTTIX
wfg_nzcl_dtif_sw_trig Perform DTIF interrupt triggered software
wfg_ppg_dead_timer_mode Perform PPG-dead timer mode of Waveform Generator Unit
wfg_rt_dead_timer_mode Perform RT-dead timer mode of Waveform Generator Unit
wfg_rt_ppg_mode Perform RT-PPG mode of Waveform Generator Unit
wfg_through_mode Perform through mode of Waveform Generator Unit
wfg_timer_ppg_mode Perform Timer-PPG mode of Waveform Generator Unit
qprc_pc_directional Perform Count mode with direction (mode 3) of Position Counter
qprc_pc_updown Perform Up/down count mode (mode 1) of Position Counter
qprc_pc_phase_diff Perform Phase different count mode (mode 2) of Position Counter
qprc_rc_pc_ofuf_trig Perform Revolution Counter mode 2 (triggered by Position Counter)
qprc_rc_zin_pcofuf_trig Perform Revolution Counter mode 3 (triggered by ZIN or Position Counter)
qprc_rc_zin_trig Perform Revolution Counter mode 1 (triggered by ZIN)
rtc_time_count Usage of time counting and alarm interruption for RTC
rtc_timer_interval Usage of time counting and timer interval mode for RTC
rtc_timer_oneshot Usage of time counting and timer one shot mode for RTC
sd_sector_wr Write/read to/from a sector of SD card via SD I/F
uid_read Several methods to read the Unique ID
sbdevice_cdc_virtual com port MCU acting as virtual COM port using Communications Device Class
sbdevice_hid_data_cdc_virtual_com_port MCU acting as composition device with HID and CDC
sbdevice_hid_data_communication Data communication using HID class
sbdevice_hid_joystick MCU acting as a joystick
sbdevice_hid_keyboard MCU acting as a keyboard (writing a text)
sbdevice_hid_mouse MCU acting as mouse
sbdevice_hid_keyboard_mouse MCU acting as composition
sbdevice_libusb Usage of LibUSB
sbdevice_lineprinter Data communication via USB Printer and CDC Class
sbhost_keyboard_mouse MCU is recognizing a USB keyoard and mouse
wc_int Watch Counter function with usage of interrupt callback
wc_polling Watch Counter function with polling for interrupt occurrence
hwwdg Usage of hardware watchdog
swwdg
swwdg_normal Usage of normal mode for software watchdog
swwdg_normal Usage of window mode for software watchdog
Usage of example code:
Each example code consists of a 'main.c' and a 'pdl_user.h' module. The main module contains the example code, where 'pdl_user.h' contains all necessary settings and definitions for the example itself. To use and compile an example, just copy these two modules to the 'template/source' folder, overwriting the modules located there. The overwritten modules have backups in the 'template/source/backup' folder for recovery. All adjustments for IAR Workbench and ARM/KEIL uVision IDE are done in the template project and will fit to the example code. Follow the explanations and advices in the main.c module's description in the comment lines at the top.