common/pic24_flash.c File Reference

#include "pic24_all.h"
#include <stdio.h>

Go to the source code of this file.

Functions

void doWriteLatchFlash (uint16 u16_addrhi, uint16 u16_addrlo, uint16 u16_wordhi, uint16 u16_wordlo)
uint32 doReadLatchFlash (uint16 u16_addrhi, uint16 u16_addrlo)
void doErasePageFlash (uint16 u16_addrhi, uint16 u16_addrlo)
void doWriteRowFlash ()
void doWritePageFlash (union32 u32_pmemAddress, uint8 *pu8_data, uint16 u16_len)
void doReadPageFlash (union32 u32_pmemAddress, uint8 *pu8_data, uint16 u16_len)


Detailed Description

FLASH memory read/write support functions. Thanks goes to David Weaver for suggestions on improving these functions.

Definition in file pic24_flash.c.


Function Documentation

void doErasePageFlash ( uint16  u16_addrhi,
uint16  u16_addrlo 
)

Erases a flash page at u16_addrhi:u16_addrlo flash address

Parameters:
u16_addrhi upper word of flash memory address
u16_addrlo lower word of flash memory address

Definition at line 74 of file pic24_flash.c.

uint32 doReadLatchFlash ( uint16  u16_addrhi,
uint16  u16_addrlo 
)

Read table latch from address u16_addrhi:u16_addrlo

Parameters:
u16_addrhi upper word of flash memory address
u16_addrlo lower word of flash memory address
Returns:
24-bit data value returned in uint32 type

Definition at line 60 of file pic24_flash.c.

void doReadPageFlash ( union32  u32_pmemAddress,
uint8 pu8_data,
uint16  u16_len 
)

Reads a flash page at u32_pmemAddress, returns u16_len bytes in buffer pu8_data

Parameters:
u32_pmemAddress flash memory address, should be on a page boundary
pu8_data pointer to byte data to write
u16_len number of bytes to read

Definition at line 162 of file pic24_flash.c.

void doWriteLatchFlash ( uint16  u16_addrhi,
uint16  u16_addrlo,
uint16  u16_wordhi,
uint16  u16_wordlo 
)

Write table latch with address u16_addrhi:u16_addrlo, data: u16_wordhi:u16_wordlo

Parameters:
u16_addrhi upper word of flash memory address
u16_addrlo lower word of flash memory address
u16_wordhi upper data word (only lower 8-bits are valid, upper 8-bits should be zero)
u16_wordlo lower data word

Definition at line 47 of file pic24_flash.c.

void doWritePageFlash ( union32  u32_pmemAddress,
uint8 pu8_data,
uint16  u16_len 
)

Erases a flash page at u32_pmemAddress, then writes u16_len bytes from pu8_data to program memory.

Parameters:
u32_pmemAddress flash memory address, should be on a page boundary
pu8_data pointer to byte data to write
u16_len number of bytes to write, this is rounded up nearest row boundary! (should be evenly divisible by 64*3)

Definition at line 129 of file pic24_flash.c.

void doWriteRowFlash (  ) 

Write current flash row

Definition at line 103 of file pic24_flash.c.


Generated on Sun Mar 15 11:14:22 2009 for PIC24 Support Libraries by  doxygen 1.5.8