PIC24 Support Libraries
Functions
pic24_flash.h File Reference
#include <stdint.h>
#include "pic24_unions.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 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)
 

Detailed Description

FLASH memory read/write support functions

Definition in file pic24_flash.h.

Function Documentation

◆ doReadLatchFlash()

uint32_t doReadLatchFlash ( uint16_t  u16_addrhi,
uint16_t  u16_addrlo 
)

Read table latch from address u16_addrhi:u16_addrlo

Parameters
u16_addrhiupper word of flash memory address
u16_addrlolower word of flash memory address
Returns
24-bit data value returned in uint32_t type

Definition at line 102 of file pic24_flash.c.

◆ doReadPageFlash()

void doReadPageFlash ( union32  u32_pmemAddress,
uint8_t pu8_data,
uint16_t  u16_len 
)

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

Parameters
u32_pmemAddressflash memory address, should be on a page boundary
pu8_datapointer to byte data to write
u16_lennumber of bytes to read

Definition at line 247 of file pic24_flash.c.

◆ doWriteLatchFlash()

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

Parameters
u16_addrhiupper word of flash memory address
u16_addrlolower word of flash memory address
u16_wordhiupper data word (only lower 8-bits are valid, upper 8-bits should be zero)
u16_wordlolower data word

Definition at line 49 of file pic24_flash.c.

◆ doWritePageFlash()

void doWritePageFlash ( union32  u32_pmemAddress,
uint8_t pu8_data,
uint16_t  u16_len 
)

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

Parameters
u32_pmemAddressflash memory address, should be on a page boundary
pu8_datapointer to byte data to write
u16_lennumber 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.