You are on page 1of 5

C:\Documents and Settings\RABBIT\Escritorio\PruebaMemoriaImprimirArreglo\rtsp_api.

martes, 16 de junio de 2015 12:19

/*******************************************************************************
ce478 RTSP API header file
Company:
Microchip Technology Inc.
File Name:
rtsp_api.h
Summary:
Flash API function definitions.
Description:
This file consists of the definitions for the Flash erase,
Flash read, Flash page modify and the Flash program functions
that are called in the main.c.
*******************************************************************************/
/*******************************************************************************
Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
Microchip licenses to you the right to use, modify, copy and distribute
Software only when embedded on a Microchip microcontroller or digital signal
controller that is integrated into your product or third party product
(pursuant to the sublicense terms in the accompanying license agreement).
You should refer to the license agreement accompanying this Software for
additional information regarding your rights and obligations.
SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
*******************************************************************************/
#ifndef _RTSP_API_H
#define _RTSP_API_H
//
//
//
//
//

*****************************************************************************
*****************************************************************************
Section: Included Files
*****************************************************************************
*****************************************************************************
#include <stdint.h>

#ifdef __cplusplus
extern "C"
{
#endif

// Provide C++ Compatability

-1-

C:\Documents and Settings\RABBIT\Escritorio\PruebaMemoriaImprimirArreglo\rtsp_api.h

martes, 16 de junio de 2015 12:19

//
//
//
//
//
/*

*****************************************************************************
*****************************************************************************
Section: Interface Routines
*****************************************************************************
*****************************************************************************
Flash Memory is organised into ROWs of 64 instructions or 192 bytes.
RTSP allows the user to erage a PAGE of memory which consists of EIGHT ROWs
(512 instructions or 1536byts) at a time.
RTSP allows the user to program a ROW (64 instructions or 192 bytes) at a
time
*/
/******************************************************************************
* Function:
int16_t FlashPageErase(uint16_t nvmAdru, uint16_t nvmAdr);
*
* PreCondition:
None
*
* Input:
nvmAdru - Selects the upper 8bits of the location to program or erase
in program flash memory
nvmAdr

- Selects the location to program or erase in program flash


memory. It must be aligned to 512 instruction boundary,
LSB 10bits of address must be zero

*
* Output:
None
*
* Side Effects:
None
*
* Overview:
This function provides the interface to erase the flash.
*****************************************************************************/
int16_t
FlashPageErase( uint16_t nvmAdru, uint16_t nvmAdr );
/******************************************************************************
* Function:
int16_t FlashPageRead(uint16_t nvmAdru, uint16_t nvmAdr, int16_t
*pageBufPtr);
*
* PreCondition:
None
*
* Input:
nvmAdru - Selects the upper 8bits of the location to program or erase
in program flash memory
nvmAdr

- Selects the location to program or erase in program flash


memory. It must be aligned to 512 instruction boundary,
LSB 10bits of address must be zero
pageBufPtr- Pointer to the data array in which read data will be stored
*
* Output:

Function returns ERROREE (or -1), if it is not successful,


Function return ZERO, if successful

*
* Side Effects:
None
*
* Overview:
This function provides the interface to read the flash.
*****************************************************************************/
-2-

C:\Documents and Settings\RABBIT\Escritorio\PruebaMemoriaImprimirArreglo\rtsp_api.h

int16_t

martes, 16 de junio de 2015 12:19

FlashPageRead( uint16_t nvmAdru, uint16_t nvmAdr, int16_t *pageBufPtr );

/******************************************************************************
* Function:
int16_t FlashWordRead(uint16_t nvmRow, uint16_t nvmOffset, uint16_t
nvmAdru,
*
uint16_t nvmAdr, int16_t *wordBufptr)
*
* PreCondition:
None
*
* Input:
nvmRow
- Selects the row in the the Flash page that will be read
nvmOffset
- Defines the offset from the start of the row where a
pair of words should be read.
nvmAdru
erase

- Selects the upper 8bits of the location to program or


in program flash memory

nvmAdr

wordBufPtr
stored

*
* Output:

- Selects the location to program or erase in program flash


memory. It must be aligned to 512 instruction boundary,
LSB 10bits of address must be zero
- Pointer to the data array in which read data will be

Function returns ERROREE (or -1), if it is not successful,


Function return ZERO, if successful

*
* Side Effects:
None
*
* Overview:
This function provides the interface to read the flash.
*****************************************************************************/
extern int16_t FlashWordRead( uint16_t nvmRow, uint16_t nvmOffset, uint16_t nvmAdru,
uint16_t nvmAdr,
int16_t *wordBufptr );
/******************************************************************************
* Function:
int16_t FlashPageModify(uint16_t row, uint16_t size, int16_t *rowBuf,
int16_t *pageBufPtr);
*
* PreCondition:
None
*
* Input:
row- Selects the row of the location to program or erase
in program flash memory
size- Number of Bytes to be modified
rowBuf- Selects the location to read in program flash memory
pageBufPtr- Pointer to the data array in which read data will be stored
*
* Output:

Function returns ERROREE (or -1), if it is not successful,


-3-

C:\Documents and Settings\RABBIT\Escritorio\PruebaMemoriaImprimirArreglo\rtsp_api.h

martes, 16 de junio de 2015 12:19

Function return ZERO, if successful


*
* Side Effects:
None
*
* Overview:
This function provides the interface to modify the flash.
*****************************************************************************/
int16_t
FlashPageModify( uint16_t row, uint16_t size, int16_t *rowBuf, int16_t *
pageBufPtr );
/******************************************************************************
* Function:
int16_t FlashPageWrite(uint16_t nvmAdru, uint16_t nvmAdr, int16_t
*pageBufPtr);
*
* PreCondition:
None
*
* Input:
nvmAdru- Selects the upper 8bits of the location to program or erase
in program flash memory
nvmAdr- Selects the location to program or erase in program flash
memory. It must be aligned to 512 instruction boundary,
LSB 10bits of address must be zero
pageBufPtr- Pointer to the data array in which read data will be stored
* Output:

Function returns ERROREE (or -1), if it is not successful,


Function return ZERO, if successful

*
* Side Effects:
None
*
* Overview:
This function provides the interface to write the flash.
*****************************************************************************/
int16_t
FlashPageWrite( uint16_t nvmAdru, uint16_t nvmAdr, int16_t *pageBufPtr );
/******************************************************************************
* Function:
int16_t FlashPageWrite(uint16_t nvmAdru, uint16_t nvmAdr, int16_t
*pageBufPtr);
*
* PreCondition:
None
*
* Input:
row
- Selects the row in the the Flash page that will be modified
offset
- Defines the offset from the start of the row where a pair
of words should be modified.
nvmAdru

- Selects the upper 8bits of the location to program or erase


in program flash memory
nvmAdr
- Selects the location to program or erase in program flash
memory. It must be aligned to 512 instruction boundary,
LSB 10bits of address must be zero
ModWords - Pointer to the word data array, that will modify the
already existing Flash contents.
* Output:

Function returns ERROREE (or -1), if it is not successful,


Function return ZERO, if successful
-4-

C:\Documents and Settings\RABBIT\Escritorio\PruebaMemoriaImprimirArreglo\rtsp_api.h

martes, 16 de junio de 2015 12:19

*
* Side Effects:
None
*
* Overview:
This function provides the interface to modify data onto the flash..
*****************************************************************************/
extern int16_t FlashWordModify( uint16_t row, uint16_t offset, uint16_t nvmAdru, uint16_t
nvmAdr, int16_t *ModWords );
// *****************************************************************************
#ifdef __cplusplus // Provide C++ Compatibility
}
#endif
#endif /* _RTSPAPI_H */
/*******************************************************************************
End of File
*/

-5-

You might also like