Driver for configuration and manage external memory.
More...
|
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...
|
|
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_Ioctl (oC_FMC_Context_t Context, oC_Ioctl_Command_t Command, void *Data) |
| handles input/output driver commands 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_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...
|
|
The driver for managing and configuring external memory.
This is the configuration structure for the FMC driver. You should fill all fields or set to 0 all that are not required. To use this structure call the oC_FMC_Configure function
- Note
- When the structure is defined as constant, the unused fields must not be filled, cause there will be set to 0 as default.
This is the structure with dynamic allocated data for the FMC. It stores a HANDLE for a driver and it can be used to identify the driver context. You should get this pointer from the oC_FMC_Configure function, but note, that not all drivers use it. In many cases it is just not needed, and it just will store NULL then. You should keep this pointer as long as it is necessary for you, and when it will not be anymore, you should call oC_FMC_Unconfigure function to destroy it.
Definition at line 135 of file oc_fmc.h.
Stores data for the SDRAM commands. For more look at the type #oC_FMC_LLD_SDRAM_CommandData_t
Definition at line 121 of file oc_fmc.h.
The type for storing heap usage - if it should be used or not
Enumerator |
---|
oC_FMC_HeapUsage_UseAsHeapIfPossible |
Default option - if usage of heap is possible, then use it.
|
oC_FMC_HeapUsage_DontUseAsHeap |
Never use the memory as heap.
|
Definition at line 81 of file oc_fmc.h.
The type is for storing allowed operations for the memory.
Enumerator |
---|
oC_FMC_Protection_Default |
Default protection for the memory type.
|
oC_FMC_Protection_AllowWrite |
Write operations are performed.
|
oC_FMC_Protection_AllowRead |
Read operations are performed.
|
oC_FMC_Protection_AllowExecute |
Execution operations are performed.
|
Definition at line 64 of file oc_fmc.h.
The type stores command that can be send to the SDRAM. It can be useful in the SDRAM initialization procedure. Look at the #oC_FMC_SendSDRAMCommand function for more informations.
Enumerator |
---|
oC_FMC_SDRAM_Command_EnableClock |
Enables the clock (provides a stable CLK signal)
|
oC_FMC_SDRAM_Command_Inhibit |
The COMMAND INHIBIT function prevents new commands from being executed by the device, regardless of whether the CLK signal is enabled.
The device is effectively deselected. Operations already in progress are not affected.
|
oC_FMC_SDRAM_Command_Nop |
Simple no operation command.
|
oC_FMC_SDRAM_Command_LoadModeRegister |
Configuration command for loading modes registers.
|
oC_FMC_SDRAM_Command_Active |
The command used for activate a row in a bank for a subsequent access.
|
oC_FMC_SDRAM_Command_Read |
Read a burst to an active row.
|
oC_FMC_SDRAM_Command_Write |
Write a burst to an active row.
|
oC_FMC_SDRAM_Command_Precharge |
Deactivate a row in a bank (or in all banks)
|
oC_FMC_SDRAM_Command_BurstTerminate |
Terminates a burst (either fixed length or continuous page burst)
|
oC_FMC_SDRAM_Command_AutoRefresh |
Refreshes a SDRAM.
It could be called each time, when the refresh is required
|
oC_FMC_SDRAM_Command_SelfRefresh |
Refreshes a ram, when the system is powered-down (it does not require a CLOCK)
|
Definition at line 97 of file oc_fmc.h.
The function is for configuration of the driver. Look at the oC_FMC_Config_t structure description and fields list to get more info.
- Parameters
-
Config | Pointer to the configuration structure |
outContext | Destination for the driver context structure |
- Returns
- code of error
Definition at line 250 of file oc_fmc.c.
oC_ErrorCode_t oC_FMC_Ioctl |
( |
oC_FMC_Context_t |
Context, |
|
|
oC_Ioctl_Command_t |
Command, |
|
|
void * |
Data |
|
) |
| |
The function is for handling input/output control commands. It will be called for non-standard operations from the userspace.
- Parameters
-
Context | Context of the driver |
Command | Command to execute |
Data | Data for the command or NULL if not used |
- Returns
- code of errror
Definition at line 342 of file oc_fmc.c.
oC_ErrorCode_t oC_FMC_Read |
( |
oC_FMC_Context_t |
Context, |
|
|
char * |
outBuffer, |
|
|
uint32_t |
Size, |
|
|
oC_IoFlags_t |
IoFlags |
|
) |
| |
The function is for reading buffer by using FMC driver. It is called when someone will read the driver file.
- Parameters
-
Context | Context of the driver |
outBuffer | Buffer for data |
Size | Size of the buffer |
IoFlags | Input/Output mode flags |
- Returns
- code of error
Definition at line 389 of file oc_fmc.c.
The function for sending SDRAM commands mainly required during chip initialization.
- Parameters
-
Context | Context of the driver received during configuration |
Timeout | Pointer to the maximum time for the initialization (will be reduced about initialization time). If the time will left before end of initialization, the function should ends with timeout error |
Command | Command to send |
Data | Data of command to send (some of commands does not require the argument and then it can be set to NULL. For more info look at the #oC_FMC_LLD_SDRAM_Command_t and oC_FMC_SDRAM_CommandData_t types description) |
- Returns
- code of error
Definition at line 468 of file oc_fmc.c.
oC_ErrorCode_t oC_FMC_TurnOff |
( |
void |
| ) |
|
The function for turning off the FMC driver. If the driver not started yet, it will return oC_ErrorCode_ModuleNotStartedYet
error code. It also turns off the LLD.
- Returns
- code of error
Definition at line 204 of file oc_fmc.c.
oC_ErrorCode_t oC_FMC_TurnOn |
( |
void |
| ) |
|
The function is for turning on the FMC module. If the module is already turned on, it will return oC_ErrorCode_ModuleIsTurnedOn
error. It also turns on the LLD layer.
- Returns
- code of error
Definition at line 168 of file oc_fmc.c.
The function is for reverting configuration from the oC_FMC_Configure function.
- Parameters
-
Config | Pointer to the configuration |
outContext | Destination for the context structure |
- Returns
- code of error
Definition at line 302 of file oc_fmc.c.
oC_ErrorCode_t oC_FMC_Write |
( |
oC_FMC_Context_t |
Context, |
|
|
const char * |
Buffer, |
|
|
uint32_t |
Size, |
|
|
oC_IoFlags_t |
IoFlags |
|
) |
| |
The function is for writing buffer by using FMC driver. It is called when someone will write the driver file.
- Parameters
-
Context | Context of the driver |
Buffer | Buffer with data |
Size | Size of the buffer |
IoFlags | Input/Output mode flags |
- Returns
- code of error
Definition at line 428 of file oc_fmc.c.