TM STM32Fxxx HAL Libraries  v1.0.0
Libraries for STM32Fxxx (F0, F4 and F7 series) devices based on HAL drivers from ST from Tilen Majerle

Library Functions. More...

Macros

#define TM_SDRAM_GetSize()    (SDRAM_MEMORY_SIZE)
 Gets SDRAM memory size. More...
 
#define TM_SDRAM_Write8(address, value)    (*(__IO uint8_t *) (SDRAM_START_ADR + (address)) = (value))
 Writes 8-bit value to SDRAM. More...
 
#define TM_SDRAM_Read8(address)    (*(__IO uint8_t *) (SDRAM_START_ADR + (address)))
 Reads 8-bit value from SDRAM. More...
 
#define TM_SDRAM_Write16(address, value)    (*(__IO uint16_t *) (SDRAM_START_ADR + (address)) = (value))
 Writes 16-bit value to SDRAM. More...
 
#define TM_SDRAM_Read16(address)    (*(__IO uint16_t *) (SDRAM_START_ADR + (address)))
 Reads 16-bit value from SDRAM. More...
 
#define TM_SDRAM_Write32(address, value)    (*(__IO uint32_t *) (SDRAM_START_ADR + (address)) = (value))
 Writes 32-bit value to SDRAM. More...
 
#define TM_SDRAM_Read32(address)    (*(__IO uint32_t *) (SDRAM_START_ADR + (address)))
 Reads 32-bit value from SDRAM. More...
 
#define TM_SDRAM_WriteFloat(address, value)    (*(__IO float *) (SDRAM_START_ADR + (address)) = (value))
 Writes float value to SDRAM. More...
 
#define TM_SDRAM_ReadFloat(address)    (*(__IO float *) (SDRAM_START_ADR + (address)))
 Reads float value from SDRAM. More...
 

Functions

uint8_t TM_SDRAM_Init (void)
 Initializes SDRAM. More...
 
uint8_t TM_SDRAM_InitCustomPinsCallback (uint16_t AlternateFunction)
 Initialize custom pins callback. It can be used by user to implement custom pins for application if needed. More...
 

Detailed Description

Library Functions.

Macro Definition Documentation

#define TM_SDRAM_GetSize ( )    (SDRAM_MEMORY_SIZE)

Gets SDRAM memory size.

Parameters
None
Return values
SDRAMmemory size in bytes
#define TM_SDRAM_Read16 (   address)    (*(__IO uint16_t *) (SDRAM_START_ADR + (address)))

Reads 16-bit value from SDRAM.

Parameters
addressoffset address from starting address of SDRAM
Return values
16-bitvalue stored at desired location
Note
Defined as macro for faster execution
#define TM_SDRAM_Read32 (   address)    (*(__IO uint32_t *) (SDRAM_START_ADR + (address)))

Reads 32-bit value from SDRAM.

Parameters
addressoffset address from starting address of SDRAM
Return values
32-bitvalue stored at desired location
Note
Defined as macro for faster execution
#define TM_SDRAM_Read8 (   address)    (*(__IO uint8_t *) (SDRAM_START_ADR + (address)))

Reads 8-bit value from SDRAM.

Parameters
addressoffset address from starting address of SDRAM
Return values
8-bitvalue stored at desired location
Note
Defined as macro for faster execution
#define TM_SDRAM_ReadFloat (   address)    (*(__IO float *) (SDRAM_START_ADR + (address)))

Reads float value from SDRAM.

Parameters
addressoffset address from starting address of SDRAM
Return values
floatvalue stored at desired location
Note
Defined as macro for faster execution
#define TM_SDRAM_Write16 (   address,
  value 
)    (*(__IO uint16_t *) (SDRAM_START_ADR + (address)) = (value))

Writes 16-bit value to SDRAM.

Parameters
addressOffset address from starting address of SDRAM
value16-bit value to be saved in SDRAM
Return values
None
Note
Defined as macro for faster execution
#define TM_SDRAM_Write32 (   address,
  value 
)    (*(__IO uint32_t *) (SDRAM_START_ADR + (address)) = (value))

Writes 32-bit value to SDRAM.

Parameters
addressOffset address from starting address of SDRAM
value32-bit value to be saved in SDRAM
Return values
None
Note
Defined as macro for faster execution
#define TM_SDRAM_Write8 (   address,
  value 
)    (*(__IO uint8_t *) (SDRAM_START_ADR + (address)) = (value))

Writes 8-bit value to SDRAM.

Parameters
addressOffset address from starting address of SDRAM
value8-bit value to be saved in SDRAM
Return values
None
Note
Defined as macro for faster execution
#define TM_SDRAM_WriteFloat (   address,
  value 
)    (*(__IO float *) (SDRAM_START_ADR + (address)) = (value))

Writes float value to SDRAM.

Parameters
addressOffset address from starting address of SDRAM
valuefloat value to be saved in SDRAM
Return values
None
Note
Defined as macro for faster execution

Function Documentation

uint8_t TM_SDRAM_Init ( void  )

Initializes SDRAM.

Parameters
None
Return values
SDRAMstatus
  • 0: SDRAM is not configured OK
  • > 0: SDRAM is configured OK and prepared to work
uint8_t TM_SDRAM_InitCustomPinsCallback ( uint16_t  AlternateFunction)

Initialize custom pins callback. It can be used by user to implement custom pins for application if needed.

Note
This function is called every time TM_SDRAM_Init() function is called
Parameters
AlternateFunctionAlternate function to be used when initializing GPIO pins
Return values
Initializationstatus:
  • 0: User did not initialize custom pins, default will be used, depending on already supported boards
  • > 0: User has initialized custom pins, default pins will be ignored
Note
With __weak parameter to prevent link errors if not defined by user