![Silicon Laboratories Si4012 Programming Manual Download Page 22](http://html1.mh-extra.com/html/silicon-laboratories/si4012/si4012_programming-manual_1272046022.webp)
A N 7 4 6
22
Rev. 0.1
5.3. Common Software Modules
In the modules hierarchy the common software modules are located between the application and the hardware
layers. It is a set of interfaces that provides possibilities to be able to control various peripherals on modular HW
platforms. Registers can be initialized with pre-configured settings and peripherals can be enabled to start/stop
their own processing. The major tasks of these software modules are to initialize the hardware elements and
control its behaviors. The principle of their installation is to provide a façade for the upper layers. Functionally, the
User Application,
at the top of the hierarchy, can be independent of the hardware and its logical operation can
remain unchanged even if the hardware has been modified later. It can be adapted to any device without
encountering difficulties. All the modules in the following subsections except the human-machine interface module
are mainly responsible for handling the dedicated internal peripherals such as the IO, the timers, the SPI and the
PCA. The HMI holds them together so it gives a higher abstraction level to the
User Application
in form of handlers.
5.3.1. IO Control Module
The IO control related source files, called
control_IO.h
and
control_IO.c
, can be found in the
/src/drivers/
folder.
The module handles the port initializations for the physical HW platform e.g. LEDs, push-buttons, buzzer. It can set
the state of the LEDs and read the status of the selected push-buttons.
5.3.2. Programmable Counter Array Driver
The PCA related source files, called
pca.h
and
pca.c
, can be found in the
/src/driver/
folder. The module initializes
the PCA so as to create beeping sounds on the buzzer. The time-base source of the PCA counter can be selected.
Interrupts can be generated when the lower byte of the counter overflows. PWM-mod cycle length can be also
selected to modify the frequency of the tweeting sound.
void
vCio_InitIO
(
void
);
void
vCio_SetLed
(
U8
biLedNum);
void
vCio_ClearLed
(
U8
biLedNum);
BIT
gCio_GetPB
(
U8
biPbNum);
void
vPca_InitPcaTmr
(
U8
biPulseSelect,
U8
biPcaTmrItEnable,
U8
biCycleLengthSelect);
Summary of Contents for Si4012
Page 14: ...AN746 14 Rev 0 1...
Page 18: ...AN746 18 Rev 0 1...
Page 29: ...AN746 Rev 0 1 29 NOTES...