Added mc1322x functions

This commit is contained in:
Lars Schmertmann 2014-05-23 12:12:26 +02:00
parent 443bbd3948
commit 879fd8de81
4 changed files with 22 additions and 0 deletions

View file

@ -90,6 +90,12 @@ clock_seconds(void)
return seconds; return seconds;
} }
void
clock_set_seconds(unsigned long sec)
{
seconds = sec;
}
void void
clock_wait(clock_time_t t) clock_wait(clock_time_t t)
{ {

View file

@ -325,6 +325,17 @@ static const int XTAL32_EN = 0;
#define pack_XTAL_CNTL(ctune4pf, ctune, ftune, ibias) \ #define pack_XTAL_CNTL(ctune4pf, ctune, ftune, ibias) \
(*CRM_XTAL_CNTL = ((ctune4pf << 25) | (ctune << 21) | ( ftune << 16) | (ibias << 8) | 0x52)) (*CRM_XTAL_CNTL = ((ctune4pf << 25) | (ctune << 21) | ( ftune << 16) | (ibias << 8) | 0x52))
#define soft_reset() \
__asm__ __volatile__ ( \
"ldr r0, [%[sw]] \n\t" \
"str r0, [%[sw]] \n\t" \
: /* out */ \
: /* in */ \
[sw] "l" (CRM_SW_RST) \
: /* clobber list */ \
"r0", "memory" \
);
#endif /* REG_NO_COMPAT */ #endif /* REG_NO_COMPAT */
#endif #endif

View file

@ -78,5 +78,6 @@ extern nvmErr_t (*nvm_write)(nvmInterface_t nvmInterface, nvmType_t nvmType ,voi
/* SST flash has 32 sectors 4096 bytes each */ /* SST flash has 32 sectors 4096 bytes each */
/* bit 0 is the first sector, bit 31 is the last */ /* bit 0 is the first sector, bit 31 is the last */
extern nvmErr_t (*nvm_erase)(nvmInterface_t nvmInterface, nvmType_t nvmType ,uint32_t sectorBitfield); extern nvmErr_t (*nvm_erase)(nvmInterface_t nvmInterface, nvmType_t nvmType ,uint32_t sectorBitfield);
extern nvmErr_t (*nvm_verify)(nvmInterface_t nvmInterface, nvmType_t nvmType, void *pSrc, uint32_t address, uint32_t numBytes);
extern void(*nvm_setsvar)(uint32_t zero_for_awesome); extern void(*nvm_setsvar)(uint32_t zero_for_awesome);
#endif //NVM_H #endif //NVM_H

View file

@ -51,6 +51,10 @@ nvmErr_t (*nvm_erase)
(nvmInterface_t nvmInterface, nvmType_t nvmType ,uint32_t sectorBitfield) (nvmInterface_t nvmInterface, nvmType_t nvmType ,uint32_t sectorBitfield)
= (void*) 0x00006e05; = (void*) 0x00006e05;
nvmErr_t (*nvm_verify)
(nvmInterface_t nvmInterface, nvmType_t nvmType, void *pSrc, uint32_t address, uint32_t numBytes)
= (void*) 0x00006f85;
void(*nvm_setsvar) void(*nvm_setsvar)
(uint32_t zero_for_awesome) (uint32_t zero_for_awesome)
= (void *)0x00007085; = (void *)0x00007085;