Choco OS  V.0.16.9.0
Join to the chocolate world
oc_fmc.h File Reference

The file with interface for FMC driver. More...

#include <oc_driver.h>
#include <oc_stdlib.h>
#include <oc_ioctl.h>
#include <oc_fmc_lld.h>
#include <oc_frequency.h>
#include <oc_memory.h>

Go to the source code of this file.

Data Structures

struct  oC_FMC_ChipInfo_t
 stores informations about chip More...
 
struct  oC_FMC_Config_t
 FMC driver configuration structure. More...
 

Typedefs

typedef oC_FMC_LLD_SDRAM_CommandData_t oC_FMC_SDRAM_CommandData_t
 stores data for SDRAM commands More...
 
typedef struct Context_toC_FMC_Context_t
 The FMC context structure. More...
 
typedef oC_ErrorCode_t(* oC_FMC_InitializationFunction_t) (const void *Config, oC_FMC_Context_t Context, oC_Time_t *Timeout)
 function for initialization of the chip More...
 
typedef struct oC_FMC_Config_t oC_FMC_Config_t
 FMC driver configuration structure. More...
 

Enumerations

Functions

oC_ErrorCode_t oC_FMC_TurnOn (void)
 turns on the module More...
 
oC_ErrorCode_t oC_FMC_TurnOff (void)
 Turns off the FMC driver. More...
 
bool oC_FMC_IsTurnedOn (void)
 checks if the driver is turned on More...
 
oC_ErrorCode_t oC_FMC_Configure (const oC_FMC_Config_t *Config, oC_FMC_Context_t *outContext)
 configures FMC pins to work More...
 
oC_ErrorCode_t oC_FMC_Unconfigure (const oC_FMC_Config_t *Config, oC_FMC_Context_t *outContext)
 Unconfigures the driver. More...
 
oC_ErrorCode_t oC_FMC_Read (oC_FMC_Context_t Context, char *outBuffer, uint32_t Size, oC_IoFlags_t IoFlags)
 reads buffer from the driver More...
 
oC_ErrorCode_t oC_FMC_Write (oC_FMC_Context_t Context, const char *Buffer, uint32_t Size, oC_IoFlags_t IoFlags)
 write buffer to the driver More...
 
oC_ErrorCode_t oC_FMC_Ioctl (oC_FMC_Context_t Context, oC_Ioctl_Command_t Command, void *Data)
 handles input/output driver commands More...
 
oC_ErrorCode_t oC_FMC_SDRAM_SendCommand (oC_FMC_Context_t Context, oC_Time_t *Timeout, oC_FMC_SDRAM_Command_t Command, const oC_FMC_SDRAM_CommandData_t *Data)
 sends command to SDRAM chips More...
 
oC_ErrorCode_t oC_FMC_ReadDirectAddress (oC_FMC_Context_t Context, void **outAddress, oC_MemorySize_t *outMemorySize)
 returns an address for direct access to the memory More...
 
oC_ErrorCode_t oC_FMC_FinishInitialization (const oC_FMC_Config_t *Config, oC_FMC_Context_t Context)
 finishes initialization More...
 

Detailed Description


File based on driver.h Ver 1.1.0

Author
Patryk Kubiak - (Created on: 2016-04-02 - 16:12:02)

Definition in file oc_fmc.h.

Typedef Documentation

typedef oC_ErrorCode_t(* oC_FMC_InitializationFunction_t) (const void *Config, oC_FMC_Context_t Context, oC_Time_t *Timeout)

The type stores the pointer for the chip initialization function. The function will be called during memory configuration.

Parameters
ContextFMC context pointer
TimeoutPointer to the maximum time for the initialization procedure (should be updated about the time that left after the initialization)
Returns
code of error

Definition at line 149 of file oc_fmc.h.

Function Documentation

oC_ErrorCode_t oC_FMC_FinishInitialization ( const oC_FMC_Config_t Config,
oC_FMC_Context_t  Context 
)

The function should be called at the end of the chip initialization procedure. It finishes initialization by performing all required additional configuration.

Parameters
ConfigPointer to the FMC configuration structure
ContextContext of the FMC from the oC_FMC_Configure function
Returns
code of error or #oC_ErrorCode_None if success

Definition at line 530 of file oc_fmc.c.

bool oC_FMC_IsTurnedOn ( void  )
Returns
true if driver is turned on

Definition at line 231 of file oc_fmc.c.

oC_ErrorCode_t oC_FMC_ReadDirectAddress ( oC_FMC_Context_t  Context,
void **  outAddress,
oC_MemorySize_t *  outMemorySize 
)

The function returns an address to direct access to the memory (if it is available)

Parameters
ContextContext of the FMC configuration
outAddressDestination for the address
outMemorySizeSize of the memory
Returns
code of error

Definition at line 497 of file oc_fmc.c.