Home

Description - STMicroelectronics

image

Contents

1. if generateReducedLookUpTable LEDmapT 32 PWM 8 bit amp tablePtr amp tableKeyPtr amp tableSize while 1 use new table carefully tablePtr tableKeyPtr tableSize while new table not changed yet removeLookUpTableReleased 15 27 Description of the firmware library UMO588 3 2 14 Function new table not changed yet Table 16 8 New table not changed yet function Filename Description Function name new table not changed yet Function prototype int new table not changed yet void Behavior description it returns TRUE untill appropriate time for table exchange is reached remains TRUE 1 untill the new table pointers are used and exchanged Output parameter with the old one Preconditions use new table carefully Called functions none Example use new table carefully tablePtr tableKeyPtr tableSize while new table not changed yet removeLookUpTableReleased y 16 27 UMO588 Description of the firmware library 3 2 15 Function generateReducedLookUpTable Table 17 GenerateReducedLookUpTable function Filename Function name Description generateReducedLookUpTable Function prototype int generateReducedLookUpTable unsigned char LEDmapIN int LEDcount int PWMdepth unsigned char tablelN unsigned char tableKeyIN int table size Behavior description generate tables Allocates memory and updates table size
2. Called functions STM32F10xxx library functions for GPIO Example We would like to enable RED LEDs of the second driver out of two only LED driver OutEnable 2 RI Dchannel E 3 2 6 Function LED driver OutDisable Table 8 LED driver OutDisable function Filename Function name Description LED driver OutDisable Function prototype void LED driver OutDisable unsigned char which unsigned char RGBchannel Behavior description switches off the LED panel so that data loaded and latched into the LED driver are no more visible Input parameter1 which selects which driver output in a row will be enabled Its value can be 1or 2 RGBchannel selects the color of the LEDs to be disabled Preconditions SPI DMA Init Called functions STM32F10xxx library functions for GPIO Example We would like to disable GREEN LEDs of the first driver out of two only LED driver Outl q Disable 1 GREENchannel 11 27 Description of the firmware library UM0588 3 2 7 Function LED driver OutEnable All On Table 9 LED driver OutEnable function Filename Description Function name LED driver OutEnable All On Function prototype void LED driver OutEnable All On void Behavior description Switches on the LEDS according to data loaded and latched into the all LED drivers Input parameter
3. BC GPIO Configuration BC EXTI Configuration P BC NVIC Configuration BC ADC Configuration 5 27 Document and library rules UM0588 2 1 3 6 27 Structure environment struct environment unsigned unsigned unsigned unsigned unsigned unsigned The flag is cleared automatically unsigned char refreshRequest yi char char char char char char columns rows colors randomNumber gameFinished setupGame size of display size of display 1 one color 3 RGB leds some games need random number when game ends set flag when started first game changed data to display This structure is declared in led demonstration h It is used to pass large amounts of parameters to the demonstration functions The members of this structure define the logical arrangement of the LED display and help to drive demonstration algorithms y UM0588 Description of the firmware library 3 Description of the firmware library 3 1 Summary of firmware library files Table 1 Firmware library files LO Filename Description O led dimmer c h Basic dimmer functionality configuration and commands hardware related 0 stm32f10x it c Interrupt routines dedicated to service dimming functionality hardware related 1 table generator c h Important tool for generation of the data to be send by interrupt routines 2 board_co
4. C71 UMO588 YI User manual Multilayer C library for LED dimming used on systems with SPI and DMA capabilities 1 Introduction The purpose of this user manual is to describe how to use the C library dedicated to perform LED dimming The document describes all the library functions and their link with the standard peripheral library of a given microcontroller This C library can be used without any change on any STM32F10xxx microcontroller The library contains a demonstration firmware running on STMicroelectronics evaluation kit STEVAL ILLO15V1 September 2008 Rev 1 1 27 www st com Contents UM0588 Contents 1 rises Juego sm a A ABA AA KAKA a a 1 2 Document and library rules eee 5 2 1 Predefined values and structures cece eee eee 5 2 1 1 Value ERROR and SUCCESS 0000000 eee eee 5 2 1 2 Structure buttonsAndADC 00 ee 5 2 1 3 Structure environment Lo 6 3 Description of the firmware library ooooooooooom 7 3 1 Summary of firmware library files llle 7 3 2 LEVEL 9 led dimmer c Ch uos RR Rem ees 8 3 2 1 Functions RCC Configuration NVIC Configuration SPI DMA Init 9 3 2 2 FUNCTION Setup uses Ec t eds See y RR e A OR CR oos 9 3 2 3 Function start dimmer lesen 10 3 2 4 Function stop dimmer lesse 10 3 2 5 Function LED driver OutEnable 0 0 00 e eee eee 11 3 2 6 Function LED driver OutDisable
5. Mainly used for the first generation of the table or similar int tableSize unsigned char tablePtr setup 48 PWM 8 bit tableKeyPtr 100 48 PWM 8 bit if generateReducedlookUpTable LEDmapClear amp tableKeyPtr amp tablePtr while 1 use new table immediately tablePtr amp tableSize tableKeyPtr tableSize ky UMO588 Description of the firmware library 3 2 13 y Function use_new_table_carefully Table 15 Use new table carefully function Filename Function name Description use new table carefully Function prototype void use new table carefully unsigned char table unsigned char tableKey int table size Behavior description It exchange table SPI data at appropriate time to prevent glitch It takes a new table and replaces the pointers as soon as it is the right time Input parameter1 table table with SPI data generated by generateReducedLookUpTable Input parameter2 tableKey indexes for the table generated by generateReducedLookUpTable Input parameter3 table size size of the table returned by generateReducedLookUp Table Preconditions generateReducedLookUpTable Called functions none Example Mainly used during slight change of the table in main loops while 1 tetris B and W LEDmapT amp buttonsADC amp env amp userData 0 if env refreshRequest
6. 200 0 eens 11 3 2 7 Function LED driver OutEnable All On lleseslsss 12 3 2 8 Function LED_driver_OutDisable_All_Off 0 12 3 2 9 Function error detection DM eese 13 3 2 10 Function error detection LE OE a 13 3 2 11 Function SPI CLK LOW SPI_LCLK_HIGH 14 3 2 12 Function use new table immediately 005 14 3 2 13 Function use new table carefully ooooocoooooo o 15 3 2 14 Function new table not changed yet aa 16 3 2 15 Function generateReducedLookUpTable 17 3 2 16 Function removeLookUpTablelnUse 0 0000 eee eee 18 3 2 17 Function removeLookUpTableReleased 18 3 3 LEVEL O stm32f10X it C 2 2 liliis 19 3 4 LEVEL 1 table generator c h 0 eee ee nnn 19 3 4 1 Function performGenerateReducedLookUpTable 19 3 5 LEVEL 2 board control c h o o oooooocoooororo om 20 3 5 1 Functions BC_ADC_Configuration BC_GPIO_Configuration BC EXTI Configuration BC NVIC Configuration 20 2 27 1671 UM0588 Contents 3 6 LEVEL 2 led demonstration c h 2 00000 c eee eee eens 21 3 6 1 Function modeSelect 00 0000 ccc eee 21 3 6 2 Function writeCharacter cee ee 22 3 6 3 Functions tetris color solid color demo wave color demo error demo asc ob naaa ama hana ee be OES o
7. 18 27 Function removeLookUpTablelnUse Table 18 RemoveLookUpTablelnUse function Filename Function name Description removeLookUpTablelnUse Function prototype void removeLookUpTablelnUse Behavior description releases tablelN and tableKeyIN created in the system by use new table X Preconditions stop dimmer new table not changed yet use new table X Called functions free It is used to clean up the memory after the application finishes Function removeLookUpTableReleased Table 19 RemoveLookUpTableReleased function Filename Function name Description removeLookUpTableReleased Function prototype void removeLookUpTableReleased Behavior description releases tablelN and tableKeyIN created in the system by use new table X Preconditions GenerateReducedLookUpTable followed by one of these two use new table immediately or use new table carefully Enough free RAM space Called functions free Example if generateReducedLookUpTable LEDmapT 32 PWM 8 bit amp tablePtr while 1 amp tableKeyPtr amp tableSize use new table carefully tablePtr tableKeyPtr tableSize while new table not changed yet removeLookUpTableReleased y UM0588 Description of the firmware library 3 3 LE VEL 0 stm32f10x_it c File functions This project uses the following interrup
8. AIR CRAFT SPACE LIFE SAVING OR LIFE SUSTAINING APPLICATIONS NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY DEATH OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE ST PRODUCTS WHICH ARE NOT SPECIFIED AS AUTOMOTIVE GRADE MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER S OWN RISK Resale of ST products with provisions different from the statements and or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever any liability of ST ST and the ST logo are trademarks or registered trademarks of ST in various countries Information in this document supersedes and replaces all information previously supplied The ST logo is a registered trademark of STMicroelectronics All other names are the property of their respective owners 2008 STMicroelectronics All rights reserved STMicroelectronics group of companies Australia Belgium Brazil Canada China Czech Republic Finland France Germany Hong Kong India Israel Italy Japan Malaysia Malta Morocco Singapore Spain Sweden Switzerland United Kingdom United States of America www st com 27 27
9. 1 Preconditions SPI DMA Init Called functions STM32F10xxx library functions for GPIO Example We would like to enable all the drivers LED driver OutEnable A11 On 3 2 8 Function LED driver OutDisable All Off 12 27 Table 10 LED driver OutDisable function Filename Function name Description LED driver OutDisable All Off Function prototype void LED driver OutDisable All Off void Behavior description switches off the LED panel so that data loaded and latched into all LED drivers are no more visible Input parameter1 Preconditions SPI DMA Init Called functions STM32F10xxx library functions for GPIO Example We would like to disable all two drivers LED driver OutDisable All Off q UMO588 Description of the firmware library 3 2 9 Function error detection DM Table 11 Error detection DM function Filename Function name Description error detection DM Function prototype unsigned char error detection DM unsigned char LEDmaplN int LEDcount Behavior description detects defective LEDs The defective LED position is indicated by zeroes in LEDmapIN returns 1 if an error occurred uses DM signal to enter the test mode Input parameter1 LEDmapIN array of bytes the length of the array is LEDcount Input parameter2 LEDcount number of LEDs connected to the system Output parameter It r
10. GH Table 13 SPI CLK LOW SPI CLK HIGH function Filename Function name Description SPI CLK LOW SPI CLK HIGH Function prototype void SPI CLK LOW void void SPI CLK HIGH void Behavior description Changes the SPI clock output to the desired logical and electrical level Preconditions the SPI pins have to be reconfigured to the GPIO Output Push Pull mode Called functions GPIO functions Example Simple generation of CLK pulse edge and intra data change GPIO SetBits GPIOA GPIO Pin 4 SPI CLK HIGH SPI CLK ResetBits SPI CLK HIGH ER LOW OW GPIO SPI CLK GPIOA GPIO Pin 4 Function use new table immediately Table 14 Use new table immediately function Filename Function name Description use new table immediately Function prototype void use new table immediately unsigned char table unsigned char tableKey int table size Behavior description It exchanges table SPI data without preventing glitch Input parameter1 table table with SPI data generated by generateReducedLookUpTable Input parameter2 tableKey indexes for the table generated by generateReducedLookUpTable Input parameter3 table size size of the table returned by generateReducedLookUpTable Preconditions generateReducedLookUpTable Called functions none Example
11. M32F10xxx library functions Example RCC Configuration NVIC Configuration SPI DMA Init 3 2 2 Function setup Table 4 Setup function Filename Description Function name setup Function prototype int setup int LEDcount int PWMdepth int requestedRefreshRate Behavior description configures timers and internal variables for requested dimming parameters Input parameter1 LEDcount indicates how many single LEDs are connected to the system inp t parameter PWMdepth one of those PWM_8_bit PWM 9 bit PWM_10_bit put p PWM_11_bit Input parameter3 requestedRefreshRate requested refresh rate Output parameter returns SUCCESS if requested parameters are achievable Preconditions Called functions STM32F10xxx library functions for Systimer DMA NVIC Example We have 8 RGB LEDs connected need 8bit PWM depth refresh 100Hz setup 3 8 PWM 8 bit 100 9 27 y Description of the firmware library UM0588 3 2 3 3 2 4 10 27 Function start_dimmer Table 5 Start_dimmer function Filename Description Function name start_dimmer Function prototype void start_dimmer void Behavior description Starts dimming The function LED_drive_OutEnable must then be called in order to make driver outputs active to make dimming visible on LEDs Preconditions The following functions have to be called before ru
12. Released function 0 000 eee ee eee 18 PerformGenerateReducedLookUpTable function 00 eee eee eee 19 Set p T nctlon i212 wa 00 0 weed Peon a Dix Roe eed water Be wk Row 20 ModeSelect function 0000 he 21 WriteCharacter function 000 0c eee 22 Tetris_color solid_color_demo wave_color_demo error_demo functions 23 Document revision history 0 00 0 teeta 26 UMO588 Document and library rules 2 2 1 Document and library rules Predefined values and structures Value ERROR and SUCCESS typedef enum 1 ERROR 0 SUCCESS ERROR ErrorStatus These values return the result of the functions The value is ERROR if the function failed and SUCCESS otherwise Structure buttonsAndADC struct buttonsAndADC unsigned char buttonLeft unsigned char buttonRight unsigned char buttonCenter unsigned char buttonKnob void y This global structure is defined in board control c and declared in board_control h It provides the status of the STEVAL ILLO15V1 buttons and knob Variables linked to the buttons are set to 1 when the button is pressed It remains 1 until the user resets it Calling buttonKnob returns the knob current value variable resistor connected to the ADC The following commands must be executed to be able to use this structure The functions are declared in board control h BC prefix stands for Board Control
13. acter External functions and types called from this file Structures used environment buttonsAndADC No hardware related functions are called from this file Detailed function description see Chapter 3 6 1 to 3 6 3 Function modeSelect Table 22 ModeSelect function Function name modeSelect Filename Description Function prototype void modeSelect unsigned char LEDmap struct buttonsAndADC btnADC struct environment env signed int userData Behavior description Provides a user interface Using buttons the user can choose one letter among many in order to select the preferred application Input parameter1 LEDmap input and output brightness display map Input parameter2 btnADC global variable buttonsADC Input parameter3 env struct environment described at the beginning of this document Input parameter4 userData array of signed integers length of 11 Output parameter userData 0 returns index relevant to the chosen letter userData 0 returns 100 if no letter has been chosen yet Preconditions structStruct environment env must be filled with correct data BC ADC Configuration must BC GPIO Configuration BC EXTI Configuration BC NVIC Configuration should be called before using of this function Called functions buttonsAndADC gt buttonKnob writeCharacter Example See the complete code in the chapter LEVEL 3 main c 21 27 De
14. ask e External functions that are called from this file These functions are not directly related to the hardware It can be any function from level O to level 2 q 23 27 Description of the firmware library UMO588 24 27 e Detailed function description int main void RCC_Configuration RCC APB2PeriphClockCmd RCC APB2Periph GPIOB ENABLE RCC USBCLKConfig RCC USBCLKSource PLLCLK Div1 RCC_APB1PeriphClockCmd RCC_APB1Periph_USB ENABLE RCC APB2PeriphClockCmd RCC APB2Periph USART1 ENABLE NVIC Configuration SPI DMA Init setup 48 PWM 8 bit 100 if generateReducedLookUpTable LEDmapClear 48 PWM 8 bit amp tablePtr amp tableKeyPtr amp tableSize while 1 use new table immediately tablePtr tableKeyPtr tableSize start dimmer BC GPIO Configuration BC EXTI Configuration n 1 BC NVIC Configuration BC ADC Configuration LED driver OutEnable 1 LED driver OutEnable 2 define modes 4 modeSelector 100 userData 1 modes env columns 3 env rows 5 env setupGame 1 while 1 switch modeSelector case 0 tetris color LEDmapClear amp buttonsADC amp env amp userData 0 break A tetris case 1 wave color demo LEDmapClear amp buttonsADC amp env amp userData 0 break B wavedemo case 2 solid color demo LEDmapClear amp butt
15. d_control c h e File constants and functions void BC_ADC_Configuration void void BC GPIO Configuration void void BC EXTI Configuration void void BC NVIC Configuration void struct buttonsAndADC e External functions and types called from this file ADC GPIO EXTI NVIC functions e Detailed function description see Chapter 3 5 1 Functions BC ADC Configuration BC GPIO Configuration BC EXTI Configuration BC NVIC Configuration Table 21 Setup function Filename Function name Description BC ADC Configuration BC GPIO Configuration BC EXTI Configuration BC NVIC Configuration Function prototype void BC ADC Configuration void void BC GPIO Configuration void void BC EXTI Configuration void void BC NVIC Configuration void Behavior description This four functions configure the ADC for knob the GPIO for buttons the external interrupts for buttons and the interrupt controller for buttons The whole configuration is given for the STEVAL ILLO15V1 evaluation kit Preconditions Called functions see source code Example BC ADC Configuration must be called before using structure unsigned char buttonsAndADC buttonKnob void UMO588 Description of the firmware library 3 6 3 6 1 y LEVEL 2 led demonstration c h File constants and functions modeSelect tetris color solid color demo wave color demo error demo writeChar
16. ent env signed int userData void solid color demo unsigned char LEDmap struct buttonsAndADC btnADC struct environment env signed int userData void wave color demo unsigned char LEDmap struct buttonsAndADC btnADC struct environment env signed int userData void error demo unsigned char LEDmap struct buttonsAndADC btnADC struct environment env signed int userData Behavior description Shows different types of LED demonstrations These functions never ask for termination Input parameter1 LEDmap input and output brightness display map Input parameter2 btnADC global variable buttonsADC Input parameter3 env struct environment described at the beginning of this document Input parameter4 userData array of signed integers length of 11 Preconditions struct environment env must be filled with correct data BC ADC Configuration must BC GPIO Configuration BC EXTI Configuration BC NVIC Configuration should be called before using of this function Called functions buttonsAndADC gt buttonKnob writeCharacter Example See the complete code in the chapter LEVEL 3 main c 3 7 LEVEL 3 main c e Filefunctions waitAbit main e Functions called from LEVEL 2 1 0 All functions from level 2 a few from level 1 and occasionally from level 0 are called from this unit It is recommended to use the highest level functions possible while solving any t
17. eturns 1 if an error occurred The defective LED position is indicated by zeroes in LEDmapIN It uses DM signal to enter the test mode Preconditions SPI DMA Init Called functions LED driver OutDisable All Off GPIO SPI LED driver OutEnable All On Example unsigned char LEDmapClear 48 error detection DM LEDmapClear 48 3 2 10 Function error detection LE OE Table 12 Error detection LE OE function Filename Function name Description error detection LE OE Function prototype unsigned char error detection LE OE unsigned char LEDmaplN int LEDcount Behavior description detects defective LEDs Input parameter1 LEDmapIN array of bytes the length of the array is LEDcount Input parameter2 LEDcount number of LEDs connected to the system Output parameter It returns 1 if an error occurred The defective LED position is indicated by zeroes in LEDmapIN It uses LE and OE signals to enter the test mode Preconditions SPI DMA Init Called functions called functionsLED driver OutDisable All Off GPIO functions SPI functions LED driver OutEnable All On SPI CLK HIGH SPI CLK LOW Example unsigned char LEDmapClear 48 error detection LE OE LEDmapClear 48 13 27 Description of the firmware library UM0588 3 2 11 3 2 12 14 27 Function SPI CLK LOW SPI CLK HI
18. he firmware library UMO588 3 2 LEVEL 0 led dimmer c h e File constants and functions PWM 8 bit 256 PWM 9 bit 512 PWM 10 bit 1024 PWM 11 bit 2048 PWM 12 bit 4096 RCC Configuration NVIC Configuration SPI DMA Initsetup start dimmer stop dimmer LED driver OutEnable LED driver OutDisable LED driver OutEnable All On LED driver OutDisable All Off error detection DM error detection LE OE SPI CLK LOW SPI CLK HIGH use new table immediately use new table carefully new table not changed yet generateReducedLookUpTable generateFullLookUpTable removeTableLookUpTable removeLookUpTablelnUse removeLookUpTableReleased e External functions and types called from the file free SPI SendData SPI ReceiveData SPI GetFlagStatus and group of functions declared in libraries dedicated to NVIC SysTick GPIO RCC DMA e Detailed function description see Chapter 3 2 1 to 3 2 17 8 27 r UM0588 Description of the firmware library 3 2 1 Functions RCC Configuration NVIC Configuration SPI DMA Init Table 3 RCC Configuration NVIC Configuration SPI DMA Init functions Filename Description Function name RCC Configuration NVIC Configuration SPI DMA Init functions Function prototype void RCC Configuration void NVIC_Configuration void SPI DMA Init Behavior description These three functions configure the system timer interrupt system and DMA Preconditions Called functions ST
19. nning start_dimmer RCC Configuration NVIC Configuration SPI DMA Init setup generateReducedLookUpTable use new table immediately Called functions SysTick CounterCmd SysTick Counter Enable Example RCC Configuration NVIC Configuration SPI DMA Init setup 32 PWM 8 bit 100 if generateReducedLookUpTable LEDmap 32 PWM 8 bit amp tableKeyPtr amp tableSize while 1 use new table immediately tablePtr tableKeyPtr LED driver OutEnable 1 start dimmer Function stop dimmer Table 6 Stop dimmer function amp tablePtr tableSize Filename Description Function name stop dimmer Function prototype void stop dimmer void Behavior description stops dimming Preconditions Called functions SysTick CounterCmd SysTick Counter Disable Y UMO588 Description of the firmware library 3 2 5 Function LED driver OutEnable Table 7 LED driver OutEnable function Filename Function name Description LED driver OutEnable Function prototype void LED driver OutEnable unsigned char which unsigned char RGBchannel Behavior description Makes driver outputs active makes dimming visible on LEDs Input parameter1 which selects which driver output in a row will be enabled Its value can be 1or2 RGBchannel selects the color of the LEDs to be enabled Preconditions SPI DMA Init
20. ntrol c h m enabling simple usage of buttons and ADC on evaluation kit hardware 2 ed demonstration c h Extension showing functionalities demonstrations and modes of the evaluation kit 3 main c Example application using led demonstration c and board control c 1 The L column groups the library files by level from user to hardware Figure 1 Figure 1 Firmware library files User main c board control c led demonstration c table generator c led dimmer c stm32f10x it c Hardware AM00260 All the source files use libraries dedicated to the microcontroller peripherals They are listed in Table 2 Table 2 External libraries and functions LO Filename Description 0 stm32f10x_gpio h library used to configure the general purpose i o of the STM32F 10xxx 0 stm32f10x_systick h library used to configure system timer of STM32F10xxx 0 stm32f10x_dma h library used to configure DMA of STM32F 10xxx 0 stm32f10x_nvic h library used to configure the interrupt controller of STM32F10xxx 0 stm32f10x_lib h library containing the definitions addresses of the STM32F10xxx 1 stdlib h provides the fuction malloc for dynamic memory allocation 2 stm32f10x_exti h library used to configure the external interrupts that are connected to the buttons 1 The L column groups the library files by level from user to hardware Figure 1 ky 7 27 Description of t
21. nts to this document and the products and services described herein at any time without notice All ST products are sold pursuant to ST s terms and conditions of sale Purchasers are solely responsible for the choice selection and use of the ST products and services described herein and ST assumes no liability whatsoever relating to the choice selection or use of the ST products and services described herein No license express or implied by estoppel or otherwise to any intellectual property rights is granted under this document If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein UNLESS OTHERWISE SET FORTH IN ST S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION OR INFRINGEMENT OF ANY PATENT COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE ST PRODUCTS ARE NOT RECOMMENDED AUTHORIZED OR WARRANTED FOR USE IN MILITARY
22. onsADC amp env amp userData 0 break C solid color case 3 error demo LEDmapClear amp buttonsADC amp env amp userData 0 D error detection if env gameFinished error detection DMX LEDmapClear 48 start dimmer LED driver OutEnable 1 LED driver OutEnable 2 break UM0588 Description of the firmware library case 100 modeSelect LEDmapClear amp buttonsADC amp env amp userData 0 if env gameFinished env setupGame 1 env gameFinished 0 modeSelector userData 0 break default modeSelector 100 break if env refreshRequest if generateReducedLookUpTable LEDmapClear 48 PWM 8 bit amp tablePtr amp tableKeyPtr amp tableSize while 1 endless loop if memory or generation fails use new table carefully tablePtr tableKeyPtr tableSize while new table not changed yet removeLookUpTableReleased nv refreshRequest 0 main 25 27 q Revision history UMO588 4 26 27 Revision history Table 25 Document revision history Date 17 Sep 2008 Revision 1 Initial release Changes UMO588 Please Read Carefully Information in this document is provided solely in connection with ST products STMicroelectronics NV and its subsidiaries ST reserve the right to make changes corrections modifications or improveme
23. scription of the firmware library UM0588 3 6 2 22 27 Function writeCharacter Table 23 WriteCharacter function Filename Function name Description writeCharacter Function prototype void writeCharacter unsigned char LEDmap unsigned char mask unsigned short brightnessR unsigned short brightnessG unsigned short brightnessB unsigned char Rotate Behavior description It sets bytes in the LEDmap array according to the requested character to be displayed Input parameter1 LEDmap an output brightness display map Input parameter2 mask table with the character shape Input parameter3 4 5 brightnessR brightnessG brightnessB defines the color of the generated character Input parameter4 rotate 0 no rotation 1 rotation change character orientation upside down Preconditions Called functions Example p a writeCharacter LE 0x50 O ROTATE sani unsigned char number mask n100 O Dmap UM0588 Description of the firmware library 3 6 3 Functions tetris color solid color demo wave color demo error demo Table 24 Tetris color solid color demo wave color demo error demo functions Filename Description Function name tetris color solid color demo wave color demo error demo Function prototype void tetris color unsigned char LEDmap struct buttonsAndADC btnADC struct environm
24. t handlers SysTickHandler DMAChannel3 IRQHandler SPH IRQHandler EXTI15 10 IRQHandler USB LP CAN RXO0 IRQHandler Detailed function description All these functions are called by the microcontroller when an interrupt occurs They cannot be called directly by the user These interrupt handlers can be found in STM32f10x it c 3 4 LEVEL 1 table generator c h e File constants and functions performGenerateReducedLookUpTable e External functions and types called from this file malloc e Detailed function description see Chapter 3 4 1 3 4 1 Function performGenerateReducedLookUpTable Table 20 PerformGenerateReducedLookUpTable function Function name performGenerateReducedLookUpTable Filename Description Function prototype LEDcount int PWMdepth unsigned char tablelN unsigned char int performGenerateReducedLookUpTable unsigned char LEDmaplN int tableKeyIN int table size Behavior description should not be called directly by user contradicts section 3 3 they cannot Generates the tables for the function generateReducedLookUpTable It be called Preconditions Called functions malloc sizeof Example This function is called by function generateReducedLookUpTable from the led dimmer c file The function is not intended to be ca lled directly by user 19 27 Description of the firmware library UM0588 3 5 3 5 1 20 27 LEVEL 2 boar
25. te eb ace ae add bihasa 23 3 7 LEVEL 3 rmiali G ua esee RR keen ee veter NG ae Se ee a 23 4 REVISION history seen oh teak re 26 ky 3 27 List of tables UM0588 List of tables Table 1 Table 2 Table 3 Table 4 Table 5 Table 6 Table 7 Table 8 Table 9 Table 10 Table 11 Table 12 Table 13 Table 14 Table 15 Table 16 Table 17 Table 18 Table 19 Table 20 Table 21 Table 22 Table 23 Table 24 Table 25 4 27 Firmware library TOS 34222402 bra eh Sio dae Seb Ded teer sa 7 External libraries and functions 000 cece eee 7 RCC_Configuration NVIC Configuration SPI_LDMA_Init functions 9 Setup TUNGONG ag mene ex ed ees Rs DR Bex eee oe eee 9 Start dimmer fUNCHON s ss eea Ea aci aee a ao a E ani n 10 Stop dimmer function llle eee 10 LED driver OutEnable function 000 cc es 11 LED driver OutDisable function 00000 cece e 11 LED driver OutEnable function e 12 LED driver OutDisable function llle 12 Error detection DM function 00 cee en 13 Error detection LE OE function ee 13 SPI CLK LOW SPI CLK HIGH function o 14 Use new table immediately function 0 0 0 ee ere 14 Use new table carefully function 0 0 0 eee I 15 New table not changed yet function e 16 GenerateReducedLookUpTable function cee eee 17 RemoveLookUpTablelnUse function tee 18 RemoveLookUpTable
26. value Returns 1 if successful Input parameter1 LEDmapIN array of bytes the array length is LEDcount User defines here the brightness of every LED Input parameter2 LEDcount number of LEDs connected to the system Input parameter3 PWMdepth used resolution of the PWM Input parameter4 tablelN the function creates a table containing SPI data and updates this pointer Input parameter5 tableKeyIN the function creates indexes for the table and updates this pointer Input parameter6 table size the function returns in this variable the size of the created table Input parameter requestedRefreshRate requested refresh dimming rate Output parameter return 1 if allocation and generation completed successfully Preconditions enough of free RAM Called functions performGenerateReducedLookUpTable Example unsigned char LEDmapT 32 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x20 0x00 0x00 0x00 0x20 0x00 Oxe0 0x00 0x00 Oxf0 Oxc0 0x00 0x00 0x60 0x60 0x00 0x00 0x50 if generateReducedLookUpTable LEDmapT 32 PWM 8 bit amp tablePtr amp tableKeyPtr amp tableSize while 1 an endless loop if the table generation fails now use use new table function to use generated data q 17 27 Description of the firmware library UM0588 3 2 16 3 2 17

Download Pdf Manuals

image

Related Search

Related Contents

Triarch 31537 User's Manual  IBM V7.2 User's Manual  Joycare JC-131 digital body thermometer  Product Sheet - Projector Central  招集ご通知 - 日本郵船  User Manual - Ocean Sensor Systems, Inc.  INP_Inventaire&Récolement_Collections  Sony VAIO SVE14114FX  Philips Streamium Wi-Fi component Hi-Fi system MCI730  

Copyright © All rights reserved.
Failed to retrieve file