PIC24 Support Libraries
|
#include "pic24_flash.h"
#include "pic24_chip.h"
#include "pic24_unittest.h"
#include "pic24_util.h"
Go to the source code of this file.
Functions | |
void | doWriteLatchFlash (uint16_t u16_addrhi, uint16_t u16_addrlo, uint16_t u16_wordhi, uint16_t u16_wordlo) |
uint32_t | doReadLatchFlash (uint16_t u16_addrhi, uint16_t u16_addrlo) |
void | doErasePageFlash (uint16_t u16_addrhi, uint16_t u16_addrlo) |
void | doWriteRowFlash () |
void | doWritePageFlash (union32 u32_pmemAddress, uint8_t *pu8_data, uint16_t u16_len) |
void | doReadPageFlash (union32 u32_pmemAddress, uint8_t *pu8_data, uint16_t u16_len) |
FLASH memory read/write support functions. Thanks goes to David Weaver for suggestions on improving these functions.
Definition in file pic24_flash.c.
void doErasePageFlash | ( | uint16_t | u16_addrhi, |
uint16_t | u16_addrlo | ||
) |
Erases a flash page at u16_addrhi:u16_addrlo flash address
u16_addrhi | upper word of flash memory address |
u16_addrlo | lower word of flash memory address |
Definition at line 116 of file pic24_flash.c.
uint32_t doReadLatchFlash | ( | uint16_t | u16_addrhi, |
uint16_t | u16_addrlo | ||
) |
Read table latch from address u16_addrhi:u16_addrlo
u16_addrhi | upper word of flash memory address |
u16_addrlo | lower word of flash memory address |
Definition at line 102 of file pic24_flash.c.
Reads a flash page at u32_pmemAddress, returns u16_len bytes in buffer pu8_data
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 247 of file pic24_flash.c.
void doWriteLatchFlash | ( | uint16_t | u16_addrhi, |
uint16_t | u16_addrlo, | ||
uint16_t | u16_wordhi, | ||
uint16_t | u16_wordlo | ||
) |
Write table latch with address u16_addrhi:u16_addrlo, data: u16_wordhi:u16_wordlo
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 49 of file pic24_flash.c.
Erases a flash page at u32_pmemAddress, then writes u16_len bytes from pu8_data to program memory.
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). For |
Definition at line 194 of file pic24_flash.c.
void doWriteRowFlash | ( | ) |
Write current flash row
Definition at line 168 of file pic24_flash.c.