Home

CrossWorks Platform Library

image

Contents

1. Mapping of A4 and A5 as analog define ARDUINO A4 ANALOG LM3S PORT PIN LM3S PORT E 3 Configured by solder jumper PB3 define ARDUINO_A5_ANALOG LM3S_PORT_PIN LM3S_PORT_E 2 Configured by solder jumper PB2 SD connections define SOLDERCORE_SD_SCK LM3S_PORT_PIN LM3S_PORT_H 4 define SOLDERCORE_SD_MISO LM3S_PORT_PIN LM3S_PORT_F 4 define SOLDERCORE_SD_MOSI LM3S_PORT_PIN LM3S_PORT_F 5 I2C header define SOLDERCORE_I2C1_SCL LM3S_PORT_PIN LM3S_PORT_J 0 define SOLDERCORE_I2C1_SDA LM3S_PORT_PIN LM3S_PORT_J 1 Wap Internal device to port pin mapping ee Vf ea Se define SOLDERCORE_USER_LED LM3S_PORT_PIN LM3S_PORT_C 5 define SOLDERCORE_MICROSD_LED LM3S_PORT_PIN LM3S_PORT_J 4 define SOLDERCORE_RUN_LED LM3S_PORT_PIN LM3S_PORT_E 7 172 CrossWorks Platform Library LEDS controlled by the PHY define SOL define SOL SPI memo define SOL define SOL microSD define SOL Platform DE DE ry DE DE SO DE RCORE_MEM1_SEI RCORE MEM2 SE cket select site selects RCORE_ETH_LEDO RCORE _ ETH LEDI1 LECT LECT RCORE_MICROSD_SELECT LM3S PORT PIN L LM3S PORT PIN L LM3S PORT PIN L LM3S PORT PIN L LM3S PORT PIN L API LED indexes in LED catalog define SOLDERCORE_USER_LED_INDEX 0 define SOLDERCORE_RUN_LED_INDEX il define SOLDERCORE_MICROSD_LED_INDEX 2 ip Platform limits
2. Graphics Examples use an STM32F4DIS LCD attached to an STM32F4DIS BB Note that the signals PD13 PD14 and PD15 have shared functions they are routed to the Orange Red and Blue LEDS as well as being used as the LCD backlight and data bus The Green LED is independent of the LCD Therefore if you intend to use graphics make sure you initialize the built in graphics first which allocates those signals for the LCD and prevents them from being used for LEDs Accelerometer The STM32F4DISCOVERY is fitted with either an LIS302DL or LIS3DSH accelerometer depending upon the revision of board you have Revision A and B boards have the LIS302DL accelerometer and Revision C board have the LIS3DSH accelerometer The Platform API will sense the type of accelerometer fitted to the board and initialize the correct driver for it Note that the accelerometer I2C SPI interface is selected by PE3 which conflicts with the LCD where PE3 is mapped to the D C signal As such it is impossible to use the accelerometer and the LCD in FSMC mode at the same time You can use the accelerometer and LCD sequentially with restrictions by configuring the LCD in GPIO mode rather than FSMC mode In GPIO mode PE3 can be multiplexed between LCD and accelerometer as long as both are not used from different CTL tasks This mode also requires that the accelerometer is the only device on the SPI bus as it is selected onto the SPI bus when a command is issued to the
3. Description platform read digital pin reads the state of a pin that s configured to be a digital input This function is fast and does no error checking whatsoever it is the client s responsibility to use this function correctly Note On some platforms it may be possible to read the state of a pin configured as an output and doing so may deliver the state of the pad or the last written digital output state Such functionality is not guaranteed or standardized by this API and none of the examples written by Rowley Associates make use of this Some processors for instance will correctly read the state of the pad for outputs configured as push pull but will not do so for outputs configured as open drain See Also platform_write_digital_pin 77 CrossWorks Platform Library CrossWorks Platform Library platform reboot Synopsis void platform reboot void Description platform reboot resets the microcontroller and starts a cold boot Note that a reset using platform reboot may be detectable as a software reset using platform reset cause after the microcontroller resets See Also platform_reset_cause 78 CrossWorks Platform Library CrossWorks Platform Library platform release pin Synopsis void platform release pin int pin Description platform release pin releases a pin for reuse and reconfiguration Pins that are successfully claimed with PIN CLAIM FIXED or PIN_CLAIM_FIXED are never released
4. 12C The platform 12C bus routing is e bus 0 Arduino headers e bus 1 UEXT socket SPI The platform SPI bus routing is e bus 0 Arduino headers e bus 1 UEXT socket API 7 sanp lesy OlimexasiMs2 2 407 plattrormacontig h not found 187 CrossWorks Platform Library STM32 LCD STM32 LCD Platform This is the Platform Library implementation for the Olimex STM32 LCD http www olimex com Products ARM ST STM32 LCD Mass Storage Examples require an Olimex MOD SDMMC attached to the UEXT 1 socket Networking Examples require an Olimex MOD ENC28J60 attached to the UEXT 2 socket Graphics Examples use the built in QVGA display 12C The platform 12C bus routing is e bus 0 UEXT 1 socket e bus 1 UEXT 2 socket e bus 2 LIS3LVO2DL on the main PCB SPI The platform SPI bus routing is e bus 0 UEXT 1 socket e bus 1 UEXT 2 socket API 7 n ae Samples OlimexaSiM32 1ED PIatorm EonNFIg KH not found 188 CrossWorks Platform Library CrossWorks Platform Library CrossWorks Platform Library STM32 P107 STM32 P107 Platform This is the Platform Library implementation for the Olimex STM32 P107 https www olimex com Products ARM ST STM32 P107 Mass Storage Examples use the built in microSD socket Networking Examples use the built in Ethernet port Graphics There are no built in graphics You can enable graphics by editing example_plugin_graphics cand selecting
5. A N ON N NNN RK A K NN NN NN KN A _RESERVED_0 _PWM1 RESERVED 2 _TIMER2 _UART3 K_RESERVED_3 Z Pa K_SYSCON K_MC K_SOURCE_t K_WDT K_TIMERO K_TIMERI1 Aa UARTO UART1 TIC SPI RESERVED 1 SEN DAC pe K CAN1 K_CAN2 K_ACF K OEI K GPIOINT K PCB TEEL SSPO TIMER3 UART2 LICR 2S 166 CrossWorks Platform Library CrossWorks Platform Library CrossWorks Platform Library LPC1700 PIN Synopsis define LPC1700 PINI X CES E EE Description LPC1700_PIN extracts the LPC1700 pin within a port from an encoded PLATFORM_PIN_CONNECTION_t value In other words LPC1700_PIN LPC1700_PAD x y y See Also LPC1700_PAD LPC1700_PORT 167 CrossWorks Platform Library CrossWorks Platform Library LPC1700 PORT Synopsis define LPC1700 PORT X ie eS 5 Description LPC1700_PORT extracts the LPC1700 port see LPC1700_PORT_t from an encoded PLATFORM _PIN_CONNECTION_t value In other words LPC1700_PORT LPC1700_PAD x y x See Also LPC1700_PAD LPC1700_PIN 168 CrossWorks Platform Library CrossWorks Platform Library LPC1700 PORT t Synopsis typedef enum BES IOO_ WORM _0 LPC1700_PORT_1 LPC1700_PORT_2 TECIIMOONPRORTE S LPE1700 PORT 4 nes ONDER ES Description LPC1700 PORT t enumerates the LPC1700 ports for the platform implementation by name 169 CrossWorks Platform Library
6. CrossWorks Platform Library Version 3 7 2015 Rowley Associates Limited CrossWorks Platform Library CrossWorks Platform Library Contents Contents ele ed rie AE el EE EEaaS 9 Maar Manus ls ed SE a DS EE EE EE DE ee EE ED 11 NEVER CE Pedi RE AE ER OE EE EE IE EN Blinking one LED Blinking all LEDs RAPIRE DONOS se N EE DR Ee Ge DR Ee BR Re Ee Ge ee Ee ee 15 de luis LE EE Ee N ee Ee Ee ee Oe Ie 15 PLATFORM BUTTON ATTRIBUTE t u c cssssssscossssssccccsssceccesnsscecessnsssccessnsecescessscessessneseseesnssceesssnsess 18 PLATFORM BUTTON CONFIGURATION o eesssssssssssccccsssescccssssseceessssccccssnssecesennsceecssssesessesnneseeets 20 PLATFORM EDGE t En PLATFORM HOOK do dabeotieauenlenventontesiis 22 PLATFORM LED ATTRIBUTE t u sssessssssssssscccsssseccesssssescessssccccesssssssesnsseesessnssessessnsssessessusscssesnnesseesse 23 PLATFORM LED CONFIGURATION 4 u ssosesssssssssssconsnsessecsossssesensassscessonsesscnersnsceesnonsestecrosssvessneasesccs 25 PLATFORM PIN EAU ER EE aeasiae asosa s saaan 26 PLATFORM_PIN_CONFIGURATION_t ss ssssssssssssssssesssssesseeessstessescesseressstessoecesseeessoeessoseessoeessoeesseotessoeee 27 PLATFORM_PIN_CONNECTION_t isis ss PLATEORM PIN DIRECMON socccssscssssssszesssssssoscssssscsssosssesstoaszasesnscenssssasessescusscsssoaszeseaniesoscsdseagessouseadtons PLATFORM PIN FEA TURE GE EE EE Eai SI EE aoni easa ai PLATFORM PIN FUNCTION t sciiiisissssisiisinssisiiii
7. My define PLATFORM PIN COUNT CES oper Es define PLATFORM LED COUNT 3 define PLATFORM BUTTON COUNT 0 define PLATFORM_UART_COUNT 2 define PLATFORM_SPI_BUS_COUNT 2 define PLATFORM_I2C_BUS_COUNT 2 define PLATFORM_UEXT_COUNT 0 endif 173 som DSM som Som Eye PORT F PORT F PORT di PORT dy PORT 6 o louie PERE CrossWorks Platform Library CrossWorks Platform Library CrossWorks Platform Library Cortino3RE Cortino3RE Platform This is the Platform Library implementation for the BugBlat Cortino3RE http www bugblat com products cor html Power We have found that debugging is unreliable when powering the Cortino3RE from the barrel connector Always power the board from the USB connector Mass Storage Examples require a SparkFun microSD shield Networking Examples require a NuElectronics ENC28J60 shield Graphics There are no built in graphics You can enable graphics by editing example_plugin_graphics cand selecting an appropriate graphics adapter 12C The platform 12C bus routing is e bus 0 Arduino headers SPI The platform SPI bus routing is e bus 0 Arduino headers API samples BugBlat Cortino3RE platform config h not found 174 CrossWorks Platform Library CrossWorks Platform Library FRDM KL25Z FRDM KL25Z Platform This is the Platform Library implementation for the Freescale FRDM KL25Z http www freescale com webapp sps s
8. platform claim pin configuration Synopsis CTL STATUS t platform claim pin configuration const PLATFORM PIN CONFIGURATION t pins Description platform claim pin configuration iterates over the list of pins pins and attempts to claim each entry s pin using its corresponding mode using platform_claim_pin The pin list pins must be terminated by PLATFORM END OF LIST in the pin member of the final PLATFORM_PIN_CONFIGURATION_t If a pin cannot be configured platform_claim_pin_configuration immediately returns the status Return Value platform_claim_pin_configuration returns a standard status code See Also platform_claim_pin platform_release_pin 43 CrossWorks Platform Library CrossWorks Platform Library platform configure i2c bus Synopsis CTL STATUS t platform configure i2c bus int index Description platform configure i2c bus powers up and initializes the 12C peripheral and configures the appropriate pins for 12C configuration on I2C bus index The SCL and SDA pins are configured using PIN_CLAIM_SHARED Return Value platform_configure_i2c_bus returns a standard status code See Also platform_configure_i2c_bus_ex aa CrossWorks Platform Library CrossWorks Platform Library platform configure i2c bus ex Synopsis CTL STATUS t platform configure i2c bus ex int index PLATFORM PIN CLAIM t claim Description platform configure i2c bus ex processes the parameter index as platform con
9. platform_configure_builtin_humidity_sensor Configure built in humidity sensor platform_configure_builtin_light_sensor Configure built in light sensor platform_configure_builtin_pressure_sensor Configure built in pressure sensor platform_configure_builtin_temperature_sensor Configure built in temperature sensor 109 CrossWorks Platform Library CrossWorks Platform Library platform configure builtin accelerometer Synopsis CTL ACCELEROMETER t platform configure builtin accelerometer void Description platform configure builtin accelerometer configures the platform s built in accelerometer if there is one If there is no built in accelerometer available or the resources SPI bus 2C bus etc are not available to support the accelerometer platform_configure_builtin_accelerometer returns zero 110 CrossWorks Platform Library CrossWorks Platform Library platform configure builtin gyroscope Synopsis CTL GYROSCOPE t platform configure builtin gyroscope void Description platform configure builtin gyroscope configures the platform s built in gyroscope if there is one If there is no built in gyroscope available or the resources SPI bus I2C bus etc are not available to support the gyroscope platform_configure_builtin_gyroscope returns zero 111 CrossWorks Platform Library CrossWorks Platform Library platform configure builtin humidity sensor Synopsis CTL HUMIDITY SENSOR t platform configure builtin hu
10. CrossWorks Platform Library CrossWorks Platform Library PLATFORM LED COLOR MASK The mask to isolate the color component of the LED attributes PLATFORM LED TRICOLOR When set indicates that the LED is part of a tricolor arrangement PLATFORM LED POSITIVE LOGIC When set indicates that the LED is driven using positive logic writing a one to the GPIO will turn the LED on and writing a zero will turn it off When clear indicates that the LED is driven using negative logic PLATFORM LED NEGATIVE LOGIC A documentation convenience when constructing LED attributes Indicates that the LED is driven using negative logic writing a one to the GPIO will turn the LED off and writing a zero will turn it on 24 CrossWorks Platform Library CrossWorks Platform Library PLATFORM LED CONFIGURATION t Synopsis typedef struct unsigned char pin unsigned char attributes const char name PLATFORM_LED_CONFIGURATION_t Description PLATFORM LED CONFIGURATION t describes the features of a LED connected to a GPIO pin The digital pin that drives the LED See PLATFORM_PIN_CONNECTION_t attributes The attributes of the LED See PLATFORM_LED_ATTRIBUTE_t name The name of the LED You can set this to the name of the LED on the silkscreen or whatever is visible to the user for identification If name is zero the LED s name is derived from the GPIO connection name for pin or the pad name for pin See platform_led_name See Also platform_
11. Description platform_name returns the presentation human readable name of the platform 69 CrossWorks Platform Library CrossWorks Platform Library CrossWorks Platform Library platform pin catalog Synopsis unsigned char platform pin catalog void Description platform pin catalog returns an array of pins that the Platform Library exposes to the client The end of the array is indicated by and entry of PLATFORM_END_OF_LIST This may well not be the entire range of pins supported by the microprocessor and is typically only populated with pins that should be modified by a client See Also platform_pin_catalog_count 70 CrossWorks Platform Library CrossWorks Platform Library platform pin catalog count Synopsis unsigned platform pin catalog count void Description platform pin catalog count returns the number of pins the in pin catalog delivered by platform pin catalog exduding the terminating PLATFORM END OF LIST See Also platform pin catalog 71 CrossWorks Platform Library CrossWorks Platform Library platform pin connection name Synopsis char platform pin connection name int pin Description platform pin connection name returns the connection name for pin pin The connection name returned is generally the name of the port and associated pin from the microprocessor s user manual For instance it could be P1 14 or PB5 Note The string may be overwritten by a subsequ
12. int pin Description platform private pin signal name returns the signal name for pin pin The platform independent code guarantees to call platform private pin signal name with a correct pin parameter The signal name returned is generally the name from the schematic or in the case of buttons and LEDs the name of the button or LED on the silkscreen See Also PLATFORM_PIN_CONNECTION_t platform pin connection name 138 CrossWorks Platform Library CrossWorks Platform Library platform private read button Synopsis int platform private read button int index Description platform private read button writes state directly to the GPIO controlled LED index If all platform LEDs are controlled using GPIOs that are accessible using platform write digital pin a platform implementation of platform_write_led can call platform_private_write_led directly 139 CrossWorks Platform Library CrossWorks Platform Library platform private release pin Synopsis void platform private release pin int pin Description platform private release pin releases the pin pin by changing it back to its reset state typically a digital input The platform independent code guarantees to call platform private release pin with a correct pin parameter 140 CrossWorks Platform Library CrossWorks Platform Library platform private software i2c methods Synopsis PLATFORM PRIVATE T2C METHODS t platform private software
13. requests 29 CrossWorks Platform Library CrossWorks Platform Library LAUNCHPAD SPI A SCK LAUNCHPAD SPI B SCK LAUNCHPAD MOSI and LAUNCHPAD MISO Equivalent to LAUNCHPAD_A6 LAUNCHPAD_A7 LAUNCHPAD_B6 and LAUNCHPAD B7 for SPI communication LAUNCHPAD TMR OUT Equivalent to LAUNCHPAD_B2 for timer event output 30 CrossWorks Platform Library CrossWorks Platform Library PLATFORM PIN DIRECTION Synopsis typedef enum PAENGD ses Gil lO Na DEPT PIN_DIRECTION_INPUT PLATFORM_PIN_DIRECTION_t Description PLATFORM_PIN_DIRECTION_t describes whether a pin will be configured as a digital input or a digital output using platform_set_digital_pin_direction PIN DIRECTION OUTPUT Pin is configured as a digital output PIN DIRECTION INPUT Pin is configured as a digital input See Also platform set digital pin direction 31 CrossWorks Platform Library CrossWorks Platform Library PLATFORM PIN FEATURE Synopsis typedef enum PIN_FEATURE_SLOW_SLEW_RATE PIN_FEATURE_FAST_SLEW_RATE PIN_FEATURE_DISABLE_GLITCH_FILTER PIN_FEATURE_ENABLE_GLITCH_FILTER PLATFORM PIN FEATURE t Description PLATFORM PIN FEATURE t describes the features that a pin may support using platform set digital pin feature Note Not all features are implemented on all platforms and not all combinations of features are possible on all platforms Individual platforms may well reject a reguest to configure a pin for a par
14. 0 to provide the CPU tick as part of platform_cpu_tick API Summary Platform Ipc1700 platform initialize Initialize LPC1700 platform Pins LPC1700 PAD Construct a pin connection LPC1700 PIN Extract pin within port from pin connection LPC1700 PORT Extract port from pin connection LPC1700 PORT t LPC1700 ports Clocking LPC1700 PCLK SOURCE t Peripheral clock selection LPC1700 164 CrossWorks Platform Library CrossWorks Platform Library LPC1700 PAD Synopsis define LPC1700 PAD PORT PIN EGC ORE i lt lt i5 em e GEN Description LPC1700_PAD creates a PLATFORM_PIN_CONNECTION_t by combining LPC1700 port PORT and a pin within that port PIN The port and pin are extracted from the connection by LPC1700_PORT and LPC1700_PIN e LPC1700_PORT LPC1700_PAD x y x e LPC1700_PIN LPC1700_PAD x y y See Also LPC1700_PORT LPC1700_PIN 165 CrossWorks Platform Library LPC1700 PCLK SOURCE t Synopsis typedef enum L L L L AE TOEP EI TOG PCO 0m PE 1700_ PE 1700_ RCL TOP BEIO pel GOM RCM HOO PE 1700_ RCL HOO _ PC1700_ EA TOG AE TOP PC1700_ HOTOT PC1700_ BCLO I AE TOP PE 1700_ ACL TOO _ RCL WOO Bey Om PC TOO PE1700_ Ped HOG pe loos EA TOG AE TOP PC1700_ PE1700_ AELTOO ESL HOO PC PC PC PC PC PC PC PC PE PC PC PC PC PC PC PC PC PC PC PC PC PC PC PC PC PC PC PC PC PC PC PC PC Li Li Li Li
15. CTL PRESSURE SENSOR t platform configure builtin pressure sensor void Description platform configure builtin pressure sensor configures the platform s built in pressure sensor if there is one If there is no built in pressure sensor available or the resources SPI bus 12C bus etc are not available to support the pressure sensor platform_configure_builtin_pressure_sensor returns zero 115 CrossWorks Platform Library CrossWorks Platform Library platform configure builtin temperature sensor Synopsis CTL TEMPERATURE SENSOR t platform configure builtin temperature sensor void Description platform configure builtin temperature sensor configures the platform s built in temperature sensor if there is one If there is no built in temperature sensor available or the resources SPI bus 2C bus etc are not available to support the temperature sensor platform_configure_builtin_temperature_sensor returns zero 116 CrossWorks Platform Library CrossWorks Platform Library lt platform_heaps h gt Overview This is the primary header file for platform heaps For information on the use of this API see CrossWorks Platform Library API Summary Memory platform_network_heap Network heap platform_system_heap System heap Private platform_private_init_heaps Initialize network and system heaps 117 CrossWorks Platform Library CrossWorks Platform Library platform network heap Synopsis CTL HEAP t platform ne
16. PLATFORM_PIN_CONNECTION_t platform pin connection name 7a CrossWorks Platform Library CrossWorks Platform Library platform read analog pin Synopsis float platform read analog pin int pin Description platform read analog pin reads the state of a pin that s configured to be an analog input The value returned is between 0 and 1 for single ended analog inputs and 1 and 1 for differential inputs This function is fast and does no error checking whatsoever it is the client s responsibility to use this function correctly See Also platform_write_analog_pin 75 CrossWorks Platform Library CrossWorks Platform Library platform read button Synopsis int platform read button int index Description platform read button reads the platform button with index index returning 1 when the button is pressed and 0 when released platform read button takes care of initializing the GPIO pin and handing buttons connected with both positive and negative logic If the button s GPIO cannot be dlaimed the button is not and 0 Return Value platform read button returns 1 when the button is pressed and 0 when the button is released Note A button doesn t need to be directly attached to a GPIO but this is the typical configuration See Also platform hook button press 76 CrossWorks Platform Library CrossWorks Platform Library platform read digital pin Synopsis int platform read digital pin int pin
17. Synopsis float platform watchdog remaining void Description platform watchdog remaining returns the time remaining in seconds before the watchdog times out 99 CrossWorks Platform Library CrossWorks Platform Library platform watchdog service Synopsis void platform watchdog service void Description platform watchdog service resets the watchdog timeout The watchdog timeout is reset to the period set by platform_watchdog_set_period 100 CrossWorks Platform Library CrossWorks Platform Library platform watchdog set period Synopsis CTL STATUS t platform watchdog set period float period Description platform watchdog set period sets the timeout period to period seconds If the period is too long for the platform to support platform watchdog set period returns an error status Return Value platform watchdog set period returns a standard status code 101 CrossWorks Platform Library CrossWorks Platform Library platform write analog pin Synopsis void platform write analog pin int pin float value Description platform write analog pin writes the state of a pin that s configured to be an analog output An analog output can be realized either by a digital to analog converter DAC or by pulse width modulation PWM The parameter value indicates the desired output level 0 through 1 This function is fast and does no error checking whatsoever it is the client s responsibility to use
18. This function is be useful when a pin needs to be reconfigured on the fly For instance some resistive panels read a touch position on one axis using analog input and require a potential difference applied on the perpendicular axis using digital outputs When reading the touch position on the perpendicular axis the roles of digital output and analog inputs are switched requiring a reconfiguration of each of the pins from analog to digital and vice versa See Also platform_claim_pin platform_claim_pin_configuration 79 CrossWorks Platform Library CrossWorks Platform Library platform reset cause Synopsis unsigned platform reset cause void Description platform reset cause reads the reason for a microcontroller reset and clears the reset cause flags The value returned is the inclusive or of the individual causes in PLATFORM RESET CAUSE t See Also PLATFORM_RESET_CAUSE t 80 CrossWorks Platform Library CrossWorks Platform Library platform set digital pin direction Synopsis void platform set digital pin direction int pin int direction Description platform set digital pin direction sets the pin direction for pin pin to direction for a pin configured as a digital VO This function is fast and does no error checking whatsoever it is the client s responsibility to use this function correctly Platform notes Changing pin direction may well change the drive strength pin speed and pull up configuratio
19. about the list that this member points to Note You only need to initialize fn and arg in the hook structure when passing the hook to a registration routine the Platform Library takes care of managing internaland next See Also platform hook pin edge platform hook background platform hook timer 22 CrossWorks Platform Library PLATFORM LED ATTRIBUTE Synopsis typedef enum PLATFORM_LED_UNKNOWN LATFORM_LED_RED LATFORM_LED_GREEN LATFORM_LED_BLUE LATFORM_LED_YELLOW LATFORM_LED_ORANGE LATFORM_LED_WHITE LATFORM_LED_IR LATFORM_LED_COLOR_MASK LATFORM_LED_TRICOLOR LATFORM_LED_POSITIVE_LOGIC LATFORM_LED_NEGATIVE_LOGIC LATFORM_LED_ATTRIBUTE_t ie Ang tac Jno taal Ge Jno tas nel nel tae dag Description CrossWorks Platform Library PLATFORM_LED_ATTRIBUTE_t describes the attributes of a LED The attributes are a combination of LED color and how the LED i s driven LEDs that are part of a tricolor arrangement have PLATFORM_L I green and blue colors PLATFORM LED UNKNOWN The LED color is unknown or varies between boards PLATFORM LED RED The LED is red PLATFORM LED GREEN The LED is green PLATFORM LED BLUE The LED is blue PLATFORM LED YELLOW The LED is yellow PLATFORM LED ORANGE The LED is orange PLATFORM LED WHITE The LED is white PLATFORM LED IR The LED emits infrared light 23 ED TRICOLOR set along with one of the red
20. an appropriate graphics adapter for instance a MOD LCD3310 or a MOD LCD6610 attached to a UEXT socket 12C The platform 12C bus routing is e bus 0 UEXT header SPI The platform SPI bus routing is e bus 0 UEXT header and microSD socket API 2 2 Samples Olimex SIM3s25P107 plattormacontig h not found 189 CrossWorks Platform Library CrossWorks Platform Library STM32 P405 STM32 P405 Platform This is the Platform Library implementation for the Olimex STM32 P405 http www olimex com Products ARM ST STM32 P405 Mass Storage Examples use the built in microSD socket Networking Examples require an Olimex MOD ENC28J60 attached to the UEXT socket Graphics There are no built in graphics You can enable graphics by editing example_plugin_graphics cand selecting an appropriate graphics adapter 12C The platform 12C bus routing is e bus 0 UEXT header e bus 1 microSD socket SPI The platform SPI bus routing is e bus 0 UEXT header e bus 1 microSD socket on the main PCB API 7 sanp lesy OlimexeSiM3s25P405 plattrormacontig h not found 190 CrossWorks Platform Library CrossWorks Platform Library STM32 P407 STM32 P407 Platform This is the Platform Library implementation for the Olimex STM32 P407 http www olimex com Products ARM ST STM32 P407 Notes The LCD uses the TRST signal so to debug and program applications that use the LCD please ensure that yo
21. based file system for mass storage on SD and MMC cards or any device with a block based interface CrossWorks Shield Library provides drivers for a range of Arduino style shields CrossWorks CoreBASIC Library provides a full featured network enabled BASIC interpreter which demonstrates the capabilities of these libraries Architecture The CrossWorks Platform Library is one part of the CrossWorks Target Library Many of the low level functions provided by the target library are built using features of the CrossWorks Tasking Library for multi threaded operation CrossWorks Platform Library CrossWorks Platform Library Delivery format The CrossWorks Platform Library is delivered in source form Feedback This facility is a work in progress and may undergo rapid change If you have comments observations suggestions or problems please feel free to air them on the CrossWorks Target and Platform API discussion forum License The following terms apply to the Rowley Associates Platform Library CrossWorks Platform Library CrossWorks Platform Library Introduction About the CrossWorks Platform Library The CrossWorks Platform Library is a standard API that runs on a collection of popular microprocessors and evaluation boards It is a way for Rowley Associates to deliver examples from simple to complex for those boards In particular the Platform Library requires the CrossWorks Tasking Library for operation Because the P
22. define ARDUINO D1 LM3S PORT PIN LM3S PORT E 4 Analog 3 define ARDUINO_D2 LM3S_PORT_PIN LM3S_PORT_E 5 EE Analog 2 define ARDUINO_D3 LM3S_PORT_PIN LM3S_PORT_E 6 can be PWM4 Arduino PWM Analog 1 define ARDUINO_D4 LM3S_PORT_PIN LM3S_PORT_G 1 can be PWM5 or PWM1 define ARDUINO_D5 LM3S_PORT_PIN LM3S_PORT_G 0 can be PWMO or PWM4 Arduino PWM define ARDUINO_D6 LM3S_PORT_PIN LM3S_PORT_D 1 can be PWMI Arduino PWM U1TX Analog 14 define ARDUINO_D7 LM3S_PORT_PIN LM3S_PORT_F 1 can be PWM1 define ARDUINO_D8 LM3S_PORT_PIN LM3S_PORT_C 7 GL IDS define ARDUINO_D9 LM3S_PORT_PIN LM3S_PORT_C 4 can be PWM6 define ARDUINO_D10 LM3S_PORT_PIN IM3S_PORT_D 2 can be PWM2 Arduino PWM UIRX Analog 13 define ARDUINO D11 LM3S PORT PINI IM3S PORT A 5 can be PWM7 Arduino PWM MOSI define ARDUINO D12 LM3S_PORT_PIN LM3S_PORT_A 4 can be PWM6 MISO define ARDUINO_D13 LM3S_PORT_PIN LM3S_PORT_A 2 can be PWM4 SER define ARDUINO_AO LM3S PORT PIN LM3S PORT D 7 Analog 4 define ARDUINO_Al LM3S_PORT_PIN LM3S_PORT_D 6 Mie Analog 5 define ARDUINO_A2 LM3S_PORT_PIN LM3S_PORT_D 5 Ve Analog 6 define ARDUINO A3 LM3S_PORT_PIN LM3S_PORT_D 4 Analog 7 Mapping of A4 and A5 as digital typically I2C define ARDUINO_A4 LM3S_PORT_PIN LM3S_PORT_B 3 Configured by solder jumper PB3 define ARDUINO_A5 LM3S_PORT_PIN LM3S_PORT_B 2 Configured by solder jumper PB2
23. e aNetduino Plus 2 an mbed LPC1768 with an ELMICRO TestBed This platform is a bit of a challenge as the LPC1768 RAM is split into several regions none big enough accommodate a complete frame buffer And you can run this code using the integrated LCD of e an Olimex STM32 LCD and perhaps this code is included in CrossStudio as an Easter Egg Human interface The code can either use a Defender Playboard with a standard joystick and arcade buttons or a Nintendo Wii Classic Controller You can attach a Classic Controller using a SolderCore SenseCore and WiiChuk adapter happen to lay everything out using a 2x2 flat four base I ve also coded up an interface using the Nintendo Wii Nunchuk Controller for the STM32 LCD in case you purchased one of those from Olimex In this case use the analog joystick for ship control and C to let off a smart bomb and Z to fire 196 CrossWorks Platform Library CrossWorks Platform Library laser cut my Defender Playboard from 5mm acrylic and fitted some proper arcade buttons and a nice joystick A good place to purchase these in the UK is Gremlin Solutions You will find that 3mm acrylic is a better fit for the arcade buttons from Gremlin because they have a spring latch underneath that will not lock on 5mm acrylic I rebated the cuts for the buttons so mine would A warning purchased some arcade buttons from SparkFun but these are very deep and have a seriously naff feel Don t use
24. graphics adapter API x samples ST_Nucleo_F401RE platform_config h not found 180 CrossWorks Platform Library Arch Pro Arch Pro Platform This is the Platform Library implementation for the Seeed Studio Arch Pro http www seeedstudio com depot Arch Pro p 1677 html Mass Storage Examples require a SparkFun microSD shield Networking Examples use the built in Ethernet port Graphics CrossWorks Platform Library There are no built in graphics You can enable graphics by editing example_plugin_graphics c to select an appropriate graphics adapter 12C The platform 12C bus routing is e bus 0 Arduino headers on A4 A5 e bus 1 Arduino R3 headers on SCL SDA e bus 2 Grove l2C socket SPI The platform SPI bus routing is e bus 0 Arduino headers e bus 1 6 pin SPI programming header API Copyright c 2004 2013 Rowley Associates Limited se ifndef SEEED STUDIO ARCH PRO PLATFORM H define SEEED STUDIO ARCH PRO PLATFORM H include libplatform platform_lpc1700 h Arduino footprint pin mapping aE Digital headers define ARDUINO_DO define ARDUINO_D1 define ARDUINO_D2 LPC1700_PAD 1 LPC1700_PAD 1 LPC1700_PORT_4 LPC1700_PORT_4 LPC1700_PAD 1 HEC iO OMP ORE 181 29 28 a CrossWorks Platform Library define ARDUINO D3 define ARDUINO_D4 define ARDUINO_D5 define ARDUINO_D6 define ARDUINO_D7 defi
25. i2c methods Description platform private software i2c methods is a set of methods to drive an 12C bus using software If you use the Platform I2C framework you can set the methods member of an I2C bus in the PLATFORM PRIVATE I2C CONFIGURATION t toplatform private software i2c methods and the Platform 12C framework will supervise the software I2C bus Return Value platform_private_software_i2c_methods returns a standard status code 141 CrossWorks Platform Library CrossWorks Platform Library platform private software spi methods Synopsis PLATFORM PRIVATE SPI METHODS t platform private software spi methods Description platform private software spi methods is a set of methods to drive an SPI bus using software If you use the Platform SPI framework you can set the methods member of an SPI bus in the PLATFORM PRIVATE SPI CONFIGURATION t to platform private software spi methods and the Platform SPI framework will supervise the software SPI bus Return Value platform_private_software_spi_methods returns a standard status code 142 CrossWorks Platform Library CrossWorks Platform Library platform private spi bus configuration Synopsis PLATFORM PRIVATE SPI CONFIGURATION t platform private spi bus configurationll Description platform private spi bus configuration array defines the SPI bus configuration when using the Platform SPI framework See Also PLATFORM_PRIVATE_SPI_CONFIGURATION_t PLAT
26. indicate healthy power supplies or USB status and so on and are not programmable When you run this all LEDs on the target board flash in unison Note PLATFORM LED COUNT expands to a numeric constant that enables static allocation of arrays for example static float led duty cyclel PLATFORM LED COUNTI Independence for LEDs Rather than blink all LEDs in unison it s visually appealing to pulse them in turn quickly 13 CrossWorks Platform Library Chase LEDs around the board include libplatform platform h int main void ant 1 Initialize platform platform_initialize All LEDs off for oi lt PRATT ORMBEE Dm EOUN T EE platform write led i 0 Pulse all LEDs one at a time forever for for i 0 i lt PLATFORM_LED_COUNT platform_write_led i 1 platform spin delay ms 10 platform write led i 0 platform spin delay ms 200 If we ever get out of here return 0 ii CrossWorks Platform Library There are other things you can do with multiple LEDs such as a classic KITT or Cylon animation These things however are more impressive when you have dedicated LED hardware to control rather than a limited number of miniature indicator LEDs on an evaluation board 14 CrossWorks Platform Library lt platform h gt Overview This is the primary header file for the Platform Library CrossWorks Platform Library For information on
27. is the Platform Library implementation for the IAR STM32F429I EXP board which comes with the Game Controller Kit http old iar com website1 1 0 1 0 3084 1 2 item prod_prod s1 2F622 or the Magnetometer Kit http old iar com website1 1 0 1 0 3084 1 item prod_prod s1 2F625 Mass Storage Examples require an Olimex MOD SDMMC attached to the UXT 1 socket Networking Examples require an Olimex MOD ENC28J60 attached to the UXT 2 socket Graphics There are no built in graphics You can enable graphics by editing example_plugin_graphics cand selecting an appropriate graphics adapter 12C The platform 12C bus routing is e bus 0 UXT 1 socket e bus 1 UXT 2 socket e bus 3 UXT 3 socket SPI The platform SPI bus routing is e bus 0 UXT 1 socket e bus 1 UXT 2 socket e bus 3 UXT 3 socket API lSamples IAR STM32FA429II EXP platform config h not found 193 CrossWorks Platform Library CrossWorks Platform Library STM32F4 DISCOVERY STM32F4 DISCOVERY Platform This is the Platform Library implementation for the STMicroelectronics STM32F4 DISCOVERY http www st com internet evalboard product 252419 jsp This platform provides both mass storage and Ethernet support using the Farnell STM32F4DIS BB base board http www element14 com community docs DOC 51084 Mass Storage Examples use the SD MMC socket of the STM32F4DIS BB Networking Examples use the Ethernet port of the STM32F4DIS BB
28. set digital pin mode Synopsis CTL STATUS t platform set digital pin mode int pin int mode Description platform set digital pin mode sets the pin mode for digital VO A digital output is configured in push pull mode but can optionally be turned into an open drain output A digital input is configured without any pull ups but pull ups or pull downs can be requested If a device cannot support pin mode mode platform_set_digital_pin_mode returns a configuration error See Also platform_set_multi_digital_pin_mode platform_digital_pin_mode 84 CrossWorks Platform Library CrossWorks Platform Library platform set digital pin speed Synopsis CTL STATUS t platform set digital pin speed int pin 1ntE kriz 9 Description platform set digital pin speed sets the pin speed for digital VO If a device cannot support the pin speed platform set digital pin speed returns a configuration error The pin speeds supported by various platforms are Processor Speeds MHz STM32L1 0 4 2 10 40 STM32F1 2 25 50 STM32F4 2 25 50 100 LM3S Not configurable LPC1700 Not configurable KLO5Z Not configurable KL25Z Not configurable See Also platform_set_multi_digital_pin_speed platform_digital_pin_speed 85 CrossWorks Platform Library CrossWorks Platform Library platform set multi digital pin drive strength Synopsis CTL STATUS t platform set multi digital pin drive strength const unsigned char pi
29. the use of this API see CrossWorks Platform Library API Summary General platform_cpu_name platform_initialize platform_name Pins PLATFORM_PIN_CLAIM_t PLATFORM PIN CONFIGURATION PLATFORM PIN CONNECTION _t PLATFORM PIN FUNCTION t platform claim multi pin platform claim pin platform claim pin configuration platform lock pin platform lock pin configuration platform pin catalog platform pin catalog count platform pin connection name platform pin function platform pin signal name platform release pin VO platform read analog pin platform read digital pin platform write analog pin platform write digital pin Buttons Platform CPU name Initialize Platform Library Platform name Pin claim reguirements Pin configuration reguest structure Pin connection Pin function reguirements Claim multiple platform pins Claim platform pin Claim a configuration of platform pins Lock pin Lock a pin configuration Pin catalog Number of entries in pin catalog Get connection name for a pin Registered platform pin function Get signal name for a pin Release pin Read analog input Read digital input Write analog output Write digital output CrossWorks Platform Library PLATFORM BUTTON ATTRIBUTE t PLATFORM BUTTON CONFIGURATION t platform button catalog platform button name platform read button LEDs PLATFORM_LED_ATTRIBUTE_t PLATFORM_LED_CONFIGURATION_t platform_led_catalog platform_led_name platform_write_led C
30. this function correctly See Also platform_read_analog_pin 102 CrossWorks Platform Library CrossWorks Platform Library platform write digital pin Synopsis void platform write digital pin int pin int value Description platform write digital pin writes the state of a pin that s configured to be a digital output This function is fast and does no error checking whatsoever it is the client s responsibility to use this function correctly Note On some platforms writing to a pin configured as a digital input may have undesirable effects such as turning pull ups on or off None of the examples written by Rowley Associates will write to a digital output pin in anything other than digital output mode See Also platform_read_digital_pin 103 CrossWorks Platform Library CrossWorks Platform Library platform write led Synopsis void platform write led int index int state Description platform write led sets the platform LED with index index on or off according to state If state is zero the LED is turned off and if state is non zero it is turned on platform write led takes care of initializing the GPIO pin and handing LEDs connected with both positive and negative logic If the LED s GPIO cannot be claimed the LED is not driven this allows shared use where a LED is connected to a GPIO as an indicator For instance the BugBlat Cortino has two LEDs connected to A4 SDA and A5 SCL so for instance a cl
31. this value In addition any lists returned by an API call for instance platform led catalog will ensure that the list is correctly terminated by the value The pins encoded by the Platform Library must lie in the range 0x00 to 0xF0 inclusive to allow for future expansion of the API This allows a pin to be encoded in a structure using an unsigned char In many API prototypes the pin connection type is int rather than PLATFORM_PIN_CONNECTION_t for brevity any argument with type int and name pin is understood to mean the argument is of type PLATFORM_PIN_CONNECTION_t For various platform footprints a common set of symbols are defined which map the microprocessor pin to a platform connector For instance As such on any platform that supports an Arduino footprint you can use the symbol ARDUINO DO to indicate the pin connected to Arduino digital header DO Arduino The following constants are supplied by the Platform Library for evaluation boards that support an Arduino footprint ARDUINO DO through ARDUINO_D12 These constants define the pins connected to the Arduino digital headers ARDUINO_AO through ARDUINO_A5 These constants define the pins connected to the Arduino analog headers 28 CrossWorks Platform Library CrossWorks Platform Library In addition some synonyms are provided by the Platform Library ARDUINO RX and ARDUINO TX Equivalent to ARDUINO DO and ARDUINO_D1 for UART communication ARDUINO MOSI AR
32. 49 platform_cpu_name Platform cpu tick AE E AE E E De Ge eed platfofm epu tick freduenEY se EER GER Ge RG ee KAR dese OAK Pe ak iaaii aidi taatia 52 platform digital pin direction sssssssssscssssccssscsssscsssccsssccsssccssccesssesssccssssecssccssscessscessseesaseessseesss 53 platform digital pin drive strength seek seR sek GER GER Oak Ge Roe OER ee Ge R oek Gee oek ee 54 platform digital pin features platform digital pin mode platform digital pin speed seeks oek GER GEROER OER eR GER oe ee Roe Roe Gee Roe Roe Roe Roe Re platform hook ackgro nd RE EO EG 58 platform hook button PreSS cssscssssssscsssessscsssessssssecssecssessnesssssssecsneesnessssessecsssseneesaeesseesaseeneessessees 59 platform hook pin edge seen seek ee ERROR ee Ge Roe Ge ek eko ek oen oek Gene oek eek ees 60 platfotm hook timer lt nie s ar is 61 platform_i2c_bus platform i2c bus PINS vs ccssscssscsesessavcssesssnscstisacssvesucssesvssavessesnessestvsecasncsaesdesnssevaviestindestovecastesudtsesessebestisvecs 63 platform initialize iss see ee one Gee GR Re ee GR ee eed oe Dee eene ER de ke ed Gkg be dee ERGER oek 64 platform Jed catalog ED EE iiai ea 65 platform led hamers tesis hied gegoede Rees ese GR eek enge se ke fee skede eed dese esse eene platform ed die RR EE EE OE N platform lock pin configuration eed Ad OO AE OE N EE EE platform pin catalog useessee sense ee ek GER Ge Geno RR oen oek Geno ek oe R
33. CrossWorks Platform Library Ipc1700 platform initialize Synopsis void 1pc1700 platform initialize void Description Ipc1700 platform initialize initializes the base LPC1700 platform and configures timer 0 to provide a CPU tick counter 170 CrossWorks Platform Library CrossWorks Platform Library SolderCore SolderCore Platform This is the Platform Library implementation for the SolderCore http www soldercore com Mass Storage Examples use the built in microSD socket Networking Examples use the built in Ethernet port Graphics There are no built in graphics You can enable graphics by editing example_plugin_graphics cand selecting an appropriate graphics adapter 12C The platform 12C bus routing is e bus 0 Arduino header e bus 1 Secondary I2C connector SPI The platform SPI bus routing is e bus 0 Arduino header e bus 1 Internal bus to the microSD socket and the two SPI memory sites on the underside of the PCB API Copyright c 2004 2013 Rowley Associates Limited Fe ifndef SOLDERCORE PLATFORM H define SOLDERCORE PLATFORM H include libplatform platform h include libplatform platform 1m3s gpio h ff SSSSSSSSSS555 SSSSSSSss Arduino footprint to port pin mapping gi define ARDUINO DO LM3S_PORT_PIN LM3S_PORT_D 0 can be PWMO UIRX Analog 15 171 CrossWorks Platform Library CrossWorks Platform Library
34. DUINO MISO and ARDUINO SCK Equivalent to ARDUINO_D11 ARDUINO_D12 and ARDUINO_D13 for SPI communication ARDUINO SDA and ARDUINO SCL Equivalent to ARDUINO_A4 and ARDUINO_AS for 12C communication Some Arduino style platforms such as the Freedom boards may also support the R3 format with LEONARDO SCL and LEONARDO SDA For boards that route the A4 A5 signals to SDA SCL on the digital header LEONARDO SCL will be set to ARDUINO A4 and LEONARDO SDA will be set to ARDUINO_AS For boards with A4 A5 independent from SDA SCL LEONARDO SCL and LEONARDO SDA will be defines as the appropriate pin connection mbed MBED P4 through MBED P30 These constants define the pins connected to the dual in line header pins of an mbed socket LaunchPad LAUNCHPAD A2 through LAUNCHPAD A7 These constants define the pins connected to the A connector of a LaunchPad socket LAUNCHPAD B2 through LAUNCHPAD B7 These constants define the pins connected to the B connector of a LaunchPad socket In addition some synonyms are provided by the Platform Library LAUNCHPAD AIN Equivalent to LAUNCHPAD A2 an analog input LAUNCHPAD RX and LAUNCHPAD TX Equivalent to LAUNCHPAD_A3 and LAUNCHPAD_A4 for UART communication LAUNCHPAD SDA and LAUNCHPAD SCL Equivalent to LAUNCHPAD B6 and LAUNCHPAD_B7 for 12C communication LAUNCHPAD INT 0 and LAUNCHPAD INT 1 Equivalent to LAUNCHPAD_A5 and LAUNCHPAD_B3 pins capable of generating external interrupt
35. EE STM32 405STK NEED EE SMS UG ER EG EE GE EE E Ge GE RR GR ee ee STMI 2 AR N OE N EF SE EE isterduscesoasis AM EP EA AN EA OE N ENS STM3240G EVAL STM32F429II EXP STMS2E4 DISEOVERN ee Ee ee E eek ees RE ee ee eg ees Ep ae be 194 Eye SE 2 EE EE N EE EE EE BL el N N EE Minimal FTP Server Er Minimal HTTP Servet OE RRS 199 CrossWorks Platform Library Contents Weather Station LCDTX9 essens seek see ee ee OER ee oe ER ee Ge ER ee Ge ee oe OER ee ER ek ee eg Gee ee ee gee ee 200 Adafruit TET Touch Shield iss SEGE Ego GESKEER Ee GERAAK ee RAE NiS 201 CrossWorks Platform Library CrossWorks Platform Library CrossWorks Platform Library About the CrossWorks Platform Library The CrossWorks Platform Library presents a standardized API for delivering high quality example code for a wide range of microcontrollers and evaluation boards Additional components that integrate with the Platform Library are CrossWorks Tools Library provides add ons for CTL such as read write locks and ring buffers CrossWorks Device Library provides drivers for common digital sensors such as accelerometers gyroscopes magnetometers and so on CrossWorks Graphics Library is a library of simple graphics functions for readily available LCD controllers CrossWorks TCP IP Library provides TCP IP networking for integrated and external network controllers on memory constrained microcontrollers CrossWorks Mass Storage Library provides a FAT
36. EP MA EE EE EA RRA A ERRAR RARR stm32 set multi pin alternate FUNCTION 0 ceesssssecsssecsssscessccssecssseccsseccsseccssecsssecesseesssecesseess 161 stm32 set pin alternate functiON Qu sesse seek ee ee ee Ge Gee oek oek oek oek oek ee eg 162 CrossWorks Platform Library Contents platform SEMIS ZEA HE scscssccssccessessicsdesesssssasssesscoseseasscgssszsecbssdesSenastobeadesduessnasiossdcossbensiquiobacosesuassssstossbcnssbelsdessondieats ip Eed em EE N Er EE ME EI OE STIMS2 PORT ER OE EE STM32 PORT BASE STIMS2_ PORT 6 RE EA AE OE stm32 platform initialize ios ccscdcescckssscessscevszascssssossceessccusenvassbdeasncsverds aveuiescavanbsvetsducteveccassecdcanavietsenstys 159 stm32 set multi pin alternate FUNCTION 0 ceesssssssssseccssccssescsseccsseccsseccsseccssscesseccsseesssecesseess 161 stm32 set pin alternate functiON Qu eessssscssescssescsssccsssscessscsssscsscessscesseccssecssseccsseccsseccsseessnecess 162 lt platfornm je V7 0 eN 164 LPC1700 PAD LPC 1700 POUK SOURCE HR ER EE ces 166 WPT POO PIN ME AE IE EA EE 167 dial vie AR EE EE tech 168 LPC T700 PORT OE Re SE Re GN RE Ge EE Ge Re ee SR ee eg ee events 169 Ipc1700 platform initialize oe see oeR sek ek GER Oak oe R ek oek eek oe R oo eR oe Roe Roe Roe Roe Roe Roe 170 EE Era EE EE EE Ro sa 177 MCBSTM32C ICSI OB RRB ie ee ee ee ee ei ae ee ee ee ee ee 179 Miclea FOIRE ME RA OE EN EE N EE 180 died Pia EE RE OE 181 re ENE EG aa EE aeania 184 EE EA EE N
37. FORM PRIVATE SPI METHODS t 143 CrossWorks Platform Library CrossWorks Platform Library platform private spi bus instance Synopsis CEASE BUS iti plat torm privaten sp bus ins kanse inl Description platform_private_spi_bus_instance contains the recoded instances of platform SPI buses indexed using the platform SPI bus index When an SPI bus is correctly configured by platform_configure_spi_bus the SPI bus instance is written to platform_private_spi_bus_instance so that platform_spi_bus can access and return an appropriate SPI bus See Also platform_spi_bus platform_configure_spi_bus 144 CrossWorks Platform Library CrossWorks Platform Library platform private spi hardware claim pins Synopsis CTL STATUS t platform private spi hardware claim pins int index const PLATFORM PIN CONFIGURATION t pins PLATFORM PIN CLAIM t claim Description platform private spi hardware claim pins is a utility method that returns the result of passing pins to platform claim pin configuration You can use platform private spi hardware claim pins as the pin claimmethod for an 12C bus using a hardware I2C controller See Also PLATFORM_PRIVATE_I2C_METHODS t 145 CrossWorks Platform Library CrossWorks Platform Library platform private start single hook timer Synopsis void platform private start single hook timer unsigned frequency Description platform private start single hook timeris a utility func
38. Hd 7 d 182 EE OE EE SS eo oe He N HE KI Ia 13 28 2 12 ND ND ND ND Mey Ge HE 1 CrossWorks Platform Library green red blue yellow CrossWorks Platform Library define define define Wie ARCH PRO LAN REFCLK ARCH PRO LAN MDC ARCH PRO LAN MDIO LPC1700 PAD LPC1700 PORT 1 LPC1700 PAD LPC1700 PORT 1 LPC1700 PAD LPC1700 PORT 1 Platform limits Hie define define define define define define define endif PLATFORM_PIN_COUNT PLATFORM_SPT_BUS_COUNT PLATFORM_I2C_BUS_COUNT PLATFORM UART COUNT PLATFORM LED COUNT PLATFORM BUTTON COUNT PLATFORM UEXT COUNT SES HS dI ey 932 183 15 16 di CrossWorks Platform Library CrossWorks Platform Library CrossWorks Platform Library Olimexino STM32 Olimexino STM32 Platform This is the Platform Library implementation for the Olimex Olimexino STM32 http www olimex com Products Duino STM32 OLIMEXINO STM32 Mass Storage Examples require an Olimex MOD SDMMC attached to the UEXT socket Note that there is not enough RAM available as delivered to run the generic Card Benchmark example Networking Examples require an Olimex MOD ENC28J60 attached to the UEXT socket Note that there is not enough RAM available as delivered to run the generic FTP Server and HTTP Server examples Graphics There are no built in graphics You can enable graphics by editing example_plugin_graph
39. IC INS N EE sass eSessszsbdsiebucstbadissssiseats 107 Platform _cOnfigure_NetWOKK csssssssssssecsssscsscccsscsssseccssecsssscsssecssssessscesssccssecesssccsseccssecessecersesesseees 108 lt platform_sensors h gt platform configure builtin accelerometer ssssssscssssesscssesecesseesessessssnsessesseesesneesenseesesnesssese 110 platform configure builtin gyrOSCOpe ssscsssscsssscssescsssscsssscsssscsssscsseessscccssecessescssscssseecseessseess 111 platform configure builtin humidity senSOF uuuusssesssser seen seek soeke eke Ge Roe Roe Roe Roe Reen 112 platform configure builtin light senSOF uuusses seen seen sek oek ee Roe Re oe ee ee Gee Gee Gee oek ee platform configure builtin magnetometer cccsssccssecsssecsssecsssscsssccssssesssccssscesscecssseceseessseesss platform configure builtin pressure sensor platform configure builtin temperature sensor platform N si EE EE platform network heap sscssscssscssecssecssscssecssecssesssecssecssscssecsnscsnscsnscssecsnscsnscsnscssecsnscsnscsnecsnecsneesseess platform private init heapS ccccsssssssssssssesssssssessesssecsssesssessecssecsnsessscssecsssesssesssessecsssesseesseesseesess platform system heap implementa oe EE AR OE CrossWorks Platform Library Contents lt platform private gt ii detensie koekoed geed bek oes opse ese see sege de oes R eke ed doe dag gees ede gede 121 PLATFORM PRIVATE 12C CONFIG
40. IN_MODE_STANDARD Pin is a standard push pull output or floating input PIN MODE OPEN DRAIN Pin is configured in open drain mode PIN MODE PULL UP Integrated pull up resistors are enabled PIN MODE PULL DOWN Integrated pull down resistors are enabled See Also platform set digital pin mode 35 CrossWorks Platform Library CrossWorks Platform Library PLATFORM RESET CAUSE t Synopsis typedef enum PLATFORM_RESET_POWER_ON PLATFORM_RESET_EXTERNAL PLATFORM_RESET_SOFTWARE PLATFORM_RESET_WATCHDOG PLATFORM_RESET_BROWNOUT PLATFORM_RESET_OSCILLATOR_FAIL PLATFORM_RESET_CAUSE_t Description PLATFORM_RESET_CAUSE_t enumerates the causes of a microcontroller reset Note that some platforms may not be able to support reporting all reset causes PLATFORM RESET POWER_ON Power on reset PLATFORM_RESET_EXTERNAL External reset using reset pin PLATFORM RESET SOFTWARE Software reset PLATFORM _ RESET WATCHDOG Reset because watchdog expired PLATFORM RESET BROWNOUT Reset after brownout PLATFORM RESET OSCILLATOR FAIL Reset after oscillator fail See Also platform_reset_cause 36 CrossWorks Platform Library CrossWorks Platform Library PLATFORM UEXT CONFIGURATION t Synopsis typedef struct signed char i2c bus index signed char spi bus index signed char uart index unsigned char pin3 txd unsigned char pin4_rxd unsigned char pin5 scl unsigned char pin6 sda unsigned char pin7_miso unsig
41. ION_t 66 CrossWorks Platform Library CrossWorks Platform Library platform lock pin Synopsis CTL STATUS t platform lock pin int pin Description platform lock pin attempts to raise the claim on pin pin to PIN CLAIM LOCKED If the underlying microcontroller implements pin locks the Platform Library may take advantage of this and hardware lock the pin in addition to locking it in software Return Value platform_lock_pin returns a standard status code See Also platform_lock_pin 67 CrossWorks Platform Library CrossWorks Platform Library platform lock pin configuration Synopsis CTL STATUS t platform lock pin configuration const PLATFORM PIN CONFIGURATION t config Description platform lock pin configuration iterates over the list of pins pins and attempts to raise the claim on each entry s pin to PIN_CLAIM_LOCKED If the underlying microcontroller implements pin locks the Platform Library may take advantage of this and hardware lock the pin in addition to locking it in software The pin list pins must be terminated by PLATFORM_END_OF_LIST in the pin member of the final PLATFORM_PIN_CONFIGURATION_t If a pin cannot be locked platform_lock_pin_configuration immediately returns the status Return Value platform_lock_pin_configuration returns a standard status code See Also platform_lock_pin 68 CrossWorks Platform Library platform name Synopsis char platform name void
42. LCD with D C 0 See the function plat form_configure_builtin_graphics in stm32f4discover c to select between fast FSMC LCD mode without accelerometer and GPIO mode with accelerometer 194 CrossWorks Platform Library CrossWorks Platform Library API AA samples STM32 ST STMS2EA4DISGOVERY platform eonfig h not found 195 CrossWorks Platform Library CrossWorks Platform Library Defender About Defender For execution on a SolderCore and a SolderCore Arcade Shield or SolderCore LCD Shield I ve even run this code on a Windows PC using Qt to do GUI heavy lifting Background This code replicates as accurately as can make it a Williams Defender unit Defender was one of those games that was pretty awesome for its time Please don t complain about the coding style don t ask how it works just do not bother me send this code out into the world to fend for itself and for you to unravel any puzzles you find You have a SolderCore you have an Arcade Shield you have CrossWorks you have a debugger so all is not lost Core hardware This code is primarily intended to run on a SolderCore and a SolderCore Arcade Shield or a SolderCore LCD Shield Best gameplay comes from using the Arcade Shield because the display is bigger and it is considerably faster You can also run this code using a SolderCore Arcade Shield or SolderCore LCD Shield on e an Olimex STM32 E407 e an Olimex STM32 H407 a BugBlat Cortino
43. PLATFORM BUTTON MASK The mask to isolate the button type above PLATFORM BUTTON POSITIVE LOGIC When set indicates that the button uses positive logic reading a one from the GPIO indicates the button is pressed and reading a zero indicates it is released When clear indicates the button uses negative logic 18 CrossWorks Platform Library CrossWorks Platform Library PLATFORM BUTTON NEGATIVE LOGIC A documentation convenience when constructing button attributes Indicates that the button uses negative logic reading a zero from the GPIO indicates the button is pressed reading a one indicates the button is released 19 CrossWorks Platform Library CrossWorks Platform Library PLATFORM BUTTON CONFIGURATION Synopsis typedef struct unsigned char pin unsigned char attributes unsigned char mode const char name PLATFORM BUTTON CONFIGURATION t Description PLATFORM BUTTON CONFIGURATION t describes the features of a button connected to a GPIO pin The digital pin that senses the button See PLATFORM PIN CONNECTION t attributes The attributes of the button See PLATFORM BUTTON ATTRIBUTE t mode The mode to set the pin should it be connected by a GPIO See PLATFORM PIN MODE t Some boards rely on integrated pull up or pull down resistors for buttons rather than using an external resistor You can specify the pull ups or pull downs by setting this member appropriately name The name of the button You can set
44. Q accelerometer on the PCB SPI The platform SPI bus routing is e bus 0 Arduino headers API samples Kinetis FRDM KL26Z platform config h not found 176 CrossWorks Platform Library CrossWorks Platform Library FRDM KL46Z FRDM KL46Z Platform This is the Platform Library implementation for the Freescale FRDM KL46Z http www freescale com webapp sps site prod_summary jsp code RDM KL46Z Sensors The FRDM KL46Z has a built in MMA8541Q accelerometer and MAG3110 magnetometer Mass Storage Examples require a SparkFun microSD shield Networking Examples require a NuElectronics ENC28J60 shield Graphics There are no built in graphics You can enable graphics by editing example_plugin_graphics cand selecting an appropriate graphics adapter 12C The platform 12C bus routing is e bus 0 Arduino headers e bus 1 Internal bus to the built in MMA8451Q accelerometer on the PCB SPI The platform SPI bus routing is e bus 0 Arduino headers API samples Kinetis FRDM KLA6Z platform config h not found 177 CrossWorks Platform Library CrossWorks Platform Library MCBSTM32C MCBSTM32C Platform This is the Platform Library implementation for the Keil MCBSTM32C http www keil com mcbstm32c Mass Storage Examples use the built in microSD socket Networking Examples use the built in Ethernet port Graphics Examples use the built in QVGA display The display u
45. URATION 0 essessssscsssssccsssensccnsccnsccsssensccnssensecsssensccsseeses 123 PLATFORM PRIVATE 12C METHODS ou seeseeeseessees sees see sees ee see Rees ee see eg ee Roe e eene R eens 124 PLATFORM PRIVATE SPI CONFIGURATION t 125 PLATFORM PRIVATE SPI METHODS t ww 126 platform private configure led oe sssssssscsssscsssscsssscessscsssccssescsssccsseccssscssscecsscessneccssecesnsecsseessses 127 platform private execute hOOKS cssssssscssssssscssssssssssssssecssssssscssssssecssssssssssssssecsssssssesssessecsssesseessees 128 platform private find pin connection seen een eek sek eek GER oek oe Roe Roe Roe Roe Renee Res 129 platform private hook single timer uuuusses sense sen sek sek gek eek GER Gee Gee Roe Gee Roe Gee ge 130 platform private i2c bus configuratiON uusseessses see sek ek oek GER ee Roe Roe Roe Roe Gee ee 131 platform _private_i2c_DUS_INSTANCE cccesssscsssesseesssesseesnssssecssssssessnecssessosssasesneesseesssssasesneesssesess 132 platform_private_i2c_hardware_claim_in ssssssssssesssesssssssssssssssssssesssssssesonesssessesseesoseees 133 platform_private_idle_task_main platform private _initialiZe 0 sense see GESE GR OR Ge OR GR oe Se GR GR ee oe ese ee ese oe ese ee se platform private lock PIN iese sees RE see ee R REGSKRAG Reede ne sege geed R eg Rede ee WE ee ees ed platform private pin connection name platform private pin signal name uussee sees s
46. _SIM32_103STK platftorm config h not found 185 CrossWorks Platform Library CrossWorks Platform Library STM32 405STK STM32 405STK Platform This is the Platform Library implementation for the Olimex STM32 405STK http www olimex com Products ARM ST STM32 405STK Noteworthy The Crazyflie Remote example uses the built in 3310 LCD and the nRF24L01 together with a Nintendo classic controller and MOD WII plugged into the UEXT socket to control a Bitcraze Crazyflie Mass Storage Examples use the built in SD MMC socket Networking Examples require an Olimex MOD ENC28J60 attached to the UEXT socket Graphics Examples use the built in Nokia 3310 LCD display 12C The platform 12C bus routing is e bus 0 UEXT socket e bus 1 BMA250 on the main PCB SPI The platform SPI bus routing is e bus 0 UEXT socket e bus 1 nRF24L01 and 3310 LCD on the main PCB API amplies Olimex SIMs25P405 plattormacontig m not Found 186 CrossWorks Platform Library CrossWorks Platform Library STM32 E407 STM32 E407 Platform This is the Platform Library implementation for the Olimex STM32 E407 http www olimex com Products ARM ST STM32 E407 Mass Storage Examples use the built in SD MMC socket Networking Examples use the built in Ethernet port Graphics There are no built in graphics You can enable graphics by editing example_plugin_graphics cand selecting an appropriate graphics adapter
47. ataloged signal name for the button s pin is nonzero the button name is that signal name Ifthe cataloged connection name for the button s pin is nonzero the button name is that connection name e Otherwise the button name is ANON See Also PLATFORM_BUTTON_CONFIGURATION_t 40 CrossWorks Platform Library CrossWorks Platform Library platform claim multi pin Synopsis CTL STATUS t platform claim multi pin const unsigned char pins TE sure ilerm s Description platform claim multi pin iterates over the list of pins pins and attempts to claim each for function using platform claim pin The pin list pins must be terminated by PLATFORM FND OF LIST If any pin cannot be claimed platform claim multi pin immediately returns the status Return Value platform claim multi pin returns a standard status code See Also platform claim pin configuration platform release pin 41 CrossWorks Platform Library CrossWorks Platform Library platform claim pin Synopsis CTL STATUS t platform claim pin int pin 1ntE Karoo Description platform claim pin attempts to claim the pin pin for function function The function parameter is the inclusive or of a PLATFORM PIN CLAIM t constant anda PLATFORM PIN FUNCTION t constant Return Value platform claim pin returns a standard status code See Also platform claim pin configuration platform release pin 42 CrossWorks Platform Library CrossWorks Platform Library
48. atform Library CrossWorks Platform Library platform digital pin direction Synopsis CTL STATUS t platform digital pin direction int pin Description platform digital pin direction returns the digital VO pin direction for pin pin configured as a digital I O This function is fast and does no error checking whatsoever it is the client s responsibility to use this function correctly See Also PLATFORM_PIN_DIRECTION_t platform_set_digital_pin_direction 53 CrossWorks Platform Library CrossWorks Platform Library platform digital pin drive strength Synopsis CTL STATUS t platform digital pin drive strength int pin Description platform digital pin drive strength returns the configured drive strength in milliamps for the pin pin Return Value platform digital pin drive strength returns an extended status code If the status indicates an error pin does not drive strength configuration Platform notes Not all platform provide programmable drive strength See platform set digital pin drive strength for additional platform information See Also platform set digital pin drive strength 54 CrossWorks Platform Library platform digital pin features Synopsis CTL STATUS t platform digital pin features int pin Description platform digital pin features returns the features for the pin pin See Also platform set digital pin features 55 CrossWorks Platform Library Cros
49. ause between changing the LED state the processor is active all the time burning cycles waiting for the right moment to continue There is a better way You can use ct 1_delay rather than platform spin delay ms todelaythe user task and let other tasks run If you do this you are being much kinder to the tasking system and in this case the processor is put to sleep whilst waiting 12 CrossWorks Platform Library Blinking all LEDs More LEDs Having mastered a single LED let s progress to multiple LEDs Blink the all platform LEDs in unison include libplatform platform h static void write_all_leds int state int index Iterate over all platform LEDs for index 0 index lt PLATFORM_LED_COUNT index platform_write_led index state void main void Initialize platform platform_initialize Blink all LEDs forever for write all leds 1 ala EDs on platform spin delay ms 500 Wait write all leds 0 i B11 REDS OT platform spin delay ms 500 Wait CrossWorks Platform Library This example is only slightly more complex than before The function write all leds iterates over all LEDs that the platform provides and sets them all to the same state The noteworthy item here is that PLATFORM LED COUNT is a count of the number of user controllable LEDs that the target platform offers There may well be more LEDs on the target board but they usually
50. e digital I Os Get CPU core frequency Get CPU tick Get CPU tick frequency Delay a number of CPU cycles Delay a number of milliseconds Delay a number of microseconds CrossWorks Platform Library Hooks PLATFORM EDGE t PLATFORM HOOK t platform hook background platform hook button press platform hook pin edge platform hook timer platform unhook background platform unhook timer 12C platform_configure_i2c_bus platform_i2c_bus platform_i2c_bus_pins SPI platform_configure_i2c_bus_ex platform_configure_spi_bus platform_configure_spi_bus_ex platform_spi_bus platform_spi_bus_pins UART platform_configure_uart platform_uart UEXT PLATFORM_UEXT_CONFIGURATION_t platform_uext_configuration Reset PLATFORM_RESET_CAUSE t platform_reboot platform_reset_cause Watchdog platform_watchdog_enable platform_watchdog_remaining platform_watchdog_service platform_watchdog_set_period CrossWorks Platform Library Signal edge require to trigger pin hook Platform hook context Hook function to background list Hook a button press Hook function to a pin edge Hook function to a repetitive timer Unhook function from background list Unhook function from timer Configure I2C bus Get I2C bus interface Get pins for 12C bus Configure I2C bus extended Configure SPI bus Configure SPI bus extended Get SPI bus interface Get pins for SPI bus Configure UART Get UART interface UEXT configuration descriptor Get UEXT config
51. en sek oek oek GER GEROER ee Roe Roe ee Roe ee Re Ge ee platform private read buttON uses seen sees ee Reese Roe Oe OER ek oek oe Rook eo Reen oe Reen oe Roe ee platform private release PIN ou sense eek Roe ROK Roe Oe Gee oek oe R oek oek oek Gene eek gee platform private software i2c methods platform private software spi methods platform private spi bus configuration platform private spi bus instance uuuuse sesse see ee RE oR RR OE Roe GE Roe Roe Roe Roe Roe Roe Roe Roe Roe Re platform private spi hardware claim pDiNS uusses seen seen eseR ee Roe Roe OER ek GER Gee ee ek ek ees 145 platform private start single hook timer ou ssssssseccssecsssccsssscsseccsssecsssecsscecsscccsscccsseesesees 146 platform private start tasking cscccsssscsssscssecssssccssccssssccscccsseesssessssccsssccsssecsssesnscessecersecesnseerseets 147 platform private stop single hook timer uusuuu sees seen ese ke ek GER GER ek GER Ge ERGER ees 148 Platform_private_test_Pin_ClaiiM c csscssssssscssssssscssssssscssssssscssssssscsssssnscsssssnscsssssssessseanscsseesseesseess 149 platform private timer hOOkS uses platform private unhook single timer platform private write led xplat orm SMIN ara annn ERR GE Ee ee Ee Ge Ee Ge ee N EA NE EE EE MEN OR EE EE AE OP STMS 2 PORT ie EG SR ED ee ee Ee Re GE ee ee ee ee ee ARE No AE N N STMSB 2 PORT Eie ee Ee se ee ke Ee es stm32 platform initialize
52. ent call to platform_pin_connection_name Implementation Special connection names such as PLATFORM_NO_CONNECTION are handled by platform_pin_connection_name and any platform specific connections are passed to platform_private_pin_connection_name to handle See Also PLATFORM_PIN_CONNECTION_t platform_pin_signal_name 72 CrossWorks Platform Library CrossWorks Platform Library platform pin function Synopsis unsigned char platform pin function Description platform pin function is an array indexed by platform pin contains the claim and function for the pin as set by platform claim pin or platform claim pin configuration Note Clients must not write to this array directly it is managed by the Platform Library to ensure proper operation 73 CrossWorks Platform Library CrossWorks Platform Library platform pin signal name Synopsis char platform pin signal name int pin Description platform pin signal name returns the signal name for pin pin The signal name returned is generally the name from the schematic or in the case of buttons and LEDs the name of the button or LED on the silkscreen Note The string may be overwritten by a subsequent call to platform_pin_signal_name Implementation Special signal names such as PLATFORM_NO_CONNECTION are handled by platform_pin_signal_name and any platform specific pins are passed to platform_private_pin_signal_name to handle See Also
53. figure i2c bus but configures the 12C bus pins using the claim mode claim You can use this to claim the pins of an 12C bus and lock them such that they cannot be reconfigured See Also platform_configure_i2c_bus 45 CrossWorks Platform Library CrossWorks Platform Library platform configure spi bus Synopsis CTL STATUS t platform configure spi bus int index int extended frames Description platform configure spi bus powers up and initializes the SPI peripheral and configures the appropriate pins for SPI configuration on SPI bus index The MISO MOSI and SCK pins are configured for shared use of those functions as returned by plaform_spi_bus_pins platform_configure_spi_bus guarantees to successfully configure devices for 8 bit frame sizes or multiples thereof If you know that all devices connected to an SPI bus require frames that are multiples of a byte you can use platform_configure_spi_bus to configure the bus In this case it s likely that the Platform Library will use a hardware SPI controller to drive the bus If some device on the bus requires non byte multiple frames for example some SPI LCDs require 9 bit frames then platform_configure_spi_bus will not in general guarantee to support those devices If you require non byte multiple frame sizes set extended frames to a non zero value and this will force use of a software SPI controller when the hardware controller only supports 8 bit frame sizes Platf
54. he code You can extend the capabilities of the server and customize it for your needs as it is delivered in source form 199 CrossWorks Platform Library CrossWorks Platform Library Weather Station LCD1x9 About the example The application searches an I2C bus to find a light sensor a pressure sensor a humidity sensor and a temperature sensor After enumerating the available sensors it will show a carousel of measurements on the LCD MOD LCD1x9 Setup For boards with a UEXT socket e Plug a MOD LCD1X9 into the first UEXT socket On everything else e Wire the MOD LCD1x9 SDA SCL signals to the primary platform 12C bus Arduino format setup You can use a SenseCore with a CorePressure module and CoreLight module for instance Or you can use a Jee Labs plug shield with some sensors that they offer Or you can plug both of them in at once if you really want to 200 CrossWorks Platform Library CrossWorks Platform Library Adafruit TFT Touch Shield Adafruit TFT Touch Shield README This note covers use of the Adafruit TFT Touch Shield on platforms that prove problematic Using the Touch Shield on an Arduino or compatible and Olimexino 5510 The Adafruit TFT Touch Shield routes the system reset signal from the Arduino header direct to the LCD reset input This is a serious problem if you intend to debug using an Arduino Uno Olimexino 328P or Olimexino 5510 because the debugger communicates using the RESET signal on t
55. he AVR it s used for debugWIRE and on the MSP430 it s used for Spy Bi Wire So you re out of luck debugging the LCD because it is continually reset when you single step What you can do is build and program your target board then simply reset it with the debug cable unplugged Using the Touch Shield on the SolderCore or Freedom Board There are no issues using the shield with a SolderCore or Freedom Board because the debug connection does not use the reset signal Alternative products The ITead Studio ITDBO2 range of LCDs has LCD reset mapped to a general purpose I O pin rather than directly to system reset so debugging using and Arduino or Olimexino 5510 is possible Alternatively consider a less pin hungry shield such as the SolderCore LCD Shield which runs using SPI at up to 40 MHz 201
56. hook_background is thread safe See Also PLATFORM_HOOK_t platform_unhook_background 58 CrossWorks Platform Library CrossWorks Platform Library platform hook button press Synopsis CTL STATUS t platform hook button press int index PLATFORM HOOK t hook Description platform hook button press hooks a press on the button with index index using hook platform hook button press will hook the correct edge to detect a button press according to the configuration for button index Return Value platform hook button press returns a standard status code See Also PLATFORM BUTTON CONFIGURATION t 59 CrossWorks Platform Library CrossWorks Platform Library platform hook pin edge Synopsis CTL STATUS t platform hook pin edge int pin PLATFORM EDGE t edge PLATFORM HOOK t hook Description platform hook pin edge hooks the function hook so that it is activated by an edge on pin pin The edge parameter reguests that the hook be triggered on a rising edge a falling edge or either edge The activated hook is executed in an interrupt context not a task context and without any surrounding calls to ctl enter isrand ctl exit isr If your hook requires CTL facilities you must ensure that you call ct enter isr and ct exit isras you would in a standard CTL interrupt handler Return Value platform_hook_pin_edge returns a standard status code Hooking an interrupt is inherently platform dependent and may fail fo
57. ibrary CrossWorks Platform Library platform spin delay ms Synopsis void platform spin delay ms unsigned period Description platform spin delay ms delays execution by busy waiting for at least period milliseconds See Also platform spin delay cycles platform spin delay us 92 CrossWorks Platform Library CrossWorks Platform Library platform spin delay us Synopsis void platform spin delay us unsigned period Description platform spin delay us delays execution by busy waiting for at least period microseconds See Also platform spin delay cycles platform spin delay ms 93 CrossWorks Platform Library CrossWorks Platform Library platform uart Synopsis CTL UART t platform_uart int index Description platform uart returns the UART driver for the UART index If index does not correspond to a logical platform UART platform_uart returns zero 94 CrossWorks Platform Library CrossWorks Platform Library platform uext configuration Synopsis PLATFORM UEXT CONFIGURATION t platform uext configuration int index Description platform uext configuration returns a configuration descriptor for UEXT socket index This function will return a non zero result for indexes in the range 0 through PLATFORM UEXT COUNT 1 and a zero results for indexes outside this range If the platform does not provide a UEXT socket PLATFORM_UEXT_COUNT is set to zero and platform_uext_configuration alwa
58. ics cand selecting an appropriate graphics adapter 12C The platform 12C bus routing is e bus 0 Arduino header e bus 1 UEXT header SPI The platform SPI bus routing is e bus 0 Arduino headers and UEXT socket e bus 1 microSD socket on the main PCB API xx samples Olimex_Olimexino_SIM32 platform_config h not found 184 CrossWorks Platform Library CrossWorks Platform Library STM32 103STK STM32 103STK Platform This is the Platform Library implementation for the Olimex STM32 103STK http www olimex com Products ARM ST STM32 103STK Noteworthy The Crazyflie Remote example uses the built in 3310 LCD and the nRF24L01 together with a Nintendo classic controller and MOD WII plugged into the UEXT socket to control a Bitcraze Crazyflie Mass Storage Examples use the built in SD MMC socket Note that there is not enough RAM available as delivered to run the generic Card Benchmark example Networking Examples require an Olimex MOD ENC28J60 attached to the UEXT socket Note that there is not enough RAM available as delivered to run the generic FTP Server and HTTP Server examples Graphics Examples use the built in Nokia 3310 LCD display 12C The platform 12C bus routing is e bus 0 UEXT socket e bus 1 LIS3LVO2DL on the main PCB SPI The platform SPI bus routing is e bus 0 UEXT socket e bus 1 nRF24L01 and 3310 LCD on the main PCB API x Samples Olimex
59. ient can request an I2C bus on those two pins and attempting to write to the LEDs using platform write led will be a no operation as SCL and SDA are claimed for 12C If however the LEDs are written using platform_write_led the pins are claimed as general purpose outputs and trying to establish an 12C bus on them will fail Note ALED doesn t need to be directly attached to a GPIO but this is the typical configuration 104 CrossWorks Platform Library CrossWorks Platform Library lt platform_graphics h gt Overview This is the primary header file for configuring SD microSD on a platform For information on the use of this API see CrossWorks Platform Library API Summary Graphics platform_configure_builtin_graphics Configure built in graphics display 105 CrossWorks Platform Library CrossWorks Platform Library platform configure builtin graphics Synopsis CTL STATUS t platform configure builtin graphics void Description platform configure builtin graphics configures the platform s built in graphics display if there is one If there is no built in display available on the platform platform configure builtin graphics returns CTL UNSUPPORTED OPERATION Return Value platform configure builtin graphics returns a standard status code 106 CrossWorks Platform Library CrossWorks Platform Library lt platform_network h gt API Summary Network platform_configure_network Configure the network i
60. iguration platform_private_software_spi_methods 125 CrossWorks Platform Library CrossWorks Platform Library PLATFORM PRIVATE SPI METHODS _t Synopsis typedef struct CTL STATUS E configure_controller int CTL STATUS t elaimi pins int const PLATFORM PIN CONFIGURATION t PLATFORM PIN CLAIM t CTU SFI BUS t oontroller Int PLATFORM PRIVATE SPI METHODS t Description PLATFORM PRIVATE SPI METHODS t contains the methods required to configure an SPI bus The first parameter of each method is the index of the device SPI bus to configure rather than the index of the Platform SPI bus For instance platform SPI bus with index 0 may well be implemented using the device SPI bus SPI2 in which case the index will be 2 configure_controller Method to configure the controller for the SPI bus claim_pins Method to claim the pins that the SPI controller will use For software SPI controllers the pins are configured for digital I O controller Method to return the SPI bus controller 126 CrossWorks Platform Library CrossWorks Platform Library platform private configure leds Synopsis CTL STATUS t platform private configure leds void Description platform private configure leds iterates over all LEDs returned by platform led pins and configures any GPIO connected LEDs for use Return Value platform private configure leds returns a standard status code 127 CrossWorks Platform Librar
61. ins Synopsis CTL STATUS t platform private i2c hardware claim pins int index const PLATFORM PIN CONFIGURATION t pins PLATFORM PIN CLAIM t claim Description platform private i2c hardware claim pins is a utility method that returns the result of passing pins to platform claim pin configuration You can use platform private i2c hardware claim pins as the pin claimmethod for an SPI bus using a hardware SPI controller See Also PLATFORM PRIVATE SPI METHODS t 133 CrossWorks Platform Library CrossWorks Platform Library platform private idle task main Synopsis void platform private idle task main void param Description platform private idle task main is the prototype for the microcontroller Platform Library to implement Typically the main function will be an infinite loop that puts the processor into low power mode waiting for an interrupt However you can customize this for instance to illuminate an LED to show when the processor is active The standard implementation of this for the platforms that we distribute is to place the processor into low power mode awaiting and interrupt 134 CrossWorks Platform Library CrossWorks Platform Library platform private initialize Synopsis void platform private initialize void Description platform private initialize initializes the private part of the Platform Library In particular for release builds is has a 250 ms delay to allow for power s
62. ite prod_summary jsp code FRDM KL25Z Sensors The FRDM KL25Z has a built in MMA8541Q accelerometer Mass Storage This platform does not have enough RAM to support mass storage Networking This platform does not have enough RAM to support networking Graphics There are no built in graphics You can enable graphics by editing example_plugin_graphics cand selecting an appropriate graphics adapter 12C The platform 12C bus routing is e bus 0 Arduino headers e bus 1 Internal bus to the built in MMA8451Q accelerometer on the PCB SPI The platform SPI bus routing is e bus 0 Arduino headers API samples Kinetis FRDM KL25Z plat form config h not found 175 CrossWorks Platform Library CrossWorks Platform Library FRDM KL26Z FRDM KL26Z Platform This is the Platform Library implementation for the Freescale FRDM KL26Z http www freescale com webapp sps site prod_summary jsp code FRDM KL26Z Sensors The FRDM KL26Z has a built in FXOS8700CO accelerometer and magnetometer Mass Storage This platform does not have enough RAM to support mass storage Networking This platform does not have enough RAM to support networking Graphics There are no built in graphics You can enable graphics by editing example_plugin_graphics cand selecting an appropriate graphics adapter 12C The platform 12C bus routing is e bus 0 Arduino headers e bus 1 Internal bus to the built in FXOS8700C
63. latform Library and facilities built on top of it use interrupts and background processing we made the decision to use the CrossWorks Tasking Library as a foundation stone for the Platform Library We have not abstracted the Platform Library to use a generic RTOS as this adds more complexity to the design Why use the Platform Library Standardizing on the Platform Library provised a certain amount of portability for you applications Rather than using vendor supplied libraries that get you running quickly on their silicon you can invest some time learning the Platform Library and use that knowledge across different architectures You are however committing to use CrossWorks CTL and the Platform Library for the long term What the Platform Library isn t The Platform Library it is not a general purpose API supporting every feature offered by common devices nor does it cater for all devices within a family The Platform Library is tested on the microprocessors and evaluation boards that Rowley Associates deliver examples for Certainly you can use it with little or no modification on boards that have other processors in the families we support but you will need to customize the Platform Library implementation yourself What the Platform Library runs on The Platform Library runs on the following microprocessor families e LPC1700 e LM3S e KLO5Z e KL25Z e STM32F1 e STM32F4 The range of boards and microprocessors that run the Platf
64. led_catalog 25 CrossWorks Platform Library CrossWorks Platform Library PLATFORM PIN CLAIM t Synopsis typedef enum PIN_CLAIM_WEAK PIN_CLAIM_SHARED PIN_CLAIM_EXCLUSIVE PIN_CLAIM_FIXED PIN_CLAIM_LOCKED PLATFORM PIN CLAIM t Description PLATFORM PIN CLAIM tdescribes the claim that the client wishes to make on a pin when configuring it using platform_claim_pin or platform_claim_pin_configuration PIN_CLAIM WEAK The application claims this pin for a function but the pin can be reconfigured for another function without first releasing it PIN_CLAIM SHARED The application claims this pin for a function and claims of the same pin for the same function will be granted The pin can be released for reuse by platform_release_pin PIN_CLAIM EXCLUSIVE The application claims exclusive use of this pin for a function and claims of the same pin for the same function will be denied The pin can be released for reuse by platform_release_pin PIN_CLAIM FIXED The application claims exclusive use of this pin for a function claims of the same pin for the same function will be denied Fixed pins cannot be released PIN CLAIM LOCKED ASPIN CLAIM FIXED but used internally by the Platform Library to deny configuration of dedicated or non existent pins Locked pins cannot be released If the underlying microcontroller implements pin locks the Platform Library may take advantage of this and hardware lock the pin in additi
65. m configure uart powers up and initializes the platform UART with index index and configures the appropriate pins for UART communication The UART pins are configured using PIN CLAIM SHARED Return Value platform configure uart returns a standard status code 48 CrossWorks Platform Library CrossWorks Platform Library platform cpu core freguency Synopsis unsigned long platform cpu core freguency void Description platform cpu core freguency returns the CPU core freguency in Hertz 49 CrossWorks Platform Library CrossWorks Platform Library platform cpu name Synopsis char platform cpu name void Description platform cpu name returns the presentation human readable name of the microprocessor that the platform runs on 50 CrossWorks Platform Library CrossWorks Platform Library platform cpu tick Synopsis unsigned long platform cpu tick void Description platform cpu tick returns the current free running CPU tick The CPU tick increments at a rate of platform cpu tick freguency ticks per second and wraps around from 2521 to zero See Also platform cpu tick freguency 51 CrossWorks Platform Library CrossWorks Platform Library platform cpu tick freguency Synopsis unsigned long platform cpu tick freguency void Description platform cpu tick freduency returns the frequency at which the CPU tick increments in Hertz See Also platform cpu tick 52 CrossWorks Pl
66. midity sensor void Description platform configure builtin humidity sensor configures the platform s built in humidity sensor if there is one If there is no built in humidity sensor available or the resources SPI bus I2C bus etc are not available to support the humidity sensor platform_configure_builtin_humidity_sensor returns zero 112 CrossWorks Platform Library CrossWorks Platform Library platform configure builtin light sensor Synopsis CTL LIGHT SENSOR t platform configure builtin light sensor void Description platform configure builtin light sensor configures the platform s built in light sensor if there is one If there is no built in light sensor available or the resources SPI bus 12C bus etc are not available to support the light sensor platform_configure_builtin_light_sensor returns zero 113 CrossWorks Platform Library CrossWorks Platform Library platform configure builtin magnetometer Synopsis CTL MAGNETOMETER t platform_configure_builtin_magnetometer void Description platform configure builtin magnetometer configures the platform s built in magnetometer if there is one If there is no built in magnetometer available or the resources SPI bus 12C bus etc are not available to support the magnetometer platform_configure_builtin_magnetometer returns zero 114 CrossWorks Platform Library CrossWorks Platform Library platform configure builtin pressure sensor Synopsis
67. mplementation For platforms that provide a single timer took platform_hook_timer should call platform_private_hook_single_timer and provide implementations of platform_private_start_single_hook_timer and platform_private_stop_single_hook_timer to control the timer interrupt See Also platform_private_unhook_single_timer 130 CrossWorks Platform Library CrossWorks Platform Library platform private i2c bus configuration Synopsis PLATFORM PRIVATE T2C CONFIGURATION t platform private i2c bus configurationll Description platform private i2c bus configuration array defines the I2C bus configuration when using the Platform 12C framework See Also PLATFORM PRIVATE 12C CONFIGURATION amp PLATFORM PRIVATE 1 2C METHODS t 131 CrossWorks Platform Library CrossWorks Platform Library platform private i2c bus instance Synopsis CIAT CABUS tt platform private ie bus instaneel Description platform private i2c bus instance contains the recoded instances of platform 12C buses indexed using the platform I2C bus index When an I2C bus is correctly configured by platform configure i2c bus the 12C bus instance is written to platform private i2c bus instance so that platform i2c bus can access and return an appropriate 12C bus See Also platform_i2c_bus platform_configure_i2c_bus 132 CrossWorks Platform Library CrossWorks Platform Library platform private i2c hardware claim p
68. n platform private test pin claim tests whether pin pin can be claimed for function function The function parameter is the inclusive or of a PLATFORM PIN CLAIM t constant and a PLATFORM PIN FUNCTION t constant Return Value platform private test pin claim returns a standard status code See Also platform claim pin 149 CrossWorks Platform Library CrossWorks Platform Library platform private timer hooks Synopsis PLATFORM HOOK t platform private timer hooks Description platform private timer hooks is the list of timer hooks set up by platform private hook single timer If no hook has been set platform private timer hooks is null See Also platform private hook single timer 150 CrossWorks Platform Library CrossWorks Platform Library platform private unhook single timer Synopsis void platform private unhook single timer PLATFORM HOOK t p Description platform private unhook single timerisa utility function when implementing plat form unhook timer on platforms that offer only one timer Implementation For platforms that provide a single timer took platform unhook timer should call platform private unhook single timer and provide implementations of platform private start single hook timer and platform private stop single hook timer to control the timer interrupt See Also platform private unhook single timer 151 CrossWorks Platform Library Cro
69. n of the pin to the defaults for that pin See Also PLATFORM_PIN_DIRECTION_t platform digital pin direction 81 CrossWorks Platform Library CrossWorks Platform Library platform set digital pin drive strength Synopsis CTL STATUS t platform set digital pin drive strength int pin int strength Description platform set digital pin drive strength sets the pin drive strength for digital VO pin to strength milliamps If a device cannot support the pin drive strength platform set digital pin drive strength returns a configuration error The pin drive strength supported by various platforms are Processor Drive Strengths mA STM32L1 Not configurable STM32F1 Not configurable STM32F4 Not configurable LM3S 2 4 8 LPC1700 Not configurable KLO5Z Not configurable KL25Z 5 18 assumes Vdd gt 2 7 V See Also platform_set_multi_digital_pin_drive_strength platform_digital_pin_drive_strength 82 CrossWorks Platform Library CrossWorks Platform Library platform set digital pin features Synopsis CTL STATUS t platform set digital pin features int pin int features Description platform set digital pin features sets the pin features for digital I O If a device cannot support the pin features features platform set digital pin features returns a configuration error See Also platform_digital_pin_features 83 CrossWorks Platform Library CrossWorks Platform Library platform
70. ne ARCH PRO LAN CRS define ARCH PRO LAN RXDO define ARCH PRO LAN RXDI define ARCH PRO LAN RXER LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD Li Li Li Li Li Li Li Li Li Li Li Li 1 1 1 1 LPC1700_PAD Li LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD PC1700 PORT 0 PC1700 PORT 2 PC1700 PORT 2 PC1700 PORT 2 PC1700 PORT 2 PC1700 PORT 0 PC1700 PORT 0 PC1700 PORT 0 PC1700 PORT 0 PC1700 PORT 0 PC1700 PORT 0 PC AL TOO JORGE _ 0 PCL FOO ICI _ 0 Pei OOP ORTaOF PIC AL HOO _I2XO RAL_ 10 PCL TOO IORI PCA TOO J2ORE_ AL ECs 0 Ome ORs ECdi 0 OME ORMAO PCL FOO _IXOIN I _0 ECs 0 Ome ORMars PC1700 PORT 0 PC1700 PORT 0 PC1700 PORT 0 PC1700 PORT 0 Pe iO Ome Raman oe MIOONEORTEAO PET7OO PORT Pe MOEDER ECO OME ORs CAL OCONEE TEIE Pe MOEDER EE oe AL OO JORGE AL Hd 7 1 LPC LEC LPC LPC LPC LPC LPC LPC LPC LPC LPC LEC loolee 1700 PO 1700 PO L700_PO L700_PO L700 PO 1700 PO io odee Mo odee 1700 PO loose e 1700 PO d si or a i n i N 1 j j 1 d 1 z 1
71. ne ARDUINO_D8 define ARDUINO_D9 define ARDUINO_D10 define ARDUINO_D11 define ARDUINO_D12 define ARDUINO_D13 Analog header define ARDUINO_AO define ARDUINO A1 define ARDUINO A2 define ARDUINO A3 define ARDUINO A4 define ARDUINO_A5 On digital header define ARDUINO_AREF Additional Uno pins define UNO_SCL define UNO_SDA define UNO_NC on power header Uno has LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD LPC1700_PAD Li Li Li Li Li Li Li Li Li Li Li Li Li Li Li Li Li Li Li Li LPC1700_PAD NACI see Arduino SPI programming header define ARDUINO_SPI_MOSI define ARDUINO_SPI_MISO define ARDUINO_SPI_SCK define ARDUINO_SPI_SSEL Grove T2C socket define GROVE_I2C_SDA define GROVE_I2C_SCL Grove UART socket define GROVE_UART_TX define GROVE_UART_RX LEDs define ARCH PRO LEDI define ARCH PRO LED2 define ARCH PRO LED3 define ARCH PRO LED4 LAN define ARCH PRO LAN RST define ARCH PRO LAN OSC EN define ARCH PRO LAN LED SPEED define ARCH PRO LAN LED LINK define ARCH PRO LAN 50 MHZ define ARCH PRO LAN TXDO define ARCH PRO LAN TXDI define ARCH PRO LAN TXEN defi
72. ned char pin8_mosi unsigned char pin9_sck unsigned char pinl0_ssel PLATFORM_UEXT_CONFIGURATION_t Description PLATFORM_UEXT_CONFIGURATION_t describes the connection topology and bus connection for an Olimex UEXT socket i2c bus index The index of the platform I2C bus that is routed to the SDA and SCL pins on the UEXT socket If this is negative the UEXT socket does not support 12C communication spi_bus_index The index of the platform SPI bus that is routed to the MOSI MISO and SCK pins on the UEXT socket If this is negative the UEXT socket does not support SPI communication uart_index The index of the platform UART that is routed to the TXD and RXD pins on the UEXT socket If this is negative the UEXT socket does not support UART communication pin3_txd The platform pin connected to TXD pin 3 on the UEXT socket If this is PLATFORM_PIN_CONNECTION the UEXT pin is unconnected pin4_rxd The platform pin connected to RXD pin 4 on the UEXT socket If this is PLATFORM_PIN_CONNECTION the UEXT pin is unconnected pin5 scl The platform pin connected to SCL pin 5 on the UEXT socket If this is PLATFORM PIN CONNECTION the UEXT pin is unconnected pin6_sda The platform pin connected to SDA pin 6 on the UEXT socket If this is PLATFORM_PIN_CONNECTION the UEXT pin is unconnected 37 CrossWorks Platform Library CrossWorks Platform Library pin7 miso The platform pin connected to MI SO
73. ns int strength Description platform set multi digital pin drive strength iterates over the list of pins pins and sets each listed pin s drive strength to strength milliamps using platform set digital pin drive strength The pin list pins must be terminated by PLATFORM END OF LIST If any pin cannot be configured platform_set_multi_digital_pin_drive_strength immediately returns the status See Also platform_set_digital_pin_drive_strength platform_set_multi_digital_pin_drive_strength 86 CrossWorks Platform Library CrossWorks Platform Library platform set multi digital pin mode Synopsis CTL STATUS t platform set multi digital pin mode const unsigned char pins int mode Description platform set multi digital pin mode iterates over the list of pins pins and sets each listed pin s mode to mode using platform set digital pin mode The pin list pins must be terminated by PLATFORM END OF LIST If any pin cannot be configured platform set multi digital pin mode immediately returns the status See Also platform set digital pin mode platform digital pin mode 87 CrossWorks Platform Library CrossWorks Platform Library platform set multi digital pin speed Synopsis CTL STATUS t platform set multi digital pin speed const unsigned char pins int mode Description platform set multi digital pin speed iterates over the list of pins pins and sets each lis
74. nterface controller 107 CrossWorks Platform Library CrossWorks Platform Library platform configure network Synopsis CTL STATUS t platform configure network CTL NET INTERFACE t self Description platform configure network configures the platform s primary network interface controller on the interface self The intention of this is for the network controller to be initialized ready to run the examples Return Value platform configure network returns a standard status code 108 CrossWorks Platform Library CrossWorks Platform Library lt platform_sensors h gt Overview This is the primary header file for sensors on a platform For information on the use of this API see CrossWorks Platform Library The design of this API separates out all sensors into classes and each class of sensor has an individual API entry point We do this rather than having a general enumeration function to conserve code and data space in linked applications If there is a single API entry point to enumerate all sensors for example then the API implementation would need to link in drivers for each sensor offered by the platform irrespective of whether the client requires it or not API Summary Motion platform_configure_builtin_accelerometer Configure built in accelerometer platform_configure_builtin_gyroscope Configure built in gyroscope Magnetics platform_configure_builtin_magnetometer Configure built in magnetometer Environmental
75. oe Roe Roe Roe Gee Roe Roe Roe Reese Platform pin catalag lt COUNE i esse esse seg SEER sege OR Geen SON Regke ede Gee RARR GR ske Ra eke ata nii ede 71 platform pin connection NamME ccsscssscssscssscssscssscssecssecssecsnscsnecsnecsscesnecssecsuscsseesssesseessecsseesseesseesses 72 platform pin TuRERGOR sissies issie se seges Ges soog oek ER eek eek ee S RENE Roe ee Ge Ek es REG ke sea platform pin signal name platform read analog pin platform read DUTON iis ees ek GR eed RR AR Koeke gek ske ene Ge Re gegee gek Gede ede ek Kees platform read digital pin platform FEO OE ER N EE platform release pin platform ds EE RE Oe Oe Oe Na 80 CrossWorks Platform Library Contents platform set digital pin direction sesse see ee Ge OER GER GER oe Rea R Ge Roe Roe Roe Re 81 platform set digital pin drive strength sees sseR ee ROER Geek OER GER GER oek ek ek eke 82 platform set digital pin features oc ssscsssscsssscssssccssscssescsssscsscccssssesseecsscecssecsssscssseesscesseessseets 83 platform set digital pin platform set digital pin platform set multi digital pin drive strength uu sssssssscseecssccsseccssccsssecsssccessscssssessecessees 86 platform set multi digital pin mode ou sees esse sesse esse ee ER eek gee eR Geek Gee Gee eR gee gee ee 87 platform set multi digital pin speed seen seen sek sek GER GER GER Ge Reen oe Renee Roe Reneke 88 platformi Spi DUS iiinis OR N EE N 89 platfo
76. on to locking it in software See Also platform_claim_pin platform_claim_pin_configuration 26 CrossWorks Platform Library CrossWorks Platform Library PLATFORM PIN CONFIGURATION Synopsis typedef struct unsigned char pin unsigned char function PLATFORM PIN CONFIGURATION t 27 CrossWorks Platform Library CrossWorks Platform Library PLATFORM PIN CONNECTION Synopsis typedef enum PLATFORM_NO_CONNECTION PLATFORM_END_OF_LIST PLATFORM PIN CONNECTION t Description PLATFORM PIN CONNECTION t is an enumeration that describes a pin connection A pin connection is platform specific and encodes a port and a pin within that port using a single integer There are two distinguished values that the Platform Library uses when accepting or defining a pin e PLATFORM NO CONNECTION ina pin list indicates that there is no direct connection for this pin For instance a button that is not directly connected to a GPIO will specify this for the pin member for the button in the button catalog the button can still be read using plat form read button butthe implementation of the Platform Library will not read directly from the pin for that button This is useful for instance when a joystick or buttons are analog encoded using resistors to change an analog input to indicate which buttons are pressed PLATFORM END OF LIST indicates the end of a list Any API call that requires a list must terminate the list with
77. onfiguration PLATFORM_PIN_DIRECTION_t PLATFORM_PIN_FEATURE_t PLATFORM_PIN_MODE_t platform_digital_pin_direction platform_digital_pin_drive_strength platform_digital_pin_features platform_digital_pin_mode platform_digital_pin_speed platform_set_digital_pin_direction platform_set_digital_pin_drive_strength platform_set_digital_pin_features platform_set_digital_pin_mode platform_set_digital_pin_speed platform_set_multi_digital_pin_drive_strength platform_set_multi_digital_pin_mode platform_set_multi_digital_pin_speed Time platform_cpu_core_frequency platform_cpu_tick platform_cpu_tick_frequency platform_spin_delay_cycles platform_spin_delay_ms platform_spin_delay_us CrossWorks Platform Library Button attributes Button configuration Get platform button configuration Get platform button name Read from button LED attributes LED configuration Get platform LED configuration Get platform LED name Write to LED Pin VO direction Pin features Pin drive mode requirements Get VO direction Read pin drive strength mode Read digital pin features Read digital pin mode Read pin speed Set direction for a single digital VO Set drive strength for a single digital VO Write features for a single digital VO Set mode for a single digital I O Set speed for a single digital I O Set drive strength for multiple digital I Os Set mode for multiple digital I Os Set speed for multipl
78. orm Library CrossWorks Platform Library STM32 PORT t Synopsis typedef enum STM32 PO TM32 PO TM32 PO ME pe TM32 PO Ms 2 1210 M32_PO M32_PO M32_PO EMS 2 ee OR Fa di a bo Gol bo be Bo bel di ap yeep EE EE HE EL Ges es 1 1 HA H NDNANnNnNANNNMNN Ed eg Description STM32_PORT_t enumerates the STM32 ports for the STM32F1 implementation by name 158 CrossWorks Platform Library CrossWorks Platform Library stm32 platform initialize Synopsis void stm32 platform initialize void Description stm32 platform initialize initializes the base STM32 platform by powering up GPIO ports A through and configuring timer 2 to provide a CPU tick counter 159 CrossWorks Platform Library CrossWorks Platform Library stm32 release pin Synopsis void stm32 release pin unsigned pin Description stm32 release pin releases the pin connection pin If the pin is configured for PWM output the PWM channel is freed for reuse 160 CrossWorks Platform Library CrossWorks Platform Library stm32 set multi pin alternate function Synopsis void stm32 set multi pin alternate function const unsigned char pins unsigned function Description stm32 set multi pin alternate function configures the list of pin connections pins to use the alternative function function The list must be terminated by PLATFORM END OF LIST 161 CrossWorks Platform Library CrossWorks Platform Lib
79. orm Library continues to expand Please check the CrossWorks web site for the latest information CrossWorks Platform Library CrossWorks Platform Library Blinking one LED Ignition on Diving straight into code you can blink a LED on your target board with a few lines of code Blink the first platform LED include libplatform platform h void main void Initialize platform platform_initialize Blink first LED forever for platform_write_led 0 1 77 TED on platform spin_delay_ms 500 Wait platform write_led 0 0 LED off platform_spin_delay_ms 500 Wait Hopefully this should be self explanatory but here are some noteworthy items e All Platform Library functions are prefixed with plat form e platform_initialize sets up the board and processor for the Platform Library You need to call this before using any other Platform Library function See platform_initialize e platform_write_led x y writes x to LED y See platform write led e platform spin delay ms x delays execution for x milliseconds by busy waiting in a loop See platform_spin_delay_ms e Which LED blinks on your target board depends upon the target board obviously consult the documentation for the Platform Library on your target board for details of LED numbering By the way This does the job but isn t the kindest way to blink a LED Because this example uses platform spin delay ms to p
80. orm notes KLO5Z KL25Z STM32F1 and STM32F4 SPI controllers support only 8 bit frames in hardware For the Arduino Uno or compatibles using the ATmega328P such as the Arduino Pro and the Olimexino 328 the SS pin is automatically configured for shared digital output along with the hardware functions for MISO MOSI and SCK The ATmega328P will switch to SPI slave mode if SS is driven low with SS configured as an input so the Platform Library silently configures SS as a shared output to avoid inadvertently switching to SPI slave mode Return Value platform_configure_spi_bus returns a standard status code See Also platform_configure_spi_bus_ex 46 CrossWorks Platform Library CrossWorks Platform Library platform configure spi bus ex Synopsis CTL STATUS t platform configure spi bus ex int index int extended frames PLATFORM PIN CLAIM t claim Description platform configure spi bus ex processes the parameters index and extended frames as platform configure spi bus but configures the SPI bus pins using the claim mode claim You can use this to claim the pins of an SPI bus and lock them such that they cannot be reconfigured Return Value platform_configure_spi_bus_ex returns a standard status code See Also platform_configure_spi_bus 47 CrossWorks Platform Library CrossWorks Platform Library platform configure uart Synopsis CTL STATUS t platform configure uart int index Description platfor
81. pin 7 on the UEXT socket If this is PLATFORM PIN CONNECTION the UEXT pin is unconnected pin8_mosi The platform pin connected to MOSI pin 8 on the UEXT socket If this is PLATFORM_PIN_CONNECTION the UEXT pin is unconnected pin9_sck The platform pin connected to SCK pin 9 on the UEXT socket If this is PLATFORM_PIN_CONNECTION the UEXT pin is unconnected pini0 ssel The platform pin connected to SSEL pin 10 on the UEXT socket If this is PLATFORM PIN CONNECTION the UEXT pin is unconnected See Also platform uext configuration 38 CrossWorks Platform Library CrossWorks Platform Library platform button catalog Synopsis PLATFORM BUTTON CONFIGURATION t platform button catalog void Description platform button catalog returns an array of buttons available on the platform The end of the array is indicated by the pin member set to PLATFORM END OF LIST See Also PLATFORM BUTTON CONFIGURATION t 39 CrossWorks Platform Library CrossWorks Platform Library platform button name Synopsis char platform button name int index Description platform button name returns the preferred name for the button with index index The returned pointer is guaranteed non zero The button name is derived as follows e If index is not a valid button index the button name is INVALID e Ifthe button name is non zero in the button catalog the button name is the cataloged name e Ifthe c
82. ption PLATFORM PRIVATE 12C CONFIGURATION t describes the configuration of a Platform I2C bus bus_index The device 12C bus index to use for the I2C controller For instance platform I2C bus with index 0 may well be implemented using the device I2C bus 2C2 in which case bus index will be 2 pins The pin connections required by the I2C bus methods The methods required to implement the I2C bus For 12C controllers implemented in software methods should be set to plat form_private_software_i2c_methods See Also platform_private_i2c_bus_configuration platform_private_software_i2c_methods 123 CrossWorks Platform Library CrossWorks Platform Library PLATFORM PRIVATE 12C METHODS t Synopsis typedef struct CTL STATUS E configure_controller int CTL STATUS t elaim pins int const PLATFORM PIN CONFIGURATION t PLATFORM PIN CLAIM t CTE T C BUS soo IIIEF RE IS PLATFORM PRIVATE I2C METHODS t Description PLATFORM PRIVATE 12C METHODS t contains the methods required to configure an I2C bus The first parameter of each method is the index of the device 12C bus to configure rather than the index of the Platform 12C bus For instance platform 12C bus with index 0 may well be implemented using the device I2C bus I2C2 in which case the index will be 2 configure_controller Method to configure the controller for the I2C bus claim_pins Method to claim the pins that the I2C controller will use For
83. r It will serve simultaneous client connections to the server if you configure MAXIMUM_FTP_CLIENTS in example_ftp_server c Limitations The server is minimal and therefore has certain limitations If all you wish to do is store and retrieve files from an SD card managed by the Mass Storage Library this will do that for you It will not however rename files or act as a full FTP server that is not its purpose This server has no compile time configuration options If you wish to remove PUT or GET capability do this by editing the code You can extend the capabilities of the server and customize it for your needs as it is delivered in source form 198 CrossWorks Platform Library CrossWorks Platform Library Minimal HTTP Server Minimal HTTP Server README This note is a description of the HTTP server example Overview The HTTP server example is a minimal implementation of an HTTP server that serves pages from a mounted disk It will serve simultaneous client connections to the server if you configure MAX IMUM_HTTP_CLIENTS in ctl_http_server c Limitations The server is minimal and therefore has certain limitations If all you wish to do is serve files from an SD card managed by the Mass Storage Library this will do that for you It will not however provide capabilities such as POST CGI and so on This server has no compile time configuration options If you wish to remove capabilities do this by editing t
84. r alternate function 153 CrossWorks Platform Library CrossWorks Platform Library STM32 PAD Synopsis define STM32 PAD PORT PIN PORT lt lt 4 PIN Description STM32 PAD creates a PLATFORM PIN CONNECTION t by combining STM32 port PORT and a pin within that port PIN The port and pin are extracted from the connection by STM32 PORT and STM32 PIN e STM32_PORT STM32_PAD x y x e STM32_PIN STM32_PAD x y y See Also STM32_PORT STM32_PIN 154 CrossWorks Platform Library CrossWorks Platform Library STM32 PIN Synopsis define STM32_PIN PIN PIN amp 15 Description STM32_PIN extracts the STM32 pin within a port from an encoded PLATFORM_PIN_CONNECTION_t value In other words STM32_PIN STM32_PAD x y y See Also STM32_PAD STM32_PORT 155 CrossWorks Platform Library STM32 PORT Synopsis define STM32 PORT PIN PIN gt gt 4 Description STM32_PORT extracts the STM32 port see STM32_PORT_t from an encoded PLATFORM PIN _CONNECTION_t value In other words STM32_PORT STM32_PAD x y x See Also STM32_PAD STM32_PIN 156 CrossWorks Platform Library CrossWorks Platform Library CrossWorks Platform Library STM32 PORT BASE Synopsis define STM32 PORT BASE X GPIO TypeDef GPIOA BASE 0x400 X Description STM32 PORT BASE returns a pointer to the STM32 CMSIS GPIO type for the port X 157 CrossWorks Platf
85. r any of the following reasons e Ahook is already established for the pin Some platforms may support more than one hook per pin and chain them whereas others may support exactly one hook per pin It is typically not possible to establish distinct hooks for rising and falling edges of a pin but the platform supports a single hook for both edges The platform is out of resources when associating interrupts with pins For instance STM32 devices can hook an interrupt to bits 0 through 31 of any port but cannot simultaneously establish hooks for the same bit on different ports i e you cannot establish hooks for interrupts on both PORTA 4 and PORTC 4 as they share the same internal resource but you can establish hooks for PORTA 4 and PORTC 5 as they use different pins The port pin cannot generate interrupts The port pin does not support the requested edge trigger See Also PLATFORM_HOOK_t PLATFORM_EDGE_t 60 CrossWorks Platform Library CrossWorks Platform Library platform hook timer Synopsis CTL STATUS t platform hook timer PLATFORM HOOK t p unsigned freguency Description platform hook timer hooks hook so that it is activated repetitively freguency times per second The platform executes the hook in an interrupt context not a task context Hooking onto a timer is a good way to execute code at a reliable fixed freguency to scan LED matrices or switches for instance Return Value platform hook timer return
86. rary stm32 set pin alternate function Synopsis void stm32 set pin alternate function unsigned pin unsigned function Description stm32 set pin alternate function configures the platform connection pin to use alternative function function 162 CrossWorks Platform Library CrossWorks Platform Library lt platform_stm32f4 h gt Overview The STM32F4 platform implements the Platform Library private API for a subset of STM32F4 processors The STM32F4 platform implementation uses the following resources e Timer 2 to provide the CPU tick as part of platform_cpu_tick e Port interrupt handlers for each port to enable hooks on pins with platform hook pin edge SPI communication is DMA driven API Summary Platform stm32_platform_initialize Initialize STM32 platform Pins STM32_PAD Construct a pin connection STM32_PIN Extract pin within port from pin connection STM32_PORT Extract port from pin connection STM32_PORT_BASE Get CMSIS GPIO structure STM32_PORT_t STM32 ports stm32_set_multi_pin_alternate_function Configure pin connection list for alternate function stm32_set_pin_alternate_function Configure pin connection for alternate function 163 CrossWorks Platform Library CrossWorks Platform Library lt platform_Ipc1700 h gt Overview The LPC1700 platform implements the Platform Library private API for a subset of LPC1700 processors The LPC1700 platform implementation uses the following resources e Timer
87. rm spi DUS PINS oes sessies oek oie kooe gs sen seekos sae deeg gees ak oek eke de ese ees ede gig platform spin delay cydles platform spin delay MS cccssssssseccsssccsseccssscsssecsssscsseccsssscssscesssscsssccsssccssscesseccsssesssccssscessscecsnecceseeesnees platfofm spin delay US i e ER RR ee GE EG ee Rees gegee doe cessiasisanecuaestsscchsacdesssesdatdaadcabauzceds sts 93 platform Ed OO EN 94 platform uext configuration iisisti iiinis 95 platform_unhook_background ssssssessessssssssssesessesesssssssoeeescensessssooeressenessssssoeeresesnssssseoeeeresesnsssssrorerreeess 96 platform_unhook_timer platform_watchdog_enable qu csssssssssssscsssscsssscsseccsssscsssscsssecsssscssssesssccsseccssecsssecsssecseneecsneessnecenseessses 98 platform watchdog remaining ssccsssscsssscsssscsssscsssscsssscsssscssesesssccssecssscessscessscessssecssccssseessseessneesss 99 platform watchdog service csscccsssssssscsssscrsescsssscsssscsssscsssscsssccssesesssccssecsssesssseessscessseessscessnecssseessnees 100 platform watchdog set period sense sen ERROR GER R ooo oe Ge Gee ee Gee ee 101 platform write analog pin platform write digital pin platform write led iss GR ee RE Re AE Gee sees eke de Gee Re GEN eGGSA ede seg ede platfom graphies hio OO EE RR EE N ia Eaa aia aaa platform configure builtin graphics ou ssssssssscsssscsssscsssscsssscsscccsssesssccsssccsssccssscessscessseessscesseeeses 106 platform SEW OT
88. s platform_initialize starts up the CrossWorks Tasking Library and creates a two task system with a user task and an idle task The user task is the thread of execution that continues after platform_initialize returns and the idle task runs when there is nothing else to do and typically puts the processor to sleep so that it doesn t continue to consume energy 64 CrossWorks Platform Library CrossWorks Platform Library platform led catalog Synopsis PLATFORM LED CONFIGURATION t platform led catalog void Description platform led catalog returns an array of LEDs available on the platform The end of the array is indicated with the pin member set to PLATFORM END OF LIST See Also PLATFORM LED CONFIGURATION t 65 CrossWorks Platform Library CrossWorks Platform Library platform led name Synopsis char platform led name int index Description platform led name returns the preferred name for the LED with index index The returned pointer is guaranteed non zero The LED name is derived as follows e If index is not a valid LED index the LED name is INVALID e Ifthe LED name is non zero in the LED catalog the LED name is the cataloged name e Ifthe cataloged signal name for the LED s pin is nonzero the LED name is that signal name e Ifthe cataloged connection name for the LED s pin is nonzero the LED name is that connection name e Otherwise the LED name is ANON See Also PLATFORM_BUTTON_CONFIGURAT
89. s a standard status code Hooking a timer is inherently platform dependent and may fail for any of the following reasons e The desired execution frequency cannot be achieved e All timer hooks are already established The platform API guarantees at least one active timer hook Thread Safety platform_hook_timer is thread safe See Also PLATFORM_HOOK_t platform_unhook_timer 61 CrossWorks Platform Library CrossWorks Platform Library platform i2c bus Synopsis CTL T2C BUS t platform i2c bus int index Description platform i2c bus returns the driver for the 12C bus index If index does not correspond to a logical platform bus platform i2c bus returns zero 62 CrossWorks Platform Library CrossWorks Platform Library platform i2c bus pins Synopsis PLATFORM PIN CONFIGURATION t platform i2c bus pins int index Description platform i2c bus pins returns the pin list required for 12C communication on 12C bus index If index does not correspond to a logical platform bus platform i2c bus pins returns zero The list of pins is terminated by PLATFORM_END_OF_LIST inthe pin member See Also PLATFORM_PIN_CONFIGURATION_t 63 CrossWorks Platform Library CrossWorks Platform Library platform initialize Synopsis void platform initialize void Description platform_initialize initializes the microprocessor and any hardware on the board for use with Platform Library functions Behind the scene
90. sWorks Platform Library platform digital pin mode Synopsis CTL STATUS t platform digital pin mode int pin Description platform digital pin mode returns the configured pin mode for the pin pin See Also platform set digital pin mode 56 CrossWorks Platform Library CrossWorks Platform Library CrossWorks Platform Library platform digital pin speed Synopsis CTL STATUS t platform digital pin speed int pin Description platform digital pin speed returns the configured pin speed in kHz for the pin pin Return Value platform digital pin speed returns an extended status code If the status indicates an error pin does not Support speed configuration Platform notes Not all platform provide programmable pin speed See platform set digital pin speed for additional platform information See Also platform set digital pin speed 57 CrossWorks Platform Library CrossWorks Platform Library platform hook background Synopsis void platform hook background PLATFORM HOOK t hook Description platform hook background hooks hook to the list of hooks that run in the background approximately ten times per second The platform executes the hook in a task context not an interrupt context Hooking onto the background list is a good way to periodically update environmental sensor readings flush shadowed LCD contents and anything else that is not time critical Thread Safety platform_
91. sasiiitiiii iniinis 33 PLATFORM_PIN MODE 1 EE N 35 PLATFORM BESET CAUSE ccsscsicsssssssssascsuescostesnosssnnssseszenededsscoscostssncasonoaesdedossasebendssetactobaa sacdensescberaaaois 36 PLATFORM UEXT CONFIGURATION t 37 platform button catalog sn nsccsccsccsssdssssssccxsescessssosssssscsansescunsssvssvecvensnsasssveisaissnaceerassarvenstageesaseesnssesestenasiets 39 CrossWorks Platform Library Contents platform button name ccsscssssssssssssssscsssossssssscsscssssosesssscssscssscossssnssossconssnseesscsasscaseensesascsnsecasesnsesssesss 40 platform claim multi PD sesse Ke GEE RR GASSE aisn SEE ESS 41 platform claim OT sissisotaa sssaaa saes saasa SSE ERES Raoa Eso ees ske 42 platform_claim_pin_configuration sssesssssssseeessssesssoeeereeesssesoseereeeuesssenootereeeusnusssootereeensssssrsootereess 43 platform_configure_i2c_bus platform configure i2c DUS eX ai cccc cccssssssisessscassensosssecteveensoseocessossesastenssseecssaveccosevesssousacaivestsateectavienss 45 platform confidure Spi DUS lt nsssisssscasessnssssessscassssssesssssancscssassccdssssaseessovereceansssscuensnsecsesssctasnasassesatasediccans 46 platform_configure spi _DUS_eEX susssnoninmsninsinisnaisianiaiaia 47 platform configure Uart ssisissisissisisicrieciississaranrssrsnisnpsatskr Henna Sne Re raS ARANES EENES E 48 platform_cpu_core_frequengy ccccsssscsseccssccsccssssccsscssssccssscesssecsssecsssecssscessccsssesssecesssccsssccsneccsseesseess
92. ses an Ampire AM320240LDTNQW module and ORISE SPFD5408B LCD driver 12C The platform 12C bus routing is e bus 0 Internal to accelerometer touch screen controller codec and EEPROM Codec and EEPROM are not supported by any high level platform code SPI The platform SPI bus routing is e bus 0 microSD socket API rs Visampies ikeil MEBSTMA 2E pdat tor oonfidg h not found 178 CrossWorks Platform Library CrossWorks Platform Library Nucleo F103RB Nucleo F103RB Platform This is the Platform Library implementation for the STMicroelectronics Nucleo F103RB www st com nucleoF 103RB pr Mass Storage Examples require a SparkFun microSD shield Networking Examples require a NuElectronics ENC28J60 shield Graphics There are no built in graphics You can enable graphics by editing example_plugin_graphics cand selecting an appropriate graphics adapter API x gt Samples ST_Nucleo_Fl03RB platform_config h not found 179 CrossWorks Platform Library CrossWorks Platform Library Nucleo F401RE Nucleo F401RE Platform This is the Platform Library implementation for the STMicroelectronics Nucleo F401RE www st com nucleoF401RE pr Mass Storage Examples require a SparkFun microSD shield Networking Examples require a NuElectronics ENC28J60 shield Graphics There are no built in graphics You can enable graphics by editing example_plugin_graphics cand selecting an appropriate
93. software 12C controllers the pins are configured for digital I O controller Method to return the I2C bus controller 124 CrossWorks Platform Library CrossWorks Platform Library PLATFORM PRIVATE SPI CONFIGURATION Synopsis typedef struct int bus index const PLATFORM PIN CONFIGURATION t pins const PLATFORM PRIVATE SPI METHODS t methods PLATFORM PRIVATE SPI CONFIGURATION t Description PLATFORM PRIVATE SPI CONFIGURATION t describes the configuration of a Platform SPI bus bus index The device SPI bus index to use for the SPI controller For instance platform SPI bus with index 0 may well be implemented using the device SPI bus SPI2 in which case bus index will be 2 pins The pin connections required by the SPI bus methods The methods required to implement the SPI bus for byte frames index 0 and extended frames index 1 For SPI buses implemented entirely in software both entries in met hods should be set to platform_private_software_spi_methods For SPI buses that are implemented entirely in hardware with the capability of extended frames both entries should be set to the device specific methods for that controller For SPI buses that are can implement byte frame in hardware but require extended frames in software index 0 should be set to the device specific methods for that controller and index 1 should be set to plat form_private_software_spi_methods See Also platform_private_spi_bus_conf
94. ssWorks Platform Library platform private write led Synopsis void platform private write led int index int state Description platform private write led writes state to the GPIO controlled LED with index index platform_private_write_led takes care of inverting state for negative logic LEDs If all platform LEDs are controlled using GPIOs that are accessible using platform_write_digital_pin a platform implementation of platform_write_led can call platform_private_write_led directly 152 CrossWorks Platform Library CrossWorks Platform Library lt platform_stm32f1 h gt Overview The STM32F1 platform implements the Platform Library private API for a subset of STM32F1 processors The STM32F1 platform implementation uses the following resources e Timer 2 to provide the CPU tick as part of platform_cpu_tick e Port interrupt handlers for each port to enable hooks on pins with platform hook pin edge SPI communication is DMA driven API Summary Platform stm32_platform_initialize Initialize STM32 platform Pins STM32_PAD Construct a pin connection STM32_PIN Extract pin within port from pin connection STM32_PORT Extract port from pin connection STM32_PORT_BASE Get CMSIS GPIO structure STM32_PORT_t STM32 ports stm32_release_pin Release configured pin connection stm32_set_multi_pin_alternate_function Configure pin connection list for alternate function stm32_set_pin_alternate_function Configure pin connection fo
95. structures for DNS ARP and so on lt is separate from the network heap that is used to hold TCP segments for transmission by the MAC platform system heap is initialized by platform configure nic See Also platform configure nic platform network heap 120 CrossWorks Platform Library lt platform_private h gt Overview CrossWorks Platform Library Private part of the Platform Library for platform implementation These functions are not intended for Platform Library API clients to call directly These functions are intended to be a framework that simplifies implementing the Platform Library for a new target processor or evaluation board API Summary Platform platform_private_idle_task_main platform_private_initialize platform_private_start_tasking Pins platform_private_find_pin_connection platform_private_lock_pin platform_private_pin_connection_name platform_private_pin_signal_name platform_private_release_pin platform_private_test_pin_claim LEDs platform_private_configure_leds platform_private_write_led Buttons platform_private_read_button Hooks platform_private_execute_hooks platform_private_hook_single_timer platform_private_start_single_hook_timer platform_private_stop_single_hook_timer platform_private_timer_hooks platform_private_unhook_single_timer 12C PLATFORM_PRIVATE_I2C_CONFIGURATION_t Platform idle task body Initialize private platform Star
96. t PIN_FUNCTION_DIGITAL OUTPUT Configure as a digital output 33 CrossWorks Platform Library CrossWorks Platform Library PIN FUNCTION ANALOG INPUT Configure as an analog input This connects the pin to an ADC PIN FUNCTION ANALOG OUTPUT Configure as a digital output This connects the pin to a DAC function or PWM function depending upon pin capability PIN FUNCTION TX Configure as an RS232 Tx signal PIN_FUNCTION_RX Configure as an RS232 Rx signal PIN FUNCTION STATUS Special configuration that is meaningful to the platform PIN FUNCTION ETHERNET INPUT PIN FUNCTION ETHERNET OUTPUT Configure for dedicated Ethernet function PIN FUNCTION MEMORY Special configuration that implements an external memory bus See Also platform claim pin platform claim pin configuration 34 CrossWorks Platform Library CrossWorks Platform Library PLATFORM PIN MODE Synopsis typedef enum PIN_MODE_STANDARD PIN_MODE_OPEN_DRAIN PIN_MODE_PULL_UP PIN_MODE_PULL_DOWN PLATFORM_PIN_MODE_t Description PLATFORM_PIN_MODE_t describes the functions that select additional options for an digital pin pin using platform_set_digital_pin_mode Note Not all modes are implemented on all platforms and not all combinations of options are possible on all platforms Individual platforms may well reject a request to configure a pin in a particular mode if the Platform Library can determine that the request cannot be satisfied P
97. t CTL and platform tasks Find pin connection by function Lock pin in hardware Get connection name for a pin Get signal name for a pin Release pin Test pin lock Configure advertised GPIO connected LEDs Write to GPIO connected LED Read GPIO connected button Execute functions on a hook list Hook a single timer Start a single hook timer Stop the single hook timer Singleton timer hook Unhook a single timer 12C bus configuration 121 CrossWorks Platform Library PLATFORM PRIVATE 12C METHODS t platform private i2c bus configuration platform private i2c bus instance platform private software i2c methods platform private spi hardware claim pins SPI PLATFORM PRIVATE SPI CONFIGURATION t PLATFORM PRIVATE SPI METHODS t platform private i2c hardware claim pins platform private software spi methods platform private spi bus configuration platform private spi bus instance CrossWorks Platform Library 12C bus methods I2C bus array Platform 12C bus instances Software I2C methods Utility methods SPI bus configuration SPI bus methods Utility methods Software SPI methods SPI bus array Platform SPI bus instances 122 CrossWorks Platform Library CrossWorks Platform Library PLATFORM PRIVATE 12C CONFIGURATION Synopsis typedef struct int bus index const PLATFORM PIN CONFIGURATION t pins const PLATFORM PRIVATE I2C METHODS t methods PLATFORM PRIVATE TI2C CONFIGURATION t Descri
98. ted pin s speed to speed using platform set digital pin speed The pin list pins must be terminated by PLATFORM END OF LIST If any pin cannot be configured platform set multi digital pin speed immediately returns the status See Also platform set digital pin speed platform digital pin speed 88 CrossWorks Platform Library CrossWorks Platform Library platform spi bus Synopsis CTL SPI BUS t platform spi bus int index Description platform spi bus returns the driver for the SPI bus index If index does not correspond to a logical platform bus platform_spi_bus returns zero 89 CrossWorks Platform Library CrossWorks Platform Library platform spi bus pins Synopsis PLATFORM PIN CONFIGURATION t platform spi bus pins int index Description platform spi bus pins returns the pin list required for SPI communication on SPI bus index If index does not correspond to a logical platform bus platform_spi_bus_pins returns zero The list of pins is terminated by PLATFORM_END_OF_LIST inthe pin member See Also PLATFORM_PIN_CONFIGURATION_t 90 CrossWorks Platform Library CrossWorks Platform Library platform spin delay cycles Synopsis void platform spin delay cycles unsigned long cycles Description platform spin delay cycles delays execution by busy waiting on the CPU timer for cycles ticks See Also platform spin delay us platform spin delay ms 91 CrossWorks Platform L
99. these arcade buttons they are truly awful What s different took a little artistic license with the gameplay e The two player game pits you against an Al controlled Defender that is on screen and playing when you play Neither Defender can collide with the other Defender and neither Defender can shoot down or smart bomb the other Defender e The game doesn t stop and restart the wave when you die This is a consequence of two player mode Although it would be possible to restart quite like it this way What s not implemented Some things have not been implemented yet and may well get round to implementing them when feel the need Things left out for the moment are Sound effects started putting in the hooks for sound effects but am no sound designer and haven t found a satisfactory way to get sound effects integrated into a SolderCore setup Ideas run along the lines of the GinSing the Fluxamasynth MIDI or custom VS1053 firmware don t want to do this and then dry up Baiter hurry ups Exploding landscape and hyperspace on loss of last human Warping when pressing the hyperspace button High scores Who needs em The Al could be much better Have a go 197 CrossWorks Platform Library CrossWorks Platform Library Minimal FTP Server Minimal FTP Server README This note is a description of the FTP server example Overview The FTP server example is a minimal implementation of an FTP serve
100. this to the name of the button on the silkscreen or whatever is visible to the user for identification If name is zero the button s name is derived from the GPIO connection name for pin or the pad name for pin See platform_button_name See Also platform_button_catalog 20 CrossWorks Platform Library CrossWorks Platform Library PLATFORM EDGE t Synopsis typedef enum PLATFORM_EDGE_FALLING PLATFORM_EDGE_RISING PLATFORM_EDGE_EITHER PLATFORM_EDGE_t Description PLATFORM EDGE t describes the required edge to trigger a pin hook Note T T PLATFORM EDGE EITHER is the inclusive or of PLATFORM EDGE RISING and T PLATFORM EDGE FALLING See Also platform hook pin edge 21 CrossWorks Platform Library CrossWorks Platform Library PLATFORM HOOK t Synopsis typedef struct void fn void void arg inter el PLATFORM HOOK s __next PLATFORM HOOK t Description PLATFORM HOOK t describes a hook function that is typically executed asynchronously The Platform Library provides a number of ways for hooks to be run using high frequency and low frequency timers and on the transitions of platform pins fn Method to execute when the hook fires arg Argument to pass to n when the hook fires internal Private member for use by the Platform Library _ next Private member that points to the next hook function an a hook list Do not assume anything
101. ticular feature if the Platform Library can determine that the reguest cannot be satisfied PIN FEATURE SLOW SLEW RATE Configure pin for slow slew rate PIN FEATURE FAST SLEW RATE Configure pin for fast slew rate PIN FEATURE DISABLE GLITCH FILTER Disable glitch filter PIN FEATURE ENABLE GLITCH FILTER Enable glitch filter See Also platform set digital pin feature 32 CrossWorks Platform Library CrossWorks Platform Library PLATFORM PIN FUNCTION t Synopsis typedef enum PIN_FUNCTION_FLOATING PIN_FUNCTION_MISO PTN_FUNCTILON_MOSI PIN FUNCTION SCK PIN FUNCTION SDA PIN FUNCTEON SCL PIN FUNCTION DIGITAL INPUT PIN FUNCTION DIGITAL OUTPUT PIN_FUNCTION_ANALOG_INPUT PIN_FUNCTION_ANALOG_OUTPUT PIN FUNCTION TX PIN FUNCTION RX PIN FUNCTION STATUS PIN FUNCTION ETHERNET INPUT PIN FUNCTION ETHERNET OUTPUT PIN E ANGEEONI SDTO PIN FUNCTION MEMORY PTN_FUNCTTON_ LCD PLATFORM_PIN_FUNCTION_t Description PLATFORM_PIN_FUNCTION_t describes the functions that the client wishes to assign to the pin PIN_FUNCTION_FLOATING Unused during configuration This indicates that the pin is currently unassigned PIN_FUNCTION_MISO Configure for SPI MISO PIN FUNCTION MOSI Configure for SPI MOSI PIN_FUNCTION_SCK Configure for SPI SCK PIN FUNCTION SDA Configure for I2C SDA PIN FUNCTION SCL Configure for I2C SCK PIN FUNCTION DIGITAL INPUT Configure as a digital inpu
102. tion when implementing platform hook single timer on platforms that offer only one timer platform private start single hook timer starts the single instance of a hook timer which fires frequency times per second Implementation The hook timer once active should call platform_private_execute_hooks passing in platform_private_timer_hooks See Also platform_private_hook_single_timer 146 CrossWorks Platform Library CrossWorks Platform Library platform private start tasking Synopsis void platform private start tasking void Description platform private start tasking starts the CTL timer to provide CTL time and services and starts the idle task which has the body function platform private idle task main 147 CrossWorks Platform Library CrossWorks Platform Library platform private stop single hook timer Synopsis void platform private stop single hook timer void Description platform private stop single hook timer is a utility function when implementing platform unhook single timer on platforms that offer only one timer platform private stop single hook timer stops a the previously started single instance of a hook timer See Also platform private unhook single timer 148 CrossWorks Platform Library CrossWorks Platform Library platform private test pin claim Synopsis CTL STATUS t platform private test pin claim int pin Shots Frie dAon Is Descriptio
103. twork heap Description platform network heap is a heap that is primarily used by the network library to hold TCP segments for transmission by the MAC If you need to allocate small control structures you should use the system heap platform system heap TCP segments in the network heap are fleeting being created handed to the MAC for transmission and freed With a quiescent network the network heap will most likely be entirely empty and therefore not fragmented platform_network_heap is initialized by platform_configure_nic See Also platform_configure_nic platform_system_heap 118 CrossWorks Platform Library CrossWorks Platform Library platform private init heaps Synopsis void platform private init heaps CTL NET MEM DRIVER t self void buf size t byte count Description platform private init heaps initializes the system heap and the network heap using the memory pointed to by buf of byte count bytes The example implementation partitions the memory by allocating 3 4 to the network heap and 1 4 for the system heap Once partitioned the network driver self is initialized with methods and data to allocate memory from the network heap 119 CrossWorks Platform Library CrossWorks Platform Library platform system heap Synopsis CTL HEAP t platform system heap Description platform system heap is a general system heap that is primarily used by the network library for maintaining non data control
104. u use SWD mode rather than JTAG mode Mass Storage Examples use the built in SD MMC socket Networking Examples use the built in Ethernet port Graphics Examples use the built in color LCD Please see notes above The LCD requires a 9 bit SPI protocol that the STM32F4 does not provide in hardware Therefore SPI is emulated in software using the methods in lt software_spi h gt as part of the CrossWorks Platform API 12C The platform 12C bus routing is e bus 0 UEXT socket SPI The platform SPI bus routing is e bus 0 UEXT and microSD sockets e bus 1 LCD API 2 Vsampies OM mes SMS TRAO p ao dont Ig N Not Found 191 CrossWorks Platform Library CrossWorks Platform Library STM3240G EVAL STM3240G EVAL Platform This is the Platform Library implementation for the STMicroelectronics STM3240G EVAL http www st com stm3240g eval Sensors The platform provides a built in LIS302DL accelerometer Mass Storage Examples use the built in SD MMC socket Networking Examples use the built in Ethernet port Graphics Examples use the built in color LCD 12C The platform 12C bus routing is e bus 0 is routed to on board 2C devices SPI e bus 0 is routed MISO PA6 MOSI PB5 SCK PAS API Ssamples STM32 ST STM3240G EVAL platform config h not found 192 CrossWorks Platform Library CrossWorks Platform Library STM32FA29I EXP STM32F4A29I EXP Platform This
105. upply stabilization and for external devices to become ready most LCD controllers require a short delay after reset before responding to commands for instance You can customize this delay for your own applications If your board doesn t start cleanly after reset but does when debugging with CrossWorks it s likely that you ll need to adjust the 250 ms delay to suit your hardware 135 CrossWorks Platform Library CrossWorks Platform Library platform private lock pin Synopsis void platform private lock pin int pin Description platform private lock pin can hardware lock the pin connection pin if the underlying microcontroller implements pin locks See Also platform lock pin 136 CrossWorks Platform Library CrossWorks Platform Library platform private pin connection name Synopsis char platform private pin connection name int pin Description platform private pin connection name returns the connection name for pin pin The platform independent code guarantees to call platform private pin connection name with a correct pin parameter The connection name returned is generally the name from the schematic or in the case of buttons and LEDs the name of the button or LED on the silkscreen See Also PLATFORM_PIN_CONNECTION_t platform pin connection name 137 CrossWorks Platform Library CrossWorks Platform Library platform private pin signal name Synopsis char platform private pin signal name
106. uration descriptor Causes of microcontroller reset Reboot platform Read microcontroller reset cause Enable watchdog Inquire remaining watchdog time Service watchdog Set watchdog timeout period CrossWorks Platform Library PLATFORM BUTTON ATTRIBUTE t Synopsis typedef enum p 19 a or Ane Igo Jae tno dhol tae tag Description LAT LAT LAT LAT LAT LAT LAT LAT LAT LAT F ORI FOR F ORI FOR FOR FORI FOR FORI F ORI FOR BU BU EBU BU BU BU BU BU BU BU TTON STANDARD TTON UP TTON DOWN TRENT BEER TTON RIGHT TTON CENTER TTON MASK MASK TTON_POSITIVE_LOGIC TTON_NEGATIVE_LOGIC TION_ATTRIBUTE_t PLATFORM_BUTTON_ATTRIBUTE_t describes the attributes of a push button The attributes are a combination of button logic and now the button is sensed CrossWorks Platform Library Buttons that are part of a joystick arrangement have PLATFORM_BUTTON_JOYSTICK set along with one of the up down left right and center attributes PLATFORM_BUTTON_STANDARD The button is a standard momentary push button PLATFORM BUTTON UP The button indicates Up direction PLATFORM BUTTON DOWN The button indicates Down direction PLATFORM BUTTON LEFT The button indicates Left direction PLATFORM BUTTON RIGHT The button indicates Right direction PLATFORM BUTTON CENTER The button indicates a joystick center push select
107. y CrossWorks Platform Library platform private execute hooks Synopsis void platform private execute hooks PLATFORM HOOK t hook Description platform private execute hooks executes all functions on the hook list hook Each function is called and passed the arg member of its hook context 128 CrossWorks Platform Library CrossWorks Platform Library platform private find pin connection Synopsis CTL STATUS t platform private find pin connection const PLATFORM PIN CONFIGURATION t list int function Description platform_private_find_pin_connection searches the list of pins in list for a match on the function function Return Value If a pin with matching function is found in the list platform_private_find_pin_connection returns the pin member of the pin configuration structure If the pin is not found or the list is empty platform_private_find_pin_connection returns CTL_UNSUPPORTED_OPERATION 129 CrossWorks Platform Library CrossWorks Platform Library platform private hook single timer Synopsis CTL STATUS t platform private hook single timer PLATFORM HOOK t p unsigned frequency Description platform_private_hook_single_timer is a utility function when implementing plat form_hook_timer on platforms that offer only one timer platform_private_hook_single_timer calls platform_private_start_single_hook_timer passing in frequency if this is a valid hook request I
108. ys returns zero See Also PLATFORM_UEXT_CONFIGURATION_t 95 CrossWorks Platform Library CrossWorks Platform Library platform unhook background Synopsis void platform unhook background PLATFORM HOOK t hook Description platform unhook background unhooks hook from the background hook list such that it no longer runs Thread Safety platform unhook background is thread safe See Also platform hook background 96 CrossWorks Platform Library CrossWorks Platform Library platform unhook timer Synopsis void platform unhook timer PLATFORM HOOK t p Description platform unhook timer unhooks hook from the timer list such that it no longer runs Thread Safety platform unhook timer is thread safe See Also platform hook timer 97 CrossWorks Platform Library CrossWorks Platform Library platform watchdog enable Synopsis void platform watchdog enable void Description platform watchdog enable enables the watchdog using the timeout period set by platform watchdog set period The watchdog must be serviced by calling platform watchdog service within the timeout period to prevent the microcontroller from being reset You can detect a reset caused by a watchdog timeout by calling platform reset cause See Also platform_watchdog_set_period platform_watchdog_service platform_reset_cause 98 CrossWorks Platform Library CrossWorks Platform Library platform watchdog remaining

Download Pdf Manuals

image

Related Search

Related Contents

Plant Germplasm Centers and Microbial Culture  Origin Storage 1TB TLC SATA 2.5"  取扱説明書 (5.06 MB/PDF)  Fantom Drives 1TB eSATA/USB 2.0 External HDD  Applications d`un fongicide tôt en saison sur le maïs  

Copyright © All rights reserved.
Failed to retrieve file