Link here

C Function Summary

Summary of C language library functions for the PDQ Board controller.

The C Function Glossary provides detailed descriptions of all of the library routines that customize the GNU C (GCC) compiler for use with the PDQ Controller and its built-in QED-Forth RTOS (real time operating system). QED-Forth is both a programming language and a real-time embedded operating system. Many QED-Forth firmware functions are callable as libraries from the Mosaic IDE Plus, a Codeblocks-based Integrated Development Environment you use for your C software development. These C library routines are defined and declared in a set of header files in the compiler's C:\MosaicPlus\c\libraries\include\mosaic directory. These functions run on the Freescale 9S12/HCS12 MCU.

This document presents an overview of the header files and explains how to interpret the information that is presented in the C Function Glossary and the Interactive Debugger Glossary. The glossary provides detailed descriptions of each library function as well as numerous C code examples.

In here you'll find:

Companion pages provide a comparison with prior QED operating software, which summarizes the functions that have been added to this version of the QED operating system software compared to prior versions; and, links to documentation for the open-source implementation of the C standard libraries provided as part of the development environment for PDQ-line controllers.

For an overview of the functions provided by the Newlib open-source library of standard C functions, see the Tables of Contents of the standard and math library documentation pages:

When you click on a library function name you should get a popup containing its detailed definition, taken from the relevant C Function Glossary page:

 

Using header files

The names and contents of the QED-Forth C header files are as follows:

Header File Contents
ANALOG.h Analog-To-Digital (ATD) converter driver functions
ARRAY.h Routines that dimension, access and manipulate Forth Arrays in paged memory
HCS12REGS.h Macro definitions for the Freescale HCS12 (9S12) registers
HEAP.h Heap memory manager functions
INTERUPT.h Interrupt identifiers and functions to facilitate posting interrupt handlers
IOACCESS.h Memory access primitives for the Wildcard and Smart I/O modules
MEMORY.h Memory access functions for paged memory, flash and EEPROM
MTASKER.h Multitasking executive and elapsed-time clock routines
NUMBERS.h Formatted number-to-string and print routines
OPSYSTEM.h Operating system functions for initialization, autostarting, and error handling
PWM.h Pulse-Width Modulated (PWM) output driver functions
SEGMENTS.h Library and application segment management structures and macros
SERIAL.h Serial communications driver functions for RS232/485, SPI, and IIC buses
TIMERIO.h Timer-controlled I/O driver functions for the Enhanced Capture Timer (ECT)
TYPES.h Useful type definitions
USER.h Declarations of USER_AREA and TASK structures, and user variable definitions
UTILITY.h Defines macros such as MIN, MAX, ABS, TRUE, FALSE, SAVE_STRING and LOAD_STRING
WATCH.h Routines that set and read the battery-backed real-time "smart watch"

The Categorized list of Control-C library functions is organized according to these header files. To examine these files, use the Mosaic IDE Plus editor to open the files in the C:\MosaicPlus\c\libraries\include\mosaic directory.

You can access these kernel functions as well as the the standard C library functions using the command

#include < mosaic\allqed.h >

as described in the section Accessing the standard (kernel) C library functions.

 

Calling functions

You can call any of these functions from within your C code using standard C syntax. There is one limitation however:

Do not nest functions!
Do not nest calls to any of the functions declared in standard C or these operating system header files. In other words, do not include function as a parameter in another function. Instead, call the functions sequentially, using a temporary variable to save the result of the first function and then use the variable as the input parameter of the next function.

There are several reasons for this limitation:

  1. The Forth operating system will not allow a function call to be included as a parameter in the function invocation of another Forth function call. Further, many functions that are callable from C are actually defined in the QED-Forth Kernel or a QED-Forth Kernel-extension library. This includes functions that are in the kernel on the PDQ Board, or are part of software distributions such as the Graphical User Interface (GUI) Toolkit. A call to one of these functions may not be made from within the parameter list of a call to another such function.
  2. The C compiler does allow functions to be used as parameters in another function call, but doing so greatly increases the stack space needed for the function, making run time errors owing to stack overflow much more likely. Many function calls in C, particularly calls to math functions, use the runtime stack very greedily, often setting up temporary buffers on the stack. Nesting such functions piles up those buffers on the stack, while calling them sequentially does not.

There is always a straightforward way to avoid nesting function calls: simply use a variable to hold the required intermediate return value/parameter. For example, if you need to use the Kernel function StoreChar() to store at xaddress 0x0F8000 the contents fetched by FetchChar() from xaddress 0x0F8100 in paged memory, you could execute the following statements:

static char contents = FetchChar( (xaddr) 0x0F8100 );
StoreChar( contents, (xaddr) 0x0F8000 );

This code is correct, while nesting the call to FetchChar() inside the parameter list of StoreChar() would be incorrect.

 

Interpreting glossary definitions

Each entry in the Main Glossary of Control-C Library Functions may include the following elements:

  1. A declaration of the routine. If it is a constant or a macro that does not require any arguments, then the name of the routine is simply presented. If it is a function, or a macro that behaves like a function, then the declaration looks like an ANSI-C function prototype, such as:

    void Emit(uchar c)''

    where void tells us that there is no return value, and uchar c tells us that there is a single input parameter that is an unsigned character.

  2. A detailed definition of what the routine does.
  3. A "Type" field that specifies whether the routine is a kernel function, a C function, a macro, a constant, or a typedef. Kernel functions are defined in the operating system ("kernel"), reside in flash on the PDQ hardware, and are called via a wrapper function and C prototype from the C environment. The remaining types are declared using standard C syntax.
  4. An "Availability" field that states the first revision of Mosaic IDE Plus in YYWW notation (post-2000 year and ISO week number) in which the routine was made available.
  5. A "QED-Forth name" or "Related QED-Forth function" field that specifies the name of a closely related function or constant that is accessible via the QED-Forth interpreter/compiler using QED-Forth syntax. Alternatively there may be a statement that the routine is "C only".
  6. A "Header file" field that specifies where the routine is defined or declared. Most header files are in the C:\MosaicPlus\c\libraries\include\mosaic directory.

 

Type abbreviations used in function declarations

Standard type specifiers such as char, int, long, and float are used in the glossary declarations. In addition, we use six convenient typedefs that are defined in the TYPES.h header file:

typedef unsigned char uchar;
typedef unsigned int uint;
typedef unsigned long ulong;
typedef unsigned long xaddr;
typedef int wchar;
typedef unsigned int uwchar;

The meanings of the first three typedefs are obvious; they are abbreviations for unsigned types. The "xaddr" typedef means "extended address", and is used when a 32-bit address parameter is passed. The "wchar" and "uwchar" stand for wide-char and unsigned wide-char. These types must be used when passing char types to any libraries or kernel functions.

 

Categorized list of Control-C library functions

The routines described here facilitate control of the hardware on the PDQ controller, including the digital I/O lines, RS232/485 serial communications ports, and battery-backed real-time clock (also called the "watch"). Built-in high level I/O drivers control the processor’s Analog-To-Digital (ATD) converter, Pulse-Width-Modulated (PWM) output port (PORTP), and timer-controlled I/O implemented by the Enhanced Capture Timer on PORTT. The timer-controlled ECT subsystem includes Input Captures (IC), Output Compares (OC), pulse accumulators, a modulus down-counter, and a free-running counter (TCNT). Additional drivers control the fast 3-wire SPI (Serial Peripheral Interface) and the 2-wire IIC (Inter-IC) serial ports; these clocked serial buses enable the processor to communicate with multiple peripheral devices. In addition, the routines provide complete control over the built-in multitasking executive, heap memory manager, interrupt handling capabilities, and operating system features including autostarting of your application program.

 

ANALOG.h

ATD0_7_RESULTS ATDMultiple ATDSample
ATD8_15_RESULTS ATDOff ATDSingle
ATDDigitalInputs ATDOn ATDStartSample
 

ARRAY.h

ARRAYBASE CopyArray FillArray
ArrayBase DELETED FORTH_ARRAY
ARRAYFETCH Deleted NUMCOLUMNS
ArrayFetch DIM NUMDIMENSIONS
ARRAYMEMBER Dimensioned NUMROWS
ArrayMember FARRAYFETCH SIZEOFMEMBER
ARRAYSIZE FArrayFetch SWAPARRAYS
ARRAYSTORE FARRAYSTORE SwapArrays
ArrayStore FArrayStore
COPYARRAY FILLARRAY
 

HCS12REGS.h

PORTAD0 PORTJ_DIRECTION PORTP_IN
PORTAD0_MODE PORTM PORTT
PORTAD1 PORTM_DIRECTION PORTT_DIRECTION
PORTAD1_MODE PORTP PORTT_IN
PORTJ PORTP_DIRECTION
See the HCS12REGS.h file. All registers are named using the standard names as described in the Motorola documentation. The names in this table are synonyms for control of on-board digital I/O.
 

HEAP.h

DEFAULT_HEAPEND INIT_DEFAULT_HEAP ToHeap
DEFAULT_HEAPSTART IsHeap TransferHeapItem
DupHeapItem ResizeHandle
FromHeap Room
 

INTERRUPT.h

ATD0_ID ECT5_ID PULSE_B_OVERFLOW_ID
ATD1_ID ECT6_ID PWM_SHUTDOWN_ID
ATTACH ECT7_ID RTI_ID
Attach ECT_OVERFLOW_ID SCI0_ID
CLOCK_MONITOR_ID ENABLE_INTERRUPTS SCI1_ID
COP_ID IIC_ID SELF_CLOCK_ID
COUNTER_UNDERFLOW_ID IRQ_ID SPI0_ID
DISABLE_INTERRUPTS PLL_LOCK_ID SPI1_ID
ECT0_ID PORTH_ID SPI2_ID
ECT1_ID PORTJ_ID SWI_ID
ECT2_ID PORTP_ID TRAP_ID
ECT3_ID PULSE_A_EDGE_ID XIRQ_ID
ECT4_ID PULSE_A_OVERFLOW_ID
 

IOACCESS.h

FromIO IOFetchLong SmartIOFetchChar
FromSmartIO IOSetBits SmartIOFetchFloat
IOChangeBits IOStoreChar SmartIOFetchInt
IOClearBits IOStoreFloat SmartIOFetchLong
IOFetchChar IOStoreInt ToIO
IOFetchFloat IOStoreLong ToIORegister
IOFetchInt IOSetBits
 

MEMORY.h

AddXaddrOffset FetchInt StoreFloatProtected
CalcChecksum FetchLong StoreInt
CalcChecksumMany FetchLongProtected StoreLong
Cat FillMany StoreLongProtected
ChangeBits LoadPage StorePages
ClearBits LoadPages StringMove
CmoveMany ReceiveBinary ToEEPROM
CmoveManyCheck ReceiveHex ToFlash
CountedString SetBits ToFlashMany
Dump StoreChar ToggleBits
DumpBinary StoreEEChar ToMemory
DumpManyS2 StoreEEFloat ToXFlash
FetchChar StoreEEInt XaddrDifference
FetchFloat StoreEELong
FetchFloatProtected StoreFloat
 

MTASKER.h

Activate InitElapsedTime Send
ACTIVATE InstallMultitasker SERIAL
ASLEEP KillTask SERIAL1_RESOURCE
AWAKE MAILBOX SERIAL2_RESOURCE
BuildTask MicrosecDelay SPI_RESOURCE
BUILD_C_TASK MsecTimeslicePeriod StartTimeslicer
CountToMsec Pause StopTimeslicer
FetchTSCount ReadElapsedSeconds TIMESLICE_COUNT
FMAILBOX RECEIVE TryToFSend
FORTH_TASK Receive TryToGet
FRECEIVE RELEASE TryToSend
FReceive Release TRY_TO_FSEND
FSEND RELEASE_AFTER_LINE TRY_TO_GET
FSend RELEASE_ALWAYS TRY_TO_SEND
GET RELEASE_NEVER WaitTilMatch
Get RESOURCE
Halt SEND
 

NUMBERS.h

FILL_FIELD LEFT_PLACES RANDOM_SEED
FIXED MANTISSA_PLACES RIGHT_PLACES
FLOATING NO_SPACES SCIENTIFIC
FPtoString PrintFP TRAILING_ZEROS
FP_FORMAT Random
FRandom RandomGaussian
 

OPSYSTEM.h

Abort EnableBootVectors SetBootVector
BreakAll Execute StandardReset
Breakpoint InitVitalIRQsOnCold StatusAtStartup
CheckstartDisable IsAutostart SysAbort
CheckstartEnable IsPriorityAutostart Version
ClearBootVectors LoadPagesAtStartup Warm
Cold NoAutostart WriteEnable
ColdOnReset NoStatusAtStartup WriteProtect
DisableBootVectors NoVitalIRQInit
 

PWM.h

PWM01 PWMConcatenate PWMLeftAlign
PWM23 PWMCounterRead PWMPeriodRead
PWM45 PWMCounterWrite PWMPeriodWrite
PWM67 PWMDisable PWMPrescaler
PWM_CLOCKA PWMDisableMultiple PWMScaledClock
PWM_CLOCKB PWMDutyRead PWMScaler
PWMActiveHigh PWMDutyWrite PWMSeparate
PWMActiveLow PWMEnable PWMSetup
PWMCenterAlign PWMEnableMultiple PWMUnscaledClock
 

SEGMENTS.h

KERNEL_ARRAY_ADDR SEG_ARRAY_BASE_ADDR SEG_VARSTART
KERNEL_ID SEG_ARRAY_ENTRY SEG_XNFA
REQUIRED_SEGMENTS_MAX SEG_CODE_XBASE SEGMENT_STRUCT
SEG_ARRAY_ADDR SEG_EEVARSTART SEGMENTS_MAX
 

SERIAL.h

IIC_NUM_BYTES_TO_RCV InitSPI
IIC_NUM_BYTES_TO_XMIT Key
IIC_RCV_BUF_FULL Key1
IIC_RCV_BUF_OFFSET Key2
AskKey IIC_RCV_BUF_OVERFLOW PauseOnKey
AskKey1 IIC_RCV_BUF_PTR RS485Init
AskKey2 IIC_RCV_BUF_SIZE RS485Receive
Baud IIC_RCV_BUFFER RS485Transmit
Beep IIC_TIMEOUT_ERROR RS485TransmitDone
Cr IIC_XMIT_BUF_EMPTY Serial1AtStartup
Emit IIC_XMIT_BUF_OFFSET Serial2AtStartup
Emit1 IIC_XMIT_BUF_OVERFLOW SPI_FALLING_LEADING_EDGE
Emit2 IIC_XMIT_BUF_PTR SPI_FALLING_TRAILING_EDGE
ForthAskKey IIC_XMIT_BUF_SIZE SPI_RISING_LEADING_EDGE
ForthEmit IIC_XMIT_BUFFER SPI_RISING_TRAILING_EDGE
ForthKey IICFrequencies SPIConfig
IIC_104KHZ_23PERCENT IICInit SPIExchange
IIC_10KHZ_13PERCENT IICReceive SPIFrequencies
IIC_96KHZ_25PERCENT IICReceiveFrame SPIRestore
IIC_ARB_LOST_ERROR IICSend SPISave
IIC_ERROR IICSendFrame UseSerial1
IIC_MASTER_RECEIVER IICSendNextFrame UseSerial2
IIC_NAK_ERROR InitIPSPI
 

TIMERIO.h

ECTClearInterruptFlag ModCounterSetup PULSE_A_GATED_HIGH
ECTFastClear ModCounterUpdate PULSE_A_GATED_LOW
ECTInterruptDisable MODULUS_UNDERFLOW PULSE_A_OVERFLOW
ECTInterruptEnable OC7ClearsIt PULSE_A_RISING_EDGE
ECTPrescaler OC7Disconnect PULSE_B
ECTStandardClear OC7SetsIt PULSE_B_OVERFLOW
HoldingRegForceLatch OC_CLEAR_ACTION PulseASetup
IC_1024_CYCLE_DELAY OC_NO_ACTION PulseBSetup
IC_256_CYCLE_DELAY OC_SET_ACTION PulseDisable
IC_512_CYCLE_DELAY OC_TOGGLE_ACTION PulseEnable
IC_DELAY_DISABLED OCAction PulseHoldingRead
ICFirstPolarity OCForce PulseRegRead
ICHoldingRead OCICRegRead PulseRegWrite
ICNoiseDelay OCNoToggleOnOverflow TCNT_OVERFLOW
ICNoOverwrite OCRegWrite TCNTRead
ICOverwriteOK OCToggleOnOverflow TRIGGER_OFF
ICPulseConfig OutputCompare TRIGGER_ON_ANY_EDGE
InputCapture PULSE_A TRIGGER_ON_FALLING_EDGE
ModCounterLoad PULSE_A_EDGE TRIGGER_ON_RISING_EDGE
ModCounterRead PULSE_A_FALLING_EDGE TriggerEdge
 

TYPES.h

_Q THIS_PAGE XADDR_TO_ADDR
EXTENDED_ADDR TO_XADDR XADDR_TO_PAGE
PAGE_LATCH TWO_INTS
 

USER.h

CURRENT_HEAP TASK UERROR
CUSTOM_ABORT TASKBASE UKEY
CUSTOM_ERROR TIB UP
NEXT_TASK UABORT UPAD
PAD UASK_KEY USER_AREA
SERIAL_ACCESS UDEBUG UTIB
STATUS UEMIT
 

UTILITY.h

ABS FLASH_IPRINTF SAVE_STRING
MIN FLASH_PRINT LOAD_STRING
MAX FLASH_PRINTF LOADED_STRING
TRUE FLASH_SNIPRINTF LOAD_STRING_TO
FALSE FLASH_SNPRINTF
 

WATCH.h

CALENDAR_TIME WATCH_DAY WATCH_MONTH
ReadWatch WATCH_HOUR watch_results
SetWatch WATCH_HUNDREDTH_SECONDS WATCH_SECONDS
WATCH_DATE WATCH_MINUTE WATCH_YEAR
 

Interactive debugger and system configuration functions

The Interactive Debugger Glossary describes useful routines that allow you to interactively call C functions and manipulate variables and FORTH_ARRAY data. These versatile routines make it easy to thoroughly test each function in your program over its full range of allowed input parameters.

The environment for the interactive debugger is the QED-Forth interpreter. Thus, while the syntax of the debugger commands is similar to C function prototypes and assignment statements, you will in fact be "talking to" the debugger using the QED-Forth language. The PDQ C User Guide explains how to use QED-Forth and the debugger routines. Forth function names are not restricted to alphanumeric characters, and can contain periods, colons, semicolons, etc. Forth functions can be interactively typed at the terminal, and are always space-delimited: there must be at least one space between successive Forth commands.

In addition to the debugger keywords that were created for debugging C programs, the Debugger Glossary also describes some QED-Forth functions that can be interactively called. These useful functions let you write to EEPROM, view memory contents using a DUMP command, capture your application in a Motorola S-record file, change the baud rates of the serial ports, and configure the MAIN program to AUTOSTART each time the PDQ controller starts up.

The "Introductory Notes" section at the top of the Debugger Glossary provides further information.

 

Assignment, fetching and function calling

=CHAR CHAR INT
=FLOAT CHAR* INT*
=INT DO[] LONG
=LONG FLOAT LONG*
CALL.CFN FLOAT*
 

EEPROM storage

(EE!) (EEC!) TO.EEPROM
(EE2!) (EEF!)
 

Hex dump and receive

DUMP DUMP.S1 RECEIVE.HEX
DUMP.AUTOSTARTS DUMP.S2
DUMP.INTEL DUMP.MANY.S2
 

Numeric I/O

. HEX PrintFP
D. HEX. U.
DECIMAL HEXD.
 

Operating system and memory management

ABORT LOAD.PAGES SP!
AUTOSTART: LOAD.PAGES.AT.STARTUP STATUS.AT.STARTUP
BAUD MAIN STANDARD.RESET
CALC.CHECKSUM MAIN2 STORE.PAGES
CFA.FOR NO.AUTOSTART TO.FLASH
CHECKSTART.DISABLE NO.STATUS.AT.STARTUP TO.MEMORY
CHECKSTART.ENABLE NO.VITAL.IRQ.INIT TO.XFLASH
CLEAR.BOOT.VECTORS PRIORITY.AUTOSTART: UNSAVE.ALL
COLD QUIET.COLD USE.SERIAL1
COLD.ON.RESET RESTORE USE.SERIAL2
DISABLE.BOOT.VECTORS RESTORE.ALL WARM
ENABLE.BOOT.VECTORS SAVE WE.ALL
INIT.VITAL.IRQS.ON.COLD SAVE.ALL WORDS
IS.AUTOSTART SERIAL1.AT.STARTUP WP.ALL
IS.PRIORITY.AUTOSTART SERIAL2.AT.STARTUP WRITE.ENABLE
LOAD.PAGE SET.BOOT.VECTOR WRITE.PROTECT
 

Functions that disable interrupts

Certain Control-C library functions temporarily disable interrupts by setting the I bit in the condition code register. The glossary entries for these words detail the length of time that interrupts are disabled. These routines are summarized here to assist you in planning the time-critical aspects of your application.

The library provides a set of uninterruptable memory operators that disable interrupts for a few microseconds during the memory access. These are very useful in applications where several tasks or interrupt routines must access a shared memory location:

ChangeBits IOClearBits SmartIOFetchChar
ClearBits IOFetchChar SmartIOFetchFloat
FetchFloatProtected IOFetchFloat SmartIOFetchInt
FetchLongProtected IOFetchInt SmartIOFetchLong
FromIO IOFetchLong StoreFloatProtected
FromSmartIO IOSetBits StoreLongProtected
IOChangeBits SetBits ToggleBits
CLEAR_BITS SET_BITS
CHANGE_BITS STORE_FLOAT_PROTECTED
FETCH_FLOAT_PROTECTED STORE_LONG_PROTECTED
FETCH_LONG_PROTECTED TOGGLE_BITS

The multitasker mediates access to shared resources and ensures smooth transfer of information among tasks. The routines that manage resource variables and mailboxes must disable interrupts for short periods to ensure proper access to shared resources and messages. Consequently, the following routines temporarily disable interrupts:

FRECEIVE RECEIVE TryToSend
FReceive Receive TRY_TO_FSEND
FSEND SEND TRY_TO_GET
FSend Send TRY_TO_SEND
GET TryToFSend
Get TryToGet

Some of these routines also call Pause to give other tasks a chance to run while waiting for a resource or message; as explained below, Pause also disables interrupts. Consult their glossary entries for details.

The following routines temporarily disable interrupts to ensure that a new task is not corrupted while it is being built:

BuildTask BUILD_C_TASK

These functions disable interrupts to ensure that the elapsed time clock is not updated while it is being read:

FetchTSCount ReadElapsedSeconds

The multitasker is charged with smoothly transferring control among tasks via timeslicing or cooperative task switching. The timeslicer is an interrupt service routine associated with the real-time interrupt (RTI). The timeslicer's interrupt service routine disables interrupts for the duration of a task switch which requires 3.6 microseconds, plus 0.5 microseconds for each ASLEEP task encountered in the task list. The cooperative task switch routine

Pause

also disables interrupts for the duration of the task switch time, which is just over 4 microseconds.

The Pause routine (which temporarily disables interrupts) is sometimes called by the following built-in device drivers:

ForthEmit IICReceive Key
ForthKey IICReceiveFrame Key1
Emit IICSend Key2
Emit1 IICSendFrame WaitTilMatch
Emit2 IICSendNextFrame

The following device driver routines GET and RELEASE resource variables, and so may disable interrupts for short periods of time:

AskKey ForthAskKey PauseOnKey
AskKey1 ForthEmit ReadWatch
AskKey2 ForthKey SetWatch
Emit Key SPIRestore
Emit1 Key1 SPISave
Emit2 Key2 SetWatch

All of the routines that write to the EEPROM disable interrupts for 30 msec per programmed 4-byte aligned EEPROM cell. This results from the processor’s design which prohibits any EEPROM locations from being read while other EEPROM locations are being modified. Since all interrupts are vectored through EEPROM, interrupts cannot be serviced while an EEPROM storage operation is in progress. The fundamental EEPROM storage functions are:

StoreEEChar StoreEEInt ToEEPROM
StoreEEFloat StoreEELong

These functions disable interrupts during EEPROM programming. The following routines may modify EEPROM locations:

ATTACH InitVitalIRQsOnCold Serial2AtStartup
Attach InstallMultitasker StandardReset
Baud LoadPagesAtStartup StartTimeslicer
ColdOnReset NoAutostart WriteEnable
DisableBootVectors NoStatusAtStartup WriteProtect
EnableBootVectors NoVitalIRQInit
IICInit Serial1AtStartup

All of the routines that write to the on-chip flash memory disable interrupts for 35 msec per programmed sector, where a sector is 512 bytes for a 256 KByte flash processor, or 1024 bytes for a 512 Kbyte processor. Routines that write to off-chip eXternal flash memory disable interrupts for 12 msec per programmed sector, where a standard sector is 256 bytes. The following flash routines disable interrupts:

CheckstartDisable IsPriorityAutostart ToFlash
CheckstartEnable NoAutostart ToMemory
ClearBootVectors SetBootVector ToXFlash
IsAutostart StorePages

The following routines disable interrupts and do not re-enable them:

Cold DISABLE_INTERRUPTS Warm

DISABLE_INTERRUPTS and its assembly language counterpart SEI explicitly set the I bit in the condition code register. The routines ENABLE_INTERRUPTS and the assembler mnemonic CLI clear the I bit to globally enable interrupts. The restart routines Cold and Warm disable interrupts to ensure that the initialization process is not interrupted.

 
This page is about: C Library Functions for HCS12 9S12 Microcontroller Hardware and Software Interfacing, C Header Files – C-language function library and software development routines for the GNU C (GCC) compiler, used with the PDQ Board Controller and its built-in RTOS (real time operating system). The PDQ Board is a low cost single board computer based on the Freescale 9S12 HCS12 microcontroller used in embedded systems, for instrument control and automation. Microcontroller C-language application programming and development
 
 
Navigation