CLEON  Version 1
Cloud-Offloaded GPS Receiver
hal_flash.h File Reference

FLASH configuration. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ERASE_INTERNAL_FLASH_ON_RESET   _DISABLE_
 
#define MSP430_INTERNAL_FLASH_BANK0_ADDRESS   0x008000
 
#define MSP430_INTERNAL_FLASH_BANK1_ADDRESS   0x018000
 
#define MSP430_INTERNAL_FLASH_BANK2_ADDRESS   0x028000
 
#define MSP430_INTERNAL_FLASH_BANK3_ADDRESS   0x038000
 

Functions

void HAL_FLASH_Init (void)
 Initializing FLASH.
 
void HAL_FLASH_Write (unsigned int uiSize, unsigned char *ptrucSource, unsigned char *ptrucDestination)
 Write data to internal FLASH.
 
void HAL_FLASH_EraseSegment (unsigned long *ptrulDestination)
 Erase FLASH segement.
 
void HAL_FLASH_EraseBank (unsigned long *ptrulDestination)
 Erase FLASH bank.
 

Detailed Description

FLASH configuration.

Definition in file hal_flash.h.

Macro Definition Documentation

#define ERASE_INTERNAL_FLASH_ON_RESET   _DISABLE_

Definition at line 10 of file hal_flash.h.

#define MSP430_INTERNAL_FLASH_BANK0_ADDRESS   0x008000

Definition at line 12 of file hal_flash.h.

#define MSP430_INTERNAL_FLASH_BANK1_ADDRESS   0x018000

Definition at line 13 of file hal_flash.h.

#define MSP430_INTERNAL_FLASH_BANK2_ADDRESS   0x028000

Definition at line 14 of file hal_flash.h.

#define MSP430_INTERNAL_FLASH_BANK3_ADDRESS   0x038000

Definition at line 15 of file hal_flash.h.

Function Documentation

void HAL_FLASH_EraseBank ( unsigned long *  ptrulDestination)

Erase FLASH bank.

Returns
void
Parameters
*ptrulDestination- base address of FLAHS bank

Definition at line 81 of file hal_flash.c.

{
FCTL3 = FWKEY; // Clear Lock bit
FCTL1 = FWKEY + MERAS; // Set Erase bit
*ptrulDestination = 0; // Dummy write to erase Flash seg
while (FCTL3 & BUSY); // test busy
FCTL1 = FWKEY; // Clear WRT bit
FCTL3 = FWKEY + LOCK; // Set LOCK bit
}

Here is the caller graph for this function:

void HAL_FLASH_EraseSegment ( unsigned long *  ptrulDestination)

Erase FLASH segement.

Returns
void
Parameters
*ptrulDestination- base address of FLAHS segment

Definition at line 63 of file hal_flash.c.

{
FCTL3 = FWKEY; // Clear Lock bit
FCTL1 = FWKEY + ERASE; // Set Erase bit
*ptrulDestination = 0; // Dummy write to erase Flash seg
while (FCTL3 & BUSY); // test busy
FCTL1 = FWKEY; // Clear WRT bit
FCTL3 = FWKEY + LOCK; // Set LOCK bit
}
void HAL_FLASH_Init ( void  )

Initializing FLASH.

Returns
void
Parameters
void

Definition at line 21 of file hal_flash.c.

{
#if ERASE_INTERNAL_FLASH_ON_RESET == _ENABLE_
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

void HAL_FLASH_Write ( unsigned int  uiSize,
unsigned char *  ptrucSource,
unsigned char *  ptrucDestination 
)

Write data to internal FLASH.

Returns
void
Parameters
uiSize- size of source data
*ptrulSource- base address of source data
*ptrulDestination- base address of FLASH destination

Definition at line 40 of file hal_flash.c.

{
FCTL3 = FWKEY; // Clear Lock bit
FCTL1 = FWKEY + WRT; // Enable byte/word write mode
while (uiSize > 0) {
while (FCTL3 & BUSY); // test busy
*ptrucDestination++ = *ptrucSource++; // Write to Flash
uiSize--;
}
FCTL1 = FWKEY; // Clear Erase bit
FCTL3 = FWKEY + LOCK; // Set LOCK bit
}

Here is the caller graph for this function: