openMMC
Open Source Modular MMC for AMCs
Loading...
Searching...
No Matches
main.c File Reference
#include <stdint.h>
#include <stdio.h>
#include "LPC176x5x.h"
#include "lpc17_clock.h"
#include "lpc17_pincfg.h"
#include "lpc17_uart.h"
#include "lpc17_iap.h"
#include "start_app.h"
Include dependency graph for main.c:

Data Structures

struct  fw_info
 

Enumerations

enum  fw_update_type { FW_UPDATE_APP = 1 , FW_UPDATE_BOOT = 2 }
 

Functions

char * u8_to_str (uint8_t n, char *str)
 
uint8_t get_sector_number (const void *flash_addr)
 
void copy_flash_region (const uint32_t *src, const uint32_t *dest, size_t len, uint32_t cpu_clk_khz)
 
void update (uint32_t cpu_clk_khz, enum fw_update_type ftype)
 
int main (void)
 

Variables

const uint32_t __AppFlash_start
 
const uint32_t __AppFlash_end
 
const uint32_t __BootFlash_start
 
const uint32_t __BootFlash_end
 
const uint32_t __FWUpdateFlash_start
 
const uint32_t __FWUpdateFlash_end
 
const fw_info __FWInfo_addr
 
const uint32_t * app_start_addr = &__AppFlash_start
 
const uint32_t * app_end_addr = &__AppFlash_end
 
const uint32_t * boot_start_addr = &__BootFlash_start
 
const uint32_t * boot_end_addr = &__BootFlash_end
 
const uint32_t * update_start_addr = &__FWUpdateFlash_start
 
const uint32_t * update_end_addr = &__FWUpdateFlash_end
 
const fw_infofw_header = &__FWInfo_addr
 

Enumeration Type Documentation

◆ fw_update_type

Enumerator
FW_UPDATE_APP 
FW_UPDATE_BOOT 

Function Documentation

◆ copy_flash_region()

void copy_flash_region ( const uint32_t * src,
const uint32_t * dest,
size_t len,
uint32_t cpu_clk_khz )

◆ get_sector_number()

uint8_t get_sector_number ( const void * flash_addr)

◆ main()

int main ( void )

◆ u8_to_str()

char * u8_to_str ( uint8_t n,
char * str )

◆ update()

void update ( uint32_t cpu_clk_khz,
enum fw_update_type ftype )

Variable Documentation

◆ __AppFlash_end

const uint32_t __AppFlash_end
extern

◆ __AppFlash_start

const uint32_t __AppFlash_start
extern

◆ __BootFlash_end

const uint32_t __BootFlash_end
extern

◆ __BootFlash_start

const uint32_t __BootFlash_start
extern

◆ __FWInfo_addr

const fw_info __FWInfo_addr
extern

◆ __FWUpdateFlash_end

const uint32_t __FWUpdateFlash_end
extern

◆ __FWUpdateFlash_start

const uint32_t __FWUpdateFlash_start
extern

◆ app_end_addr

const uint32_t* app_end_addr = &__AppFlash_end

◆ app_start_addr

const uint32_t* app_start_addr = &__AppFlash_start

◆ boot_end_addr

const uint32_t* boot_end_addr = &__BootFlash_end

◆ boot_start_addr

const uint32_t* boot_start_addr = &__BootFlash_start

◆ fw_header

const fw_info* fw_header = &__FWInfo_addr

◆ update_end_addr

const uint32_t* update_end_addr = &__FWUpdateFlash_end

◆ update_start_addr

const uint32_t* update_start_addr = &__FWUpdateFlash_start