JSAPI for STM32F0xx MCU  1.10
jsapi_st_mcu.h File Reference

This file contains JSAPI functions and classes that are common to all STM32Fxxx MCU. DO NOT include this include explicitly. It is included by jsapi.h. More...

Go to the source code of this file.

Classes

class  JSAPI_EXTI
 EXTI (externally triggered interrupt) abstraction. With the ST Cortex-M MCU, all the pins can be externally triggered. Note that each EXTI refers to a pin number, and only one GPIO port with that pin number can be set to triggered on that EXTI. For example, if "EXTI1" is set to trigger on PORTA (pin number 1), then no other 'pin one' on other PORT can be set to trigger. More...
 
class  JSAPI_GPIO
 MCU GPIO. More...
 
class  JSAPI_I2C
 JSAPI_I2C is the abstraction for the I2C functions. Build on top of the JSAPI_I2C_WIRE hardware units. More...
 
class  JSAPI_IOPIN
 IO Pin abstraction. This allows you to work with a single pin insetad of using JSAPI_GPIO and specify pin_no in all the function calls. More...
 
class  JSAPI_SPI
 SPI Master functions. More...
 
class  JSAPI_TIMER
 Provides TIMER related functions. Highly MCU dependent. More...
 
class  JSAPI_ST_MCU
 Functions that are unique to ST MCU. More...
 
class  JSAPI_USART
 USART abstraction. printf IO redirection is supported. Currenty only asyncrhonous mode is supported. More...
 

Macros

#define ADC_SampleTime_3Cycles   (0x00)
 ADC Sample Time defines.
 
#define ADC_SampleTime_15Cycles   (0x01)
 
#define ADC_SampleTime_28Cycles   (0x02)
 
#define ADC_SampleTime_56Cycles   (0x03)
 
#define ADC_SampleTime_84Cycles   (0x04)
 
#define ADC_SampleTime_112Cycles   (0x05)
 
#define ADC_SampleTime_144Cycles   (0x06)
 
#define ADC_SampleTime_480Cycles   (0x07)
 
#define SPI_CPOL_HIGH   0b01
 spi mode to the MakeSPI call.
 
#define SPI_CPHA_HIGH   0b10
 

Enumerations

enum  DMA_XFER_MODE { PERIPH_TO_MEM, MEM_TO_PERIPH, MEM_TO_MEM }
 DMA transfer mode. More...
 
enum  EDGE_TRIGGER { RISING_EDGE = 1, FALLING_EDGE, BOTH_EDGES }
 
enum  I2C_SPEED { _10KHZ, _100KHZ, _400KHZ, _FASTMODE_PLUS }
 I2C speed supported by the hardware. _400KHZ is a good default value to use. More...
 
enum  OTYPE { OTYPE_PUSHPULL = 0, OTYPE_OPENDRAIN }
 GPIO Output pin type. More...
 
enum  PUPDR { PUPDR_NONE = 0, PUPDR_UP, PUPDR_DOWN }
 GPIO pin pull-up / pull-down setting. More...
 

Functions

void JSAPI_RetargetConsole (JSAPI_USART *USART)
 Redirect printf to use a JSAPI_USART unit. In order to retarget the console functions like printf to use an embedded USART the user must call the following method to set up the input/output redirection. More...
 

Detailed Description

This file contains JSAPI functions and classes that are common to all STM32Fxxx MCU. DO NOT include this include explicitly. It is included by jsapi.h.

Enumeration Type Documentation

DMA transfer mode.

Enumerator
PERIPH_TO_MEM 

Peripheral to memory transfer

MEM_TO_PERIPH 

Memory to peripheral transfer

MEM_TO_MEM 

Memory to memory transfer

Signal trigger edge types

Enumerator
RISING_EDGE 

trigger on rising edge

FALLING_EDGE 

trigger on falling edge

BOTH_EDGES 

trigger on rising or falling edge

enum I2C_SPEED

I2C speed supported by the hardware. _400KHZ is a good default value to use.

Enumerator
_10KHZ 

10 KHz

_100KHZ 

100 KHz

_400KHZ 

400 KHz

_FASTMODE_PLUS 

1 MHz, not available in all devices

enum OTYPE

GPIO Output pin type.

Enumerator
OTYPE_PUSHPULL 

push-pull output

OTYPE_OPENDRAIN 

open drain output

enum PUPDR

GPIO pin pull-up / pull-down setting.

Enumerator
PUPDR_NONE 

no internal pull-up register

PUPDR_UP 

pull-up

PUPDR_DOWN 

pull-down

Function Documentation

void JSAPI_RetargetConsole ( JSAPI_USART USART)

Redirect printf to use a JSAPI_USART unit. In order to retarget the console functions like printf to use an embedded USART the user must call the following method to set up the input/output redirection.

Example: JSAPI_RetargetConsole(&usart2);

Parameters
USARTJSAPI_USART to use.