pdk-includes
This repository contains include files for Padauk MCUs.
Example code that uses these include files can be found here: free-pdk-examples
Warning: This is a work in progress and may change significantly before being considered stable. Use at your own risk.
This repo is intended to be integrated into other projects either as a git Submodule or by manual file copy.
This repo should be installed into a pdk/ subdirectory in the root includes directory of a parent project.
To install as a git Submodule:
These include files assume the use of:
File Layout:
- device.h - The main include file.
- Factory that pulls in the appropriate device/XXX.h include file and other supporting files.
- NOTE: Requires definition of the intended Padauk IC device, usually by specifying
-D$(DEVICE)
on the SDCC command line
- device/XXX.h - The main device specific include files, one per device.
- Contain device specific configuration values like: register addresses, fuse address/values, factory calibration address(es), peripheral configuration, etc...
- Usually pulled in automatically by including device.h.
- NOTE: If needed, up to one of these can be included manually instead of by including device.h. Doing so may also require manual inclusion of the other include files below.
- device/periph/XXX.h - Common device peripheral include files.
- Contain peripheral specific register __sfr and value definitions.
- The appropriate ones are pulled in automatically by device/XXX.h files.
- When there is enough commonality between devices, they share the same peripheral file (with some configurability allowed), otherwise the peripheral files are split and the device/XXX.h file pulls in the appropriate one.
- util.h - Common utility macros.
- Contains macros for built-in opcodes and inline assembler statements
- This is pulled in automatically by device.h
- fuse.h -
- Contains a macro for setting the FUSE word at the appropriate address.
- The FUSE address is usually the last word of the device
- Requires definition of FUSE_ADDR and FUSE values, usually performed by device/XXX.h.
- This is pulled in automatically by device.h
- factory_calibration.h - Factory calibration macros
- Contains macros for using factory installed calibration values (IHRCR and/or BGTR).
- OTP devices usually only include factory calibration for BGTR (bandgap)
- MTP devices usually contain factory calibration for boty IHRCR (internal 16MHz high speed oscillator) as well at BGTR (bandgap)
- Requires definition of FACTORY_IHRCR_ADDR and/or FACTORY_BGTR_ADDR values, usually performed by device/XXX.h.
- This is pulled in automatically by device.h
- sysclock.h - System clock macros
- Contains macros for setting the system clock to the various IHRC and ILRC frequencies.
- Requires definition of CLKMD_* values, usually performed by device/XXX.h.
- This is pulled in automatically by device.h
Copyright and License: