#include "Media.h"
Go to the source code of this file.
Functions | |
uint8_t | MED_Write (sMedia *pMedia, uint32_t address, void *data, uint32_t length, MediaCallback callback, void *argument) |
Writes data on a media. | |
uint8_t | MED_Read (sMedia *pMedia, uint32_t address, void *data, uint32_t length, MediaCallback callback, void *argument) |
Reads a specified amount of data from a media. | |
uint8_t | MED_Lock (sMedia *pMedia, uint32_t start, uint32_t end, uint32_t *pActualStart, uint32_t *pActualEnd) |
Locks all the regions in the given address range. | |
uint8_t | MED_Unlock (sMedia *pMedia, uint32_t start, uint32_t end, uint32_t *pActualStart, uint32_t *pActualEnd) |
Unlocks all the regions in the given address range. | |
uint8_t | MED_Flush (sMedia *pMedia) |
void | MED_Handler (sMedia *pMedia) |
Invokes the interrupt handler of the specified media. | |
void | MED_DeInit (sMedia *pMedia) |
Reset the media interface to un-configured state. | |
uint8_t | MED_IsInitialized (sMedia *pMedia) |
Check if the Media instance is ready to use. | |
uint8_t | MED_IsBusy (sMedia *pMedia) |
Check if the Media instance is busy in transfer. | |
uint8_t | MED_IsMappedRDSupported (sMedia *pMedia) |
Check if the Media supports mapped reading. | |
uint8_t | MED_IsMappedWRSupported (sMedia *pMedia) |
Check if the Media supports mapped writing. | |
uint8_t | MED_IsProtected (sMedia *pMedia) |
Check if the Media is write protected. | |
uint8_t | MED_GetState (sMedia *pMedia) |
Return current state of the Media. | |
uint32_t | MED_GetBlockSize (sMedia *pMedia) |
Return block size in bytes. | |
uint32_t | MED_GetSize (sMedia *pMedia) |
Return Media size in number of blocks. | |
uint32_t | MED_GetMappedAddress (sMedia *pMedia, uint32_t dwBlk) |
Return mapped memory address for a block on media. | |
void | MED_HandleAll (sMedia *pMedia, uint8_t bNumMedia) |
Handle interrupts on specified media. | |
Variables | |
uint32_t | gNbMedias = 0 |
Definition in file Media.c.
void MED_DeInit | ( | sMedia * | pMedia | ) |
uint8_t MED_Flush | ( | sMedia * | pMedia | ) |
uint32_t MED_GetBlockSize | ( | sMedia * | pMedia | ) |
uint32_t MED_GetMappedAddress | ( | sMedia * | pMedia, | |
uint32_t | dwBlk | |||
) |
uint32_t MED_GetSize | ( | sMedia * | pMedia | ) |
uint8_t MED_GetState | ( | sMedia * | pMedia | ) |
void MED_HandleAll | ( | sMedia * | pMedia, | |
uint8_t | bNumMedia | |||
) |
void MED_Handler | ( | sMedia * | pMedia | ) |
uint8_t MED_IsBusy | ( | sMedia * | pMedia | ) |
uint8_t MED_IsInitialized | ( | sMedia * | pMedia | ) |
uint8_t MED_IsMappedRDSupported | ( | sMedia * | pMedia | ) |
uint8_t MED_IsMappedWRSupported | ( | sMedia * | pMedia | ) |
uint8_t MED_IsProtected | ( | sMedia * | pMedia | ) |
uint8_t MED_Lock | ( | sMedia * | pMedia, | |
uint32_t | start, | |||
uint32_t | end, | |||
uint32_t * | pActualStart, | |||
uint32_t * | pActualEnd | |||
) |
Locks all the regions in the given address range.
media | Pointer to a Media instance | |
start | Start address of lock range. | |
end | End address of lock range. | |
pActualStart | Start address of the actual lock range (optional). | |
pActualEnd | End address of the actual lock range (optional). |
uint8_t MED_Read | ( | sMedia * | pMedia, | |
uint32_t | address, | |||
void * | data, | |||
uint32_t | length, | |||
MediaCallback | callback, | |||
void * | argument | |||
) |
Reads a specified amount of data from a media.
media | Pointer to a Media instance | |
address | Address of the data to read | |
data | Pointer to the buffer in which to store the retrieved data | |
length | Length of the buffer | |
callback | Optional pointer to a callback function to invoke when the operation is finished | |
argument | Optional pointer to an argument for the callback |
uint8_t MED_Unlock | ( | sMedia * | pMedia, | |
uint32_t | start, | |||
uint32_t | end, | |||
uint32_t * | pActualStart, | |||
uint32_t * | pActualEnd | |||
) |
Unlocks all the regions in the given address range.
media | Pointer to a Media instance | |
start | Start address of unlock range. | |
end | End address of unlock range. | |
pActualStart | Start address of the actual unlock range (optional). | |
pActualEnd | End address of the actual unlock range (optional). |
uint8_t MED_Write | ( | sMedia * | pMedia, | |
uint32_t | address, | |||
void * | data, | |||
uint32_t | length, | |||
MediaCallback | callback, | |||
void * | argument | |||
) |
Writes data on a media.
media | Pointer to a Media instance | |
address | Address at which to write | |
data | Pointer to the data to write | |
length | Size of the data buffer | |
callback | Optional pointer to a callback function to invoke when the write operation terminates | |
argument | Optional argument for the callback function |