Professional Documents
Culture Documents
/*******************************************************************************
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
-1-
//
//
//
//
//
/*
*****************************************************************************
*****************************************************************************
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
*
* 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
*
* Side Effects:
None
*
* Overview:
This function provides the interface to read the flash.
*****************************************************************************/
-2-
int16_t
/******************************************************************************
* 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
nvmAdr
wordBufPtr
stored
*
* Output:
*
* 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:
*
* 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
*
* 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-