diff --git a/CHANGELOG.md b/CHANGELOG.md index a69ea5b9e9..b745848d15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ **Updates by date of commit:** ++ **[20230505](#20230505)** + **[20230428](#20230428)** + **[20230421](#20230421)** + **[20230413](#20230413)** @@ -46,6 +47,32 @@ --- --- +## `20230505` + +*Following click boards have been added:* + ++ `LED Driver 17` ++ `RS485 7` ++ `AWS IoT` ++ `Magnetic Rotary 5` + +*Following click boards have been updated:* + ++ `3D Hall 2` ++ `3G SARA` ++ `3G-EA` ++ `3G-AA` ++ `4x4 RGB` ++ `6DOF IMU 17` ++ `7-SEG RGB` ++ `AC Current` ++ `Accel 15` ++ `Accel 16` + +**[BACK TO TOP](#changelog)** + +--- + ## `20230428` *Following click boards have been added:* diff --git a/README.md b/README.md index f81b9203b6..cf673fc853 100644 --- a/README.md +++ b/README.md @@ -110,264 +110,265 @@ A full list of all clicks in this repository is defined below: | AudioAmp 5 click | [Click Here](./clicks/audioamp5) | AudioAmp 6 click | [Click Here](./clicks/audioamp6) | | AudioAmp 8 click | [Click Here](./clicks/audioamp8) | AudioAmp 9 click | [Click Here](./clicks/audioamp9) | | Audio DAC click | [Click Here](./clicks/audiodac) | AudioMUX click | [Click Here](./clicks/audiomux) | -| Audio Xover click | [Click Here](./clicks/audioxover) | Balancer 2 click | [Click Here](./clicks/balancer2) | -| Balancer 3 click | [Click Here](./clicks/balancer3) | Balancer 4 click | [Click Here](./clicks/balancer4) | -| Balancer 5 click | [Click Here](./clicks/balancer5) | Barcode click | [Click Here](./clicks/barcode) | -| Barcode 2 click | [Click Here](./clicks/barcode2) | BarGraph click | [Click Here](./clicks/bargraph) | -| Bargraph 2 click | [Click Here](./clicks/bargraph2) | BARGRAPH 3 click | [Click Here](./clicks/bargraph3) | -| BarGraph 4 click | [Click Here](./clicks/bargraph4) | Barometer click | [Click Here](./clicks/barometer) | -| Barometer 10 click | [Click Here](./clicks/barometer10) | Barometer 2 click | [Click Here](./clicks/barometer2) | -| Barometer 3 click | [Click Here](./clicks/barometer3) | Barometer 4 click | [Click Here](./clicks/barometer4) | -| Barometer 5 click | [Click Here](./clicks/barometer5) | Barometer 6 click | [Click Here](./clicks/barometer6) | -| Barometer 7 click | [Click Here](./clicks/barometer7) | Barometer 8 click | [Click Here](./clicks/barometer8) | -| BATT-MAN click | [Click Here](./clicks/battman) | BATT-MAN 2 click | [Click Here](./clicks/battman2) | -| BATT-MAN 3 click | [Click Here](./clicks/battman3) | BATT-MON click | [Click Here](./clicks/battmon) | -| BATT-MON 2 click | [Click Here](./clicks/battmon2) | BATT-MON 3 click | [Click Here](./clicks/battmon3) | -| BATT-MON 4 click | [Click Here](./clicks/battmon4) | BEE click | [Click Here](./clicks/bee) | -| BIG 7-SEG click | [Click Here](./clicks/big7seg) | BI HALL click | [Click Here](./clicks/bihall) | -| BLE 10 click | [Click Here](./clicks/ble10) | BLE 12 click | [Click Here](./clicks/ble12) | -| BLE 3 click | [Click Here](./clicks/ble3) | BLE 4 click | [Click Here](./clicks/ble4) | -| BLE 7 click | [Click Here](./clicks/ble7) | BLE 8 click | [Click Here](./clicks/ble8) | -| BLE 9 click | [Click Here](./clicks/ble9) | BLE TINY click | [Click Here](./clicks/bletiny) | -| BLE TX click | [Click Here](./clicks/bletx) | Bluetooth click | [Click Here](./clicks/bluetooth) | -| Bluetooth 2 click | [Click Here](./clicks/bluetooth2) | BOOST click | [Click Here](./clicks/boost) | -| Boost 2 click | [Click Here](./clicks/boost2) | Boost 3 click | [Click Here](./clicks/boost3) | -| Boost 4 click | [Click Here](./clicks/boost4) | Boost 6 click | [Click Here](./clicks/boost6) | -| Boost 7 click | [Click Here](./clicks/boost7) | Boost 8 click | [Click Here](./clicks/boost8) | -| Boost-INV click | [Click Here](./clicks/boostinv) | Boost-inv 2 click | [Click Here](./clicks/boostinv2) | -| Brushless click | [Click Here](./clicks/brushless) | Brushless 12 click | [Click Here](./clicks/brushless12) | -| Brushless 14 click | [Click Here](./clicks/brushless14) | Brushless 15 click | [Click Here](./clicks/brushless15) | -| Brushless 16 click | [Click Here](./clicks/brushless16) | Brushless 17 click | [Click Here](./clicks/brushless17) | -| Brushless 2 click | [Click Here](./clicks/brushless2) | Brushless 20 click | [Click Here](./clicks/brushless20) | -| Brushless 21 click | [Click Here](./clicks/brushless21) | Brushless 22 click | [Click Here](./clicks/brushless22) | -| Brushless 23 click | [Click Here](./clicks/brushless23) | Brushless 24 click | [Click Here](./clicks/brushless24) | -| Brushless 3 click | [Click Here](./clicks/brushless3) | Brushless 4 click | [Click Here](./clicks/brushless4) | -| Brushless 5 click | [Click Here](./clicks/brushless5) | Brushless 6 click | [Click Here](./clicks/brushless6) | -| Brushless 7 click | [Click Here](./clicks/brushless7) | Brushless 8 click | [Click Here](./clicks/brushless8) | -| Brushless 9 click | [Click Here](./clicks/brushless9) | BT click | [Click Here](./clicks/bt) | -| BT Audio click | [Click Here](./clicks/btaudio) | BT Audio 3 click | [Click Here](./clicks/btaudio3) | -| BT-EZ click | [Click Here](./clicks/btez) | BUCK click | [Click Here](./clicks/buck) | -| Buck 10 click | [Click Here](./clicks/buck10) | Buck 11 click | [Click Here](./clicks/buck11) | -| Buck 12 click | [Click Here](./clicks/buck12) | Buck 13 click | [Click Here](./clicks/buck13) | -| Buck 14 click | [Click Here](./clicks/buck14) | Buck 16 click | [Click Here](./clicks/buck16) | -| Buck 19 click | [Click Here](./clicks/buck19) | Buck 2 click | [Click Here](./clicks/buck2) | -| Buck 20 click | [Click Here](./clicks/buck20) | Buck 22 click | [Click Here](./clicks/buck22) | -| Buck 23 click | [Click Here](./clicks/buck23) | Buck 3 click | [Click Here](./clicks/buck3) | -| Buck 5 click | [Click Here](./clicks/buck5) | BUCK 6 click | [Click Here](./clicks/buck6) | -| BUCK 7 click | [Click Here](./clicks/buck7) | Buck 8 click | [Click Here](./clicks/buck8) | -| Buck 9 click | [Click Here](./clicks/buck9) | Buck-Boost click | [Click Here](./clicks/buckboost) | -| Buck Boost 2 click | [Click Here](./clicks/buckboost2) | Buck-Boost 3 click | [Click Here](./clicks/buckboost3) | -| Buck n Boost click | [Click Here](./clicks/bucknboost) | Button ALARM click | [Click Here](./clicks/buttonalarm) | -| Button G click | [Click Here](./clicks/buttong) | Button PLAY click | [Click Here](./clicks/buttonplay) | -| Button Power click | [Click Here](./clicks/buttonpower) | Button R click | [Click Here](./clicks/buttonr) | -| Button Y click | [Click Here](./clicks/buttony) | BUZZ click | [Click Here](./clicks/buzz) | -| BUZZ 2 click | [Click Here](./clicks/buzz2) | Buzz 3 click | [Click Here](./clicks/buzz3) | -| CAN Bus click | [Click Here](./clicks/canbus) | CAN FD click | [Click Here](./clicks/canfd) | -| CAN FD 2 click | [Click Here](./clicks/canfd2) | CAN FD 3 click | [Click Here](./clicks/canfd3) | -| CAN FD 4 click | [Click Here](./clicks/canfd4) | CAN FD 5 click | [Click Here](./clicks/canfd5) | -| CAN FD 6 click | [Click Here](./clicks/canfd6) | CAN Isolator click | [Click Here](./clicks/canisolator) | -| Cap Extend click | [Click Here](./clicks/capextend) | Cap Extend 3 click | [Click Here](./clicks/capextend3) | -| CapSense click | [Click Here](./clicks/capsense) | CapSense 2 click | [Click Here](./clicks/capsense2) | -| CAP Slider 2 click | [Click Here](./clicks/capslider2) | Cap Touch click | [Click Here](./clicks/captouch) | -| Cap Touch 2 click | [Click Here](./clicks/captouch2) | Cap Touch 5 click | [Click Here](./clicks/captouch5) | -| Cap Touch 6 click | [Click Here](./clicks/captouch6) | CAP WHEEL click | [Click Here](./clicks/capwheel) | -| Cap Wheel 2 click | [Click Here](./clicks/capwheel2) | ccRF 2 click | [Click Here](./clicks/ccrf2) | -| ccRF 3 click | [Click Here](./clicks/ccrf3) | Charger 11 click | [Click Here](./clicks/charger11) | -| CHARGER 12 click | [Click Here](./clicks/charger12) | Charger 13 click | [Click Here](./clicks/charger13) | -| Charger 16 click | [Click Here](./clicks/charger16) | Charger 18 click | [Click Here](./clicks/charger18) | -| Charger 2 click | [Click Here](./clicks/charger2) | Charger 23 click | [Click Here](./clicks/charger23) | -| Charger 3 click | [Click Here](./clicks/charger3) | Charger 5 click | [Click Here](./clicks/charger5) | -| Charger 6 click | [Click Here](./clicks/charger6) | Charger 8 click | [Click Here](./clicks/charger8) | -| Charger 9 click | [Click Here](./clicks/charger9) | Clock Gen click | [Click Here](./clicks/clockgen) | -| Clock Gen 2 click | [Click Here](./clicks/clockgen2) | Clock Gen 3 click | [Click Here](./clicks/clockgen3) | -| Clock Gen 4 click | [Click Here](./clicks/clockgen4) | Clock Gen 5 click | [Click Here](./clicks/clockgen5) | -| Clock Gen 6 click | [Click Here](./clicks/clockgen6) | CO click | [Click Here](./clicks/co) | -| CO2 click | [Click Here](./clicks/co2) | Color click | [Click Here](./clicks/color) | -| Color 10 click | [Click Here](./clicks/color10) | Color 13 click | [Click Here](./clicks/color13) | -| Color 14 click | [Click Here](./clicks/color14) | Color 15 click | [Click Here](./clicks/color15) | -| Color 16 click | [Click Here](./clicks/color16) | Color 2 click | [Click Here](./clicks/color2) | -| Color 3 click | [Click Here](./clicks/color3) | Color 4 click | [Click Here](./clicks/color4) | -| Color 6 click | [Click Here](./clicks/color6) | Color 7 click | [Click Here](./clicks/color7) | -| Color 8 click | [Click Here](./clicks/color8) | Color 9 click | [Click Here](./clicks/color9) | -| Comparator click | [Click Here](./clicks/comparator) | Compass click | [Click Here](./clicks/compass) | -| Compass 2 click | [Click Here](./clicks/compass2) | Compass 3 click | [Click Here](./clicks/compass3) | -| Compass 4 click | [Click Here](./clicks/compass4) | Compass 5 click | [Click Here](./clicks/compass5) | -| Compass 6 click | [Click Here](./clicks/compass6) | Compass 7 click | [Click Here](./clicks/compass7) | -| Counter click | [Click Here](./clicks/counter) | CO 2 click | [Click Here](./clicks/co_2) | -| Current click | [Click Here](./clicks/current) | Current 2 click | [Click Here](./clicks/current2) | -| Current 3 click | [Click Here](./clicks/current3) | Current 4 click | [Click Here](./clicks/current4) | -| Current 5 click | [Click Here](./clicks/current5) | Current 6 click | [Click Here](./clicks/current6) | -| Current 7 click | [Click Here](./clicks/current7) | Current 9 click | [Click Here](./clicks/current9) | -| Current Limit click | [Click Here](./clicks/currentlimit) | Current Limit 5 click | [Click Here](./clicks/currentlimit5) | -| Current Limit 6 click | [Click Here](./clicks/currentlimit6) | Current Limit 7 click | [Click Here](./clicks/currentlimit7) | -| CXPI click | [Click Here](./clicks/cxpi) | DAC click | [Click Here](./clicks/dac) | -| DAC 10 click | [Click Here](./clicks/dac10) | DAC 11 click | [Click Here](./clicks/dac11) | -| DAC 12 click | [Click Here](./clicks/dac12) | DAC 13 click | [Click Here](./clicks/dac13) | -| DAC 14 click | [Click Here](./clicks/dac14) | DAC 2 click | [Click Here](./clicks/dac2) | -| DAC 3 click | [Click Here](./clicks/dac3) | DAC 4 click | [Click Here](./clicks/dac4) | -| DAC 5 click | [Click Here](./clicks/dac5) | DAC 6 click | [Click Here](./clicks/dac6) | -| DAC 7 click | [Click Here](./clicks/dac7) | DAC 8 click | [Click Here](./clicks/dac8) | -| DAC 9 click | [Click Here](./clicks/dac9) | DAQ click | [Click Here](./clicks/daq) | -| DAQ 3 click | [Click Here](./clicks/daq3) | DC MOTOR click | [Click Here](./clicks/dcmotor) | -| DC Motor 10 click | [Click Here](./clicks/dcmotor10) | DC Motor 11 click | [Click Here](./clicks/dcmotor11) | -| DC Motor 12 click | [Click Here](./clicks/dcmotor12) | DC Motor 14 click | [Click Here](./clicks/dcmotor14) | -| DC Motor 15 click | [Click Here](./clicks/dcmotor15) | DC Motor 16 click | [Click Here](./clicks/dcmotor16) | -| DC Motor 17 click | [Click Here](./clicks/dcmotor17) | DC Motor 18 click | [Click Here](./clicks/dcmotor18) | -| DC Motor 19 click | [Click Here](./clicks/dcmotor19) | DC Motor 2 click | [Click Here](./clicks/dcmotor2) | -| DC Motor 20 click | [Click Here](./clicks/dcmotor20) | DC Motor 21 click | [Click Here](./clicks/dcmotor21) | -| DC Motor 22 click | [Click Here](./clicks/dcmotor22) | DC Motor 24 click | [Click Here](./clicks/dcmotor24) | -| DC Motor 25 click | [Click Here](./clicks/dcmotor25) | DC Motor 3 click | [Click Here](./clicks/dcmotor3) | -| DC Motor 4 click | [Click Here](./clicks/dcmotor4) | DC Motor 5 click | [Click Here](./clicks/dcmotor5) | -| DC Motor 6 click | [Click Here](./clicks/dcmotor6) | DC MOTOR 7 click | [Click Here](./clicks/dcmotor7) | -| DC Motor 8 click | [Click Here](./clicks/dcmotor8) | DC Motor 9 click | [Click Here](./clicks/dcmotor9) | -| DHT22 click | [Click Here](./clicks/dht22) | DHT22 2 click | [Click Here](./clicks/dht222) | -| Diff Press click | [Click Here](./clicks/diffpress) | Diff Press 2 click | [Click Here](./clicks/diffpress2) | -| Diff pressure click | [Click Here](./clicks/diffpressure) | DIGI POT click | [Click Here](./clicks/digipot) | -| DIGI POT 11 click | [Click Here](./clicks/digipot11) | DIGI POT 2 click | [Click Here](./clicks/digipot2) | -| DIGI POT 3 click | [Click Here](./clicks/digipot3) | Digi Pot 4 click | [Click Here](./clicks/digipot4) | -| DIGI POT 5 click | [Click Here](./clicks/digipot5) | DIGI POT 6 click | [Click Here](./clicks/digipot6) | -| DIGI POT 7 click | [Click Here](./clicks/digipot7) | DIGI POT 8 click | [Click Here](./clicks/digipot8) | -| DIGI POT 9 click | [Click Here](./clicks/digipot9) | DigiVref click | [Click Here](./clicks/digivref) | -| Dot Matrix R click | [Click Here](./clicks/dotmatrixr) | DRAM click | [Click Here](./clicks/dram) | -| Driver click | [Click Here](./clicks/driver) | Driver 2 click | [Click Here](./clicks/driver2) | -| DSP click | [Click Here](./clicks/dsp) | DTMF Decoder click | [Click Here](./clicks/dtmfdecoder) | -| DTMF Generator click | [Click Here](./clicks/dtmfgenerator) | Dual EE click | [Click Here](./clicks/dualee) | -| Dual LIN click | [Click Here](./clicks/duallin) | Earthquake click | [Click Here](./clicks/earthquake) | -| ECG click | [Click Here](./clicks/ecg) | ECG 2 click | [Click Here](./clicks/ecg2) | -| ECG 3 click | [Click Here](./clicks/ecg3) | ECG 4 click | [Click Here](./clicks/ecg4) | -| ECG 5 click | [Click Here](./clicks/ecg5) | Ecg 6 click | [Click Here](./clicks/ecg6) | -| ECG 7 click | [Click Here](./clicks/ecg7) | ECG GSR Click | [Click Here](./clicks/ecg_gsr) | -| EEG click | [Click Here](./clicks/eeg) | EEPROM click | [Click Here](./clicks/eeprom) | -| EEPROM 2 click | [Click Here](./clicks/eeprom2) | EEPROM 3 click | [Click Here](./clicks/eeprom3) | -| EEPROM 4 click | [Click Here](./clicks/eeprom4) | EEPROM 5 click | [Click Here](./clicks/eeprom5) | -| EEPROM 6 click | [Click Here](./clicks/eeprom6) | EEPROM 7 click | [Click Here](./clicks/eeprom7) | -| EEPROM 8 click | [Click Here](./clicks/eeprom8) | EEPROM 9 click | [Click Here](./clicks/eeprom9) | -| EERAM 2 click | [Click Here](./clicks/eeram2) | EERAM 3 click | [Click Here](./clicks/eeram3) | -| EERAM 3v3 click | [Click Here](./clicks/eeram3v3) | EERAM 5V click | [Click Here](./clicks/eeram5v) | -| eFuse click | [Click Here](./clicks/efuse) | eFuse 2 click | [Click Here](./clicks/efuse2) | -| e Fuse 3 click | [Click Here](./clicks/efuse3) | eFuse 4 click | [Click Here](./clicks/efuse4) | -| eFuse 5 click | [Click Here](./clicks/efuse5) | eINK 1.54 inch display | [Click Here](./clicks/eink154inch) | -| eINK 2.00 inch display | [Click Here](./clicks/eink200inch) | eINK 2.13 inch display | [Click Here](./clicks/eink213inch) | -| eINK 2.90 inch display | [Click Here](./clicks/eink290inch) | EMG click | [Click Here](./clicks/emg) | -| EnOcean click | [Click Here](./clicks/enocean) | EnOcean 2 click | [Click Here](./clicks/enocean2) | -| EnOcean 3 click | [Click Here](./clicks/enocean3) | EnOcean 4 click | [Click Here](./clicks/enocean4) | -| Environment click | [Click Here](./clicks/environment) | Environment 2 click | [Click Here](./clicks/environment2) | -| Environment 3 click | [Click Here](./clicks/environment3) | Environment 4 click | [Click Here](./clicks/environment4) | -| EVC click | [Click Here](./clicks/evc) | Excelon LP click | [Click Here](./clicks/excelonlp) | -| Excelon-Ultra click | [Click Here](./clicks/excelonultra) | Expand click | [Click Here](./clicks/expand) | -| Expand 10 click | [Click Here](./clicks/expand10) | Expand 11 click | [Click Here](./clicks/expand11) | -| Expand 12 click | [Click Here](./clicks/expand12) | Expand 13 click | [Click Here](./clicks/expand13) | -| Expand 14 click | [Click Here](./clicks/expand14) | Expand 15 click | [Click Here](./clicks/expand15) | -| Expand 2 click | [Click Here](./clicks/expand2) | Expand 4 click | [Click Here](./clicks/expand4) | -| Expand 5 click | [Click Here](./clicks/expand5) | Expand 6 click | [Click Here](./clicks/expand6) | -| Expand 7 click | [Click Here](./clicks/expand7) | Expand 8 click | [Click Here](./clicks/expand8) | -| Expand 9 click | [Click Here](./clicks/expand9) | Fan click | [Click Here](./clicks/fan) | -| Fan 2 click | [Click Here](./clicks/fan2) | Fan 3 click | [Click Here](./clicks/fan3) | -| FAN 4 click | [Click Here](./clicks/fan4) | Fan 5 click | [Click Here](./clicks/fan5) | -| Fan 6 click | [Click Here](./clicks/fan6) | FAN 8 click | [Click Here](./clicks/fan8) | -| Fever click | [Click Here](./clicks/fever) | Fiber Opt click | [Click Here](./clicks/fiberopt) | -| Fingerprint 2 click | [Click Here](./clicks/fingerprint2) | Fingerprint 3 click | [Click Here](./clicks/fingerprint3) | -| Fingerprint 4 click | [Click Here](./clicks/fingerprint4) | FLAME click | [Click Here](./clicks/flame) | -| Flash click | [Click Here](./clicks/flash) | Flash 10 click | [Click Here](./clicks/flash10) | -| Flash 2 click | [Click Here](./clicks/flash2) | Flash 3 click | [Click Here](./clicks/flash3) | -| Flash 4 click | [Click Here](./clicks/flash4) | Flash 5 click | [Click Here](./clicks/flash5) | -| Flash 6 click | [Click Here](./clicks/flash6) | Flash 7 click | [Click Here](./clicks/flash7) | -| Flash 8 click | [Click Here](./clicks/flash8) | Flash 9 click | [Click Here](./clicks/flash9) | -| Flicker click | [Click Here](./clicks/flicker) | FM click | [Click Here](./clicks/fm) | -| Force click | [Click Here](./clicks/force) | Force 2 click | [Click Here](./clicks/force2) | -| Force 3 click | [Click Here](./clicks/force3) | Force 4 click | [Click Here](./clicks/force4) | -| Force 5 click | [Click Here](./clicks/force5) | Fram click | [Click Here](./clicks/fram) | -| FRAM 2 click | [Click Here](./clicks/fram2) | FRAM 3 click | [Click Here](./clicks/fram3) | -| FRAM 5 click | [Click Here](./clicks/fram5) | FRAM 6 click | [Click Here](./clicks/fram6) | -| FT click | [Click Here](./clicks/ft) | G2C click | [Click Here](./clicks/g2c) | -| G2C 3G click | [Click Here](./clicks/g2c3g) | GainAMP click | [Click Here](./clicks/gainamp) | -| GainAMP 2 click | [Click Here](./clicks/gainamp2) | GainAMP 3 click | [Click Here](./clicks/gainamp3) | -| Gaussmeter click | [Click Here](./clicks/gaussmeter) | GeoMagnetic click | [Click Here](./clicks/geomagnetic) | -| GMR Angle click | [Click Here](./clicks/gmrangle) | GNSS click | [Click Here](./clicks/gnss) | -| GNSS 10 click | [Click Here](./clicks/gnss10) | GNSS 12 click | [Click Here](./clicks/gnss12) | -| GNSS 13 click | [Click Here](./clicks/gnss13) | GNSS 2 click | [Click Here](./clicks/gnss2) | -| GNSS3 click | [Click Here](./clicks/gnss3) | GNSS4 click | [Click Here](./clicks/gnss4) | -| GNSS 5 click | [Click Here](./clicks/gnss5) | GNSS 7 click | [Click Here](./clicks/gnss7) | -| GNSS 8 click | [Click Here](./clicks/gnss8) | GNSS MAX click | [Click Here](./clicks/gnssmax) | -| GNSS RTK click | [Click Here](./clicks/gnssrtk) | GNSS RTK 2 click | [Click Here](./clicks/gnssrtk2) | -| GNSS ZOE click | [Click Here](./clicks/gnsszoe) | GPS click | [Click Here](./clicks/gps) | -| GPS 3 click | [Click Here](./clicks/gps3) | GPS 4 click | [Click Here](./clicks/gps4) | -| GPS 5 click | [Click Here](./clicks/gps5) | GPS 6 click | [Click Here](./clicks/gps6) | -| Grid-Eye click | [Click Here](./clicks/grideye) | GSM click | [Click Here](./clicks/gsm) | -| GSM 2 click | [Click Here](./clicks/gsm2) | GSM 3 click | [Click Here](./clicks/gsm3) | -| GSM 4 click | [Click Here](./clicks/gsm4) | GSM 5 click | [Click Here](./clicks/gsm5) | -| GSM/GNSS click | [Click Here](./clicks/gsmgnss) | GSM/GNSS 2 click | [Click Here](./clicks/gsmgnss2) | -| GSM-GPS click | [Click Here](./clicks/gsmgps) | GSR click | [Click Here](./clicks/gsr) | -| Gyro click | [Click Here](./clicks/gyro) | Gyro 2 click | [Click Here](./clicks/gyro2) | -| Gyro 3 click | [Click Here](./clicks/gyro3) | Gyro 4 click | [Click Here](./clicks/gyro4) | -| Gyro 5 click | [Click Here](./clicks/gyro5) | Gyro 6 click | [Click Here](./clicks/gyro6) | -| Gyro 7 click | [Click Here](./clicks/gyro7) | Gyro 8 click | [Click Here](./clicks/gyro8) | -| Hall Current click | [Click Here](./clicks/hallcurrent) | Hall Current 10 click | [Click Here](./clicks/hallcurrent10) | -| Hall Current 11 click | [Click Here](./clicks/hallcurrent11) | Hall Current 12 click | [Click Here](./clicks/hallcurrent12) | -| Hall Current 13 click | [Click Here](./clicks/hallcurrent13) | Hall Current 14 click | [Click Here](./clicks/hallcurrent14) | -| Hall Current 15 click | [Click Here](./clicks/hallcurrent15) | Hall Current 2 click | [Click Here](./clicks/hallcurrent2) | -| Hall Current 3 click | [Click Here](./clicks/hallcurrent3) | Hall Current 4 click | [Click Here](./clicks/hallcurrent4) | -| Hall Current 5 click | [Click Here](./clicks/hallcurrent5) | Hall Current 6 click | [Click Here](./clicks/hallcurrent6) | -| Hall Current 7 click | [Click Here](./clicks/hallcurrent7) | Hall Current 8 120A click | [Click Here](./clicks/hallcurrent8120a) | -| Hall Current 8 25A click | [Click Here](./clicks/hallcurrent825a) | Hall Current 9 click | [Click Here](./clicks/hallcurrent9) | -| Hall Switch click | [Click Here](./clicks/hallswitch) | Hall Switch 2 click | [Click Here](./clicks/hallswitch2) | -| HAPTIC click | [Click Here](./clicks/haptic) | HAPTIC 2 click | [Click Here](./clicks/haptic2) | -| HAPTIC 3 click | [Click Here](./clicks/haptic3) | H-Bridge 10 click | [Click Here](./clicks/hbridge10) | -| H-Bridge 11 click | [Click Here](./clicks/hbridge11) | H-Bridge 2 click | [Click Here](./clicks/hbridge2) | -| H-Bridge 3 click | [Click Here](./clicks/hbridge3) | H-Bridge 4 click | [Click Here](./clicks/hbridge4) | -| H-Bridge 5 click | [Click Here](./clicks/hbridge5) | H-Bridge 6 click | [Click Here](./clicks/hbridge6) | -| H-Bridge 7 click | [Click Here](./clicks/hbridge7) | H-Bridge 8 click | [Click Here](./clicks/hbridge8) | -| H-Bridge 9 click | [Click Here](./clicks/hbridge9) | H-Bridge Driver click | [Click Here](./clicks/hbridgedriver) | -| H-Bridge Driver 2 click | [Click Here](./clicks/hbridgedriver2) | HDC1000 click | [Click Here](./clicks/hdc1000) | -| Headphone AMP click | [Click Here](./clicks/headphoneamp) | Heart Rate click | [Click Here](./clicks/heartrate) | -| Heart Rate 10 click | [Click Here](./clicks/heartrate10) | Heart Rate 11 click | [Click Here](./clicks/heartrate11) | -| Heart Rate 2 click | [Click Here](./clicks/heartrate2) | Heart rate 3 click | [Click Here](./clicks/heartrate3) | -| Heart rate 4 click | [Click Here](./clicks/heartrate4) | Heart Rate 5 click | [Click Here](./clicks/heartrate5) | -| Heart rate 6 click | [Click Here](./clicks/heartrate6) | Heart Rate 7 click | [Click Here](./clicks/heartrate7) | -| Heart Rate 8 click | [Click Here](./clicks/heartrate8) | Heart Rate 9 click | [Click Here](./clicks/heartrate9) | -| Heater click | [Click Here](./clicks/heater) | HTU21D click | [Click Here](./clicks/htu21d) | -| Humidity click | [Click Here](./clicks/humidity) | HVAC click | [Click Here](./clicks/hvac) | -| HW Monitor click | [Click Here](./clicks/hwmonitor) | Hydrogen click | [Click Here](./clicks/hydrogen) | -| Hydro Probe click | [Click Here](./clicks/hydroprobe) | Hz to V click | [Click Here](./clicks/hztov) | -| HZ to V 2 click | [Click Here](./clicks/hztov2) | I2C 1-Wire click | [Click Here](./clicks/i2c1wire) | -| I2C Extend click | [Click Here](./clicks/i2cextend) | I2C Extend 2 click | [Click Here](./clicks/i2cextend2) | -| I2C isolator click | [Click Here](./clicks/i2cisolator) | I2C Isolator 2 click | [Click Here](./clicks/i2cisolator2) | -| I2C Isolator 3 click | [Click Here](./clicks/i2cisolator3) | I2C Isolator 4 click | [Click Here](./clicks/i2cisolator4) | -| I2C Isolator 6 click | [Click Here](./clicks/i2cisolator6) | I2C MUX click | [Click Here](./clicks/i2cmux) | -| I2C MUX 2 click | [Click Here](./clicks/i2cmux2) | I2C MUX 3 click | [Click Here](./clicks/i2cmux3) | -| I2C MUX 4 click | [Click Here](./clicks/i2cmux4) | I2C MUX 5 click | [Click Here](./clicks/i2cmux5) | -| I2C MUX 6 click | [Click Here](./clicks/i2cmux6) | I2C MUX 7 click | [Click Here](./clicks/i2cmux7) | -| I2C to CAN click | [Click Here](./clicks/i2ctocan) | I2C to SPI click | [Click Here](./clicks/i2ctospi) | -| Illuminance click | [Click Here](./clicks/illuminance) | Inclinometer click | [Click Here](./clicks/inclinometer) | -| Inclinometer 2 click | [Click Here](./clicks/inclinometer2) | Index Counter click | [Click Here](./clicks/indexcounter) | -| iqRF click | [Click Here](./clicks/iqrf) | iqRF 2 click | [Click Here](./clicks/iqrf2) | -| IR click | [Click Here](./clicks/ir) | IR 2 click | [Click Here](./clicks/ir2) | -| IR Beacon click | [Click Here](./clicks/irbeacon) | IrDA 2 click | [Click Here](./clicks/irda2) | -| IrDA 3 click | [Click Here](./clicks/irda3) | IR distance click | [Click Here](./clicks/irdistance) | -| Ir Eclipse click | [Click Here](./clicks/ireclipse) | IR Gesture click | [Click Here](./clicks/irgesture) | -| IR Gesture 2 click | [Click Here](./clicks/irgesture2) | IR Grid click | [Click Here](./clicks/irgrid) | -| IR Grid 2 click | [Click Here](./clicks/irgrid2) | IR Grid 3 click | [Click Here](./clicks/irgrid3) | -| IRNSS click | [Click Here](./clicks/irnss) | IR reflect click | [Click Here](./clicks/irreflect) | -| IR SENSE click | [Click Here](./clicks/irsense) | IR Sense 2 click | [Click Here](./clicks/irsense2) | -| IR Sense 3 click | [Click Here](./clicks/irsense3) | IrThermo 2 click | [Click Here](./clicks/irthermo2) | -| IrThermo 3 click | [Click Here](./clicks/irthermo3) | IrThermo 3V3 click | [Click Here](./clicks/irthermo3v3) | -| IrThermo 5V click | [Click Here](./clicks/irthermo5v) | ISM click | [Click Here](./clicks/ism) | -| ISM RX click | [Click Here](./clicks/ismrx) | ISM RX 2 click | [Click Here](./clicks/ismrx2) | -| ISM RX 3 click | [Click Here](./clicks/ismrx3) | ISM TX click | [Click Here](./clicks/ismtx) | -| ISO 9141 click | [Click Here](./clicks/iso9141) | ISO ADC 2 click | [Click Here](./clicks/isoadc2) | -| ISO ADC 3 click | [Click Here](./clicks/isoadc3) | ISO ADC 5 click | [Click Here](./clicks/isoadc5) | -| Joystick click | [Click Here](./clicks/joystick) | Joystick 2 click | [Click Here](./clicks/joystick2) | -| Joystick 3 click | [Click Here](./clicks/joystick3) | Keylock click | [Click Here](./clicks/keylock) | -| Key Lock 2 click | [Click Here](./clicks/keylock2) | Knob click | [Click Here](./clicks/knob) | -| LBAND RTK click | [Click Here](./clicks/lbandrtk) | LCD mini click | [Click Here](./clicks/lcdmini) | -| LCD Mono click | [Click Here](./clicks/lcdmono) | LDC click | [Click Here](./clicks/ldc) | -| LDC 1000 click | [Click Here](./clicks/ldc1000) | LDC 1101 click | [Click Here](./clicks/ldc1101) | -| LDC 2 click | [Click Here](./clicks/ldc2) | LDC Touch click | [Click Here](./clicks/ldctouch) | -| LDO click | [Click Here](./clicks/ldo) | LED DRIVER click | [Click Here](./clicks/leddriver) | -| LED Driver 10 click | [Click Here](./clicks/leddriver10) | LED Driver 11 click | [Click Here](./clicks/leddriver11) | -| LED Driver 12 click | [Click Here](./clicks/leddriver12) | LED Driver 13 click | [Click Here](./clicks/leddriver13) | -| LED Driver 14 click | [Click Here](./clicks/leddriver14) | LED Driver 15 click | [Click Here](./clicks/leddriver15) | -| LED Driver 16 click | [Click Here](./clicks/leddriver16) | LED Driver 18 click | [Click Here](./clicks/leddriver18) | +| Audio Xover click | [Click Here](./clicks/audioxover) | AWS IoT click | [Click Here](./clicks/awsiot) | +| Balancer 2 click | [Click Here](./clicks/balancer2) | Balancer 3 click | [Click Here](./clicks/balancer3) | +| Balancer 4 click | [Click Here](./clicks/balancer4) | Balancer 5 click | [Click Here](./clicks/balancer5) | +| Barcode click | [Click Here](./clicks/barcode) | Barcode 2 click | [Click Here](./clicks/barcode2) | +| BarGraph click | [Click Here](./clicks/bargraph) | Bargraph 2 click | [Click Here](./clicks/bargraph2) | +| BARGRAPH 3 click | [Click Here](./clicks/bargraph3) | BarGraph 4 click | [Click Here](./clicks/bargraph4) | +| Barometer click | [Click Here](./clicks/barometer) | Barometer 10 click | [Click Here](./clicks/barometer10) | +| Barometer 2 click | [Click Here](./clicks/barometer2) | Barometer 3 click | [Click Here](./clicks/barometer3) | +| Barometer 4 click | [Click Here](./clicks/barometer4) | Barometer 5 click | [Click Here](./clicks/barometer5) | +| Barometer 6 click | [Click Here](./clicks/barometer6) | Barometer 7 click | [Click Here](./clicks/barometer7) | +| Barometer 8 click | [Click Here](./clicks/barometer8) | BATT-MAN click | [Click Here](./clicks/battman) | +| BATT-MAN 2 click | [Click Here](./clicks/battman2) | BATT-MAN 3 click | [Click Here](./clicks/battman3) | +| BATT-MON click | [Click Here](./clicks/battmon) | BATT-MON 2 click | [Click Here](./clicks/battmon2) | +| BATT-MON 3 click | [Click Here](./clicks/battmon3) | BATT-MON 4 click | [Click Here](./clicks/battmon4) | +| BEE click | [Click Here](./clicks/bee) | BIG 7-SEG click | [Click Here](./clicks/big7seg) | +| BI HALL click | [Click Here](./clicks/bihall) | BLE 10 click | [Click Here](./clicks/ble10) | +| BLE 12 click | [Click Here](./clicks/ble12) | BLE 3 click | [Click Here](./clicks/ble3) | +| BLE 4 click | [Click Here](./clicks/ble4) | BLE 7 click | [Click Here](./clicks/ble7) | +| BLE 8 click | [Click Here](./clicks/ble8) | BLE 9 click | [Click Here](./clicks/ble9) | +| BLE TINY click | [Click Here](./clicks/bletiny) | BLE TX click | [Click Here](./clicks/bletx) | +| Bluetooth click | [Click Here](./clicks/bluetooth) | Bluetooth 2 click | [Click Here](./clicks/bluetooth2) | +| BOOST click | [Click Here](./clicks/boost) | Boost 2 click | [Click Here](./clicks/boost2) | +| Boost 3 click | [Click Here](./clicks/boost3) | Boost 4 click | [Click Here](./clicks/boost4) | +| Boost 6 click | [Click Here](./clicks/boost6) | Boost 7 click | [Click Here](./clicks/boost7) | +| Boost 8 click | [Click Here](./clicks/boost8) | Boost-INV click | [Click Here](./clicks/boostinv) | +| Boost-inv 2 click | [Click Here](./clicks/boostinv2) | Brushless click | [Click Here](./clicks/brushless) | +| Brushless 12 click | [Click Here](./clicks/brushless12) | Brushless 14 click | [Click Here](./clicks/brushless14) | +| Brushless 15 click | [Click Here](./clicks/brushless15) | Brushless 16 click | [Click Here](./clicks/brushless16) | +| Brushless 17 click | [Click Here](./clicks/brushless17) | Brushless 2 click | [Click Here](./clicks/brushless2) | +| Brushless 20 click | [Click Here](./clicks/brushless20) | Brushless 21 click | [Click Here](./clicks/brushless21) | +| Brushless 22 click | [Click Here](./clicks/brushless22) | Brushless 23 click | [Click Here](./clicks/brushless23) | +| Brushless 24 click | [Click Here](./clicks/brushless24) | Brushless 3 click | [Click Here](./clicks/brushless3) | +| Brushless 4 click | [Click Here](./clicks/brushless4) | Brushless 5 click | [Click Here](./clicks/brushless5) | +| Brushless 6 click | [Click Here](./clicks/brushless6) | Brushless 7 click | [Click Here](./clicks/brushless7) | +| Brushless 8 click | [Click Here](./clicks/brushless8) | Brushless 9 click | [Click Here](./clicks/brushless9) | +| BT click | [Click Here](./clicks/bt) | BT Audio click | [Click Here](./clicks/btaudio) | +| BT Audio 3 click | [Click Here](./clicks/btaudio3) | BT-EZ click | [Click Here](./clicks/btez) | +| BUCK click | [Click Here](./clicks/buck) | Buck 10 click | [Click Here](./clicks/buck10) | +| Buck 11 click | [Click Here](./clicks/buck11) | Buck 12 click | [Click Here](./clicks/buck12) | +| Buck 13 click | [Click Here](./clicks/buck13) | Buck 14 click | [Click Here](./clicks/buck14) | +| Buck 16 click | [Click Here](./clicks/buck16) | Buck 19 click | [Click Here](./clicks/buck19) | +| Buck 2 click | [Click Here](./clicks/buck2) | Buck 20 click | [Click Here](./clicks/buck20) | +| Buck 22 click | [Click Here](./clicks/buck22) | Buck 23 click | [Click Here](./clicks/buck23) | +| Buck 3 click | [Click Here](./clicks/buck3) | Buck 5 click | [Click Here](./clicks/buck5) | +| BUCK 6 click | [Click Here](./clicks/buck6) | BUCK 7 click | [Click Here](./clicks/buck7) | +| Buck 8 click | [Click Here](./clicks/buck8) | Buck 9 click | [Click Here](./clicks/buck9) | +| Buck-Boost click | [Click Here](./clicks/buckboost) | Buck Boost 2 click | [Click Here](./clicks/buckboost2) | +| Buck-Boost 3 click | [Click Here](./clicks/buckboost3) | Buck n Boost click | [Click Here](./clicks/bucknboost) | +| Button ALARM click | [Click Here](./clicks/buttonalarm) | Button G click | [Click Here](./clicks/buttong) | +| Button PLAY click | [Click Here](./clicks/buttonplay) | Button Power click | [Click Here](./clicks/buttonpower) | +| Button R click | [Click Here](./clicks/buttonr) | Button Y click | [Click Here](./clicks/buttony) | +| BUZZ click | [Click Here](./clicks/buzz) | BUZZ 2 click | [Click Here](./clicks/buzz2) | +| Buzz 3 click | [Click Here](./clicks/buzz3) | CAN Bus click | [Click Here](./clicks/canbus) | +| CAN FD click | [Click Here](./clicks/canfd) | CAN FD 2 click | [Click Here](./clicks/canfd2) | +| CAN FD 3 click | [Click Here](./clicks/canfd3) | CAN FD 4 click | [Click Here](./clicks/canfd4) | +| CAN FD 5 click | [Click Here](./clicks/canfd5) | CAN FD 6 click | [Click Here](./clicks/canfd6) | +| CAN Isolator click | [Click Here](./clicks/canisolator) | Cap Extend click | [Click Here](./clicks/capextend) | +| Cap Extend 3 click | [Click Here](./clicks/capextend3) | CapSense click | [Click Here](./clicks/capsense) | +| CapSense 2 click | [Click Here](./clicks/capsense2) | CAP Slider 2 click | [Click Here](./clicks/capslider2) | +| Cap Touch click | [Click Here](./clicks/captouch) | Cap Touch 2 click | [Click Here](./clicks/captouch2) | +| Cap Touch 5 click | [Click Here](./clicks/captouch5) | Cap Touch 6 click | [Click Here](./clicks/captouch6) | +| CAP WHEEL click | [Click Here](./clicks/capwheel) | Cap Wheel 2 click | [Click Here](./clicks/capwheel2) | +| ccRF 2 click | [Click Here](./clicks/ccrf2) | ccRF 3 click | [Click Here](./clicks/ccrf3) | +| Charger 11 click | [Click Here](./clicks/charger11) | CHARGER 12 click | [Click Here](./clicks/charger12) | +| Charger 13 click | [Click Here](./clicks/charger13) | Charger 16 click | [Click Here](./clicks/charger16) | +| Charger 18 click | [Click Here](./clicks/charger18) | Charger 2 click | [Click Here](./clicks/charger2) | +| Charger 23 click | [Click Here](./clicks/charger23) | Charger 3 click | [Click Here](./clicks/charger3) | +| Charger 5 click | [Click Here](./clicks/charger5) | Charger 6 click | [Click Here](./clicks/charger6) | +| Charger 8 click | [Click Here](./clicks/charger8) | Charger 9 click | [Click Here](./clicks/charger9) | +| Clock Gen click | [Click Here](./clicks/clockgen) | Clock Gen 2 click | [Click Here](./clicks/clockgen2) | +| Clock Gen 3 click | [Click Here](./clicks/clockgen3) | Clock Gen 4 click | [Click Here](./clicks/clockgen4) | +| Clock Gen 5 click | [Click Here](./clicks/clockgen5) | Clock Gen 6 click | [Click Here](./clicks/clockgen6) | +| CO click | [Click Here](./clicks/co) | CO2 click | [Click Here](./clicks/co2) | +| Color click | [Click Here](./clicks/color) | Color 10 click | [Click Here](./clicks/color10) | +| Color 13 click | [Click Here](./clicks/color13) | Color 14 click | [Click Here](./clicks/color14) | +| Color 15 click | [Click Here](./clicks/color15) | Color 16 click | [Click Here](./clicks/color16) | +| Color 2 click | [Click Here](./clicks/color2) | Color 3 click | [Click Here](./clicks/color3) | +| Color 4 click | [Click Here](./clicks/color4) | Color 6 click | [Click Here](./clicks/color6) | +| Color 7 click | [Click Here](./clicks/color7) | Color 8 click | [Click Here](./clicks/color8) | +| Color 9 click | [Click Here](./clicks/color9) | Comparator click | [Click Here](./clicks/comparator) | +| Compass click | [Click Here](./clicks/compass) | Compass 2 click | [Click Here](./clicks/compass2) | +| Compass 3 click | [Click Here](./clicks/compass3) | Compass 4 click | [Click Here](./clicks/compass4) | +| Compass 5 click | [Click Here](./clicks/compass5) | Compass 6 click | [Click Here](./clicks/compass6) | +| Compass 7 click | [Click Here](./clicks/compass7) | Counter click | [Click Here](./clicks/counter) | +| CO 2 click | [Click Here](./clicks/co_2) | Current click | [Click Here](./clicks/current) | +| Current 2 click | [Click Here](./clicks/current2) | Current 3 click | [Click Here](./clicks/current3) | +| Current 4 click | [Click Here](./clicks/current4) | Current 5 click | [Click Here](./clicks/current5) | +| Current 6 click | [Click Here](./clicks/current6) | Current 7 click | [Click Here](./clicks/current7) | +| Current 9 click | [Click Here](./clicks/current9) | Current Limit click | [Click Here](./clicks/currentlimit) | +| Current Limit 5 click | [Click Here](./clicks/currentlimit5) | Current Limit 6 click | [Click Here](./clicks/currentlimit6) | +| Current Limit 7 click | [Click Here](./clicks/currentlimit7) | CXPI click | [Click Here](./clicks/cxpi) | +| DAC click | [Click Here](./clicks/dac) | DAC 10 click | [Click Here](./clicks/dac10) | +| DAC 11 click | [Click Here](./clicks/dac11) | DAC 12 click | [Click Here](./clicks/dac12) | +| DAC 13 click | [Click Here](./clicks/dac13) | DAC 14 click | [Click Here](./clicks/dac14) | +| DAC 2 click | [Click Here](./clicks/dac2) | DAC 3 click | [Click Here](./clicks/dac3) | +| DAC 4 click | [Click Here](./clicks/dac4) | DAC 5 click | [Click Here](./clicks/dac5) | +| DAC 6 click | [Click Here](./clicks/dac6) | DAC 7 click | [Click Here](./clicks/dac7) | +| DAC 8 click | [Click Here](./clicks/dac8) | DAC 9 click | [Click Here](./clicks/dac9) | +| DAQ click | [Click Here](./clicks/daq) | DAQ 3 click | [Click Here](./clicks/daq3) | +| DC MOTOR click | [Click Here](./clicks/dcmotor) | DC Motor 10 click | [Click Here](./clicks/dcmotor10) | +| DC Motor 11 click | [Click Here](./clicks/dcmotor11) | DC Motor 12 click | [Click Here](./clicks/dcmotor12) | +| DC Motor 14 click | [Click Here](./clicks/dcmotor14) | DC Motor 15 click | [Click Here](./clicks/dcmotor15) | +| DC Motor 16 click | [Click Here](./clicks/dcmotor16) | DC Motor 17 click | [Click Here](./clicks/dcmotor17) | +| DC Motor 18 click | [Click Here](./clicks/dcmotor18) | DC Motor 19 click | [Click Here](./clicks/dcmotor19) | +| DC Motor 2 click | [Click Here](./clicks/dcmotor2) | DC Motor 20 click | [Click Here](./clicks/dcmotor20) | +| DC Motor 21 click | [Click Here](./clicks/dcmotor21) | DC Motor 22 click | [Click Here](./clicks/dcmotor22) | +| DC Motor 24 click | [Click Here](./clicks/dcmotor24) | DC Motor 25 click | [Click Here](./clicks/dcmotor25) | +| DC Motor 3 click | [Click Here](./clicks/dcmotor3) | DC Motor 4 click | [Click Here](./clicks/dcmotor4) | +| DC Motor 5 click | [Click Here](./clicks/dcmotor5) | DC Motor 6 click | [Click Here](./clicks/dcmotor6) | +| DC MOTOR 7 click | [Click Here](./clicks/dcmotor7) | DC Motor 8 click | [Click Here](./clicks/dcmotor8) | +| DC Motor 9 click | [Click Here](./clicks/dcmotor9) | DHT22 click | [Click Here](./clicks/dht22) | +| DHT22 2 click | [Click Here](./clicks/dht222) | Diff Press click | [Click Here](./clicks/diffpress) | +| Diff Press 2 click | [Click Here](./clicks/diffpress2) | Diff pressure click | [Click Here](./clicks/diffpressure) | +| DIGI POT click | [Click Here](./clicks/digipot) | DIGI POT 11 click | [Click Here](./clicks/digipot11) | +| DIGI POT 2 click | [Click Here](./clicks/digipot2) | DIGI POT 3 click | [Click Here](./clicks/digipot3) | +| Digi Pot 4 click | [Click Here](./clicks/digipot4) | DIGI POT 5 click | [Click Here](./clicks/digipot5) | +| DIGI POT 6 click | [Click Here](./clicks/digipot6) | DIGI POT 7 click | [Click Here](./clicks/digipot7) | +| DIGI POT 8 click | [Click Here](./clicks/digipot8) | DIGI POT 9 click | [Click Here](./clicks/digipot9) | +| DigiVref click | [Click Here](./clicks/digivref) | Dot Matrix R click | [Click Here](./clicks/dotmatrixr) | +| DRAM click | [Click Here](./clicks/dram) | Driver click | [Click Here](./clicks/driver) | +| Driver 2 click | [Click Here](./clicks/driver2) | DSP click | [Click Here](./clicks/dsp) | +| DTMF Decoder click | [Click Here](./clicks/dtmfdecoder) | DTMF Generator click | [Click Here](./clicks/dtmfgenerator) | +| Dual EE click | [Click Here](./clicks/dualee) | Dual LIN click | [Click Here](./clicks/duallin) | +| Earthquake click | [Click Here](./clicks/earthquake) | ECG click | [Click Here](./clicks/ecg) | +| ECG 2 click | [Click Here](./clicks/ecg2) | ECG 3 click | [Click Here](./clicks/ecg3) | +| ECG 4 click | [Click Here](./clicks/ecg4) | ECG 5 click | [Click Here](./clicks/ecg5) | +| Ecg 6 click | [Click Here](./clicks/ecg6) | ECG 7 click | [Click Here](./clicks/ecg7) | +| ECG GSR Click | [Click Here](./clicks/ecg_gsr) | EEG click | [Click Here](./clicks/eeg) | +| EEPROM click | [Click Here](./clicks/eeprom) | EEPROM 2 click | [Click Here](./clicks/eeprom2) | +| EEPROM 3 click | [Click Here](./clicks/eeprom3) | EEPROM 4 click | [Click Here](./clicks/eeprom4) | +| EEPROM 5 click | [Click Here](./clicks/eeprom5) | EEPROM 6 click | [Click Here](./clicks/eeprom6) | +| EEPROM 7 click | [Click Here](./clicks/eeprom7) | EEPROM 8 click | [Click Here](./clicks/eeprom8) | +| EEPROM 9 click | [Click Here](./clicks/eeprom9) | EERAM 2 click | [Click Here](./clicks/eeram2) | +| EERAM 3 click | [Click Here](./clicks/eeram3) | EERAM 3v3 click | [Click Here](./clicks/eeram3v3) | +| EERAM 5V click | [Click Here](./clicks/eeram5v) | eFuse click | [Click Here](./clicks/efuse) | +| eFuse 2 click | [Click Here](./clicks/efuse2) | e Fuse 3 click | [Click Here](./clicks/efuse3) | +| eFuse 4 click | [Click Here](./clicks/efuse4) | eFuse 5 click | [Click Here](./clicks/efuse5) | +| eINK 1.54 inch display | [Click Here](./clicks/eink154inch) | eINK 2.00 inch display | [Click Here](./clicks/eink200inch) | +| eINK 2.13 inch display | [Click Here](./clicks/eink213inch) | eINK 2.90 inch display | [Click Here](./clicks/eink290inch) | +| EMG click | [Click Here](./clicks/emg) | EnOcean click | [Click Here](./clicks/enocean) | +| EnOcean 2 click | [Click Here](./clicks/enocean2) | EnOcean 3 click | [Click Here](./clicks/enocean3) | +| EnOcean 4 click | [Click Here](./clicks/enocean4) | Environment click | [Click Here](./clicks/environment) | +| Environment 2 click | [Click Here](./clicks/environment2) | Environment 3 click | [Click Here](./clicks/environment3) | +| Environment 4 click | [Click Here](./clicks/environment4) | EVC click | [Click Here](./clicks/evc) | +| Excelon LP click | [Click Here](./clicks/excelonlp) | Excelon-Ultra click | [Click Here](./clicks/excelonultra) | +| Expand click | [Click Here](./clicks/expand) | Expand 10 click | [Click Here](./clicks/expand10) | +| Expand 11 click | [Click Here](./clicks/expand11) | Expand 12 click | [Click Here](./clicks/expand12) | +| Expand 13 click | [Click Here](./clicks/expand13) | Expand 14 click | [Click Here](./clicks/expand14) | +| Expand 15 click | [Click Here](./clicks/expand15) | Expand 2 click | [Click Here](./clicks/expand2) | +| Expand 4 click | [Click Here](./clicks/expand4) | Expand 5 click | [Click Here](./clicks/expand5) | +| Expand 6 click | [Click Here](./clicks/expand6) | Expand 7 click | [Click Here](./clicks/expand7) | +| Expand 8 click | [Click Here](./clicks/expand8) | Expand 9 click | [Click Here](./clicks/expand9) | +| Fan click | [Click Here](./clicks/fan) | Fan 2 click | [Click Here](./clicks/fan2) | +| Fan 3 click | [Click Here](./clicks/fan3) | FAN 4 click | [Click Here](./clicks/fan4) | +| Fan 5 click | [Click Here](./clicks/fan5) | Fan 6 click | [Click Here](./clicks/fan6) | +| FAN 8 click | [Click Here](./clicks/fan8) | Fever click | [Click Here](./clicks/fever) | +| Fiber Opt click | [Click Here](./clicks/fiberopt) | Fingerprint 2 click | [Click Here](./clicks/fingerprint2) | +| Fingerprint 3 click | [Click Here](./clicks/fingerprint3) | Fingerprint 4 click | [Click Here](./clicks/fingerprint4) | +| FLAME click | [Click Here](./clicks/flame) | Flash click | [Click Here](./clicks/flash) | +| Flash 10 click | [Click Here](./clicks/flash10) | Flash 2 click | [Click Here](./clicks/flash2) | +| Flash 3 click | [Click Here](./clicks/flash3) | Flash 4 click | [Click Here](./clicks/flash4) | +| Flash 5 click | [Click Here](./clicks/flash5) | Flash 6 click | [Click Here](./clicks/flash6) | +| Flash 7 click | [Click Here](./clicks/flash7) | Flash 8 click | [Click Here](./clicks/flash8) | +| Flash 9 click | [Click Here](./clicks/flash9) | Flicker click | [Click Here](./clicks/flicker) | +| FM click | [Click Here](./clicks/fm) | Force click | [Click Here](./clicks/force) | +| Force 2 click | [Click Here](./clicks/force2) | Force 3 click | [Click Here](./clicks/force3) | +| Force 4 click | [Click Here](./clicks/force4) | Force 5 click | [Click Here](./clicks/force5) | +| Fram click | [Click Here](./clicks/fram) | FRAM 2 click | [Click Here](./clicks/fram2) | +| FRAM 3 click | [Click Here](./clicks/fram3) | FRAM 5 click | [Click Here](./clicks/fram5) | +| FRAM 6 click | [Click Here](./clicks/fram6) | FT click | [Click Here](./clicks/ft) | +| G2C click | [Click Here](./clicks/g2c) | G2C 3G click | [Click Here](./clicks/g2c3g) | +| GainAMP click | [Click Here](./clicks/gainamp) | GainAMP 2 click | [Click Here](./clicks/gainamp2) | +| GainAMP 3 click | [Click Here](./clicks/gainamp3) | Gaussmeter click | [Click Here](./clicks/gaussmeter) | +| GeoMagnetic click | [Click Here](./clicks/geomagnetic) | GMR Angle click | [Click Here](./clicks/gmrangle) | +| GNSS click | [Click Here](./clicks/gnss) | GNSS 10 click | [Click Here](./clicks/gnss10) | +| GNSS 12 click | [Click Here](./clicks/gnss12) | GNSS 13 click | [Click Here](./clicks/gnss13) | +| GNSS 2 click | [Click Here](./clicks/gnss2) | GNSS3 click | [Click Here](./clicks/gnss3) | +| GNSS4 click | [Click Here](./clicks/gnss4) | GNSS 5 click | [Click Here](./clicks/gnss5) | +| GNSS 7 click | [Click Here](./clicks/gnss7) | GNSS 8 click | [Click Here](./clicks/gnss8) | +| GNSS MAX click | [Click Here](./clicks/gnssmax) | GNSS RTK click | [Click Here](./clicks/gnssrtk) | +| GNSS RTK 2 click | [Click Here](./clicks/gnssrtk2) | GNSS ZOE click | [Click Here](./clicks/gnsszoe) | +| GPS click | [Click Here](./clicks/gps) | GPS 3 click | [Click Here](./clicks/gps3) | +| GPS 4 click | [Click Here](./clicks/gps4) | GPS 5 click | [Click Here](./clicks/gps5) | +| GPS 6 click | [Click Here](./clicks/gps6) | Grid-Eye click | [Click Here](./clicks/grideye) | +| GSM click | [Click Here](./clicks/gsm) | GSM 2 click | [Click Here](./clicks/gsm2) | +| GSM 3 click | [Click Here](./clicks/gsm3) | GSM 4 click | [Click Here](./clicks/gsm4) | +| GSM 5 click | [Click Here](./clicks/gsm5) | GSM/GNSS click | [Click Here](./clicks/gsmgnss) | +| GSM/GNSS 2 click | [Click Here](./clicks/gsmgnss2) | GSM-GPS click | [Click Here](./clicks/gsmgps) | +| GSR click | [Click Here](./clicks/gsr) | Gyro click | [Click Here](./clicks/gyro) | +| Gyro 2 click | [Click Here](./clicks/gyro2) | Gyro 3 click | [Click Here](./clicks/gyro3) | +| Gyro 4 click | [Click Here](./clicks/gyro4) | Gyro 5 click | [Click Here](./clicks/gyro5) | +| Gyro 6 click | [Click Here](./clicks/gyro6) | Gyro 7 click | [Click Here](./clicks/gyro7) | +| Gyro 8 click | [Click Here](./clicks/gyro8) | Hall Current click | [Click Here](./clicks/hallcurrent) | +| Hall Current 10 click | [Click Here](./clicks/hallcurrent10) | Hall Current 11 click | [Click Here](./clicks/hallcurrent11) | +| Hall Current 12 click | [Click Here](./clicks/hallcurrent12) | Hall Current 13 click | [Click Here](./clicks/hallcurrent13) | +| Hall Current 14 click | [Click Here](./clicks/hallcurrent14) | Hall Current 15 click | [Click Here](./clicks/hallcurrent15) | +| Hall Current 2 click | [Click Here](./clicks/hallcurrent2) | Hall Current 3 click | [Click Here](./clicks/hallcurrent3) | +| Hall Current 4 click | [Click Here](./clicks/hallcurrent4) | Hall Current 5 click | [Click Here](./clicks/hallcurrent5) | +| Hall Current 6 click | [Click Here](./clicks/hallcurrent6) | Hall Current 7 click | [Click Here](./clicks/hallcurrent7) | +| Hall Current 8 120A click | [Click Here](./clicks/hallcurrent8120a) | Hall Current 8 25A click | [Click Here](./clicks/hallcurrent825a) | +| Hall Current 9 click | [Click Here](./clicks/hallcurrent9) | Hall Switch click | [Click Here](./clicks/hallswitch) | +| Hall Switch 2 click | [Click Here](./clicks/hallswitch2) | HAPTIC click | [Click Here](./clicks/haptic) | +| HAPTIC 2 click | [Click Here](./clicks/haptic2) | HAPTIC 3 click | [Click Here](./clicks/haptic3) | +| H-Bridge 10 click | [Click Here](./clicks/hbridge10) | H-Bridge 11 click | [Click Here](./clicks/hbridge11) | +| H-Bridge 2 click | [Click Here](./clicks/hbridge2) | H-Bridge 3 click | [Click Here](./clicks/hbridge3) | +| H-Bridge 4 click | [Click Here](./clicks/hbridge4) | H-Bridge 5 click | [Click Here](./clicks/hbridge5) | +| H-Bridge 6 click | [Click Here](./clicks/hbridge6) | H-Bridge 7 click | [Click Here](./clicks/hbridge7) | +| H-Bridge 8 click | [Click Here](./clicks/hbridge8) | H-Bridge 9 click | [Click Here](./clicks/hbridge9) | +| H-Bridge Driver click | [Click Here](./clicks/hbridgedriver) | H-Bridge Driver 2 click | [Click Here](./clicks/hbridgedriver2) | +| HDC1000 click | [Click Here](./clicks/hdc1000) | Headphone AMP click | [Click Here](./clicks/headphoneamp) | +| Heart Rate click | [Click Here](./clicks/heartrate) | Heart Rate 10 click | [Click Here](./clicks/heartrate10) | +| Heart Rate 11 click | [Click Here](./clicks/heartrate11) | Heart Rate 2 click | [Click Here](./clicks/heartrate2) | +| Heart rate 3 click | [Click Here](./clicks/heartrate3) | Heart rate 4 click | [Click Here](./clicks/heartrate4) | +| Heart Rate 5 click | [Click Here](./clicks/heartrate5) | Heart rate 6 click | [Click Here](./clicks/heartrate6) | +| Heart Rate 7 click | [Click Here](./clicks/heartrate7) | Heart Rate 8 click | [Click Here](./clicks/heartrate8) | +| Heart Rate 9 click | [Click Here](./clicks/heartrate9) | Heater click | [Click Here](./clicks/heater) | +| HTU21D click | [Click Here](./clicks/htu21d) | Humidity click | [Click Here](./clicks/humidity) | +| HVAC click | [Click Here](./clicks/hvac) | HW Monitor click | [Click Here](./clicks/hwmonitor) | +| Hydrogen click | [Click Here](./clicks/hydrogen) | Hydro Probe click | [Click Here](./clicks/hydroprobe) | +| Hz to V click | [Click Here](./clicks/hztov) | HZ to V 2 click | [Click Here](./clicks/hztov2) | +| I2C 1-Wire click | [Click Here](./clicks/i2c1wire) | I2C Extend click | [Click Here](./clicks/i2cextend) | +| I2C Extend 2 click | [Click Here](./clicks/i2cextend2) | I2C isolator click | [Click Here](./clicks/i2cisolator) | +| I2C Isolator 2 click | [Click Here](./clicks/i2cisolator2) | I2C Isolator 3 click | [Click Here](./clicks/i2cisolator3) | +| I2C Isolator 4 click | [Click Here](./clicks/i2cisolator4) | I2C Isolator 6 click | [Click Here](./clicks/i2cisolator6) | +| I2C MUX click | [Click Here](./clicks/i2cmux) | I2C MUX 2 click | [Click Here](./clicks/i2cmux2) | +| I2C MUX 3 click | [Click Here](./clicks/i2cmux3) | I2C MUX 4 click | [Click Here](./clicks/i2cmux4) | +| I2C MUX 5 click | [Click Here](./clicks/i2cmux5) | I2C MUX 6 click | [Click Here](./clicks/i2cmux6) | +| I2C MUX 7 click | [Click Here](./clicks/i2cmux7) | I2C to CAN click | [Click Here](./clicks/i2ctocan) | +| I2C to SPI click | [Click Here](./clicks/i2ctospi) | Illuminance click | [Click Here](./clicks/illuminance) | +| Inclinometer click | [Click Here](./clicks/inclinometer) | Inclinometer 2 click | [Click Here](./clicks/inclinometer2) | +| Index Counter click | [Click Here](./clicks/indexcounter) | iqRF click | [Click Here](./clicks/iqrf) | +| iqRF 2 click | [Click Here](./clicks/iqrf2) | IR click | [Click Here](./clicks/ir) | +| IR 2 click | [Click Here](./clicks/ir2) | IR Beacon click | [Click Here](./clicks/irbeacon) | +| IrDA 2 click | [Click Here](./clicks/irda2) | IrDA 3 click | [Click Here](./clicks/irda3) | +| IR distance click | [Click Here](./clicks/irdistance) | Ir Eclipse click | [Click Here](./clicks/ireclipse) | +| IR Gesture click | [Click Here](./clicks/irgesture) | IR Gesture 2 click | [Click Here](./clicks/irgesture2) | +| IR Grid click | [Click Here](./clicks/irgrid) | IR Grid 2 click | [Click Here](./clicks/irgrid2) | +| IR Grid 3 click | [Click Here](./clicks/irgrid3) | IRNSS click | [Click Here](./clicks/irnss) | +| IR reflect click | [Click Here](./clicks/irreflect) | IR SENSE click | [Click Here](./clicks/irsense) | +| IR Sense 2 click | [Click Here](./clicks/irsense2) | IR Sense 3 click | [Click Here](./clicks/irsense3) | +| IrThermo 2 click | [Click Here](./clicks/irthermo2) | IrThermo 3 click | [Click Here](./clicks/irthermo3) | +| IrThermo 3V3 click | [Click Here](./clicks/irthermo3v3) | IrThermo 5V click | [Click Here](./clicks/irthermo5v) | +| ISM click | [Click Here](./clicks/ism) | ISM RX click | [Click Here](./clicks/ismrx) | +| ISM RX 2 click | [Click Here](./clicks/ismrx2) | ISM RX 3 click | [Click Here](./clicks/ismrx3) | +| ISM TX click | [Click Here](./clicks/ismtx) | ISO 9141 click | [Click Here](./clicks/iso9141) | +| ISO ADC 2 click | [Click Here](./clicks/isoadc2) | ISO ADC 3 click | [Click Here](./clicks/isoadc3) | +| ISO ADC 5 click | [Click Here](./clicks/isoadc5) | Joystick click | [Click Here](./clicks/joystick) | +| Joystick 2 click | [Click Here](./clicks/joystick2) | Joystick 3 click | [Click Here](./clicks/joystick3) | +| Keylock click | [Click Here](./clicks/keylock) | Key Lock 2 click | [Click Here](./clicks/keylock2) | +| Knob click | [Click Here](./clicks/knob) | LBAND RTK click | [Click Here](./clicks/lbandrtk) | +| LCD mini click | [Click Here](./clicks/lcdmini) | LCD Mono click | [Click Here](./clicks/lcdmono) | +| LDC click | [Click Here](./clicks/ldc) | LDC 1000 click | [Click Here](./clicks/ldc1000) | +| LDC 1101 click | [Click Here](./clicks/ldc1101) | LDC 2 click | [Click Here](./clicks/ldc2) | +| LDC Touch click | [Click Here](./clicks/ldctouch) | LDO click | [Click Here](./clicks/ldo) | +| LED DRIVER click | [Click Here](./clicks/leddriver) | LED Driver 10 click | [Click Here](./clicks/leddriver10) | +| LED Driver 11 click | [Click Here](./clicks/leddriver11) | LED Driver 12 click | [Click Here](./clicks/leddriver12) | +| LED Driver 13 click | [Click Here](./clicks/leddriver13) | LED Driver 14 click | [Click Here](./clicks/leddriver14) | +| LED Driver 15 click | [Click Here](./clicks/leddriver15) | LED Driver 16 click | [Click Here](./clicks/leddriver16) | +| LED Driver 17 click | [Click Here](./clicks/leddriver17) | LED Driver 18 click | [Click Here](./clicks/leddriver18) | | LED Driver 2 click | [Click Here](./clicks/leddriver2) | LED Driver 3 click | [Click Here](./clicks/leddriver3) | | LED Driver 4 click | [Click Here](./clicks/leddriver4) | Led Driver 5 click | [Click Here](./clicks/leddriver5) | | LED driver 6 click | [Click Here](./clicks/leddriver6) | LED Driver 7 click | [Click Here](./clicks/leddriver7) | @@ -400,125 +401,126 @@ A full list of all clicks in this repository is defined below: | MAC Address click | [Click Here](./clicks/macaddress) | Magic RFID click | [Click Here](./clicks/magicrfid) | | Magnetic linear click | [Click Here](./clicks/magneticlinear) | Magnetic Rotary click | [Click Here](./clicks/magneticrotary) | | Magnetic Rotary 2 click | [Click Here](./clicks/magneticrotary2) | Magnetic Rotary 3 click | [Click Here](./clicks/magneticrotary3) | -| Magnetic Rotary 4 click | [Click Here](./clicks/magneticrotary4) | Magnetic Rotary 6 click | [Click Here](./clicks/magneticrotary6) | -| MAGNETO click | [Click Here](./clicks/magneto) | Magneto 10 click | [Click Here](./clicks/magneto10) | -| Magneto 11 click | [Click Here](./clicks/magneto11) | Magneto 12 click | [Click Here](./clicks/magneto12) | -| Magneto 2 click | [Click Here](./clicks/magneto2) | MAGNETO 4 click | [Click Here](./clicks/magneto4) | -| Magneto 5 click | [Click Here](./clicks/magneto5) | Magneto 7 click | [Click Here](./clicks/magneto7) | -| Magneto 8 click | [Click Here](./clicks/magneto8) | Magneto 9 click | [Click Here](./clicks/magneto9) | -| Manometer click | [Click Here](./clicks/manometer) | Manometer 2 click | [Click Here](./clicks/manometer2) | -| Matrix G click | [Click Here](./clicks/matrixg) | Matrix R click | [Click Here](./clicks/matrixr) | -| Matrix RGB click | [Click Here](./clicks/matrixrgb) | M-Bus Master click | [Click Here](./clicks/mbusmaster) | -| M-BUS RF 4 click | [Click Here](./clicks/mbusrf4) | M-Bus Slave click | [Click Here](./clicks/mbusslave) | -| MCP16331 click | [Click Here](./clicks/mcp16331) | MCP16331 INV click | [Click Here](./clicks/mcp16331inv) | -| MCP1664 click | [Click Here](./clicks/mcp1664) | MCP251863 click | [Click Here](./clicks/mcp251863) | -| MCP2542 click | [Click Here](./clicks/mcp2542) | MCP73213 click | [Click Here](./clicks/mcp73213) | -| MCP73871 click | [Click Here](./clicks/mcp73871) | Methane click | [Click Here](./clicks/methane) | -| Mic click | [Click Here](./clicks/mic) | MIC 2 click | [Click Here](./clicks/mic2) | -| MIC23099 click | [Click Here](./clicks/mic23099) | MIC24045 click | [Click Here](./clicks/mic24045) | -| MIC24055 click | [Click Here](./clicks/mic24055) | MIC 3 click | [Click Here](./clicks/mic3) | -| MIC33153 click | [Click Here](./clicks/mic33153) | Microwave click | [Click Here](./clicks/microwave) | -| Microwave 2 click | [Click Here](./clicks/microwave2) | Moisture click | [Click Here](./clicks/moisture) | -| Monarch Adapter click | [Click Here](./clicks/monarchadapter) | MOTION click | [Click Here](./clicks/motion) | -| Motion 2 click | [Click Here](./clicks/motion2) | Motion 3 click | [Click Here](./clicks/motion3) | -| Motion 4 click | [Click Here](./clicks/motion4) | MP3 2 click | [Click Here](./clicks/mp32) | -| MPU 9DOF click | [Click Here](./clicks/mpu9dof) | MPU IMU click | [Click Here](./clicks/mpuimu) | -| MRAM click | [Click Here](./clicks/mram) | MRAM 2 click | [Click Here](./clicks/mram2) | -| MRAM 3 click | [Click Here](./clicks/mram3) | MR Angle click | [Click Here](./clicks/mrangle) | -| Multimeter click | [Click Here](./clicks/multimeter) | Multi Stepper TB62261 click | [Click Here](./clicks/multisteppertb62261) | -| Multi Stepper TB62262 click | [Click Here](./clicks/multisteppertb62262) | Multi Stepper TB62269 click | [Click Here](./clicks/multisteppertb62269) | -| Multi Stepper TB67S101 click | [Click Here](./clicks/multisteppertb67s101) | Multi Stepper TB67S102 click | [Click Here](./clicks/multisteppertb67s102) | -| Multi Stepper TB67S109 click | [Click Here](./clicks/multisteppertb67s109) | Multi Stepper TB67S209 click | [Click Here](./clicks/multisteppertb67s209) | -| Multi Stepper TB67S261 click | [Click Here](./clicks/multisteppertb67s261) | Multi Stepper TB67S269 click | [Click Here](./clicks/multisteppertb67s269) | -| MUX click | [Click Here](./clicks/mux) | MUX 2 click | [Click Here](./clicks/mux2) | -| MUX 3 click | [Click Here](./clicks/mux3) | MUX 4 click | [Click Here](./clicks/mux4) | -| MUX 5 click | [Click Here](./clicks/mux5) | MUX 9 click | [Click Here](./clicks/mux9) | -| Nano GPS click | [Click Here](./clicks/nanogps) | Nano GPS 2 click | [Click Here](./clicks/nanogps2) | -| Nano LR click | [Click Here](./clicks/nanolr) | Nano Power click | [Click Here](./clicks/nanopower) | -| Nano Power 2 click | [Click Here](./clicks/nanopower2) | NB IoT click | [Click Here](./clicks/nbiot) | -| NB IoT 2 click | [Click Here](./clicks/nbiot2) | NB IoT 4 click | [Click Here](./clicks/nbiot4) | -| NB IoT 5 click | [Click Here](./clicks/nbiot5) | NDIR CO2 click | [Click Here](./clicks/ndirco2) | -| NFC click | [Click Here](./clicks/nfc) | NFC 2 click | [Click Here](./clicks/nfc2) | -| NFC 3 click | [Click Here](./clicks/nfc3) | NFC 4 click | [Click Here](./clicks/nfc4) | -| NFC Extend click | [Click Here](./clicks/nfcextend) | NFC Tag 4 click | [Click Here](./clicks/nfctag4) | -| NFC Tag 5 click | [Click Here](./clicks/nfctag5) | NO2 click | [Click Here](./clicks/no2) | -| NO2 2 click | [Click Here](./clicks/no22) | Noise click | [Click Here](./clicks/noise) | -| NTAG 5 Link click | [Click Here](./clicks/ntag5link) | nvSRAM click | [Click Here](./clicks/nvsram) | -| nvSRAM 2 click | [Click Here](./clicks/nvsram2) | nvSRAM 3 click | [Click Here](./clicks/nvsram3) | -| nvSRAM 4 click | [Click Here](./clicks/nvsram4) | OBDII click | [Click Here](./clicks/obdii) | -| OLED B click | [Click Here](./clicks/oledb) | OLED C click | [Click Here](./clicks/oledc) | -| OLED Switch click | [Click Here](./clicks/oledswitch) | OLED W click | [Click Here](./clicks/oledw) | -| One Shot click | [Click Here](./clicks/oneshot) | OOK RX click | [Click Here](./clicks/ookrx) | -| OOK TX click | [Click Here](./clicks/ooktx) | OPTO click | [Click Here](./clicks/opto) | -| Opto 2 click | [Click Here](./clicks/opto2) | Opto 3 click | [Click Here](./clicks/opto3) | -| OPTO 4 click | [Click Here](./clicks/opto4) | Opto 5 click | [Click Here](./clicks/opto5) | -| Opto Encoder click | [Click Here](./clicks/optoencoder) | Opto Encoder 2 click | [Click Here](./clicks/optoencoder2) | -| Opto Encoder 3 click | [Click Here](./clicks/optoencoder3) | OSD click | [Click Here](./clicks/osd) | -| Oximeter click | [Click Here](./clicks/oximeter) | Oximeter2 click | [Click Here](./clicks/oximeter2) | -| Oximeter 3 click | [Click Here](./clicks/oximeter3) | Oximeter 5 click | [Click Here](./clicks/oximeter5) | -| Ozone 2 click | [Click Here](./clicks/ozone2) | Ozone 3 click | [Click Here](./clicks/ozone3) | -| PAC1720 click | [Click Here](./clicks/pac1720) | PAC1921 click | [Click Here](./clicks/pac1921) | -| Pac1934 click | [Click Here](./clicks/pac1934) | PAC1944 click | [Click Here](./clicks/pac1944) | -| PAC1954 click | [Click Here](./clicks/pac1954) | Pedometer click | [Click Here](./clicks/pedometer) | -| Pedometer 3 click | [Click Here](./clicks/pedometer3) | Peltier click | [Click Here](./clicks/peltier) | -| pH click | [Click Here](./clicks/ph) | pH 2 click | [Click Here](./clicks/ph2) | -| PHT click | [Click Here](./clicks/pht) | Piezo Accel click | [Click Here](./clicks/piezoaccel) | -| PIR click | [Click Here](./clicks/pir) | Pixi click | [Click Here](./clicks/pixi) | -| PLL click | [Click Here](./clicks/pll) | Plug n Trust click | [Click Here](./clicks/plugntrust) | -| Pollution click | [Click Here](./clicks/pollution) | POT click | [Click Here](./clicks/pot) | -| POT 2 click | [Click Here](./clicks/pot2) | Pot 3 click | [Click Here](./clicks/pot3) | -| POT 4 click | [Click Here](./clicks/pot4) | POT 5 click | [Click Here](./clicks/pot5) | -| PowerBank click | [Click Here](./clicks/powerbank) | PowerBank 2 click | [Click Here](./clicks/powerbank2) | -| Power Monitor click | [Click Here](./clicks/powermonitor) | Power MUX click | [Click Here](./clicks/powermux) | -| Power MUX 2 click | [Click Here](./clicks/powermux2) | Power/Reset click | [Click Here](./clicks/powerreset) | -| Presence click | [Click Here](./clicks/presence) | Pressure click | [Click Here](./clicks/pressure) | -| Pressure 10 click | [Click Here](./clicks/pressure10) | Pressure 11 click | [Click Here](./clicks/pressure11) | -| Pressure 12 click | [Click Here](./clicks/pressure12) | Pressure 13 click | [Click Here](./clicks/pressure13) | -| Pressure 14 click | [Click Here](./clicks/pressure14) | Pressure 15 click | [Click Here](./clicks/pressure15) | -| Pressure 16 click | [Click Here](./clicks/pressure16) | Pressure 17 click | [Click Here](./clicks/pressure17) | -| Pressure 18 click | [Click Here](./clicks/pressure18) | Pressure 19 click | [Click Here](./clicks/pressure19) | -| Pressure 2 click | [Click Here](./clicks/pressure2) | Pressure 20 click | [Click Here](./clicks/pressure20) | -| Pressure 21 click | [Click Here](./clicks/pressure21) | Pressure 3 click | [Click Here](./clicks/pressure3) | -| Pressure 4 click | [Click Here](./clicks/pressure4) | Pressure 5 click | [Click Here](./clicks/pressure5) | -| Pressure 6 click | [Click Here](./clicks/pressure6) | Pressure 7 click | [Click Here](./clicks/pressure7) | -| Pressure 8 click | [Click Here](./clicks/pressure8) | Pressure 9 click | [Click Here](./clicks/pressure9) | -| PROFET 10A click | [Click Here](./clicks/profet10a) | PROFET 15A click | [Click Here](./clicks/profet15a) | -| PROFET 2 3A click | [Click Here](./clicks/profet23a) | PROFET 2 7A click | [Click Here](./clicks/profet27a) | -| ProxFusion click | [Click Here](./clicks/proxfusion) | ProxFusion 2 click | [Click Here](./clicks/proxfusion2) | -| ProxFusion 3 click | [Click Here](./clicks/proxfusion3) | Proximity click | [Click Here](./clicks/proximity) | -| Proximity 10 click | [Click Here](./clicks/proximity10) | Proximity 11 click | [Click Here](./clicks/proximity11) | -| Proximity 12 click | [Click Here](./clicks/proximity12) | Proximity 13 click | [Click Here](./clicks/proximity13) | -| Proximity 14 click | [Click Here](./clicks/proximity14) | Proximity 15 click | [Click Here](./clicks/proximity15) | -| Proximity 16 click | [Click Here](./clicks/proximity16) | Proximity 17 click | [Click Here](./clicks/proximity17) | -| Proximity 18 click | [Click Here](./clicks/proximity18) | Proximity 2 click | [Click Here](./clicks/proximity2) | -| Proximity 3 click | [Click Here](./clicks/proximity3) | Proximity 5 click | [Click Here](./clicks/proximity5) | -| Proximity 6 click | [Click Here](./clicks/proximity6) | PROXIMITY 7 click | [Click Here](./clicks/proximity7) | -| Proximity 8 click | [Click Here](./clicks/proximity8) | Proximity 9 click | [Click Here](./clicks/proximity9) | -| PWM click | [Click Here](./clicks/pwm) | PWM 2 click | [Click Here](./clicks/pwm2) | -| Pwm Driver click | [Click Here](./clicks/pwmdriver) | PWR Meter click | [Click Here](./clicks/pwrmeter) | -| PWR Meter 2 click | [Click Here](./clicks/pwrmeter2) | PWR Meter 3 click | [Click Here](./clicks/pwrmeter3) | -| Qi Receiver click | [Click Here](./clicks/qireceiver) | Qi RX click | [Click Here](./clicks/qirx) | -| Radar click | [Click Here](./clicks/radar) | RadioStation click | [Click Here](./clicks/radiostation) | -| Rec N Play click | [Click Here](./clicks/recnplay) | REED click | [Click Here](./clicks/reed) | -| Relay click | [Click Here](./clicks/relay) | Relay 2 click | [Click Here](./clicks/relay2) | -| Relay 3 click | [Click Here](./clicks/relay3) | Relay 4 click | [Click Here](./clicks/relay4) | -| Remote Temp click | [Click Here](./clicks/remotetemp) | ReRAM click | [Click Here](./clicks/reram) | -| ReRAM 2 click | [Click Here](./clicks/reram2) | RFID click | [Click Here](./clicks/rfid) | -| RFID 2 click | [Click Here](./clicks/rfid2) | RF Meter click | [Click Here](./clicks/rfmeter) | -| RF Meter 3 click | [Click Here](./clicks/rfmeter3) | RF Switch click | [Click Here](./clicks/rfswitch) | -| RGB Driver click | [Click Here](./clicks/rgbdriver) | R Meter click | [Click Here](./clicks/rmeter) | -| RMS to DC click | [Click Here](./clicks/rmstodc) | RN4678 click | [Click Here](./clicks/rn4678) | -| RN4870 click | [Click Here](./clicks/rn4870) | RN4871 click | [Click Here](./clicks/rn4871) | -| RNG click | [Click Here](./clicks/rng) | ROTARY B click | [Click Here](./clicks/rotaryb) | -| ROTARY G click | [Click Here](./clicks/rotaryg) | ROTARY O click | [Click Here](./clicks/rotaryo) | -| ROTARY R click | [Click Here](./clicks/rotaryr) | ROTARY Y click | [Click Here](./clicks/rotaryy) | -| RS232 click | [Click Here](./clicks/rs232) | RS232 2 click | [Click Here](./clicks/rs2322) | -| RS232 3 click | [Click Here](./clicks/rs2323) | RS232 Isolator click | [Click Here](./clicks/rs232isolator) | -| RS232 Isolator 2 click | [Click Here](./clicks/rs232isolator2) | RS232 SPI click | [Click Here](./clicks/rs232spi) | -| RS232 to I2C click | [Click Here](./clicks/rs232toi2c) | RS485 2 click | [Click Here](./clicks/rs4852) | -| RS485 3 click | [Click Here](./clicks/rs4853) | RS485 3V3 click | [Click Here](./clicks/rs4853v3) | -| RS485 4 click | [Click Here](./clicks/rs4854) | RS485 5 click | [Click Here](./clicks/rs4855) | -| RS485 5V click | [Click Here](./clicks/rs4855v) | RS485 6 click | [Click Here](./clicks/rs4856) | +| Magnetic Rotary 4 click | [Click Here](./clicks/magneticrotary4) | Magnetic Rotary 5 click | [Click Here](./clicks/magneticrotary5) | +| Magnetic Rotary 6 click | [Click Here](./clicks/magneticrotary6) | MAGNETO click | [Click Here](./clicks/magneto) | +| Magneto 10 click | [Click Here](./clicks/magneto10) | Magneto 11 click | [Click Here](./clicks/magneto11) | +| Magneto 12 click | [Click Here](./clicks/magneto12) | Magneto 2 click | [Click Here](./clicks/magneto2) | +| MAGNETO 4 click | [Click Here](./clicks/magneto4) | Magneto 5 click | [Click Here](./clicks/magneto5) | +| Magneto 7 click | [Click Here](./clicks/magneto7) | Magneto 8 click | [Click Here](./clicks/magneto8) | +| Magneto 9 click | [Click Here](./clicks/magneto9) | Manometer click | [Click Here](./clicks/manometer) | +| Manometer 2 click | [Click Here](./clicks/manometer2) | Matrix G click | [Click Here](./clicks/matrixg) | +| Matrix R click | [Click Here](./clicks/matrixr) | Matrix RGB click | [Click Here](./clicks/matrixrgb) | +| M-Bus Master click | [Click Here](./clicks/mbusmaster) | M-BUS RF 4 click | [Click Here](./clicks/mbusrf4) | +| M-Bus Slave click | [Click Here](./clicks/mbusslave) | MCP16331 click | [Click Here](./clicks/mcp16331) | +| MCP16331 INV click | [Click Here](./clicks/mcp16331inv) | MCP1664 click | [Click Here](./clicks/mcp1664) | +| MCP251863 click | [Click Here](./clicks/mcp251863) | MCP2542 click | [Click Here](./clicks/mcp2542) | +| MCP73213 click | [Click Here](./clicks/mcp73213) | MCP73871 click | [Click Here](./clicks/mcp73871) | +| Methane click | [Click Here](./clicks/methane) | Mic click | [Click Here](./clicks/mic) | +| MIC 2 click | [Click Here](./clicks/mic2) | MIC23099 click | [Click Here](./clicks/mic23099) | +| MIC24045 click | [Click Here](./clicks/mic24045) | MIC24055 click | [Click Here](./clicks/mic24055) | +| MIC 3 click | [Click Here](./clicks/mic3) | MIC33153 click | [Click Here](./clicks/mic33153) | +| Microwave click | [Click Here](./clicks/microwave) | Microwave 2 click | [Click Here](./clicks/microwave2) | +| Moisture click | [Click Here](./clicks/moisture) | Monarch Adapter click | [Click Here](./clicks/monarchadapter) | +| MOTION click | [Click Here](./clicks/motion) | Motion 2 click | [Click Here](./clicks/motion2) | +| Motion 3 click | [Click Here](./clicks/motion3) | Motion 4 click | [Click Here](./clicks/motion4) | +| MP3 2 click | [Click Here](./clicks/mp32) | MPU 9DOF click | [Click Here](./clicks/mpu9dof) | +| MPU IMU click | [Click Here](./clicks/mpuimu) | MRAM click | [Click Here](./clicks/mram) | +| MRAM 2 click | [Click Here](./clicks/mram2) | MRAM 3 click | [Click Here](./clicks/mram3) | +| MR Angle click | [Click Here](./clicks/mrangle) | Multimeter click | [Click Here](./clicks/multimeter) | +| Multi Stepper TB62261 click | [Click Here](./clicks/multisteppertb62261) | Multi Stepper TB62262 click | [Click Here](./clicks/multisteppertb62262) | +| Multi Stepper TB62269 click | [Click Here](./clicks/multisteppertb62269) | Multi Stepper TB67S101 click | [Click Here](./clicks/multisteppertb67s101) | +| Multi Stepper TB67S102 click | [Click Here](./clicks/multisteppertb67s102) | Multi Stepper TB67S109 click | [Click Here](./clicks/multisteppertb67s109) | +| Multi Stepper TB67S209 click | [Click Here](./clicks/multisteppertb67s209) | Multi Stepper TB67S261 click | [Click Here](./clicks/multisteppertb67s261) | +| Multi Stepper TB67S269 click | [Click Here](./clicks/multisteppertb67s269) | MUX click | [Click Here](./clicks/mux) | +| MUX 2 click | [Click Here](./clicks/mux2) | MUX 3 click | [Click Here](./clicks/mux3) | +| MUX 4 click | [Click Here](./clicks/mux4) | MUX 5 click | [Click Here](./clicks/mux5) | +| MUX 9 click | [Click Here](./clicks/mux9) | Nano GPS click | [Click Here](./clicks/nanogps) | +| Nano GPS 2 click | [Click Here](./clicks/nanogps2) | Nano LR click | [Click Here](./clicks/nanolr) | +| Nano Power click | [Click Here](./clicks/nanopower) | Nano Power 2 click | [Click Here](./clicks/nanopower2) | +| NB IoT click | [Click Here](./clicks/nbiot) | NB IoT 2 click | [Click Here](./clicks/nbiot2) | +| NB IoT 4 click | [Click Here](./clicks/nbiot4) | NB IoT 5 click | [Click Here](./clicks/nbiot5) | +| NDIR CO2 click | [Click Here](./clicks/ndirco2) | NFC click | [Click Here](./clicks/nfc) | +| NFC 2 click | [Click Here](./clicks/nfc2) | NFC 3 click | [Click Here](./clicks/nfc3) | +| NFC 4 click | [Click Here](./clicks/nfc4) | NFC Extend click | [Click Here](./clicks/nfcextend) | +| NFC Tag 4 click | [Click Here](./clicks/nfctag4) | NFC Tag 5 click | [Click Here](./clicks/nfctag5) | +| NO2 click | [Click Here](./clicks/no2) | NO2 2 click | [Click Here](./clicks/no22) | +| Noise click | [Click Here](./clicks/noise) | NTAG 5 Link click | [Click Here](./clicks/ntag5link) | +| nvSRAM click | [Click Here](./clicks/nvsram) | nvSRAM 2 click | [Click Here](./clicks/nvsram2) | +| nvSRAM 3 click | [Click Here](./clicks/nvsram3) | nvSRAM 4 click | [Click Here](./clicks/nvsram4) | +| OBDII click | [Click Here](./clicks/obdii) | OLED B click | [Click Here](./clicks/oledb) | +| OLED C click | [Click Here](./clicks/oledc) | OLED Switch click | [Click Here](./clicks/oledswitch) | +| OLED W click | [Click Here](./clicks/oledw) | One Shot click | [Click Here](./clicks/oneshot) | +| OOK RX click | [Click Here](./clicks/ookrx) | OOK TX click | [Click Here](./clicks/ooktx) | +| OPTO click | [Click Here](./clicks/opto) | Opto 2 click | [Click Here](./clicks/opto2) | +| Opto 3 click | [Click Here](./clicks/opto3) | OPTO 4 click | [Click Here](./clicks/opto4) | +| Opto 5 click | [Click Here](./clicks/opto5) | Opto Encoder click | [Click Here](./clicks/optoencoder) | +| Opto Encoder 2 click | [Click Here](./clicks/optoencoder2) | Opto Encoder 3 click | [Click Here](./clicks/optoencoder3) | +| OSD click | [Click Here](./clicks/osd) | Oximeter click | [Click Here](./clicks/oximeter) | +| Oximeter2 click | [Click Here](./clicks/oximeter2) | Oximeter 3 click | [Click Here](./clicks/oximeter3) | +| Oximeter 5 click | [Click Here](./clicks/oximeter5) | Ozone 2 click | [Click Here](./clicks/ozone2) | +| Ozone 3 click | [Click Here](./clicks/ozone3) | PAC1720 click | [Click Here](./clicks/pac1720) | +| PAC1921 click | [Click Here](./clicks/pac1921) | Pac1934 click | [Click Here](./clicks/pac1934) | +| PAC1944 click | [Click Here](./clicks/pac1944) | PAC1954 click | [Click Here](./clicks/pac1954) | +| Pedometer click | [Click Here](./clicks/pedometer) | Pedometer 3 click | [Click Here](./clicks/pedometer3) | +| Peltier click | [Click Here](./clicks/peltier) | pH click | [Click Here](./clicks/ph) | +| pH 2 click | [Click Here](./clicks/ph2) | PHT click | [Click Here](./clicks/pht) | +| Piezo Accel click | [Click Here](./clicks/piezoaccel) | PIR click | [Click Here](./clicks/pir) | +| Pixi click | [Click Here](./clicks/pixi) | PLL click | [Click Here](./clicks/pll) | +| Plug n Trust click | [Click Here](./clicks/plugntrust) | Pollution click | [Click Here](./clicks/pollution) | +| POT click | [Click Here](./clicks/pot) | POT 2 click | [Click Here](./clicks/pot2) | +| Pot 3 click | [Click Here](./clicks/pot3) | POT 4 click | [Click Here](./clicks/pot4) | +| POT 5 click | [Click Here](./clicks/pot5) | PowerBank click | [Click Here](./clicks/powerbank) | +| PowerBank 2 click | [Click Here](./clicks/powerbank2) | Power Monitor click | [Click Here](./clicks/powermonitor) | +| Power MUX click | [Click Here](./clicks/powermux) | Power MUX 2 click | [Click Here](./clicks/powermux2) | +| Power/Reset click | [Click Here](./clicks/powerreset) | Presence click | [Click Here](./clicks/presence) | +| Pressure click | [Click Here](./clicks/pressure) | Pressure 10 click | [Click Here](./clicks/pressure10) | +| Pressure 11 click | [Click Here](./clicks/pressure11) | Pressure 12 click | [Click Here](./clicks/pressure12) | +| Pressure 13 click | [Click Here](./clicks/pressure13) | Pressure 14 click | [Click Here](./clicks/pressure14) | +| Pressure 15 click | [Click Here](./clicks/pressure15) | Pressure 16 click | [Click Here](./clicks/pressure16) | +| Pressure 17 click | [Click Here](./clicks/pressure17) | Pressure 18 click | [Click Here](./clicks/pressure18) | +| Pressure 19 click | [Click Here](./clicks/pressure19) | Pressure 2 click | [Click Here](./clicks/pressure2) | +| Pressure 20 click | [Click Here](./clicks/pressure20) | Pressure 21 click | [Click Here](./clicks/pressure21) | +| Pressure 3 click | [Click Here](./clicks/pressure3) | Pressure 4 click | [Click Here](./clicks/pressure4) | +| Pressure 5 click | [Click Here](./clicks/pressure5) | Pressure 6 click | [Click Here](./clicks/pressure6) | +| Pressure 7 click | [Click Here](./clicks/pressure7) | Pressure 8 click | [Click Here](./clicks/pressure8) | +| Pressure 9 click | [Click Here](./clicks/pressure9) | PROFET 10A click | [Click Here](./clicks/profet10a) | +| PROFET 15A click | [Click Here](./clicks/profet15a) | PROFET 2 3A click | [Click Here](./clicks/profet23a) | +| PROFET 2 7A click | [Click Here](./clicks/profet27a) | ProxFusion click | [Click Here](./clicks/proxfusion) | +| ProxFusion 2 click | [Click Here](./clicks/proxfusion2) | ProxFusion 3 click | [Click Here](./clicks/proxfusion3) | +| Proximity click | [Click Here](./clicks/proximity) | Proximity 10 click | [Click Here](./clicks/proximity10) | +| Proximity 11 click | [Click Here](./clicks/proximity11) | Proximity 12 click | [Click Here](./clicks/proximity12) | +| Proximity 13 click | [Click Here](./clicks/proximity13) | Proximity 14 click | [Click Here](./clicks/proximity14) | +| Proximity 15 click | [Click Here](./clicks/proximity15) | Proximity 16 click | [Click Here](./clicks/proximity16) | +| Proximity 17 click | [Click Here](./clicks/proximity17) | Proximity 18 click | [Click Here](./clicks/proximity18) | +| Proximity 2 click | [Click Here](./clicks/proximity2) | Proximity 3 click | [Click Here](./clicks/proximity3) | +| Proximity 5 click | [Click Here](./clicks/proximity5) | Proximity 6 click | [Click Here](./clicks/proximity6) | +| PROXIMITY 7 click | [Click Here](./clicks/proximity7) | Proximity 8 click | [Click Here](./clicks/proximity8) | +| Proximity 9 click | [Click Here](./clicks/proximity9) | PWM click | [Click Here](./clicks/pwm) | +| PWM 2 click | [Click Here](./clicks/pwm2) | Pwm Driver click | [Click Here](./clicks/pwmdriver) | +| PWR Meter click | [Click Here](./clicks/pwrmeter) | PWR Meter 2 click | [Click Here](./clicks/pwrmeter2) | +| PWR Meter 3 click | [Click Here](./clicks/pwrmeter3) | Qi Receiver click | [Click Here](./clicks/qireceiver) | +| Qi RX click | [Click Here](./clicks/qirx) | Radar click | [Click Here](./clicks/radar) | +| RadioStation click | [Click Here](./clicks/radiostation) | Rec N Play click | [Click Here](./clicks/recnplay) | +| REED click | [Click Here](./clicks/reed) | Relay click | [Click Here](./clicks/relay) | +| Relay 2 click | [Click Here](./clicks/relay2) | Relay 3 click | [Click Here](./clicks/relay3) | +| Relay 4 click | [Click Here](./clicks/relay4) | Remote Temp click | [Click Here](./clicks/remotetemp) | +| ReRAM click | [Click Here](./clicks/reram) | ReRAM 2 click | [Click Here](./clicks/reram2) | +| RFID click | [Click Here](./clicks/rfid) | RFID 2 click | [Click Here](./clicks/rfid2) | +| RF Meter click | [Click Here](./clicks/rfmeter) | RF Meter 3 click | [Click Here](./clicks/rfmeter3) | +| RF Switch click | [Click Here](./clicks/rfswitch) | RGB Driver click | [Click Here](./clicks/rgbdriver) | +| R Meter click | [Click Here](./clicks/rmeter) | RMS to DC click | [Click Here](./clicks/rmstodc) | +| RN4678 click | [Click Here](./clicks/rn4678) | RN4870 click | [Click Here](./clicks/rn4870) | +| RN4871 click | [Click Here](./clicks/rn4871) | RNG click | [Click Here](./clicks/rng) | +| ROTARY B click | [Click Here](./clicks/rotaryb) | ROTARY G click | [Click Here](./clicks/rotaryg) | +| ROTARY O click | [Click Here](./clicks/rotaryo) | ROTARY R click | [Click Here](./clicks/rotaryr) | +| ROTARY Y click | [Click Here](./clicks/rotaryy) | RS232 click | [Click Here](./clicks/rs232) | +| RS232 2 click | [Click Here](./clicks/rs2322) | RS232 3 click | [Click Here](./clicks/rs2323) | +| RS232 Isolator click | [Click Here](./clicks/rs232isolator) | RS232 Isolator 2 click | [Click Here](./clicks/rs232isolator2) | +| RS232 SPI click | [Click Here](./clicks/rs232spi) | RS232 to I2C click | [Click Here](./clicks/rs232toi2c) | +| RS485 2 click | [Click Here](./clicks/rs4852) | RS485 3 click | [Click Here](./clicks/rs4853) | +| RS485 3V3 click | [Click Here](./clicks/rs4853v3) | RS485 4 click | [Click Here](./clicks/rs4854) | +| RS485 5 click | [Click Here](./clicks/rs4855) | RS485 5V click | [Click Here](./clicks/rs4855v) | +| RS485 6 click | [Click Here](./clicks/rs4856) | RS485 7 click | [Click Here](./clicks/rs4857) | | RS485 Isolator click | [Click Here](./clicks/rs485isolator) | RS485 Isolator 2 click | [Click Here](./clicks/rs485isolator2) | | RS485 Isolator 3 click | [Click Here](./clicks/rs485isolator3) | RTC 10 click | [Click Here](./clicks/rtc10) | | RTC 11 click | [Click Here](./clicks/rtc11) | RTC 12 click | [Click Here](./clicks/rtc12) | diff --git a/clicks/3dhall2/CHANGELOG.md b/clicks/3dhall2/CHANGELOG.md index 17ab9ddb66..249474c644 100644 --- a/clicks/3dhall2/CHANGELOG.md +++ b/clicks/3dhall2/CHANGELOG.md @@ -1,4 +1,4 @@ ## Changelog -### Version 2.0.0.8 +### Version 2.1.0.8 - Initial release diff --git a/clicks/3dhall2/CMakeLists.txt b/clicks/3dhall2/CMakeLists.txt new file mode 100644 index 0000000000..d3fa27ae73 --- /dev/null +++ b/clicks/3dhall2/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(example_c3dhall2 LANGUAGES MikroC) +else() + project(example_c3dhall2 LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_executable(example_c3dhall2 + example/main.c + +) + + +############################ example_c3dhall2 GENERATED CODE START ########################### +find_package(MikroC.Core REQUIRED) +target_link_libraries(example_c3dhall2 PUBLIC MikroC.Core) +find_package(MikroSDK.Board REQUIRED) +target_link_libraries(example_c3dhall2 PUBLIC MikroSDK.Board) +find_package(MikroSDK.Log REQUIRED) +target_link_libraries(example_c3dhall2 PUBLIC MikroSDK.Log) +add_subdirectory(lib_c3dhall2) +target_link_libraries(example_c3dhall2 PUBLIC Click.3dHall2) +############################ example_c3dhall2 GENERATED CODE END ########################### diff --git a/clicks/3dhall2/DETAILS.md b/clicks/3dhall2/DETAILS.md index 9779136054..693a281495 100644 --- a/clicks/3dhall2/DETAILS.md +++ b/clicks/3dhall2/DETAILS.md @@ -1,5 +1,4 @@ - --- # 3D Hall 2 click @@ -23,7 +22,7 @@ # Software Support -We provide a library for the C3dHall2 Click +We provide a library for the 3d Hall 2 Click as well as a demo application (example), developed using MikroElektronika [compilers](https://shop.mikroe.com/compilers). The demo can run on all the main MikroElektronika [development boards](https://shop.mikroe.com/development-boards). @@ -32,29 +31,41 @@ Package can be downloaded/installed directly form compilers IDE(recommended way) ## Library Description -> This library contains API for C3dHall2 Click driver. +> This library contains API for 3d Hall 2 Click driver. #### Standard key functions : -- Config Object Initialization function. -> void c3dhall2_cfg_setup ( c3dhall2_cfg_t *cfg ); - -- Initialization function. -> C3DHALL2_RETVAL c3dhall2_init ( c3dhall2_t *ctx, c3dhall2_cfg_t *cfg ); - +- `c3dhall2_cfg_setup` Config Object Initialization function. +```c +void c3dhall2_cfg_setup ( c10x10rgb_cfg_t *cfg ); +``` -#### Example key functions : +- `c3dhall2_init` Initialization function. +```c +err_t c3dhall2_init ( c3dhall2_t *ctx, c3dhall2_cfg_t *cfg ); +``` +- `c3dhall2_default_cfg` Default configuration initialization function. +```c +err_t c3dhall2_default_cfg( c3dhall2_t *ctx ); +``` -- This function reads data from register. -> void c3dhall2_read_data ( c3dhall2_t *ctx, uint8_t *data_buf, uint16_t len ); +#### Example key functions : -- This function gets temperature and axis data. -> void c3dhall2_get_axis_temp_data ( c3dhall2_t *ctx, float *axis_data, float *temp_data ); +- `c3dhall2_read_data` This function reads data from register. +```c +err_t c3dhall2_read_data ( c3dhall2_t *ctx, uint8_t *data_buf, uint16_t len ); +``` -- This function configures the chip for measurement. -> void c3dhall2_configuration( c3dhall2_t *ctx, uint8_t settings1, uint8_t settings2); +- `c3dhall2_get_axis_temp_data` This function gets temperature and axis data. +```c +err_t c3dhall2_get_axis_temp_data ( c3dhall2_t *ctx, float *axis_data, float *temp_data ); +``` +- `c3dhall2_configuration` This function configures the chip for measurement. +```c +err_t c3dhall2_configuration ( c3dhall2_t *ctx, uint8_t settings1, uint8_t settings2 ); +``` ## Examples Description @@ -64,13 +75,14 @@ Package can be downloaded/installed directly form compilers IDE(recommended way) ### Application Init -> Initialization driver init and configuration chip. +> Initializes the driver and configures the click board. ```c void application_init ( void ) { - c3dhall2_cfg_t cfg; + log_cfg_t log_cfg; + c3dhall2_cfg_t cfg; /** * Logger initialization. @@ -86,7 +98,6 @@ void application_init ( void ) log_info( &logger, "---- Application Init ----" ); // Click initialization. - c3dhall2_cfg_setup( &cfg ); C3DHALL2_MAP_MIKROBUS( cfg, MIKROBUS_1 ); c3dhall2_init( &c3dhall2, &cfg ); @@ -97,21 +108,22 @@ void application_init ( void ) ### Application Task -> Reads X/Y/Z hall axis and Temperature data and logs values every 3 seconds. +> Reads X/Y/Z hall axis and Temperature data. All data logs on the USBUART every 200ms. ```c void application_task ( void ) { - c3dhall2_get_axis_temp_data( &c3dhall2, &xyz_axis[ 0 ], &temperature ); - - log_printf( &logger, " Axis X: %.2f mT\r\n", xyz_axis[ 0 ] ); - log_printf( &logger, " Axis Y: %.2f mT\r\n", xyz_axis[ 1 ] ); - log_printf( &logger, " Axis Z: %.2f mT\r\n", xyz_axis[ 2 ] ); - - log_printf( &logger, " Temperature: %.2f C\r\n", temperature ); - - Delay_ms( 3000 ); + float xyz_axis[ 3 ] = { 0 }; + float temperature = 0; + if ( C3DHALL2_OK == c3dhall2_get_axis_temp_data( &c3dhall2, &xyz_axis[ 0 ], &temperature ) ) + { + log_printf( &logger, " Axis X: %.2f mT\r\n", xyz_axis[ 0 ] ); + log_printf( &logger, " Axis Y: %.2f mT\r\n", xyz_axis[ 1 ] ); + log_printf( &logger, " Axis Z: %.2f mT\r\n", xyz_axis[ 2 ] ); + log_printf( &logger, " Temperature: %.2f C\r\n\n", temperature ); + Delay_ms( 200 ); + } } ``` @@ -122,7 +134,7 @@ The full application code, and ready to use projects can be installed directly - MikroSDK.Board - MikroSDK.Log -- Click.C3dHall2 +- Click.3dHall2 **Additional notes and informations** diff --git a/clicks/3dhall2/README.md b/clicks/3dhall2/README.md index 25c0b3b5e0..cc6caae096 100644 --- a/clicks/3dhall2/README.md +++ b/clicks/3dhall2/README.md @@ -1,7 +1,5 @@ \mainpage Main Page - - --- # 3D Hall 2 click @@ -25,7 +23,7 @@ # Software Support -We provide a library for the C3dHall2 Click +We provide a library for the 3d Hall 2 Click as well as a demo application (example), developed using MikroElektronika [compilers](https://shop.mikroe.com/compilers). The demo can run on all the main MikroElektronika [development boards](https://shop.mikroe.com/development-boards). @@ -34,29 +32,41 @@ Package can be downloaded/installed directly form compilers IDE(recommended way) ## Library Description -> This library contains API for C3dHall2 Click driver. +> This library contains API for 3d Hall 2 Click driver. #### Standard key functions : -- Config Object Initialization function. -> void c3dhall2_cfg_setup ( c3dhall2_cfg_t *cfg ); - -- Initialization function. -> C3DHALL2_RETVAL c3dhall2_init ( c3dhall2_t *ctx, c3dhall2_cfg_t *cfg ); - +- `c3dhall2_cfg_setup` Config Object Initialization function. +```c +void c3dhall2_cfg_setup ( c10x10rgb_cfg_t *cfg ); +``` -#### Example key functions : +- `c3dhall2_init` Initialization function. +```c +err_t c3dhall2_init ( c3dhall2_t *ctx, c3dhall2_cfg_t *cfg ); +``` +- `c3dhall2_default_cfg` Default configuration initialization function. +```c +err_t c3dhall2_default_cfg( c3dhall2_t *ctx ); +``` -- This function reads data from register. -> void c3dhall2_read_data ( c3dhall2_t *ctx, uint8_t *data_buf, uint16_t len ); +#### Example key functions : -- This function gets temperature and axis data. -> void c3dhall2_get_axis_temp_data ( c3dhall2_t *ctx, float *axis_data, float *temp_data ); +- `c3dhall2_read_data` This function reads data from register. +```c +err_t c3dhall2_read_data ( c3dhall2_t *ctx, uint8_t *data_buf, uint16_t len ); +``` -- This function configures the chip for measurement. -> void c3dhall2_configuration( c3dhall2_t *ctx, uint8_t settings1, uint8_t settings2); +- `c3dhall2_get_axis_temp_data` This function gets temperature and axis data. +```c +err_t c3dhall2_get_axis_temp_data ( c3dhall2_t *ctx, float *axis_data, float *temp_data ); +``` +- `c3dhall2_configuration` This function configures the chip for measurement. +```c +err_t c3dhall2_configuration ( c3dhall2_t *ctx, uint8_t settings1, uint8_t settings2 ); +``` ## Examples Description @@ -66,13 +76,14 @@ Package can be downloaded/installed directly form compilers IDE(recommended way) ### Application Init -> Initialization driver init and configuration chip. +> Initializes the driver and configures the click board. ```c void application_init ( void ) { - c3dhall2_cfg_t cfg; + log_cfg_t log_cfg; + c3dhall2_cfg_t cfg; /** * Logger initialization. @@ -88,7 +99,6 @@ void application_init ( void ) log_info( &logger, "---- Application Init ----" ); // Click initialization. - c3dhall2_cfg_setup( &cfg ); C3DHALL2_MAP_MIKROBUS( cfg, MIKROBUS_1 ); c3dhall2_init( &c3dhall2, &cfg ); @@ -99,21 +109,22 @@ void application_init ( void ) ### Application Task -> Reads X/Y/Z hall axis and Temperature data and logs values every 3 seconds. +> Reads X/Y/Z hall axis and Temperature data. All data logs on the USBUART every 200ms. ```c void application_task ( void ) { - c3dhall2_get_axis_temp_data( &c3dhall2, &xyz_axis[ 0 ], &temperature ); - - log_printf( &logger, " Axis X: %.2f mT\r\n", xyz_axis[ 0 ] ); - log_printf( &logger, " Axis Y: %.2f mT\r\n", xyz_axis[ 1 ] ); - log_printf( &logger, " Axis Z: %.2f mT\r\n", xyz_axis[ 2 ] ); - - log_printf( &logger, " Temperature: %.2f C\r\n", temperature ); - - Delay_ms( 3000 ); + float xyz_axis[ 3 ] = { 0 }; + float temperature = 0; + if ( C3DHALL2_OK == c3dhall2_get_axis_temp_data( &c3dhall2, &xyz_axis[ 0 ], &temperature ) ) + { + log_printf( &logger, " Axis X: %.2f mT\r\n", xyz_axis[ 0 ] ); + log_printf( &logger, " Axis Y: %.2f mT\r\n", xyz_axis[ 1 ] ); + log_printf( &logger, " Axis Z: %.2f mT\r\n", xyz_axis[ 2 ] ); + log_printf( &logger, " Temperature: %.2f C\r\n\n", temperature ); + Delay_ms( 200 ); + } } ``` @@ -124,7 +135,7 @@ The full application code, and ready to use projects can be installed directly - MikroSDK.Board - MikroSDK.Log -- Click.C3dHall2 +- Click.3dHall2 **Additional notes and informations** diff --git a/clicks/3dhall2/doc/doxy/Doxyfile.doxy b/clicks/3dhall2/doc/doxy/Doxyfile.doxy index 9180408ce4..b840e0fb6c 100644 --- a/clicks/3dhall2/doc/doxy/Doxyfile.doxy +++ b/clicks/3dhall2/doc/doxy/Doxyfile.doxy @@ -44,21 +44,21 @@ PROJECT_NUMBER = 2.0.0.0 # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = +PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = +PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = ../clicks/c3dhall2/temp/Help/doc +OUTPUT_DIRECTORY = ../cmake/c3dhall2/temp/Help/doc # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -162,7 +162,7 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -171,7 +171,7 @@ STRIP_FROM_PATH = # specify the list of include paths that are normally passed to the compiler # using the -I flag. -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't @@ -238,13 +238,13 @@ TAB_SIZE = 4 # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. -ALIASES = +ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. -TCL_SUBST = +TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For @@ -291,7 +291,7 @@ OPTIMIZE_OUTPUT_VHDL = NO # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. -EXTENSION_MAPPING = +EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable @@ -648,7 +648,7 @@ GENERATE_DEPRECATEDLIST= YES # sections, marked by \if ... \endif and \cond # ... \endcond blocks. -ENABLED_SECTIONS = +ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the @@ -690,7 +690,7 @@ SHOW_NAMESPACES = YES # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. -FILE_VERSION_FILTER = +FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated @@ -703,7 +703,7 @@ FILE_VERSION_FILTER = # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. -LAYOUT_FILE = +LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib @@ -713,7 +713,7 @@ LAYOUT_FILE = # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. -CITE_BIB_FILES = +CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages @@ -778,7 +778,7 @@ WARN_FORMAT = "$file:$line: $text" # messages should be written. If left blank the output is written to standard # error (stderr). -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files @@ -790,9 +790,9 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = ../clicks/c3dhall2/example \ - ../clicks/c3dhall2/lib/include \ - ../clicks/c3dhall2/README.md +INPUT = ../cmake/c3dhall2/example \ + ../cmake/c3dhall2/lib_c3dhall2/include \ + ../cmake/c3dhall2/README.md # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -877,7 +877,7 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = +EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -893,7 +893,7 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the @@ -904,13 +904,13 @@ EXCLUDE_PATTERNS = # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* -EXCLUDE_SYMBOLS = +EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = ../clicks/c3dhall2/example +EXAMPLE_PATH = ../cmake/c3dhall2/example # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and @@ -930,7 +930,7 @@ EXAMPLE_RECURSIVE = YES # that contain images that are to be included in the documentation (see the # \image command). -IMAGE_PATH = +IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program @@ -951,7 +951,7 @@ IMAGE_PATH = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -INPUT_FILTER = +INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the @@ -964,7 +964,7 @@ INPUT_FILTER = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -FILTER_PATTERNS = +FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for @@ -979,14 +979,14 @@ FILTER_SOURCE_FILES = NO # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. -FILTER_SOURCE_PATTERNS = +FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = +USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing @@ -1091,7 +1091,7 @@ CLANG_ASSISTED_PARSING = NO # specified with INPUT and INCLUDE_PATH. # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. -CLANG_OPTIONS = +CLANG_OPTIONS = #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index @@ -1117,7 +1117,7 @@ COLS_IN_ALPHA_INDEX = 5 # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output @@ -1161,7 +1161,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = +HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard @@ -1171,7 +1171,7 @@ HTML_HEADER = # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = +HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of @@ -1183,7 +1183,7 @@ HTML_FOOTER = # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_STYLESHEET = +HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets @@ -1196,7 +1196,7 @@ HTML_STYLESHEET = # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = +HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note @@ -1206,7 +1206,7 @@ HTML_EXTRA_STYLESHEET = # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = +HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to @@ -1335,7 +1335,7 @@ GENERATE_HTMLHELP = YES # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_FILE = +CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, @@ -1343,7 +1343,7 @@ CHM_FILE = # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -HHC_LOCATION = +HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the master .chm file (NO). @@ -1356,7 +1356,7 @@ GENERATE_CHI = NO # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_INDEX_ENCODING = +CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it @@ -1387,7 +1387,7 @@ GENERATE_QHP = NO # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. -QCH_FILE = +QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace @@ -1412,7 +1412,7 @@ QHP_VIRTUAL_FOLDER = ./temp/Help/doc # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom @@ -1420,21 +1420,21 @@ QHP_CUST_FILTER_NAME = # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_ATTRS = +QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_SECT_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. -QHG_LOCATION = +QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To @@ -1567,7 +1567,7 @@ MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_EXTENSIONS = +MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site @@ -1575,7 +1575,7 @@ MATHJAX_EXTENSIONS = # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_CODEFILE = +MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and @@ -1635,7 +1635,7 @@ EXTERNAL_SEARCH = NO # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. -SEARCHENGINE_URL = +SEARCHENGINE_URL = # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed # search data is written to a file for indexing by an external tool. With the @@ -1651,7 +1651,7 @@ SEARCHDATA_FILE = searchdata.xml # projects and redirect the results back to the right project. # This tag requires that the tag SEARCHENGINE is set to YES. -EXTERNAL_SEARCH_ID = +EXTERNAL_SEARCH_ID = # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen # projects other than the one defined by this configuration file, but that are @@ -1661,7 +1661,7 @@ EXTERNAL_SEARCH_ID = # EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... # This tag requires that the tag SEARCHENGINE is set to YES. -EXTRA_SEARCH_MAPPINGS = +EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- # Configuration options related to the LaTeX output @@ -1725,7 +1725,7 @@ PAPER_TYPE = a4 # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. -EXTRA_PACKAGES = +EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for the # generated LaTeX document. The header should contain everything until the first @@ -1741,7 +1741,7 @@ EXTRA_PACKAGES = # to HTML_HEADER. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_HEADER = +LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the # generated LaTeX document. The footer should contain everything after the last @@ -1752,7 +1752,7 @@ LATEX_HEADER = # Note: Only use a user-defined footer if you know what you are doing! # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_FOOTER = +LATEX_FOOTER = # The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined # LaTeX style sheets that are included after the standard style sheets created @@ -1763,7 +1763,7 @@ LATEX_FOOTER = # list). # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_STYLESHEET = +LATEX_EXTRA_STYLESHEET = # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output @@ -1771,7 +1771,7 @@ LATEX_EXTRA_STYLESHEET = # markers available. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_FILES = +LATEX_EXTRA_FILES = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is # prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will @@ -1879,14 +1879,14 @@ RTF_HYPERLINKS = NO # default style sheet that doxygen normally uses. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_STYLESHEET_FILE = +RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is # similar to doxygen's config file. A template extensions file can be generated # using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_EXTENSIONS_FILE = +RTF_EXTENSIONS_FILE = # If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code # with syntax highlighting in the RTF output. @@ -1931,7 +1931,7 @@ MAN_EXTENSION = .3 # MAN_EXTENSION with the initial . removed. # This tag requires that the tag GENERATE_MAN is set to YES. -MAN_SUBDIR = +MAN_SUBDIR = # If the MAN_LINKS tag is set to YES and doxygen generates man output, then it # will generate one additional man file for each entity documented in the real @@ -2044,7 +2044,7 @@ PERLMOD_PRETTY = YES # overwrite each other's variables. # This tag requires that the tag GENERATE_PERLMOD is set to YES. -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor @@ -2085,7 +2085,7 @@ SEARCH_INCLUDES = YES # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = +INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the @@ -2093,7 +2093,7 @@ INCLUDE_PATH = # used. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -INCLUDE_FILE_PATTERNS = +INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that are # defined before the preprocessor is started (similar to the -D option of e.g. @@ -2103,7 +2103,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = +PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -2112,7 +2112,7 @@ PREDEFINED = # definition found in the source code. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will # remove all references to function-like macros that are alone on a line, have @@ -2141,13 +2141,13 @@ SKIP_FUNCTION_MACROS = YES # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. -TAGFILES = +TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create a # tag file that is based on the input files it reads. See section "Linking to # external documentation" for more information about the usage of tag files. -GENERATE_TAGFILE = +GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES, all external class will be listed in # the class index. If set to NO, only the inherited external classes will be @@ -2196,14 +2196,14 @@ CLASS_DIAGRAMS = YES # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. -MSCGEN_PATH = +MSCGEN_PATH = # You can include diagrams made with dia in doxygen documentation. Doxygen will # then run dia to produce the diagram and insert it in the documentation. The # DIA_PATH tag allows you to specify the directory where the dia binary resides. # If left empty dia is assumed to be found in the default search path. -DIA_PATH = +DIA_PATH = # If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. @@ -2252,7 +2252,7 @@ DOT_FONTSIZE = 10 # the path where dot can find it using this tag. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTPATH = +DOT_FONTPATH = # If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for # each documented class showing the direct and indirect inheritance relations. @@ -2396,26 +2396,26 @@ INTERACTIVE_SVG = NO # found. If left blank, it is assumed the dot tool can be found in the path. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_PATH = +DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the \dotfile # command). # This tag requires that the tag HAVE_DOT is set to YES. -DOTFILE_DIRS = +DOTFILE_DIRS = # The MSCFILE_DIRS tag can be used to specify one or more directories that # contain msc files that are included in the documentation (see the \mscfile # command). -MSCFILE_DIRS = +MSCFILE_DIRS = # The DIAFILE_DIRS tag can be used to specify one or more directories that # contain dia files that are included in the documentation (see the \diafile # command). -DIAFILE_DIRS = +DIAFILE_DIRS = # When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the # path where java can find the plantuml.jar file. If left blank, it is assumed @@ -2423,17 +2423,17 @@ DIAFILE_DIRS = # generate a warning when it encounters a \startuml command in this case and # will not generate output for the diagram. -PLANTUML_JAR_PATH = +PLANTUML_JAR_PATH = # When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a # configuration file for plantuml. -PLANTUML_CFG_FILE = +PLANTUML_CFG_FILE = # When using plantuml, the specified paths are searched for files specified by # the !include statement in a plantuml block. -PLANTUML_INCLUDE_PATH = +PLANTUML_INCLUDE_PATH = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes @@ -2494,7 +2494,3 @@ GENERATE_LEGEND = YES # This tag requires that the tag HAVE_DOT is set to YES. DOT_CLEANUP = YES - - - - diff --git a/clicks/3dhall2/doc/package/manifest.json b/clicks/3dhall2/doc/package/manifest.json index 55dc850b1f..876ba13b20 100644 --- a/clicks/3dhall2/doc/package/manifest.json +++ b/clicks/3dhall2/doc/package/manifest.json @@ -1,6 +1,6 @@ { - "architecture": "ARM|PIC|PIC32", - "category": "Magnetic", + "architecture": "ARM|PIC|PIC32|RISC-V|AVR", + "category": "Click Boards > Sensors > Magnetic", "changelog": "Resources/CHANGELOG.md", "contains": [ "libraries", @@ -8,8 +8,7 @@ "examples", "source_files" ], - "dependency_list": [ - ], +"dependency_list": [], "details": "Resources/DETAILS.md", "display_name": "3D Hall 2 click", "example_list": [ @@ -26,20 +25,14 @@ "name": "mikroe.click.c3dhall2", "product_link": "https://www.mikroe.com/3d-hall-2-click", "short_description": "3D Hall 2 click is a very accurate magnetic field sensing Click board™, used to sense the magnetic field strength in three perpendicular axes. It relies on a TLV493D-A1B6, a low power 3D magnetic sensor from Infineon. ", - "supported_compiler": "mikroC AI", + "supported_compiler": "mikroC AI|GCC", "type": "Library", - "_type":"mikroSDK Library", - "related_projects":[ + "_type": "mikroSDK Library", + "related_projects": [ 2592 ], - "_type": "mikroSDK Library", - "version": "2.0.0.8" + "version": "2.1.0.8", + "cmake": true, + "alias": "Click.3dHall2", + "subdir_name": "lib_c3dhall2" } - - - - - - - - diff --git a/clicks/3dhall2/example/CMakeLists.txt b/clicks/3dhall2/example/CMakeLists.txt new file mode 100644 index 0000000000..666eebc087 --- /dev/null +++ b/clicks/3dhall2/example/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(example_c3dhall2 LANGUAGES MikroC) +else() + project(example_c3dhall2 LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_executable(example_c3dhall2 + main.c + +) + + +############################ example_c3dhall2 GENERATED CODE START ########################### +find_package(MikroC.Core REQUIRED) +target_link_libraries(example_c3dhall2 PUBLIC MikroC.Core) +find_package(MikroSDK.Board REQUIRED) +target_link_libraries(example_c3dhall2 PUBLIC MikroSDK.Board) +find_package(MikroSDK.Log REQUIRED) +target_link_libraries(example_c3dhall2 PUBLIC MikroSDK.Log) +add_subdirectory(lib_c3dhall2) +target_link_libraries(example_c3dhall2 PUBLIC Click.3dHall2) +############################ example_c3dhall2 GENERATED CODE END ########################### diff --git a/clicks/3dhall2/example/main.c b/clicks/3dhall2/example/main.c index 6e3d425eb7..69fa6e6c3e 100644 --- a/clicks/3dhall2/example/main.c +++ b/clicks/3dhall2/example/main.c @@ -4,17 +4,17 @@ * * # Description * - * This application reads X/Y/Z hall axis and temperature data and converts it to - * human readable format. + * This application reads X/Y/Z hall axis and temperature + * data and converts it to human readable format. * * The demo application is composed of two sections : * * ## Application Init - * Initialization driver init and configuration chip + * Initializes the driver and configures the click board. * * ## Application Task * Reads X/Y/Z hall axis and Temperature data. - * All data logs on the USBUART every 3 sec. + * All data logs on the USBUART every 200ms. * * \author MikroE Team * @@ -29,8 +29,6 @@ static c3dhall2_t c3dhall2; static log_t logger; -float xyz_axis[ 3 ]; -float temperature; // ------------------------------------------------------ APPLICATION FUNCTIONS @@ -63,15 +61,16 @@ void application_init ( void ) void application_task ( void ) { - c3dhall2_get_axis_temp_data( &c3dhall2, &xyz_axis[ 0 ], &temperature ); - - log_printf( &logger, " Axis X: %.2f mT\r\n", xyz_axis[ 0 ] ); - log_printf( &logger, " Axis Y: %.2f mT\r\n", xyz_axis[ 1 ] ); - log_printf( &logger, " Axis Z: %.2f mT\r\n", xyz_axis[ 2 ] ); - - log_printf( &logger, " Temperature: %.2f C\r\n", temperature ); - - Delay_ms( 2000 ); + float xyz_axis[ 3 ] = { 0 }; + float temperature = 0; + if ( C3DHALL2_OK == c3dhall2_get_axis_temp_data( &c3dhall2, &xyz_axis[ 0 ], &temperature ) ) + { + log_printf( &logger, " Axis X: %.2f mT\r\n", xyz_axis[ 0 ] ); + log_printf( &logger, " Axis Y: %.2f mT\r\n", xyz_axis[ 1 ] ); + log_printf( &logger, " Axis Z: %.2f mT\r\n", xyz_axis[ 2 ] ); + log_printf( &logger, " Temperature: %.2f C\r\n\n", temperature ); + Delay_ms( 200 ); + } } void main ( void ) diff --git a/clicks/3dhall2/example/manifest.exm b/clicks/3dhall2/example/manifest.exm index 9a853104ed..2a67a0c567 100644 --- a/clicks/3dhall2/example/manifest.exm +++ b/clicks/3dhall2/example/manifest.exm @@ -2,7 +2,7 @@ "name": "3D Hall Click", "description": "3D Hall 2 click is a very accurate magnetic field sensing Click board™, used to sense the magnetic field strength in three perpendicular axes. It relies on a TLV493D-A1B6, a low power 3D magnetic sensor from Infineon. ", "image" : "../../Resources/click_icon.png", - "toolchain": ["mikrocarm","mikrocpic","mikrocpic32"], + "toolchain": ["mikrocarm","mikrocpic","mikrocpic32","gcc-riscv","mikrocavr"], "hw" : ["click","TLV493D-A1B6"], "category" : ["Magnetic"] } diff --git a/clicks/3dhall2/example/memake.txt b/clicks/3dhall2/example/memake.txt deleted file mode 100644 index d4b662104f..0000000000 --- a/clicks/3dhall2/example/memake.txt +++ /dev/null @@ -1,17 +0,0 @@ -type: executable -target: example_c3dhall2 - -depends: { - MikroC.Core - MikroSDK.Board - MikroSDK.Log - Click.C3dHall2 -} - -uses: { - MikroC.Core -} - -sources: { - main.c -} diff --git a/clicks/3dhall2/lib/memake.txt b/clicks/3dhall2/lib/memake.txt deleted file mode 100644 index adda39ad69..0000000000 --- a/clicks/3dhall2/lib/memake.txt +++ /dev/null @@ -1,40 +0,0 @@ -type: library - -target: lib_c3dhall2 - -alias: Click.C3dHall2 - -sources: { - src/c3dhall2.c -} - -headers: { - include/c3dhall2.h -} - -include: { - include -} - -install: { - src(include/c3dhall2.h) dst(include/c3dhall2.h) -} - -expInclude: { - include -} - -depends: { - MikroC.Core - MikroSDK.Driver -} - -uses: { - MikroC.Core -} - -others: { - ../README.md - ../DETAILS.md - ../CHANGELOG.md -} diff --git a/clicks/3dhall2/lib/src/c3dhall2.c b/clicks/3dhall2/lib/src/c3dhall2.c deleted file mode 100644 index 137f1c4d07..0000000000 --- a/clicks/3dhall2/lib/src/c3dhall2.c +++ /dev/null @@ -1,165 +0,0 @@ -/* - * MikroSDK - MikroE Software Development Kit - * Copyright© 2020 MikroElektronika d.o.o. - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE - * OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/*! - * \file - * - */ - -#include "c3dhall2.h" - -// ------------------------------------------------ PUBLIC FUNCTION DEFINITIONS - -void c3dhall2_cfg_setup ( c3dhall2_cfg_t *cfg ) -{ - // Communication gpio pins - - cfg->scl = HAL_PIN_NC; - cfg->sda = HAL_PIN_NC; - - cfg->i2c_speed = I2C_MASTER_SPEED_STANDARD; - cfg->i2c_address = 0x5E; -} - -C3DHALL2_RETVAL c3dhall2_init ( c3dhall2_t *ctx, c3dhall2_cfg_t *cfg ) -{ - i2c_master_config_t i2c_cfg; - - i2c_master_configure_default( &i2c_cfg ); - i2c_cfg.speed = cfg->i2c_speed; - i2c_cfg.scl = cfg->scl; - i2c_cfg.sda = cfg->sda; - - ctx->slave_address = cfg->i2c_address; - - if ( i2c_master_open( &ctx->i2c, &i2c_cfg ) == I2C_MASTER_ERROR ) - { - return C3DHALL2_INIT_ERROR; - } - - i2c_master_set_slave_address( &ctx->i2c, ctx->slave_address ); - i2c_master_set_speed( &ctx->i2c, cfg->i2c_speed ); - - return C3DHALL2_OK; -} - -void c3dhall2_default_cfg( c3dhall2_t *ctx ) -{ - c3dhall2_configuration( ctx, C3DHALL2_M1_I2C_SLAVE_ADDRESS_0 | - C3DHALL2_M1_INTERRUPT_DISABLE | - C3DHALL2_M1_FAST_MODE_ENABLE | - C3DHALL2_M1_LOW_POWER_MODE_DISABLE, - C3DHALL2_M2_TEMPERATURE_ENABLE | - C3DHALL2_M2_LOW_POWER_PERIOD_12ms | - C3DHALL2_M2_PARITY_TEST_ENABLE ); -} - -void c3dhall2_write_data ( c3dhall2_t *ctx, uint8_t *data_buf, uint16_t len ) -{ - i2c_master_write( &ctx->i2c, data_buf, len ); -} - -void c3dhall2_read_data ( c3dhall2_t *ctx, uint8_t *data_buf, uint16_t len ) -{ - uint8_t tx_buf[ 1 ]; - - tx_buf [ 0 ] = 0x00; - - i2c_master_write_then_read( &ctx->i2c, tx_buf, 1, data_buf, len ); -} - -void c3dhall2_get_axis_temp_data ( c3dhall2_t *ctx, float *axis_data, float *temp_data ) -{ - char read_data[ 10 ]; - - int16_t x_axis; - int16_t y_axis; - int16_t z_axis; - int16_t temp; - - c3dhall2_read_data( ctx, read_data, 7); - - x_axis = read_data[ 0 ]; - x_axis = x_axis << 4; - x_axis |= ( ( read_data[ 4 ] >> 4 ) & 0x0F ); - - if ( x_axis > 2048 ) - { - x_axis = x_axis - 4096; - } - axis_data[ 0 ] = ( float )( x_axis * 0.098 ); - - y_axis = read_data[1]; - y_axis = y_axis << 4; - y_axis |= ( read_data[ 4 ] & 0x0F ); - if( y_axis > 2048 ) - { - y_axis = y_axis - 4096; - } - axis_data[ 1 ] = ( float )( y_axis * 0.098 ); - - z_axis = read_data[ 2 ]; - z_axis = z_axis << 4; - z_axis |= ( read_data[ 5 ] & 0x0F ); - if ( z_axis > 2048 ) - { - z_axis = z_axis - 4096; - } - axis_data[ 2 ] = ( float )( z_axis * 0.098 ); - - temp = read_data[ 3 ]; - temp = temp << 4; - temp = temp & 0x0F00; - temp = temp | read_data[ 6 ]; - - if ( temp > 2048 ) - { - temp = temp - 4096; - } - - *temp_data = ( temp * 1.1 ) - 340; -} - -void c3dhall2_configuration ( c3dhall2_t *ctx, uint8_t settings1, uint8_t settings2 ) -{ - uint8_t rdata[ 10 ]; - uint8_t wdata[ 10 ]; - uint8_t addr; - - addr = settings1 & 0x60; - - c3dhall2_read_data( ctx, rdata, 10 ); - - wdata[ 0 ] = 0x00; - wdata[ 1 ] = ( rdata[ 7 ] && 0x71 ); - wdata[ 1 ] = ( wdata[ 1 ] || settings1 ); - wdata[ 2 ] = rdata[ 8 ]; - wdata[ 3 ] = ( rdata[ 9 ] && 0x1F ); - wdata[ 3 ] = ( wdata[ 1 ] || settings2 ); - - c3dhall2_write_data( ctx, wdata, 4 ); - -} -// ------------------------------------------------------------------------- END - diff --git a/clicks/3dhall2/lib_c3dhall2/CMakeLists.txt b/clicks/3dhall2/lib_c3dhall2/CMakeLists.txt new file mode 100644 index 0000000000..a482687714 --- /dev/null +++ b/clicks/3dhall2/lib_c3dhall2/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(lib_c3dhall2 LANGUAGES MikroC) +else() + project(lib_c3dhall2 LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_library(lib_c3dhall2 STATIC + src/c3dhall2.c + include/c3dhall2.h +) +add_library(Click.3dHall2 ALIAS lib_c3dhall2) + + + +target_include_directories(lib_c3dhall2 PUBLIC + include +) + +find_package(MikroC.Core REQUIRED) +target_link_libraries(lib_c3dhall2 PUBLIC MikroC.Core) +find_package(MikroSDK.Driver REQUIRED) +target_link_libraries(lib_c3dhall2 PUBLIC MikroSDK.Driver) diff --git a/clicks/3dhall2/lib_c3dhall2/include/Click.3dHall2 b/clicks/3dhall2/lib_c3dhall2/include/Click.3dHall2 new file mode 100644 index 0000000000..999228ef85 --- /dev/null +++ b/clicks/3dhall2/lib_c3dhall2/include/Click.3dHall2 @@ -0,0 +1 @@ +#include "c3dhall2.h" diff --git a/clicks/3dhall2/lib/include/c3dhall2.h b/clicks/3dhall2/lib_c3dhall2/include/c3dhall2.h similarity index 85% rename from clicks/3dhall2/lib/include/c3dhall2.h rename to clicks/3dhall2/lib_c3dhall2/include/c3dhall2.h index 8f663ca564..972c82d0a9 100644 --- a/clicks/3dhall2/lib/include/c3dhall2.h +++ b/clicks/3dhall2/lib_c3dhall2/include/c3dhall2.h @@ -1,245 +1,252 @@ -/* - * MikroSDK - MikroE Software Development Kit - * Copyright© 2020 MikroElektronika d.o.o. - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE - * OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/*! - * \file - * - * \brief This file contains API for 3D Hall 2 Click driver. - * - * \addtogroup c3dhall2 3D Hall 2 Click Driver - * @{ - */ -// ---------------------------------------------------------------------------- - -#ifndef C3DHALL2_H -#define C3DHALL2_H - -#include "drv_digital_out.h" -#include "drv_digital_in.h" -#include "drv_i2c_master.h" - -// -------------------------------------------------------------- PUBLIC MACROS -/** - * \defgroup macros Macros - * \{ - */ - -/** - * \defgroup map_mikrobus MikroBUS - * \{ - */ -#define C3DHALL2_MAP_MIKROBUS( cfg, mikrobus ) \ - cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \ - cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ) -/** \} */ - -/** - * \defgroup error_code Error Code - * \{ - */ -#define C3DHALL2_RETVAL uint8_t -#define C3DHALL2_OK 0x00 -#define C3DHALL2_INIT_ERROR 0xFF -/** \} */ - -#define C3DHALL2_DEF_SLAVE_ADDRESS 0x00 - -/** - * \defgroup mode_1_settings Mode 1 settings - * \{ - */ -#define C3DHALL2_M1_I2C_SLAVE_ADDRESS_0 0x00 -#define C3DHALL2_M1_I2C_SLAVE_ADDRESS_1 0x20 -#define C3DHALL2_M1_I2C_SLAVE_ADDRESS_2 0x40 -#define C3DHALL2_M1_I2C_SLAVE_ADDRESS_3 0x60 -#define C3DHALL2_M1_INTERRUPT_ENABLE 0x04 -#define C3DHALL2_M1_INTERRUPT_DISABLE 0x00 -#define C3DHALL2_M1_FAST_MODE_ENABLE 0x02 -#define C3DHALL2_M1_FAST_MODE_DISABLE 0x00 -#define C3DHALL2_M1_LOW_POWER_MODE_ENABLE 0x01 -#define C3DHALL2_M1_LOW_POWER_MODE_DISABLE 0x00 -/** \} */ - -/** - * \defgroup mode_2_settings Mode 2 settings - * \{ - */ -#define C3DHALL2_M2_TEMPERATURE_ENABLE 0x00 -#define C3DHALL2_M2_TEMPERATURE_DISABLE 0x80 -#define C3DHALL2_M2_LOW_POWER_PERIOD_100ms 0x00 -#define C3DHALL2_M2_LOW_POWER_PERIOD_12ms 0x40 -#define C3DHALL2_M2_PARITY_TEST_ENABLE 0x00 -#define C3DHALL2_M2_PARITY_TEST_DISABLE 0x20 -/** \} */ - -/** \} */ // End group macro -// --------------------------------------------------------------- PUBLIC TYPES -/** - * \defgroup type Types - * \{ - */ - -/** - * @brief Click ctx object definition. - */ -typedef struct -{ - - // Modules - - i2c_master_t i2c; - - // ctx variable - - uint8_t slave_address; - -} c3dhall2_t; - -/** - * @brief Click configuration structure definition. - */ -typedef struct -{ - // Communication gpio pins - - pin_name_t scl; - pin_name_t sda; - - // static variable - - uint32_t i2c_speed; - uint8_t i2c_address; - -} c3dhall2_cfg_t; - -/** \} */ // End types group - -// ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS - -/** - * \defgroup public_function Public function - * \{ - */ - -#ifdef __cplusplus -extern "C"{ -#endif - -/** - * @brief Config Object Initialization function. - * - * @param cfg Click configuration structure. - * - * @description This function initializes click configuration structure to init state. - * @note All used pins will be set to unconnected state. - */ -void c3dhall2_cfg_setup ( c3dhall2_cfg_t *cfg ); - -/** - * @brief Initialization function. - * - * @param ctx Click object. - * @param cfg Click configuration structure. - * - * @description This function initializes all necessary pins and peripherals used for this click. - */ -C3DHALL2_RETVAL c3dhall2_init ( c3dhall2_t *ctx, c3dhall2_cfg_t *cfg ); - -/** - * @brief Default configuration initialization function. - * - * @param ctx Click object. - * - * @description This function initializes default configuration. - * @note This function sets values to required registers. - */ -void c3dhall2_default_cfg ( c3dhall2_t *ctx ); - -/** - * @brief Generic write function. - * - * @param ctx Click object. - * @param data_buf Data buf to be written. - * @param len Number of the bytes in data buf. - * - * @description This function writes data to register. - */ -void c3dhall2_write_data ( c3dhall2_t *ctx, uint8_t *data_buf, uint16_t len ); - -/** - * @brief Generic read function. - * - * @param ctx Click object. - * @param data_buf Output data buf - * @param len Number of the bytes to be read - * - * @description This function reads data from register. - */ -void c3dhall2_read_data ( c3dhall2_t *ctx, uint8_t *data_buf, uint16_t len ); - -/** - * @brief Functions for getting Hall axis data and Temperature data - * - * @param ctx Click object. - * @param axis_data Hall axis data in mT - (axisData[0] - X axis, axisData[1] - Y axis, axisData[2] - Z axis) - * @param temp_data Temperature data in C - * - * @description This function gets temperature and axis data. - */ -void c3dhall2_get_axis_temp_data ( c3dhall2_t *ctx, float *axis_data, float *temp_data ); - -/** - * @brief Functions for settings chip for measurement - * - * @param ctx Click object - * @param settings1 Mode 1 register settings - * @param settings2 Mode 2 register settings - * - * @description This function configures the chip for measurement. - * @note Options - modes : - * *
- * Options for settings:
- *  Mode 1 :
- *    Slave address (0,1, 2 or 3)
- *		Interrupt (Enable or Disable)
- *		Fast mode (Enable or Disable)
- *		Low power mode (Enable or Disable)
- *	Mode 2 :
- *	    Temperature (Enable or Disable)
- *		Low power period (100ms or 12ms)
- *		Parity test (Enable or Disable)
- *
- */ -void c3dhall2_configuration ( c3dhall2_t *ctx, uint8_t settings1, uint8_t settings2 ); - - -#ifdef __cplusplus -} -#endif -#endif // _C3DHALL2_H_ - -/** \} */ // End public_function group -/// \} // End click Driver group -/*! @} */ -// ------------------------------------------------------------------------- END +/* + * MikroSDK - MikroE Software Development Kit + * Copyright© 2020 MikroElektronika d.o.o. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE + * OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/*! + * \file + * + * \brief This file contains API for 3D Hall 2 Click driver. + * + * \addtogroup c3dhall2 3D Hall 2 Click Driver + * @{ + */ +// ---------------------------------------------------------------------------- + +#ifndef C3DHALL2_H +#define C3DHALL2_H + +#include "drv_digital_out.h" +#include "drv_digital_in.h" +#include "drv_i2c_master.h" + +// -------------------------------------------------------------- PUBLIC MACROS +/** + * \defgroup macros Macros + * \{ + */ + +/** + * \defgroup map_mikrobus MikroBUS + * \{ + */ +#define C3DHALL2_MAP_MIKROBUS( cfg, mikrobus ) \ + cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \ + cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ) +/** \} */ + +/** + * @brief 3D Hall 2 device address setting. + * @details Specified setting for device slave address selection of + * 3D Hall 2 Click driver. + */ +#define C3DHALL2_DEVICE_ADDRESS 0x5E + +/** + * \defgroup mode_1_settings Mode 1 settings + * \{ + */ +#define C3DHALL2_M1_I2C_SLAVE_ADDRESS_0 0x00 +#define C3DHALL2_M1_I2C_SLAVE_ADDRESS_1 0x20 +#define C3DHALL2_M1_I2C_SLAVE_ADDRESS_2 0x40 +#define C3DHALL2_M1_I2C_SLAVE_ADDRESS_3 0x60 +#define C3DHALL2_M1_INTERRUPT_ENABLE 0x04 +#define C3DHALL2_M1_INTERRUPT_DISABLE 0x00 +#define C3DHALL2_M1_FAST_MODE_ENABLE 0x02 +#define C3DHALL2_M1_FAST_MODE_DISABLE 0x00 +#define C3DHALL2_M1_LOW_POWER_MODE_ENABLE 0x01 +#define C3DHALL2_M1_LOW_POWER_MODE_DISABLE 0x00 +/** \} */ + +/** + * \defgroup mode_2_settings Mode 2 settings + * \{ + */ +#define C3DHALL2_M2_TEMPERATURE_ENABLE 0x00 +#define C3DHALL2_M2_TEMPERATURE_DISABLE 0x80 +#define C3DHALL2_M2_LOW_POWER_PERIOD_100MS 0x00 +#define C3DHALL2_M2_LOW_POWER_PERIOD_12MS 0x40 +#define C3DHALL2_M2_PARITY_TEST_ENABLE 0x00 +#define C3DHALL2_M2_PARITY_TEST_DISABLE 0x20 +/** \} */ + +/** \} */ // End group macro +// --------------------------------------------------------------- PUBLIC TYPES +/** + * \defgroup type Types + * \{ + */ + +/** + * @brief Click ctx object definition. + */ +typedef struct +{ + + // Modules + + i2c_master_t i2c; + + // ctx variable + + uint8_t slave_address; + +} c3dhall2_t; + +/** + * @brief Click configuration structure definition. + */ +typedef struct +{ + // Communication gpio pins + + pin_name_t scl; + pin_name_t sda; + + // static variable + + uint32_t i2c_speed; + uint8_t i2c_address; + +} c3dhall2_cfg_t; + +/** + * @brief 3D Hall 2 Click return value data. + * @details Predefined enum values for driver return values. + */ +typedef enum +{ + C3DHALL2_OK = 0, + C3DHALL2_ERROR = -1 + +} c3dhall2_return_value_t; + +/** \} */ // End types group + +// ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS + +/** + * \defgroup public_function Public function + * \{ + */ + +#ifdef __cplusplus +extern "C"{ +#endif + +/** + * @brief Config Object Initialization function. + * + * @param cfg Click configuration structure. + * + * @description This function initializes click configuration structure to init state. + * @note All used pins will be set to unconnected state. + */ +void c3dhall2_cfg_setup ( c3dhall2_cfg_t *cfg ); + +/** + * @brief Initialization function. + * + * @param ctx Click object. + * @param cfg Click configuration structure. + * + * @description This function initializes all necessary pins and peripherals used for this click. + */ +err_t c3dhall2_init ( c3dhall2_t *ctx, c3dhall2_cfg_t *cfg ); + +/** + * @brief Default configuration initialization function. + * + * @param ctx Click object. + * + * @description This function initializes default configuration. + * @note This function sets values to required registers. + */ +err_t c3dhall2_default_cfg( c3dhall2_t *ctx ); + +/** + * @brief Generic write function. + * + * @param ctx Click object. + * @param data_buf Data buf to be written. + * @param len Number of the bytes in data buf. + * + * @description This function writes data to register. + */ +err_t c3dhall2_write_data ( c3dhall2_t *ctx, uint8_t *data_buf, uint16_t len ); + +/** + * @brief Generic read function. + * + * @param ctx Click object. + * @param data_buf Output data buf + * @param len Number of the bytes to be read + * + * @description This function reads data from register. + */ +err_t c3dhall2_read_data ( c3dhall2_t *ctx, uint8_t *data_buf, uint16_t len ); + +/** + * @brief Functions for getting Hall axis data and Temperature data + * + * @param ctx Click object. + * @param axis_data Hall axis data in mT - (axisData[0] - X axis, axisData[1] - Y axis, axisData[2] - Z axis) + * @param temp_data Temperature data in C + * + * @description This function gets temperature and axis data. + */ +err_t c3dhall2_get_axis_temp_data ( c3dhall2_t *ctx, float *axis_data, float *temp_data ); + +/** + * @brief Functions for settings chip for measurement + * + * @param ctx Click object + * @param settings1 Mode 1 register settings + * @param settings2 Mode 2 register settings + * + * @description This function configures the chip for measurement. + * @note Options - modes : + * *
+ * Options for settings:
+ *  Mode 1 :
+ *    Slave address (0,1, 2 or 3)
+ *		Interrupt (Enable or Disable)
+ *		Fast mode (Enable or Disable)
+ *		Low power mode (Enable or Disable)
+ *	Mode 2 :
+ *	    Temperature (Enable or Disable)
+ *		Low power period (100ms or 12ms)
+ *		Parity test (Enable or Disable)
+ *
+ */ +err_t c3dhall2_configuration ( c3dhall2_t *ctx, uint8_t settings1, uint8_t settings2 ); + + +#ifdef __cplusplus +} +#endif +#endif // _C3DHALL2_H_ + +/** \} */ // End public_function group +/// \} // End click Driver group +/*! @} */ +// ------------------------------------------------------------------------- END diff --git a/clicks/3dhall2/lib_c3dhall2/src/c3dhall2.c b/clicks/3dhall2/lib_c3dhall2/src/c3dhall2.c new file mode 100644 index 0000000000..3755777725 --- /dev/null +++ b/clicks/3dhall2/lib_c3dhall2/src/c3dhall2.c @@ -0,0 +1,170 @@ +/* + * MikroSDK - MikroE Software Development Kit + * Copyright© 2020 MikroElektronika d.o.o. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE + * OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/*! + * \file + * + */ + +#include "c3dhall2.h" + +// ------------------------------------------------ PUBLIC FUNCTION DEFINITIONS + +void c3dhall2_cfg_setup ( c3dhall2_cfg_t *cfg ) +{ + // Communication gpio pins + cfg->scl = HAL_PIN_NC; + cfg->sda = HAL_PIN_NC; + + cfg->i2c_speed = I2C_MASTER_SPEED_STANDARD; + cfg->i2c_address = C3DHALL2_DEVICE_ADDRESS; +} + +err_t c3dhall2_init ( c3dhall2_t *ctx, c3dhall2_cfg_t *cfg ) +{ + i2c_master_config_t i2c_cfg; + + i2c_master_configure_default( &i2c_cfg ); + + i2c_cfg.scl = cfg->scl; + i2c_cfg.sda = cfg->sda; + + ctx->slave_address = cfg->i2c_address; + + if ( I2C_MASTER_ERROR == i2c_master_open( &ctx->i2c, &i2c_cfg ) ) + { + return I2C_MASTER_ERROR; + } + + if ( I2C_MASTER_ERROR == i2c_master_set_slave_address( &ctx->i2c, ctx->slave_address ) ) + { + return I2C_MASTER_ERROR; + } + + if ( I2C_MASTER_ERROR == i2c_master_set_speed( &ctx->i2c, cfg->i2c_speed ) ) + { + return I2C_MASTER_ERROR; + } + + return C3DHALL2_OK; +} + +err_t c3dhall2_default_cfg( c3dhall2_t *ctx ) +{ + return c3dhall2_configuration ( ctx, C3DHALL2_M1_I2C_SLAVE_ADDRESS_0 | + C3DHALL2_M1_INTERRUPT_DISABLE | + C3DHALL2_M1_FAST_MODE_ENABLE | + C3DHALL2_M1_LOW_POWER_MODE_DISABLE, + C3DHALL2_M2_TEMPERATURE_ENABLE | + C3DHALL2_M2_LOW_POWER_PERIOD_12MS | + C3DHALL2_M2_PARITY_TEST_ENABLE ); +} + +err_t c3dhall2_write_data ( c3dhall2_t *ctx, uint8_t *data_buf, uint16_t len ) +{ + return i2c_master_write ( &ctx->i2c, data_buf, len ); +} + +err_t c3dhall2_read_data ( c3dhall2_t *ctx, uint8_t *data_buf, uint16_t len ) +{ + uint8_t reg_addr = 0; + return i2c_master_write_then_read ( &ctx->i2c, ®_addr, 1, data_buf, len ); +} + +err_t c3dhall2_get_axis_temp_data ( c3dhall2_t *ctx, float *axis_data, float *temp_data ) +{ + uint8_t data_buf[ 7 ] = { 0 }; + int16_t x_axis = 0; + int16_t y_axis = 0; + int16_t z_axis = 0; + int16_t temp = 0; + + err_t error_flag = c3dhall2_read_data ( ctx, data_buf, 7 ); + + if ( data_buf[ 3 ] & 0x03 ) + { + error_flag = C3DHALL2_ERROR; + } + else + { + x_axis = ( ( int16_t ) data_buf[ 0 ] << 4 ) | ( ( data_buf[ 4 ] >> 4 ) & 0x0F ); + x_axis <<= 4; + x_axis >>= 4; + axis_data[ 0 ] = ( float ) ( x_axis * 0.098 ); + + y_axis = ( ( int16_t ) data_buf[ 1 ] << 4 ) | ( data_buf[ 4 ] & 0x0F ); + y_axis <<= 4; + y_axis >>= 4; + axis_data[ 1 ] = ( float ) ( y_axis * 0.098 ); + + z_axis = ( ( int16_t ) data_buf[ 2 ] << 4 ) | ( data_buf[ 5 ] & 0x0F ); + z_axis <<= 4; + z_axis >>= 4; + axis_data[ 2 ] = ( float ) ( z_axis * 0.098 ); + + temp = ( ( int16_t ) ( data_buf[ 3 ] & 0xF0 ) << 4 ) | data_buf[ 6 ]; + temp <<= 4; + temp >>= 4; + *temp_data = ( temp - 340 ) * 1.1 + 25.0; + } + + return error_flag; +} + +err_t c3dhall2_configuration ( c3dhall2_t *ctx, uint8_t settings1, uint8_t settings2 ) +{ + err_t error_flag = C3DHALL2_OK; + uint8_t data_buf[ 10 ] = { 0 }; + uint8_t parity_bit = 0; + + error_flag |= c3dhall2_read_data( ctx, data_buf, 10 ); + + data_buf[ 0 ] = 0x00; + data_buf[ 1 ] = ( data_buf[ 7 ] & 0x18 ) | ( settings1 & 0x67 ); + data_buf[ 2 ] = data_buf[ 8 ]; + data_buf[ 3 ] = ( data_buf[ 9 ] & 0x1F ) | ( settings2 & 0xE0 ); + + for ( uint8_t bit_cnt = 0; bit_cnt < 8; bit_cnt++ ) + { + if ( data_buf[ 1 ] & ( 1 << bit_cnt ) ) + { + parity_bit++; + } + if ( data_buf[ 2 ] & ( 1 << bit_cnt ) ) + { + parity_bit++; + } + if ( data_buf[ 3 ] & ( 1 << bit_cnt ) ) + { + parity_bit++; + } + } + data_buf[ 1 ] |= ( ( parity_bit << 7 ) & 0x80 ); + + error_flag |= c3dhall2_write_data( ctx, data_buf, 4 ); + + return error_flag; +} +// ------------------------------------------------------------------------- END + diff --git a/clicks/3dhall2/memake.txt b/clicks/3dhall2/memake.txt deleted file mode 100644 index 81e477ac23..0000000000 --- a/clicks/3dhall2/memake.txt +++ /dev/null @@ -1,7 +0,0 @@ -type: subdirs -project: C3dHall2 - -subdirs: { - lib - example -} diff --git a/clicks/3gaa/CMakeLists.txt b/clicks/3gaa/CMakeLists.txt new file mode 100644 index 0000000000..d2e48083a2 --- /dev/null +++ b/clicks/3gaa/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(example_c3gaa LANGUAGES MikroC) +else() + project(example_c3gaa LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_executable(example_c3gaa + example/main.c + +) + + +############################ example_c3gaa GENERATED CODE START ########################### +find_package(MikroC.Core REQUIRED) +target_link_libraries(example_c3gaa PUBLIC MikroC.Core) +find_package(MikroSDK.Board REQUIRED) +target_link_libraries(example_c3gaa PUBLIC MikroSDK.Board) +find_package(MikroSDK.Log REQUIRED) +target_link_libraries(example_c3gaa PUBLIC MikroSDK.Log) +add_subdirectory(lib_c3gaa) +target_link_libraries(example_c3gaa PUBLIC Click.3GAA) +############################ example_c3gaa GENERATED CODE END ########################### diff --git a/clicks/3gaa/README.md b/clicks/3gaa/README.md index c3352fbc39..ad15d49659 100644 --- a/clicks/3gaa/README.md +++ b/clicks/3gaa/README.md @@ -3,21 +3,21 @@ --- # 3G-AA click -3G-AA click is a versatile cellular network communication solution, featuring the compact 3G UMTS/HSPA Quectel UG95 module. This module features a full set of options for the cellular networking and communication, such as the network indication, embedded TCP/UDP stack, HTTP/HTTPS stack, full GSM/GPRS/EDGE implementation, UMTS/HSDPA/HSUPA protocol implementation and more.3G-EA click features data-rates of 7.2 Mb/s (downlink) and 5.76 Mb/s (uplink) in HSPA mode. Onboard 16bit audio CODEC IC adds high-quality voice communication capability. +3G-AA click is a versatile cellular network communication solution, featuring the compact 3G UMTS/HSPA Quectel UG95 module. This module features a full set of options for the cellular networking and communication, such as the network indication, embedded TCP/UDP stack, HTTP/HTTPS stack, full GSM/GPRS/EDGE implementation, UMTS/HSDPA/HSUPA protocol implementation and more. 3G-AA click features data-rates of 7.2 Mb/s (downlink) and 5.76 Mb/s (uplink) in HSPA mode. Onboard 16bit audio CODEC IC adds high-quality voice communication capability.

- +

-[click Product page](https://www.mikroe.com/3g-aa-click) +[click Product page](https://www.mikroe.com/3g-ea-click) --- #### Click library -- **Author** : Stefan Ilic -- **Date** : Jul 2021. +- **Author** : Stefan Filipovic +- **Date** : May 2023. - **Type** : UART type @@ -48,44 +48,45 @@ err_t c3gaa_init ( c3gaa_t *ctx, c3gaa_cfg_t *cfg ); #### Example key functions : -- `c3gaa_module_power` This function powers ON/OFF the module. +- `c3gaa_set_sim_apn` This function sets APN for sim card. ```c -void c3gaa_module_power ( c3gaa_t *ctx, uint8_t state ); +void c3gaa_set_sim_apn ( c3gaa_t *ctx, uint8_t *sim_apn ); ``` -- `c3gaa_send_cmd_with_parameter` This function sends a command with specified parameter to the click module. +- `c3gaa_send_sms_text` This function sends text message to a phone number. ```c -void c3gaa_send_cmd_with_parameter ( c3gaa_t *ctx, char *at_cmd_buf, char *param_buf ); +void c3gaa_send_sms_text ( c3gaa_t *ctx, uint8_t *phone_number, uint8_t *sms_text ); ``` -- `c3gaa_send_sms_text` This function sends text message to a phone number. +- `c3gaa_send_sms_pdu` This function sends text message to a phone number in PDU mode. ```c -void c3gaa_send_sms_text ( c3gaa_t *ctx, char *phone_number, char *sms_text ); +err_t c3gaa_send_sms_pdu ( c3gaa_t *ctx, uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text ); ``` ## Example Description -> This example reads and processes data from 3G AA click. +> Application example shows device capability of connecting to the network and sending SMS or TCP/UDP messages using standard "AT" commands. **The demo application is composed of two sections :** ### Application Init -> Initializes the driver and powers up the module, then sets default configuration for connecting the device to network. +> Initializes the driver, tests the communication by sending "AT" command, and after that restarts the device. ```c -void application_init ( void ) { +void application_init ( void ) +{ log_cfg_t log_cfg; /**< Logger config object. */ c3gaa_cfg_t c3gaa_cfg; /**< Click config object. */ - /** + /** * Logger initialization. * Default baud rate: 115200 * Default log level: LOG_LEVEL_DEBUG - * @note If USB_UART_RX and USB_UART_TX - * are defined as HAL_PIN_NC, you will - * need to define them manually for log to work. + * @note If USB_UART_RX and USB_UART_TX + * are defined as HAL_PIN_NC, you will + * need to define them manually for log to work. * See @b LOG_MAP_USB_UART macro definition for detailed explanation. */ LOG_MAP_USB_UART( log_cfg ); @@ -93,118 +94,87 @@ void application_init ( void ) { log_info( &logger, " Application Init " ); // Click initialization. - c3gaa_cfg_setup( &c3gaa_cfg ); C3GAA_MAP_MIKROBUS( c3gaa_cfg, MIKROBUS_1 ); - c3gaa_init( &c3gaa, &c3gaa_cfg ); - - c3gaa_module_power( &c3gaa, C3GAA_MODULE_POWER_ON ); + if ( UART_ERROR == c3gaa_init( &c3gaa, &c3gaa_cfg ) ) + { + log_error( &logger, " Application Init Error. " ); + log_info( &logger, " Please, run program again... " ); + for ( ; ; ); + } - // dummy read c3gaa_process( ); c3gaa_clear_app_buf( ); - - // AT + + // Check communication c3gaa_send_cmd( &c3gaa, C3GAA_CMD_AT ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - // ATI - product information - c3gaa_send_cmd( &c3gaa, C3GAA_CMD_ATI ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CGMR - firmware version - c3gaa_send_cmd( &c3gaa, C3GAA_CMD_CGMR ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CMEE - Report Mobile Equipment Error - c3gaa_send_cmd_with_parameter( &c3gaa, C3GAA_CMD_CMEE, "2" ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + c3gaa_error_check( error_flag ); - // COPS - deregister from network - c3gaa_send_cmd_with_parameter( &c3gaa, C3GAA_CMD_COPS, "2" ); - Delay_ms( 4000 ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); + // Restart device + #define RESTART_DEVICE "1,1" + c3gaa_send_cmd_with_par( &c3gaa, C3GAA_CMD_CFUN, RESTART_DEVICE ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + c3gaa_error_check( error_flag ); - // CGDCONT - set sim apn - c3gaa_set_sim_apn( &c3gaa, SIM_APN ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CFUN - full funtionality - c3gaa_send_cmd_with_parameter( &c3gaa, C3GAA_CMD_CFUN, "1" ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - // COPS - automatic mode - c3gaa_send_cmd_with_parameter( &c3gaa, C3GAA_CMD_COPS, "0" ); - Delay_ms( 4000 ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CREG - network registration status - c3gaa_send_cmd_with_parameter( &c3gaa, C3GAA_CMD_CREG, "1" ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - app_buf_len = 0; - app_buf_cnt = 0; - app_connection_status = WAIT_FOR_CONNECTION; log_info( &logger, " Application Task " ); - Delay_ms( 5000 ); + example_state = C3GAA_CONFIGURE_FOR_NETWORK; } ``` ### Application Task -> Waits for device to connect to network and then sends a desired SMS to the selected phone number approximately every 30 seconds. +> Application task is split in few stages: + - C3GAA_CONFIGURE_FOR_NETWORK: + > Sets configuration to device to be able to connect to the network. + - C3GAA_WAIT_FOR_CONNECTION: + > Waits for the network registration indicated via CREG URC event and then checks the connection status. + - C3GAA_CONFIGURE_FOR_EXAMPLE: + > Sets the device configuration for sending SMS or TCP/UDP messages depending on the selected demo example. + - C3GAA_EXAMPLE: + > Depending on the selected demo example, it sends an SMS message (in PDU or TXT mode) or TCP/UDP message. +> By default, the TCP/UDP example is selected. ```c -void application_task ( void ) { - if ( app_connection_status == WAIT_FOR_CONNECTION ) { - // CREG - network registration status - c3gaa_send_cmd_check( &c3gaa, C3GAA_CMD_CREG ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CSQ - signal quality - c3gaa_send_cmd( &c3gaa, C3GAA_CMD_CSQ ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 3000 ); - } else { - log_info( &logger, "CONNECTED TO NETWORK" ); - - // SMS message format - PDU mode - c3gaa_send_cmd_with_parameter( &c3gaa, C3GAA_CMD_CMGF, "0" ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 3000 ); - - for( ; ; ) { - log_printf( &logger, "> Sending message to phone number...\r\n" ); - c3gaa_send_sms_pdu ( &c3gaa, SIM_SMSC, PHONE_NUMBER_TO_MESSAGE, MESSAGE_CONTENT ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 10000 ); - Delay_ms( 10000 ); - Delay_ms( 10000 ); +void application_task ( void ) +{ + switch ( example_state ) + { + case C3GAA_CONFIGURE_FOR_NETWORK: + { + if ( C3GAA_OK == c3gaa_configure_for_network( ) ) + { + example_state = C3GAA_WAIT_FOR_CONNECTION; + } + break; + } + case C3GAA_WAIT_FOR_CONNECTION: + { + if ( C3GAA_OK == c3gaa_check_connection( ) ) + { + example_state = C3GAA_CONFIGURE_FOR_EXAMPLE; + } + break; + } + case C3GAA_CONFIGURE_FOR_EXAMPLE: + { + if ( C3GAA_OK == c3gaa_configure_for_example( ) ) + { + example_state = C3GAA_EXAMPLE; + } + break; + } + case C3GAA_EXAMPLE: + { + c3gaa_example( ); + break; + } + default: + { + log_error( &logger, " Example state." ); + break; } } } @@ -213,13 +183,14 @@ void application_task ( void ) { ## Note -> In order for the example to work, user needs to set the phone number to which he wants -> to send an SMS, and also will need to set an APN and SMSC (required for PDU mode only) of entered SIM card. -> Enter valid data for the following macros: SIM_APN, SIM_SMSC and PHONE_NUMBER_TO_MESSAGE. ->> E.g. - >> * SIM_APN "vipmobile" - >> * SIM_SMSC "+381610401" - >> * PHONE_NUMBER_TO_MESSAGE "+381659999999" +> In order for the examples to work, user needs to set the APN and SMSC (SMS PDU mode only) +of entered SIM card as well as the phone number (SMS mode only) to which he wants to send an SMS. +Enter valid values for the following macros: SIM_APN, SIM_SMSC and PHONE_NUMBER_TO_MESSAGE. +> > Example: +> > - SIM_APN "internet" +> > - SIM_SMSC "+381610401" +> > - PHONE_NUMBER_TO_MESSAGE "+381659999999" + The full application code, and ready to use projects can be installed directly from *NECTO Studio Package Manager*(recommended way), downloaded from our [LibStock™](https://libstock.mikroe.com) or found on [Mikroe github account](https://github.com/MikroElektronika/mikrosdk_click_v2/tree/master/clicks). @@ -227,7 +198,7 @@ The full application code, and ready to use projects can be installed directly f - MikroSDK.Board - MikroSDK.Log -- Click.C3GAA +- Click.3GAA **Additional notes and informations** diff --git a/clicks/3gaa/changelog.md b/clicks/3gaa/changelog.md index 8a902bbfaf..ca09ef759f 100644 --- a/clicks/3gaa/changelog.md +++ b/clicks/3gaa/changelog.md @@ -1,4 +1,4 @@ ## Changelog -### Version 2.0.0.4 +### Version 2.1.0.4 - Initial release diff --git a/clicks/3gaa/details.md b/clicks/3gaa/details.md index ca7e42509d..e7706c797c 100644 --- a/clicks/3gaa/details.md +++ b/clicks/3gaa/details.md @@ -2,21 +2,21 @@ --- # 3G-AA click -3G-AA click is a versatile cellular network communication solution, featuring the compact 3G UMTS/HSPA Quectel UG95 module. This module features a full set of options for the cellular networking and communication, such as the network indication, embedded TCP/UDP stack, HTTP/HTTPS stack, full GSM/GPRS/EDGE implementation, UMTS/HSDPA/HSUPA protocol implementation and more.3G-EA click features data-rates of 7.2 Mb/s (downlink) and 5.76 Mb/s (uplink) in HSPA mode. Onboard 16bit audio CODEC IC adds high-quality voice communication capability. +3G-AA click is a versatile cellular network communication solution, featuring the compact 3G UMTS/HSPA Quectel UG95 module. This module features a full set of options for the cellular networking and communication, such as the network indication, embedded TCP/UDP stack, HTTP/HTTPS stack, full GSM/GPRS/EDGE implementation, UMTS/HSDPA/HSUPA protocol implementation and more. 3G-AA click features data-rates of 7.2 Mb/s (downlink) and 5.76 Mb/s (uplink) in HSPA mode. Onboard 16bit audio CODEC IC adds high-quality voice communication capability.

- +

-[click Product page](https://www.mikroe.com/3g-aa-click) +[click Product page](https://www.mikroe.com/3g-ea-click) --- #### Click library -- **Author** : Stefan Ilic -- **Date** : Jul 2021. +- **Author** : Stefan Filipovic +- **Date** : May 2023. - **Type** : UART type @@ -47,44 +47,45 @@ err_t c3gaa_init ( c3gaa_t *ctx, c3gaa_cfg_t *cfg ); #### Example key functions : -- `c3gaa_module_power` This function powers ON/OFF the module. +- `c3gaa_set_sim_apn` This function sets APN for sim card. ```c -void c3gaa_module_power ( c3gaa_t *ctx, uint8_t state ); +void c3gaa_set_sim_apn ( c3gaa_t *ctx, uint8_t *sim_apn ); ``` -- `c3gaa_send_cmd_with_parameter` This function sends a command with specified parameter to the click module. +- `c3gaa_send_sms_text` This function sends text message to a phone number. ```c -void c3gaa_send_cmd_with_parameter ( c3gaa_t *ctx, char *at_cmd_buf, char *param_buf ); +void c3gaa_send_sms_text ( c3gaa_t *ctx, uint8_t *phone_number, uint8_t *sms_text ); ``` -- `c3gaa_send_sms_text` This function sends text message to a phone number. +- `c3gaa_send_sms_pdu` This function sends text message to a phone number in PDU mode. ```c -void c3gaa_send_sms_text ( c3gaa_t *ctx, char *phone_number, char *sms_text ); +err_t c3gaa_send_sms_pdu ( c3gaa_t *ctx, uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text ); ``` ## Example Description -> This example reads and processes data from 3G AA click. +> Application example shows device capability of connecting to the network and sending SMS or TCP/UDP messages using standard "AT" commands. **The demo application is composed of two sections :** ### Application Init -> Initializes the driver and powers up the module, then sets default configuration for connecting the device to network. +> Initializes the driver, tests the communication by sending "AT" command, and after that restarts the device. ```c -void application_init ( void ) { +void application_init ( void ) +{ log_cfg_t log_cfg; /**< Logger config object. */ c3gaa_cfg_t c3gaa_cfg; /**< Click config object. */ - /** + /** * Logger initialization. * Default baud rate: 115200 * Default log level: LOG_LEVEL_DEBUG - * @note If USB_UART_RX and USB_UART_TX - * are defined as HAL_PIN_NC, you will - * need to define them manually for log to work. + * @note If USB_UART_RX and USB_UART_TX + * are defined as HAL_PIN_NC, you will + * need to define them manually for log to work. * See @b LOG_MAP_USB_UART macro definition for detailed explanation. */ LOG_MAP_USB_UART( log_cfg ); @@ -92,118 +93,87 @@ void application_init ( void ) { log_info( &logger, " Application Init " ); // Click initialization. - c3gaa_cfg_setup( &c3gaa_cfg ); C3GAA_MAP_MIKROBUS( c3gaa_cfg, MIKROBUS_1 ); - c3gaa_init( &c3gaa, &c3gaa_cfg ); - - c3gaa_module_power( &c3gaa, C3GAA_MODULE_POWER_ON ); + if ( UART_ERROR == c3gaa_init( &c3gaa, &c3gaa_cfg ) ) + { + log_error( &logger, " Application Init Error. " ); + log_info( &logger, " Please, run program again... " ); + for ( ; ; ); + } - // dummy read c3gaa_process( ); c3gaa_clear_app_buf( ); - - // AT + + // Check communication c3gaa_send_cmd( &c3gaa, C3GAA_CMD_AT ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - // ATI - product information - c3gaa_send_cmd( &c3gaa, C3GAA_CMD_ATI ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CGMR - firmware version - c3gaa_send_cmd( &c3gaa, C3GAA_CMD_CGMR ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CMEE - Report Mobile Equipment Error - c3gaa_send_cmd_with_parameter( &c3gaa, C3GAA_CMD_CMEE, "2" ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + c3gaa_error_check( error_flag ); - // COPS - deregister from network - c3gaa_send_cmd_with_parameter( &c3gaa, C3GAA_CMD_COPS, "2" ); - Delay_ms( 4000 ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); + // Restart device + #define RESTART_DEVICE "1,1" + c3gaa_send_cmd_with_par( &c3gaa, C3GAA_CMD_CFUN, RESTART_DEVICE ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + c3gaa_error_check( error_flag ); - // CGDCONT - set sim apn - c3gaa_set_sim_apn( &c3gaa, SIM_APN ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CFUN - full funtionality - c3gaa_send_cmd_with_parameter( &c3gaa, C3GAA_CMD_CFUN, "1" ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - // COPS - automatic mode - c3gaa_send_cmd_with_parameter( &c3gaa, C3GAA_CMD_COPS, "0" ); - Delay_ms( 4000 ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CREG - network registration status - c3gaa_send_cmd_with_parameter( &c3gaa, C3GAA_CMD_CREG, "1" ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - app_buf_len = 0; - app_buf_cnt = 0; - app_connection_status = WAIT_FOR_CONNECTION; log_info( &logger, " Application Task " ); - Delay_ms( 5000 ); + example_state = C3GAA_CONFIGURE_FOR_NETWORK; } ``` ### Application Task -> Waits for device to connect to network and then sends a desired SMS to the selected phone number approximately every 30 seconds. +> Application task is split in few stages: + - C3GAA_CONFIGURE_FOR_NETWORK: + > Sets configuration to device to be able to connect to the network. + - C3GAA_WAIT_FOR_CONNECTION: + > Waits for the network registration indicated via CREG URC event and then checks the connection status. + - C3GAA_CONFIGURE_FOR_EXAMPLE: + > Sets the device configuration for sending SMS or TCP/UDP messages depending on the selected demo example. + - C3GAA_EXAMPLE: + > Depending on the selected demo example, it sends an SMS message (in PDU or TXT mode) or TCP/UDP message. +> By default, the TCP/UDP example is selected. ```c -void application_task ( void ) { - if ( app_connection_status == WAIT_FOR_CONNECTION ) { - // CREG - network registration status - c3gaa_send_cmd_check( &c3gaa, C3GAA_CMD_CREG ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CSQ - signal quality - c3gaa_send_cmd( &c3gaa, C3GAA_CMD_CSQ ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 3000 ); - } else { - log_info( &logger, "CONNECTED TO NETWORK" ); - - // SMS message format - PDU mode - c3gaa_send_cmd_with_parameter( &c3gaa, C3GAA_CMD_CMGF, "0" ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 3000 ); - - for( ; ; ) { - log_printf( &logger, "> Sending message to phone number...\r\n" ); - c3gaa_send_sms_pdu ( &c3gaa, SIM_SMSC, PHONE_NUMBER_TO_MESSAGE, MESSAGE_CONTENT ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 10000 ); - Delay_ms( 10000 ); - Delay_ms( 10000 ); +void application_task ( void ) +{ + switch ( example_state ) + { + case C3GAA_CONFIGURE_FOR_NETWORK: + { + if ( C3GAA_OK == c3gaa_configure_for_network( ) ) + { + example_state = C3GAA_WAIT_FOR_CONNECTION; + } + break; + } + case C3GAA_WAIT_FOR_CONNECTION: + { + if ( C3GAA_OK == c3gaa_check_connection( ) ) + { + example_state = C3GAA_CONFIGURE_FOR_EXAMPLE; + } + break; + } + case C3GAA_CONFIGURE_FOR_EXAMPLE: + { + if ( C3GAA_OK == c3gaa_configure_for_example( ) ) + { + example_state = C3GAA_EXAMPLE; + } + break; + } + case C3GAA_EXAMPLE: + { + c3gaa_example( ); + break; + } + default: + { + log_error( &logger, " Example state." ); + break; } } } @@ -212,13 +182,14 @@ void application_task ( void ) { ## Note -> In order for the example to work, user needs to set the phone number to which he wants -> to send an SMS, and also will need to set an APN and SMSC (required for PDU mode only) of entered SIM card. -> Enter valid data for the following macros: SIM_APN, SIM_SMSC and PHONE_NUMBER_TO_MESSAGE. ->> E.g. - >> * SIM_APN "vipmobile" - >> * SIM_SMSC "+381610401" - >> * PHONE_NUMBER_TO_MESSAGE "+381659999999" +> In order for the examples to work, user needs to set the APN and SMSC (SMS PDU mode only) +of entered SIM card as well as the phone number (SMS mode only) to which he wants to send an SMS. +Enter valid values for the following macros: SIM_APN, SIM_SMSC and PHONE_NUMBER_TO_MESSAGE. +> > Example: +> > - SIM_APN "internet" +> > - SIM_SMSC "+381610401" +> > - PHONE_NUMBER_TO_MESSAGE "+381659999999" + The full application code, and ready to use projects can be installed directly from *NECTO Studio Package Manager*(recommended way), downloaded from our [LibStock™](https://libstock.mikroe.com) or found on [Mikroe github account](https://github.com/MikroElektronika/mikrosdk_click_v2/tree/master/clicks). @@ -226,7 +197,7 @@ The full application code, and ready to use projects can be installed directly f - MikroSDK.Board - MikroSDK.Log -- Click.C3GAA +- Click.3GAA **Additional notes and informations** diff --git a/clicks/3gaa/doc/doxy/Doxyfile.doxy b/clicks/3gaa/doc/doxy/Doxyfile.doxy index cb40e01b55..fcb96b5329 100644 --- a/clicks/3gaa/doc/doxy/Doxyfile.doxy +++ b/clicks/3gaa/doc/doxy/Doxyfile.doxy @@ -44,21 +44,21 @@ PROJECT_NUMBER = 2.0.0.0 # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = +PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = +PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = ../clicks/c3gaa/temp/Help/doc +OUTPUT_DIRECTORY = ../cmake/c3gaa/temp/Help/doc # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -162,7 +162,7 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -171,7 +171,7 @@ STRIP_FROM_PATH = # specify the list of include paths that are normally passed to the compiler # using the -I flag. -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't @@ -238,13 +238,13 @@ TAB_SIZE = 4 # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. -ALIASES = +ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. -TCL_SUBST = +TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For @@ -291,7 +291,7 @@ OPTIMIZE_OUTPUT_VHDL = NO # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. -EXTENSION_MAPPING = +EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable @@ -648,7 +648,7 @@ GENERATE_DEPRECATEDLIST= YES # sections, marked by \if ... \endif and \cond # ... \endcond blocks. -ENABLED_SECTIONS = +ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the @@ -690,7 +690,7 @@ SHOW_NAMESPACES = YES # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. -FILE_VERSION_FILTER = +FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated @@ -703,7 +703,7 @@ FILE_VERSION_FILTER = # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. -LAYOUT_FILE = +LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib @@ -713,7 +713,7 @@ LAYOUT_FILE = # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. -CITE_BIB_FILES = +CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages @@ -778,7 +778,7 @@ WARN_FORMAT = "$file:$line: $text" # messages should be written. If left blank the output is written to standard # error (stderr). -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files @@ -790,9 +790,9 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = ../clicks/c3gaa/example \ - ../clicks/c3gaa/lib/include \ - ../clicks/c3gaa/README.md +INPUT = ../cmake/c3gaa/example \ + ../cmake/c3gaa/lib_c3gaa/include \ + ../cmake/c3gaa/README.md # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -877,7 +877,7 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = +EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -893,7 +893,7 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the @@ -904,13 +904,13 @@ EXCLUDE_PATTERNS = # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* -EXCLUDE_SYMBOLS = +EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = ../clicks/c3gaa/example +EXAMPLE_PATH = ../cmake/c3gaa/example # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and @@ -930,7 +930,7 @@ EXAMPLE_RECURSIVE = YES # that contain images that are to be included in the documentation (see the # \image command). -IMAGE_PATH = +IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program @@ -951,7 +951,7 @@ IMAGE_PATH = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -INPUT_FILTER = +INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the @@ -964,7 +964,7 @@ INPUT_FILTER = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -FILTER_PATTERNS = +FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for @@ -979,14 +979,14 @@ FILTER_SOURCE_FILES = NO # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. -FILTER_SOURCE_PATTERNS = +FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = +USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing @@ -1091,7 +1091,7 @@ CLANG_ASSISTED_PARSING = NO # specified with INPUT and INCLUDE_PATH. # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. -CLANG_OPTIONS = +CLANG_OPTIONS = #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index @@ -1117,7 +1117,7 @@ COLS_IN_ALPHA_INDEX = 5 # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output @@ -1161,7 +1161,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = +HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard @@ -1171,7 +1171,7 @@ HTML_HEADER = # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = +HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of @@ -1183,7 +1183,7 @@ HTML_FOOTER = # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_STYLESHEET = +HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets @@ -1196,7 +1196,7 @@ HTML_STYLESHEET = # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = +HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note @@ -1206,7 +1206,7 @@ HTML_EXTRA_STYLESHEET = # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = +HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to @@ -1335,7 +1335,7 @@ GENERATE_HTMLHELP = NO # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_FILE = +CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, @@ -1343,7 +1343,7 @@ CHM_FILE = # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -HHC_LOCATION = +HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the master .chm file (NO). @@ -1356,7 +1356,7 @@ GENERATE_CHI = NO # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_INDEX_ENCODING = +CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it @@ -1387,7 +1387,7 @@ GENERATE_QHP = NO # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. -QCH_FILE = +QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace @@ -1412,7 +1412,7 @@ QHP_VIRTUAL_FOLDER = ./temp/Help/doc # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom @@ -1420,21 +1420,21 @@ QHP_CUST_FILTER_NAME = # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_ATTRS = +QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_SECT_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. -QHG_LOCATION = +QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To @@ -1567,7 +1567,7 @@ MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_EXTENSIONS = +MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site @@ -1575,7 +1575,7 @@ MATHJAX_EXTENSIONS = # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_CODEFILE = +MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and @@ -1635,7 +1635,7 @@ EXTERNAL_SEARCH = NO # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. -SEARCHENGINE_URL = +SEARCHENGINE_URL = # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed # search data is written to a file for indexing by an external tool. With the @@ -1651,7 +1651,7 @@ SEARCHDATA_FILE = searchdata.xml # projects and redirect the results back to the right project. # This tag requires that the tag SEARCHENGINE is set to YES. -EXTERNAL_SEARCH_ID = +EXTERNAL_SEARCH_ID = # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen # projects other than the one defined by this configuration file, but that are @@ -1661,7 +1661,7 @@ EXTERNAL_SEARCH_ID = # EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... # This tag requires that the tag SEARCHENGINE is set to YES. -EXTRA_SEARCH_MAPPINGS = +EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- # Configuration options related to the LaTeX output @@ -1725,7 +1725,7 @@ PAPER_TYPE = a4 # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. -EXTRA_PACKAGES = +EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for the # generated LaTeX document. The header should contain everything until the first @@ -1741,7 +1741,7 @@ EXTRA_PACKAGES = # to HTML_HEADER. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_HEADER = +LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the # generated LaTeX document. The footer should contain everything after the last @@ -1752,7 +1752,7 @@ LATEX_HEADER = # Note: Only use a user-defined footer if you know what you are doing! # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_FOOTER = +LATEX_FOOTER = # The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined # LaTeX style sheets that are included after the standard style sheets created @@ -1763,7 +1763,7 @@ LATEX_FOOTER = # list). # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_STYLESHEET = +LATEX_EXTRA_STYLESHEET = # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output @@ -1771,7 +1771,7 @@ LATEX_EXTRA_STYLESHEET = # markers available. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_FILES = +LATEX_EXTRA_FILES = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is # prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will @@ -1879,14 +1879,14 @@ RTF_HYPERLINKS = NO # default style sheet that doxygen normally uses. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_STYLESHEET_FILE = +RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is # similar to doxygen's config file. A template extensions file can be generated # using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_EXTENSIONS_FILE = +RTF_EXTENSIONS_FILE = # If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code # with syntax highlighting in the RTF output. @@ -1931,7 +1931,7 @@ MAN_EXTENSION = .3 # MAN_EXTENSION with the initial . removed. # This tag requires that the tag GENERATE_MAN is set to YES. -MAN_SUBDIR = +MAN_SUBDIR = # If the MAN_LINKS tag is set to YES and doxygen generates man output, then it # will generate one additional man file for each entity documented in the real @@ -2044,7 +2044,7 @@ PERLMOD_PRETTY = YES # overwrite each other's variables. # This tag requires that the tag GENERATE_PERLMOD is set to YES. -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor @@ -2085,7 +2085,7 @@ SEARCH_INCLUDES = YES # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = +INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the @@ -2093,7 +2093,7 @@ INCLUDE_PATH = # used. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -INCLUDE_FILE_PATTERNS = +INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that are # defined before the preprocessor is started (similar to the -D option of e.g. @@ -2103,7 +2103,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = +PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -2112,7 +2112,7 @@ PREDEFINED = # definition found in the source code. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will # remove all references to function-like macros that are alone on a line, have @@ -2141,13 +2141,13 @@ SKIP_FUNCTION_MACROS = YES # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. -TAGFILES = +TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create a # tag file that is based on the input files it reads. See section "Linking to # external documentation" for more information about the usage of tag files. -GENERATE_TAGFILE = +GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES, all external class will be listed in # the class index. If set to NO, only the inherited external classes will be @@ -2188,7 +2188,7 @@ CLASS_DIAGRAMS = YES # DIA_PATH tag allows you to specify the directory where the dia binary resides. # If left empty dia is assumed to be found in the default search path. -DIA_PATH = +DIA_PATH = # If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. @@ -2237,7 +2237,7 @@ DOT_FONTSIZE = 10 # the path where dot can find it using this tag. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTPATH = +DOT_FONTPATH = # If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for # each documented class showing the direct and indirect inheritance relations. @@ -2381,26 +2381,26 @@ INTERACTIVE_SVG = NO # found. If left blank, it is assumed the dot tool can be found in the path. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_PATH = +DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the \dotfile # command). # This tag requires that the tag HAVE_DOT is set to YES. -DOTFILE_DIRS = +DOTFILE_DIRS = # The MSCFILE_DIRS tag can be used to specify one or more directories that # contain msc files that are included in the documentation (see the \mscfile # command). -MSCFILE_DIRS = +MSCFILE_DIRS = # The DIAFILE_DIRS tag can be used to specify one or more directories that # contain dia files that are included in the documentation (see the \diafile # command). -DIAFILE_DIRS = +DIAFILE_DIRS = # When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the # path where java can find the plantuml.jar file. If left blank, it is assumed @@ -2408,17 +2408,17 @@ DIAFILE_DIRS = # generate a warning when it encounters a \startuml command in this case and # will not generate output for the diagram. -PLANTUML_JAR_PATH = +PLANTUML_JAR_PATH = # When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a # configuration file for plantuml. -PLANTUML_CFG_FILE = +PLANTUML_CFG_FILE = # When using plantuml, the specified paths are searched for files specified by # the !include statement in a plantuml block. -PLANTUML_INCLUDE_PATH = +PLANTUML_INCLUDE_PATH = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes diff --git a/clicks/3gaa/doc/package/manifest.json b/clicks/3gaa/doc/package/manifest.json index fb6c31bee4..6601277b21 100644 --- a/clicks/3gaa/doc/package/manifest.json +++ b/clicks/3gaa/doc/package/manifest.json @@ -1,6 +1,6 @@ { - "architecture": "ARM|PIC|PIC32", - "category": "GSM/LTE", + "architecture": "ARM|PIC|PIC32|RISC-V", + "category": "Click Boards > Wireless connectivity > GSM/LTE", "changelog": "Resources/CHANGELOG.md", "contains": [ "libraries", @@ -8,8 +8,7 @@ "examples", "source_files" ], - "dependency_list": [ - ], + "dependency_list": [], "details": "Resources/DETAILS.md", "display_name": "3G-AA click", "example_list": [ @@ -25,12 +24,15 @@ }, "name": "mikroe.click.c3gaa", "product_link": "https://www.mikroe.com/3g-aa-click", - "short_description": "3G-AA click is a versatile cellular network communication solution, featuring the compact 3G UMTS/HSPA Quectel UG95 module. This module features a full set of options for the cellular networking and communication, such as the network indication, embedded TCP/UDP stack, HTTP/HTTPS stack, full GSM/GPRS/EDGE implementation, UMTS/HSDPA/HSUPA protocol implementation and more.3G-EA click features data-rates of 7.2 Mb/s (downlink) and 5.76 Mb/s (uplink) in HSPA mode. Onboard 16bit audio CODEC IC adds high-quality voice communication capability.", - "supported_compiler": "mikroC AI", + "short_description": "3G-AA click is a versatile cellular network communication solution, featuring the compact 3G UMTS/HSPA Quectel UG95 module. This module features a full set of options for the cellular networking and communication, such as the network indication, embedded TCP/UDP stack, HTTP/HTTPS stack, full GSM/GPRS/EDGE implementation, UMTS/HSDPA/HSUPA protocol implementation and more.3G-AA click features data-rates of 7.2 Mb/s (downlink) and 5.76 Mb/s (uplink) in HSPA mode. Onboard 16bit audio CODEC IC adds high-quality voice communication capability.", + "supported_compiler": "mikroC AI|GCC", "type": "Library", - "_type":"mikroSDK Library", - "version": "2.0.0.4" + "related_projects": [ + 1802 + ], + "_type": "mikroSDK Library", + "version": "2.1.0.4", + "cmake": true, + "alias": "Click.3GAA", + "subdir_name": "lib_c3gaa" } - - - diff --git a/clicks/3gaa/example/CMakeLists.txt b/clicks/3gaa/example/CMakeLists.txt new file mode 100644 index 0000000000..41c273faf6 --- /dev/null +++ b/clicks/3gaa/example/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(example_c3gaa LANGUAGES MikroC) +else() + project(example_c3gaa LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_executable(example_c3gaa + main.c + +) + + +############################ example_c3gaa GENERATED CODE START ########################### +find_package(MikroC.Core REQUIRED) +target_link_libraries(example_c3gaa PUBLIC MikroC.Core) +find_package(MikroSDK.Board REQUIRED) +target_link_libraries(example_c3gaa PUBLIC MikroSDK.Board) +find_package(MikroSDK.Log REQUIRED) +target_link_libraries(example_c3gaa PUBLIC MikroSDK.Log) +add_subdirectory(lib_c3gaa) +target_link_libraries(example_c3gaa PUBLIC Click.3GAA) +############################ example_c3gaa GENERATED CODE END ########################### diff --git a/clicks/3gaa/example/main.c b/clicks/3gaa/example/main.c index b50dd98886..2579cd9f7a 100644 --- a/clicks/3gaa/example/main.c +++ b/clicks/3gaa/example/main.c @@ -3,140 +3,210 @@ * @brief 3G-AA Click Example. * * # Description - * This example reads and processes data from 3G-AA click. + * Application example shows device capability of connecting to the network and + * sending SMS or TCP/UDP messages using standard "AT" commands. * * The demo application is composed of two sections : - * - * ## Application Init - * Initializes the driver and powers up the module, then sets default configuration - * for connecting the device to network. - * - * ## Application Task - * Waits for device to connect to network and then sends a desired SMS to the selected phone number - * approximately every 30 seconds. - * + * + * ## Application Init + * Initializes the driver, tests the communication by sending "AT" command, and after that restarts the device. + * + * ## Application Task + * Application task is split in few stages: + * - C3GAA_CONFIGURE_FOR_NETWORK: + * Sets configuration to device to be able to connect to the network. + * + * - C3GAA_WAIT_FOR_CONNECTION: + * Waits for the network registration indicated via CREG URC event and then checks + * the connection status. + * + * - C3GAA_CONFIGURE_FOR_EXAMPLE: + * Sets the device configuration for sending SMS or TCP/UDP messages depending on the selected demo example. + * + * - C3GAA_EXAMPLE: + * Depending on the selected demo example, it sends an SMS message (in PDU or TXT mode) or TCP/UDP message. + * + * By default, the TCP/UDP example is selected. + * * ## Additional Function * - static void c3gaa_clear_app_buf ( void ) + * - static err_t c3gaa_process ( void ) * - static void c3gaa_error_check( err_t error_flag ) * - static void c3gaa_log_app_buf ( void ) - * - static void c3gaa_check_connection( void ) - * - static err_t c3gaa_rsp_check ( void ) - * - static err_t c3gaa_process ( void ) - * - * @note - * In order for the example to work, user needs to set the phone number to which he wants - * to send an SMS, and also will need to set an APN and SMSC (required for PDU mode only) of entered SIM card. - * Enter valid data for the following macros: SIM_APN, SIM_SMSC and PHONE_NUMBER_TO_MESSAGE. - * E.g. - SIM_APN "vipmobile" + * - static err_t c3gaa_rsp_check ( uint8_t *rsp ) + * - static err_t c3gaa_configure_for_connection( void ) + * - static err_t c3gaa_check_connection( void ) + * - static err_t c3gaa_configure_for_messages( void ) + * - static err_t c3gaa_send_message( void ) + * + * @note + * In order for the examples to work, user needs to set the APN and SMSC (SMS PDU mode only) + * of entered SIM card as well as the phone number (SMS mode only) to which he wants to send an SMS. + * Enter valid values for the following macros: SIM_APN, SIM_SMSC and PHONE_NUMBER_TO_MESSAGE. + * Example: + SIM_APN "internet" SIM_SMSC "+381610401" - PHONE_NUMBER_TO_MESSAGE "+38169999999" + PHONE_NUMBER_TO_MESSAGE "+381659999999" * - * @author Stefan Ilic + * @author Stefan Filipovic * */ #include "board.h" #include "log.h" #include "c3gaa.h" -#include "string.h" +#include "conversions.h" -#define APP_OK 0 -#define APP_ERROR_DRIVER -1 -#define APP_ERROR_OVERFLOW -2 -#define APP_ERROR_TIMEOUT -3 +// Example selection macros +#define EXAMPLE_TCP_UDP 0 // Example of sending messages to a TCP/UDP echo server +#define EXAMPLE_SMS 1 // Example of sending SMS to a phone number +#define DEMO_EXAMPLE EXAMPLE_TCP_UDP // Example selection macro -#define RSP_OK "OK" -#define RSP_ERROR "ERROR" +// SIM APN config +#define SIM_APN "" // Set valid SIM APN -#define SIM_APN "" // Set valid SIM APN -#define SIM_SMSC "" // Set valid SMS Service Center Address - only in PDU mode -#define PHONE_NUMBER_TO_MESSAGE "" // Set Phone number to message -#define MESSAGE_CONTENT "3G-AA click board - demo example." // Message content +// SMS example parameters +#define SIM_SMSC "" // Set valid SMS Service Center Address - only in SMS PDU mode +#define PHONE_NUMBER_TO_MESSAGE "" // Set Phone number to message +#define SMS_MODE "1" // SMS mode: "0" - PDU, "1" - TXT +// TCP/UDP example parameters +#define REMOTE_IP "77.46.162.162" // TCP/UDP echo server IP address +#define REMOTE_PORT "51111" // TCP/UDP echo server port + +// Message content +#define MESSAGE_CONTENT "3G-AA click board - demo example." + +// Application buffer size +#define APP_BUFFER_SIZE 256 #define PROCESS_BUFFER_SIZE 256 -#define WAIT_FOR_CONNECTION 0 -#define CONNECTED_TO_NETWORK 1 +/** + * @brief Example states. + * @details Predefined enum values for application example state. + */ +typedef enum +{ + C3GAA_CONFIGURE_FOR_NETWORK = 1, + C3GAA_WAIT_FOR_CONNECTION, + C3GAA_CONFIGURE_FOR_EXAMPLE, + C3GAA_EXAMPLE + +} c3gaa_example_state_t; static c3gaa_t c3gaa; static log_t logger; -static char app_buf[ PROCESS_BUFFER_SIZE ] = { 0 }; +/** + * @brief Application example variables. + * @details Variables used in application example. + */ +static uint8_t app_buf[ APP_BUFFER_SIZE ] = { 0 }; static int32_t app_buf_len = 0; -static int32_t app_buf_cnt = 0; - -static uint8_t app_connection_status = WAIT_FOR_CONNECTION; - -static err_t app_error_flag; +static err_t error_flag; +static c3gaa_example_state_t example_state; /** - * @brief 3G-AA clearing application buffer. - * @details This function clears memory of application buffer and reset it's length and counter. - * @note None. + * @brief Clearing application buffer. + * @details This function clears memory of application + * buffer and reset its length and counter. */ static void c3gaa_clear_app_buf ( void ); /** - * @brief 3G-AA data reading function. - * @details This function reads data from device and concatenates data to application buffer. - * - * @return @li @c 0 - Read some data. + * @brief Data reading function. + * @details This function reads data from device and + * appends it to the application buffer. + * @return @li @c 0 - Some data is read. * @li @c -1 - Nothing is read. - * @li @c -2 - Application buffer overflow. - * * See #err_t definition for detailed explanation. - * @note None. */ static err_t c3gaa_process ( void ); /** - * @brief 3G-AA check for errors. - * @details This function checks for different types of errors and logs them on UART. - * @note None. + * @brief Check for errors. + * @details This function checks for different types of + * errors and logs them on UART or logs the response if no errors occured. + * @param[in] error_flag Error flag to check. */ -static void c3gaa_error_check( err_t error_flag ); +static void c3gaa_error_check ( err_t error_flag ); /** - * @brief 3G-AA logs application buffer. + * @brief Logs application buffer. * @details This function logs data from application buffer. - * @note None. */ static void c3gaa_log_app_buf ( void ); /** - * @brief 3G-AA response check. - * @details This function checks for response and returns the status of response. - * - * @return application status. + * @brief Response check. + * @details This function checks for response and + * returns the status of response. + * @param[in] rsp Expected response. + * @return @li @c 0 - OK response. + * @li @c -2 - Timeout error. + * @li @c -3 - Command error. + * @li @c -4 - Unknown error. + * See #err_t definition for detailed explanation. + */ +static err_t c3gaa_rsp_check ( uint8_t *rsp ); + +/** + * @brief Configure device for connection to the network. + * @details Sends commands to configure and enable + * connection to the specified network. + * @return @li @c 0 - OK response. + * @li @c -2 - Timeout error. + * @li @c -3 - Command error. + * @li @c -4 - Unknown error. * See #err_t definition for detailed explanation. - * @note None. */ -static err_t c3gaa_rsp_check ( void ); +static err_t c3gaa_configure_for_network ( void ); /** - * @brief 3G-AA check connection. - * @details This function checks connection to the network and - * logs that status to UART. - * - * @note None. + * @brief Wait for connection signal. + * @details Wait for connection signal from CREG URC. + * @return @li @c 0 - OK response. + * @li @c -2 - Timeout error. + * @li @c -3 - Command error. + * @li @c -4 - Unknown error. + * See #err_t definition for detailed explanation. */ -static void c3gaa_check_connection( void ); +static err_t c3gaa_check_connection ( void ); -// ------------------------------------------------------ APPLICATION FUNCTIONS +/** + * @brief Configure device for example. + * @details Configure device for the specified example. + * @return @li @c 0 - OK response. + * @li @c -2 - Timeout error. + * @li @c -3 - Command error. + * @li @c -4 - Unknown error. + * See #err_t definition for detailed explanation. + */ +static err_t c3gaa_configure_for_example ( void ); +/** + * @brief Execute example. + * @details This function executes SMS or TCP/UDP example depending on the DEMO_EXAMPLE macro. + * @return @li @c 0 - OK response. + * @li @c -2 - Timeout error. + * @li @c -3 - Command error. + * @li @c -4 - Unknown error. + * See #err_t definition for detailed explanation. + */ +static err_t c3gaa_example ( void ); -void application_init ( void ) { +void application_init ( void ) +{ log_cfg_t log_cfg; /**< Logger config object. */ c3gaa_cfg_t c3gaa_cfg; /**< Click config object. */ - /** + /** * Logger initialization. * Default baud rate: 115200 * Default log level: LOG_LEVEL_DEBUG - * @note If USB_UART_RX and USB_UART_TX - * are defined as HAL_PIN_NC, you will - * need to define them manually for log to work. + * @note If USB_UART_RX and USB_UART_TX + * are defined as HAL_PIN_NC, you will + * need to define them manually for log to work. * See @b LOG_MAP_USB_UART macro definition for detailed explanation. */ LOG_MAP_USB_UART( log_cfg ); @@ -144,227 +214,403 @@ void application_init ( void ) { log_info( &logger, " Application Init " ); // Click initialization. - c3gaa_cfg_setup( &c3gaa_cfg ); C3GAA_MAP_MIKROBUS( c3gaa_cfg, MIKROBUS_1 ); - c3gaa_init( &c3gaa, &c3gaa_cfg ); - - c3gaa_module_power( &c3gaa, C3GAA_MODULE_POWER_ON ); + if ( UART_ERROR == c3gaa_init( &c3gaa, &c3gaa_cfg ) ) + { + log_error( &logger, " Application Init Error. " ); + log_info( &logger, " Please, run program again... " ); + for ( ; ; ); + } - // dummy read c3gaa_process( ); c3gaa_clear_app_buf( ); - - // AT + + // Check communication c3gaa_send_cmd( &c3gaa, C3GAA_CMD_AT ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - // ATI - product information - c3gaa_send_cmd( &c3gaa, C3GAA_CMD_ATI ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CGMR - firmware version - c3gaa_send_cmd( &c3gaa, C3GAA_CMD_CGMR ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CMEE - Report Mobile Equipment Error - c3gaa_send_cmd_with_parameter( &c3gaa, C3GAA_CMD_CMEE, "2" ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - // COPS - deregister from network - c3gaa_send_cmd_with_parameter( &c3gaa, C3GAA_CMD_COPS, "2" ); - Delay_ms( 4000 ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CGDCONT - set sim apn - c3gaa_set_sim_apn( &c3gaa, SIM_APN ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CFUN - full funtionality - c3gaa_send_cmd_with_parameter( &c3gaa, C3GAA_CMD_CFUN, "1" ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - // COPS - automatic mode - c3gaa_send_cmd_with_parameter( &c3gaa, C3GAA_CMD_COPS, "0" ); - Delay_ms( 4000 ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + c3gaa_error_check( error_flag ); - // CREG - network registration status - c3gaa_send_cmd_with_parameter( &c3gaa, C3GAA_CMD_CREG, "1" ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); + // Restart device + #define RESTART_DEVICE "1,1" + c3gaa_send_cmd_with_par( &c3gaa, C3GAA_CMD_CFUN, RESTART_DEVICE ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + c3gaa_error_check( error_flag ); - app_buf_len = 0; - app_buf_cnt = 0; - app_connection_status = WAIT_FOR_CONNECTION; log_info( &logger, " Application Task " ); - Delay_ms( 5000 ); + example_state = C3GAA_CONFIGURE_FOR_NETWORK; } -void application_task ( void ) { - if ( app_connection_status == WAIT_FOR_CONNECTION ) { - // CREG - network registration status - c3gaa_send_cmd_check( &c3gaa, C3GAA_CMD_CREG ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CSQ - signal quality - c3gaa_send_cmd( &c3gaa, C3GAA_CMD_CSQ ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 3000 ); - } else { - log_info( &logger, "CONNECTED TO NETWORK" ); - - // SMS message format - PDU mode - c3gaa_send_cmd_with_parameter( &c3gaa, C3GAA_CMD_CMGF, "0" ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 3000 ); - - for( ; ; ) { - log_printf( &logger, "> Sending message to phone number...\r\n" ); - c3gaa_send_sms_pdu ( &c3gaa, SIM_SMSC, PHONE_NUMBER_TO_MESSAGE, MESSAGE_CONTENT ); - app_error_flag = c3gaa_rsp_check( ); - c3gaa_error_check( app_error_flag ); - Delay_ms( 10000 ); - Delay_ms( 10000 ); - Delay_ms( 10000 ); +void application_task ( void ) +{ + switch ( example_state ) + { + case C3GAA_CONFIGURE_FOR_NETWORK: + { + if ( C3GAA_OK == c3gaa_configure_for_network( ) ) + { + example_state = C3GAA_WAIT_FOR_CONNECTION; + } + break; + } + case C3GAA_WAIT_FOR_CONNECTION: + { + if ( C3GAA_OK == c3gaa_check_connection( ) ) + { + example_state = C3GAA_CONFIGURE_FOR_EXAMPLE; + } + break; + } + case C3GAA_CONFIGURE_FOR_EXAMPLE: + { + if ( C3GAA_OK == c3gaa_configure_for_example( ) ) + { + example_state = C3GAA_EXAMPLE; + } + break; + } + case C3GAA_EXAMPLE: + { + c3gaa_example( ); + break; + } + default: + { + log_error( &logger, " Example state." ); + break; } } } -void main ( void ) { +void main ( void ) +{ application_init( ); - for ( ; ; ) { + for ( ; ; ) + { application_task( ); } } -static void c3gaa_clear_app_buf ( void ) { +static void c3gaa_clear_app_buf ( void ) +{ memset( app_buf, 0, app_buf_len ); app_buf_len = 0; - app_buf_cnt = 0; } -static err_t c3gaa_process ( void ) { - err_t return_flag = APP_ERROR_DRIVER; - int32_t rx_size; - char rx_buff[ PROCESS_BUFFER_SIZE ] = { 0 }; - - rx_size = c3gaa_generic_read( &c3gaa, rx_buff, PROCESS_BUFFER_SIZE ); - - if ( rx_size > 0 ) { - int32_t buf_cnt = 0; - return_flag = APP_OK; - - if ( app_buf_len + rx_size >= PROCESS_BUFFER_SIZE ) { - c3gaa_clear_app_buf( ); - return_flag = APP_ERROR_OVERFLOW; - } else { - buf_cnt = app_buf_len; - app_buf_len += rx_size; +static err_t c3gaa_process ( void ) +{ + uint8_t rx_buf[ PROCESS_BUFFER_SIZE ] = { 0 }; + int32_t rx_size = 0; + rx_size = c3gaa_generic_read( &c3gaa, rx_buf, PROCESS_BUFFER_SIZE ); + if ( rx_size > 0 ) + { + int32_t buf_cnt = app_buf_len; + if ( ( ( app_buf_len + rx_size ) > APP_BUFFER_SIZE ) && ( app_buf_len > 0 ) ) + { + buf_cnt = APP_BUFFER_SIZE - ( ( app_buf_len + rx_size ) - APP_BUFFER_SIZE ); + memmove ( app_buf, &app_buf[ APP_BUFFER_SIZE - buf_cnt ], buf_cnt ); } - - for ( int32_t rx_cnt = 0; rx_cnt < rx_size; rx_cnt++ ) { - if ( rx_buff[ rx_cnt ] != 0 ) { - app_buf[ ( buf_cnt + rx_cnt ) ] = rx_buff[ rx_cnt ]; - } else { - app_buf_len--; - buf_cnt--; + for ( int32_t rx_cnt = 0; rx_cnt < rx_size; rx_cnt++ ) + { + if ( rx_buf[ rx_cnt ] ) + { + app_buf[ buf_cnt++ ] = rx_buf[ rx_cnt ]; + if ( app_buf_len < APP_BUFFER_SIZE ) + { + app_buf_len++; + } } } - } - - return return_flag; + return C3GAA_OK; + } + return C3GAA_ERROR; } -static err_t c3gaa_rsp_check ( void ) { - uint16_t timeout_cnt = 0; - uint32_t timeout = 100000; - - err_t error_flag = c3gaa_process( ); - - if ( ( error_flag != 0 ) && ( error_flag != -1 ) ) { - return error_flag; - } - - while ( ( strstr( app_buf, RSP_OK ) == 0 ) && ( strstr( app_buf, RSP_ERROR ) == 0 ) ) { - error_flag = c3gaa_process( ); - if ( ( error_flag != 0 ) && ( error_flag != -1 ) ) { - return error_flag; - } - - timeout_cnt++; - if ( timeout_cnt > timeout ) { - while ( ( strstr( app_buf, RSP_OK ) == 0 ) && ( strstr( app_buf, RSP_ERROR ) == 0 ) ) { - c3gaa_send_cmd( &c3gaa, C3GAA_CMD_AT ); - c3gaa_process( ); - Delay_ms( 100 ); - } - c3gaa_clear_app_buf( ); - return APP_ERROR_TIMEOUT; +static err_t c3gaa_rsp_check ( uint8_t *rsp ) +{ + uint32_t timeout_cnt = 0; + uint32_t timeout = 120000; + c3gaa_clear_app_buf( ); + c3gaa_process( ); + while ( ( 0 == strstr( app_buf, rsp ) ) && + ( 0 == strstr( app_buf, C3GAA_RSP_ERROR ) ) ) + { + c3gaa_process( ); + if ( timeout_cnt++ > timeout ) + { + c3gaa_clear_app_buf( ); + return C3GAA_ERROR_TIMEOUT; } - Delay_ms( 1 ); } - - c3gaa_check_connection(); - - c3gaa_log_app_buf(); - - return APP_OK; + Delay_ms( 100 ); + c3gaa_process( ); + if ( strstr( app_buf, rsp ) ) + { + return C3GAA_OK; + } + else if ( strstr( app_buf, C3GAA_RSP_ERROR ) ) + { + return C3GAA_ERROR_CMD; + } + else + { + return C3GAA_ERROR_UNKNOWN; + } } -static void c3gaa_error_check( err_t error_flag ) { - if ( ( error_flag != 0 ) && ( error_flag != -1 ) ) { - switch ( error_flag ) { - case -2: - log_error( &logger, " Overflow!" ); - break; - case -3: - log_error( &logger, " Timeout!" ); - break; - default: - break; +static void c3gaa_error_check ( err_t error_flag ) +{ + switch ( error_flag ) + { + case C3GAA_OK: + { + c3gaa_log_app_buf( ); + break; + } + case C3GAA_ERROR: + { + log_error( &logger, " Overflow!" ); + break; + } + case C3GAA_ERROR_TIMEOUT: + { + log_error( &logger, " Timeout!" ); + break; + } + case C3GAA_ERROR_CMD: + { + log_error( &logger, " CMD!" ); + break; + } + case C3GAA_ERROR_UNKNOWN: + default: + { + log_error( &logger, " Unknown!" ); + break; } } + Delay_ms( 500 ); } -static void c3gaa_log_app_buf ( void ) { - for ( int32_t buf_cnt = 0; buf_cnt < app_buf_len; buf_cnt++ ) { +static void c3gaa_log_app_buf ( void ) +{ + for ( int32_t buf_cnt = 0; buf_cnt < app_buf_len; buf_cnt++ ) + { log_printf( &logger, "%c", app_buf[ buf_cnt ] ); } - log_printf( &logger, "\r\n-----------------------------------\r\n" ); +} + +static err_t c3gaa_configure_for_network ( void ) +{ + err_t func_error = C3GAA_OK; +#if ( ( DEMO_EXAMPLE == EXAMPLE_TCP_UDP ) || ( DEMO_EXAMPLE == EXAMPLE_SMS ) ) + Delay_ms ( 5000 ); + // Deregister from network + #define DEREGISTER_FROM_NETWORK "2" + c3gaa_send_cmd_with_par( &c3gaa, C3GAA_CMD_COPS, DEREGISTER_FROM_NETWORK ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + func_error |= error_flag; + c3gaa_error_check( error_flag ); - c3gaa_clear_app_buf( ); + // Set SIM APN + c3gaa_set_sim_apn( &c3gaa, SIM_APN ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + func_error |= error_flag; + c3gaa_error_check( error_flag ); + + // Enable full functionality + #define FULL_FUNCTIONALITY "1" + c3gaa_send_cmd_with_par( &c3gaa, C3GAA_CMD_CFUN, FULL_FUNCTIONALITY ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + func_error |= error_flag; + c3gaa_error_check( error_flag ); + + // Enable network registartion + #define ENABLE_REG "2" + c3gaa_send_cmd_with_par( &c3gaa, C3GAA_CMD_CREG, ENABLE_REG ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + func_error |= error_flag; + c3gaa_error_check( error_flag ); + + // Automatic registration + #define AUTOMATIC_REGISTRATION "0" + c3gaa_send_cmd_with_par( &c3gaa, C3GAA_CMD_COPS, AUTOMATIC_REGISTRATION ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + func_error |= error_flag; + c3gaa_error_check( error_flag ); +#endif + return func_error; +} + +static err_t c3gaa_check_connection ( void ) +{ +#if ( ( DEMO_EXAMPLE == EXAMPLE_TCP_UDP ) || ( DEMO_EXAMPLE == EXAMPLE_SMS ) ) + #define CONNECTED "+CREG: 2,1" + c3gaa_send_cmd_check ( &c3gaa, C3GAA_CMD_CREG ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + c3gaa_error_check( error_flag ); + if ( strstr( app_buf, CONNECTED ) ) + { + Delay_ms( 100 ); + c3gaa_process( ); + c3gaa_log_app_buf( ); + log_printf( &logger, "\r\n" ); + c3gaa_clear_app_buf( ); + // Check signal quality + c3gaa_send_cmd( &c3gaa, C3GAA_CMD_CSQ ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + c3gaa_error_check( error_flag ); + return error_flag; + } + Delay_ms ( 1000 ); + return C3GAA_ERROR; +#endif + return C3GAA_OK; } -static void c3gaa_check_connection( void ) { - #define CONNECTED "+CREG: 1,1" +static err_t c3gaa_configure_for_example ( void ) +{ + err_t func_error = C3GAA_OK; +#if ( DEMO_EXAMPLE == EXAMPLE_TCP_UDP ) + #define ACTIVATE_PDP_CONTEXT "1" + c3gaa_send_cmd_with_par( &c3gaa, C3GAA_CMD_QIACT, ACTIVATE_PDP_CONTEXT ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + func_error |= error_flag; + c3gaa_error_check( error_flag ); +#elif ( DEMO_EXAMPLE == EXAMPLE_SMS ) + c3gaa_send_cmd_with_par( &c3gaa, C3GAA_CMD_CMGF, SMS_MODE ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + func_error |= error_flag; + c3gaa_error_check( error_flag ); +#else + #error "No demo example selected" +#endif + return func_error; +} + +static err_t c3gaa_example ( void ) +{ + err_t func_error = C3GAA_OK; +#if ( DEMO_EXAMPLE == EXAMPLE_TCP_UDP ) + uint8_t cmd_buf[ 100 ] = { 0 }; + uint8_t tcp_socket_num[ 2 ] = { '0', 0 }; + uint8_t udp_socket_num[ 2 ] = { '1', 0 }; + #define CONTEXT_ID "1," + + // Open TCP socket. + #define TCP_SERVICE_TYPE ",\"TCP\"," + strcpy( cmd_buf, CONTEXT_ID ); + strcat( cmd_buf, tcp_socket_num ); + strcat( cmd_buf, TCP_SERVICE_TYPE ); + strcat( cmd_buf, "\"" ); + strcat( cmd_buf, REMOTE_IP ); + strcat( cmd_buf, "\"" ); + strcat( cmd_buf, "," ); + strcat( cmd_buf, REMOTE_PORT ); + c3gaa_send_cmd_with_par( &c3gaa, C3GAA_CMD_QIOPEN, cmd_buf ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + func_error |= error_flag; + c3gaa_error_check( error_flag ); + + // Open UDP socket. + #define UDP_SERVICE_TYPE ",\"UDP\"," + strcpy( cmd_buf, CONTEXT_ID ); + strcat( cmd_buf, udp_socket_num ); + strcat( cmd_buf, UDP_SERVICE_TYPE ); + strcat( cmd_buf, "\"" ); + strcat( cmd_buf, REMOTE_IP ); + strcat( cmd_buf, "\"" ); + strcat( cmd_buf, "," ); + strcat( cmd_buf, REMOTE_PORT ); + c3gaa_send_cmd_with_par( &c3gaa, C3GAA_CMD_QIOPEN, cmd_buf ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + func_error |= error_flag; + c3gaa_error_check( error_flag ); + + // Get message length + uint8_t message_len_buf[ 10 ] = { 0 }; + uint16_t message_len = strlen( MESSAGE_CONTENT ); + uint16_to_str( message_len, message_len_buf ); + l_trim( message_len_buf ); + r_trim( message_len_buf ); + + // Write message to TCP socket and read response + strcpy( cmd_buf, tcp_socket_num ); + strcat( cmd_buf, "," ); + strcat( cmd_buf, message_len_buf ); + c3gaa_send_cmd_with_par( &c3gaa, C3GAA_CMD_QISEND, cmd_buf ); + Delay_ms ( 100 ); + c3gaa_generic_write ( &c3gaa, MESSAGE_CONTENT, message_len ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + func_error |= error_flag; + c3gaa_error_check( error_flag ); + Delay_ms ( 1000 ); + c3gaa_send_cmd_with_par( &c3gaa, C3GAA_CMD_QIRD, cmd_buf ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + func_error |= error_flag; + c3gaa_error_check( error_flag ); + + // Write message to UDP socket and read response + strcpy( cmd_buf, udp_socket_num ); + strcat( cmd_buf, "," ); + strcat( cmd_buf, message_len_buf ); + c3gaa_send_cmd_with_par( &c3gaa, C3GAA_CMD_QISEND, cmd_buf ); + Delay_ms ( 100 ); + c3gaa_generic_write ( &c3gaa, MESSAGE_CONTENT, message_len ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + func_error |= error_flag; + c3gaa_error_check( error_flag ); + Delay_ms ( 1000 ); + c3gaa_send_cmd_with_par( &c3gaa, C3GAA_CMD_QIRD, cmd_buf ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + func_error |= error_flag; + c3gaa_error_check( error_flag ); - if ( strstr( app_buf, CONNECTED ) != 0 ) { - app_connection_status = CONNECTED_TO_NETWORK; + // Close TCP socket + c3gaa_send_cmd_with_par( &c3gaa, C3GAA_CMD_QICLOSE, tcp_socket_num ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + func_error |= error_flag; + c3gaa_error_check( error_flag ); + + // Close UDP socket + c3gaa_send_cmd_with_par( &c3gaa, C3GAA_CMD_QICLOSE, udp_socket_num ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + func_error |= error_flag; + c3gaa_error_check( error_flag ); + Delay_ms( 5000 ); +#elif ( DEMO_EXAMPLE == EXAMPLE_SMS ) + // Check SMS mode + #define CMGF_PDU "+CMGF: 0" + #define CMGF_TXT "+CMGF: 1" + c3gaa_send_cmd_check( &c3gaa, C3GAA_CMD_CMGF ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + func_error |= error_flag; + c3gaa_error_check( error_flag ); + if ( strstr( app_buf, CMGF_PDU ) ) + { + // Send SMS in PDU mode + c3gaa_send_sms_pdu( &c3gaa, SIM_SMSC, PHONE_NUMBER_TO_MESSAGE, MESSAGE_CONTENT ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + func_error |= error_flag; + c3gaa_error_check( error_flag ); + } + else if ( strstr( app_buf, CMGF_TXT ) ) + { + // Send SMS in TXT mode + c3gaa_send_sms_text ( &c3gaa, PHONE_NUMBER_TO_MESSAGE, MESSAGE_CONTENT ); + error_flag = c3gaa_rsp_check( C3GAA_RSP_OK ); + func_error |= error_flag; + c3gaa_error_check( error_flag ); } + Delay_ms( 10000 ); + Delay_ms( 10000 ); + Delay_ms( 10000 ); +#else + #error "No demo example selected" +#endif + return func_error; } // ------------------------------------------------------------------------ END diff --git a/clicks/3gaa/example/manifest.exm b/clicks/3gaa/example/manifest.exm index e184c6ac17..bfbc161347 100644 --- a/clicks/3gaa/example/manifest.exm +++ b/clicks/3gaa/example/manifest.exm @@ -1,8 +1,8 @@ { "name": "3G-AA Click", - "description": "3G-AA click is a versatile cellular network communication solution, featuring the compact 3G UMTS/HSPA Quectel UG95 module. This module features a full set of options for the cellular networking and communication, such as the network indication, embedded TCP/UDP stack, HTTP/HTTPS stack, full GSM/GPRS/EDGE implementation, UMTS/HSDPA/HSUPA protocol implementation and more.3G-EA click features data-rates of 7.2 Mb/s (downlink) and 5.76 Mb/s (uplink) in HSPA mode. Onboard 16bit audio CODEC IC adds high-quality voice communication capability.", + "description": "3G-AA click is a versatile cellular network communication solution, featuring the compact 3G UMTS/HSPA Quectel UG95 module. This module features a full set of options for the cellular networking and communication, such as the network indication, embedded TCP/UDP stack, HTTP/HTTPS stack, full GSM/GPRS/EDGE implementation, UMTS/HSDPA/HSUPA protocol implementation and more.3G-AA click features data-rates of 7.2 Mb/s (downlink) and 5.76 Mb/s (uplink) in HSPA mode. Onboard 16bit audio CODEC IC adds high-quality voice communication capability.", "image" : "../../Resources/click_icon.png", - "toolchain": ["mikrocarm","mikrocpic","mikrocpic32"], + "toolchain": ["mikrocarm","mikrocpic","mikrocpic32","gcc-riscv"], "hw" : ["click","Quectel UG95"], "category" : ["GSM/LTE"] } diff --git a/clicks/3gaa/example/memake.txt b/clicks/3gaa/example/memake.txt deleted file mode 100644 index 14a9b36d5f..0000000000 --- a/clicks/3gaa/example/memake.txt +++ /dev/null @@ -1,13 +0,0 @@ -type: executable -target: example_c3gaa - -depends: { - MikroC.Core - MikroSDK.Board - MikroSDK.Log - Click.C3GAA -} - -sources: { - main.c -} diff --git a/clicks/3gaa/lib/memake.txt b/clicks/3gaa/lib/memake.txt deleted file mode 100644 index 9ef67d2771..0000000000 --- a/clicks/3gaa/lib/memake.txt +++ /dev/null @@ -1,38 +0,0 @@ -type: library - -target: lib_c3gaa - -sources: { - src/c3gaa.c -} - -headers: { - include/c3gaa.h -} - -include: { - include -} - -install: { - src(include/c3gaa.h) dst(include/c3gaa.h) -} - -expInclude: { - include -} - -depends: { - MikroC.Core - MikroSDK.Driver - MikroSDK.Conversions - MikroSDK.GenericPointer -} - -others: { - ../README.md - ../DETAILS.md - ../CHANGELOG.md -} - -alias: Click.C3GAA diff --git a/clicks/3gaa/lib_c3gaa/CMakeLists.txt b/clicks/3gaa/lib_c3gaa/CMakeLists.txt new file mode 100644 index 0000000000..06b4da6dfb --- /dev/null +++ b/clicks/3gaa/lib_c3gaa/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(lib_c3gaa LANGUAGES MikroC) +else() + project(lib_c3gaa LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_library(lib_c3gaa STATIC + src/c3gaa.c + include/c3gaa.h +) +add_library(Click.3GAA ALIAS lib_c3gaa) + + + +target_include_directories(lib_c3gaa PUBLIC + include +) + +find_package(MikroC.Core REQUIRED) +target_link_libraries(lib_c3gaa PUBLIC MikroC.Core) +find_package(MikroSDK.Driver REQUIRED) +target_link_libraries(lib_c3gaa PUBLIC MikroSDK.Driver) +find_package(MikroSDK.Conversions REQUIRED) +target_link_libraries(lib_c3gaa PUBLIC MikroSDK.Conversions) +find_package(MikroSDK.GenericPointer REQUIRED) +target_link_libraries(lib_c3gaa PUBLIC MikroSDK.GenericPointer) diff --git a/clicks/3gaa/lib_c3gaa/include/Click.3GAA b/clicks/3gaa/lib_c3gaa/include/Click.3GAA new file mode 100644 index 0000000000..d99a39bef7 --- /dev/null +++ b/clicks/3gaa/lib_c3gaa/include/Click.3GAA @@ -0,0 +1 @@ +#include "c3gaa.h" diff --git a/clicks/3gaa/lib/include/c3gaa.h b/clicks/3gaa/lib_c3gaa/include/c3gaa.h similarity index 64% rename from clicks/3gaa/lib/include/c3gaa.h rename to clicks/3gaa/lib_c3gaa/include/c3gaa.h index 7c1b6f5647..5f2206c2fd 100644 --- a/clicks/3gaa/lib/include/c3gaa.h +++ b/clicks/3gaa/lib_c3gaa/include/c3gaa.h @@ -53,38 +53,38 @@ extern "C"{ */ /** - * @brief 3G-AA module power. - * @details Module power state. + * @brief 3G-AA control commands. + * @details Specified setting for control commands of 3G-AA Click driver. */ -#define C3GAA_MODULE_POWER_ON 1 -#define C3GAA_MODULE_POWER_OFF 0 +#define C3GAA_CMD_AT "AT" +#define C3GAA_CMD_ATI "ATI" +#define C3GAA_CMD_CFUN "AT+CFUN" +#define C3GAA_CMD_CREG "AT+CREG" +#define C3GAA_CMD_CGDCONT "AT+CGDCONT" +#define C3GAA_CMD_CSQ "AT+CSQ" +#define C3GAA_CMD_COPS "AT+COPS" +#define C3GAA_CMD_CMGS "AT+CMGS" +#define C3GAA_CMD_CMGF "AT+CMGF" +#define C3GAA_CMD_QIACT "AT+QIACT" +#define C3GAA_CMD_QIOPEN "AT+QIOPEN" +#define C3GAA_CMD_QICLOSE "AT+QICLOSE" +#define C3GAA_CMD_QISEND "AT+QISEND" +#define C3GAA_CMD_QIRD "AT+QIRD" /** - * @brief 3G-AA description setting. - * @details Specified setting for description of 3G-AA Click driver. + * @brief 3G-AA device response for AT commands. + * @details Device response after commands. */ -#define C3GAA_CMD_AT "AT" -#define C3GAA_CMD_ATI "ATI" -#define C3GAA_CMD_CGMR "AT+CGMR" -#define C3GAA_CMD_CFUN "AT+CFUN" -#define C3GAA_CMD_CREG "AT+CREG" -#define C3GAA_CMD_CGREG "AT+CGREG" -#define C3GAA_CMD_CGDCONT "AT+CGDCONT" -#define C3GAA_CMD_CIMI "AT+CIMI" -#define C3GAA_CMD_CMEE "AT+CMEE" -#define C3GAA_CMD_CGATT "AT+CGATT" -#define C3GAA_CMD_CSQ "AT+CSQ" -#define C3GAA_CMD_COPS "AT+COPS" -#define C3GAA_CMD_CMGS "AT+CMGS" -#define C3GAA_CMD_CMGF "AT+CMGF" +#define C3GAA_RSP_OK "OK" +#define C3GAA_RSP_ERROR "ERROR" /** * @brief 3G-AA driver buffer size. * @details Specified size of driver ring buffer. * @note Increase buffer size if needed. */ -#define DRV_RX_BUFFER_SIZE 256 -#define DRV_TX_BUFFER_SIZE 256 +#define C3GAA_RX_DRV_BUFFER_SIZE 256 +#define C3GAA_TX_DRV_BUFFER_SIZE 256 /*! @} */ // c3gaa_set @@ -121,20 +121,20 @@ extern "C"{ typedef struct { // Output pins - digital_out_t pwk; - digital_out_t rts; + digital_out_t pwk; /**< Power-up module. */ + digital_out_t rts; /**< UART Request to Send. */ // Input pins - digital_in_t sta; - digital_in_t ring; - digital_in_t cts; + digital_in_t sta; /**< Module status. */ + digital_in_t ring; /**< Ring indicator. */ + digital_in_t cts; /**< UART Clear to Send. */ // Modules - uart_t uart; /**< UART driver object. */ + uart_t uart; /**< UART driver object. */ // Buffers - char uart_rx_buffer[ DRV_RX_BUFFER_SIZE ]; /**< Buffer size. */ - char uart_tx_buffer[ DRV_TX_BUFFER_SIZE ]; /**< Buffer size. */ + char uart_rx_buffer[ C3GAA_RX_DRV_BUFFER_SIZE ]; /**< Buffer size. */ + char uart_tx_buffer[ C3GAA_TX_DRV_BUFFER_SIZE ]; /**< Buffer size. */ } c3gaa_t; @@ -145,22 +145,22 @@ typedef struct typedef struct { // Communication gpio pins - pin_name_t rx_pin; /**< RX pin. */ - pin_name_t tx_pin; /**< TX pin. */ + pin_name_t rx_pin; /**< RX pin. */ + pin_name_t tx_pin; /**< TX pin. */ // Additional gpio pins - pin_name_t sta; - pin_name_t pwk; - pin_name_t rts; - pin_name_t ring; - pin_name_t cts; + pin_name_t sta; /**< Module status. */ + pin_name_t pwk; /**< Power-up module. */ + pin_name_t rts; /**< UART Request to Send. */ + pin_name_t ring; /**< Ring indicator. */ + pin_name_t cts; /**< UART Clear to Send. */ // Static variable - uint32_t baud_rate; /**< Clock speed. */ - bool uart_blocking; /**< Wait for interrupt or not. */ - uart_data_bits_t data_bit; /**< Data bits. */ - uart_parity_t parity_bit; /**< Parity bit. */ - uart_stop_bits_t stop_bit; /**< Stop bits. */ + uint32_t baud_rate; /**< Clock speed. */ + bool uart_blocking; /**< Wait for interrupt or not. */ + uart_data_bits_t data_bit; /**< Data bits. */ + uart_parity_t parity_bit; /**< Parity bit. */ + uart_stop_bits_t stop_bit; /**< Stop bits. */ } c3gaa_cfg_t; @@ -170,8 +170,11 @@ typedef struct */ typedef enum { - C3GAA_OK = 0, - C3GAA_ERROR = -1 + C3GAA_OK = 0, + C3GAA_ERROR = -1, + C3GAA_ERROR_TIMEOUT = -2, + C3GAA_ERROR_CMD = -3, + C3GAA_ERROR_UNKNOWN = -4 } c3gaa_return_value_t; @@ -202,104 +205,87 @@ void c3gaa_cfg_setup ( c3gaa_cfg_t *cfg ); * See #c3gaa_cfg_t object definition for detailed explanation. * @return @li @c 0 - Success, * @li @c -1 - Error. - * * See #err_t definition for detailed explanation. * @note None. */ err_t c3gaa_init ( c3gaa_t *ctx, c3gaa_cfg_t *cfg ); - -/** - * @brief Power ON/OFF the module. - * @details This function powers ON/OFF the module. - * @param ctx Click object. - * @param state 0 - power OFF, 1 - power ON. - * @return Nothing. - * @return None. - */ -void c3gaa_module_power ( c3gaa_t *ctx, uint8_t state ); - /** * @brief 3G-AA data writing function. * @details This function writes a desired number of data bytes by using UART serial interface. * @param[in] ctx : Click context object. * See #c3gaa_t object definition for detailed explanation. - * @param[in] data_buf : Data buffer for sending. + * @param[in] data_in : Data buffer for sending. * @param[in] len : Number of bytes for sending. * @return @li @c >=0 - Success, * @li @c <0 - Error. - * * See #err_t definition for detailed explanation. * @note None. */ -err_t c3gaa_generic_write ( c3gaa_t *ctx, char *data_buf, uint16_t len ); +err_t c3gaa_generic_write ( c3gaa_t *ctx, uint8_t *data_in, uint16_t len ); /** * @brief 3G-AA data reading function. * @details This function reads a desired number of data bytes by using UART serial interface. * @param[in] ctx : Click context object. * See #c3gaa_t object definition for detailed explanation. - * @param[out] data_buf : Output read data. - * @param[in] max_len : Number of bytes to be read. + * @param[out] data_out : Output read data. + * @param[in] len : Number of bytes to be read. * @return @li @c >0 - Number of data bytes read, * @li @c <=0 - Error/Empty Ring buffer. - * * See #err_t definition for detailed explanation. * @note None. */ -err_t c3gaa_generic_read ( c3gaa_t *ctx, char *data_buf, uint16_t max_len ); +err_t c3gaa_generic_read ( c3gaa_t *ctx, uint8_t *data_out, uint16_t len ); /** - * @brief Sets state of the RTS pin. - * @details This function sets RTS pin state. + * @brief 3G-AA set rts pin function. + * @details This function sets the Request to Send (RTS) pin logic state. * @param[in] ctx : Click context object. * See #c3gaa_t object definition for detailed explanation. - * @param[in] state Pin state ( 1 or 0 ). - * @return Nothing. + * @param[in] state : Pin logic state. + * @return None. * @note None. */ void c3gaa_set_rts_pin ( c3gaa_t *ctx, uint8_t state ); /** - * @brief Sets state of the PWK pin. - * @details This function sets PWK pin state. + * @brief 3G-AA set pwk pin function. + * @details This function sets the PWRKEY pin logic state. * @param[in] ctx : Click context object. * See #c3gaa_t object definition for detailed explanation. - * @param[in] state Pin state ( 1 or 0 ). - * @return Nothing. + * @param[in] state : Pin logic state. + * @return None. * @note None. */ void c3gaa_set_pwk_pin ( c3gaa_t *ctx, uint8_t state ); /** - * @brief CTS Pin Get function. - * @details This function allows user to check state of the CTS pin. + * @brief 3G-AA get cts pin function. + * @details This function returns the Clear to Send (CTS) pin logic state. * @param[in] ctx : Click context object. * See #c3gaa_t object definition for detailed explanation. - * @return @li @c 0 logical low. - * @li @c 1 logical high. + * @return Pin logic state. * @note None. */ uint8_t c3gaa_get_cts_pin ( c3gaa_t *ctx ); /** - * @brief STA Pin Get function. - * @details This function allows user to check state of the STA pin. + * @brief 3G-AA get sta pin function. + * @details This function returns the status (STA) pin logic state. * @param[in] ctx : Click context object. * See #c3gaa_t object definition for detailed explanation. - * @return @li @c 0 logical low. - * @li @c 1 logical high. + * @return Pin logic state. * @note None. */ uint8_t c3gaa_get_sta_pin ( c3gaa_t *ctx ); /** - * @brief RING Pin Get function. - * @details This function allows user to check state of the RING pin. + * @brief 3G-AA get ring pin function. + * @details This function returns the ring indication (RING) pin logic state. * @param[in] ctx : Click context object. * See #c3gaa_t object definition for detailed explanation. - * @return @li @c 0 logical low. - * @li @c 1 logical high. + * @return Pin logic state. * @note None. */ uint8_t c3gaa_get_ring_pin ( c3gaa_t *ctx ); @@ -309,83 +295,83 @@ uint8_t c3gaa_get_ring_pin ( c3gaa_t *ctx ); * @details This function sends a specified command to the click module. * @param[in] ctx : Click context object. * See #c3gaa_t object definition for detailed explanation. - * @param[in] cmd Command variable. + * @param[in] cmd : Command variable. * @return Nothing. * @note None. */ -void c3gaa_send_cmd ( c3gaa_t *ctx, char *cmd ); +void c3gaa_send_cmd ( c3gaa_t *ctx, uint8_t *cmd ); /** * @brief Send command function with parameter. * @details This function sends a command with specified parameter to the click module. * @param[in] ctx : Click context object. * See #c3gaa_t object definition for detailed explanation. - * @param[in] at_cmd_buf Command buffer. - * @param[in] param_buf Parameter buffer. + * @param[in] at_cmd_buf : Command buffer. + * @param[in] param_buf : Parameter buffer. * @return Nothing. * @note None. */ -void c3gaa_send_cmd_with_parameter ( c3gaa_t *ctx, char *at_cmd_buf, char *param_buf ); +void c3gaa_send_cmd_with_par ( c3gaa_t *ctx, uint8_t *at_cmd_buf, uint8_t *param_buf ); /** * @brief Check the sent command. * @details This function checks the command that is sent. * @param[in] ctx : Click context object. * See #c3gaa_t object definition for detailed explanation. - * @param[in] at_cmd_buf Command buffer. + * @param[in] at_cmd_buf : Command buffer. * @return Nothing. * @note None. */ -void c3gaa_send_cmd_check ( c3gaa_t *ctx, char *at_cmd_buf ); +void c3gaa_send_cmd_check ( c3gaa_t *ctx, uint8_t *at_cmd_buf ); /** * @brief Check the command parameters. * @details This function checks the command that is sent. * @param[in] ctx : Click context object. * See #c3gaa_t object definition for detailed explanation. - * @param[in] at_cmd_buf Command buffer. + * @param[in] at_cmd_buf : Command buffer. * @return Nothing. * @note None. */ -void c3gaa_send_cmd_parameter_check ( c3gaa_t *ctx, char *at_cmd_buf ); +void c3gaa_send_cmd_par_check ( c3gaa_t *ctx, uint8_t *at_cmd_buf ); /** * @brief Set sim card APN. * @details This function sets APN for sim card. * @param[in] ctx : Click context object. * See #c3gaa_t object definition for detailed explanation. - * @param[in] sim_apn SIM card APN. + * @param[in] sim_apn : SIM card APN. * @return Nothing. * @note None. */ -void c3gaa_set_sim_apn ( c3gaa_t *ctx, char *sim_apn ); +void c3gaa_set_sim_apn ( c3gaa_t *ctx, uint8_t *sim_apn ); /** * @brief 3G-AA send SMS in text mode. * @details This function sends text message to a phone number. * @param[in] ctx : Click context object. * See #c3gaa_t object definition for detailed explanation. - * @param[in] phone_number Phone number to message. - * @param[in] sms_text Message to be sent. + * @param[in] phone_number : Phone number to message. + * @param[in] sms_text : Message to be sent. * @return Nothing. * @note None. */ -void c3gaa_send_sms_text ( c3gaa_t *ctx, char *phone_number, char *sms_text ); +void c3gaa_send_sms_text ( c3gaa_t *ctx, uint8_t *phone_number, uint8_t *sms_text ); /** * @brief 3G-AA send SMS in PDU mode. * @details This function sends text message to a phone number in PDU mode. * @param[in] ctx : Click context object. * See #c3gaa_t object definition for detailed explanation. - * @param[in] service_center_number SMSC of the SIM card. - * @param[in] phone_number Phone number to message. - * @param[in] sms_text Message to be sent. + * @param[in] service_center_number : SMSC of the SIM card. + * @param[in] phone_number : Phone number to message. + * @param[in] sms_text : Message to be sent. * @return @li @c >=0 - Success, * @li @c <0 - Error. * See #err_t definition for detailed explanation. * @note None. */ -err_t c3gaa_send_sms_pdu ( c3gaa_t *ctx, char *service_center_number, char *phone_number, char *sms_text ); +err_t c3gaa_send_sms_pdu ( c3gaa_t *ctx, uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text ); #ifdef __cplusplus } diff --git a/clicks/3gaa/lib/src/c3gaa.c b/clicks/3gaa/lib_c3gaa/src/c3gaa.c similarity index 60% rename from clicks/3gaa/lib/src/c3gaa.c rename to clicks/3gaa/lib_c3gaa/src/c3gaa.c index 1fc93bbe32..db4b1c97d6 100644 --- a/clicks/3gaa/lib/src/c3gaa.c +++ b/clicks/3gaa/lib_c3gaa/src/c3gaa.c @@ -26,12 +26,13 @@ */ #include "c3gaa.h" -#include "string.h" -#include "generic_pointer.h" #include "conversions.h" +#include "generic_pointer.h" -// ------------------------------------------------------------- PRIVATE MACROS - +/** + * @brief PDU macros. + * @details Predefined PDU macros for driver use. + */ #define BITMASK_7BITS 0x7F #define BITMASK_8BITS 0xFF #define BITMASK_HIGH_4BITS 0xF0 @@ -44,8 +45,6 @@ #define SMS_MAX_7BIT_TEXT_LENGTH 160 #define SMS_MAX_PDU_LENGTH 256 -// ---------------------------------------------- PRIVATE FUNCTION DECLARATIONS - /** * @brief Encode message for PDU mode. * @details Encode message for PDU mode and outputs @@ -58,7 +57,8 @@ * @return @li @c >=0 - Length of the SMS encoded message, * @li @c <0 - Error. */ -static int16_t pdu_encode( char *service_center_number, char *phone_number, char *sms_text, uint8_t *output_buffer, uint16_t buffer_size ); +static int16_t pdu_encode ( uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text, + uint8_t *output_buffer, uint16_t buffer_size ); /** * @brief Swap decimal digits of a number. @@ -66,7 +66,7 @@ static int16_t pdu_encode( char *service_center_number, char *phone_number, char * @param[in] x : Decimal number to swap digits. * @return Swapped decimal number. */ -static uint8_t swap_decimal_nibble( uint8_t x ); +static uint8_t swap_decimal_nibble ( uint8_t x ); /** * @brief Encode text content for PDU mode. @@ -79,7 +79,8 @@ static uint8_t swap_decimal_nibble( uint8_t x ); * @return @li @c >=0 - Length of the enccoded text messages, * @li @c <0 - Error. */ -static int16_t encode_pdu_message( char *sms_text, int16_t sms_text_length, uint8_t *output_buffer, uint16_t buffer_size ); +static int16_t encode_pdu_message ( uint8_t *sms_text, int16_t sms_text_length, + uint8_t *output_buffer, uint16_t buffer_size ); /** * @brief Encode phone number for PDU mode. @@ -91,11 +92,19 @@ static int16_t encode_pdu_message( char *sms_text, int16_t sms_text_length, uint * @return @li @c >=0 - Length of the SMS encoded message, * @li @c <0 - Error. */ -static int16_t encode_phone_number ( char *phone_number, uint8_t *output_buffer, uint16_t buffer_size ); +static int16_t encode_phone_number ( uint8_t *phone_number, uint8_t *output_buffer, uint16_t buffer_size ); -// ------------------------------------------------ PUBLIC FUNCTION DEFINITIONS +/** + * @brief 3G-AA str cut chr function. + * @details This function removes all selected characters from string str, + * and returns it to the same str without those characters. + * @param str Address of string. + * @param chr Character to cut. + */ +static void c3gaa_str_cut_chr ( uint8_t *str, uint8_t chr ); -void c3gaa_cfg_setup ( c3gaa_cfg_t *cfg ) { +void c3gaa_cfg_setup ( c3gaa_cfg_t *cfg ) +{ // Communication gpio pins cfg->rx_pin = HAL_PIN_NC; cfg->tx_pin = HAL_PIN_NC; @@ -114,7 +123,8 @@ void c3gaa_cfg_setup ( c3gaa_cfg_t *cfg ) { cfg->uart_blocking = false; } -err_t c3gaa_init ( c3gaa_t *ctx, c3gaa_cfg_t *cfg ) { +err_t c3gaa_init ( c3gaa_t *ctx, c3gaa_cfg_t *cfg ) +{ uart_config_t uart_cfg; // Default config @@ -130,7 +140,8 @@ err_t c3gaa_init ( c3gaa_t *ctx, c3gaa_cfg_t *cfg ) { uart_cfg.tx_ring_size = sizeof( ctx->uart_tx_buffer ); uart_cfg.rx_ring_size = sizeof( ctx->uart_rx_buffer ); - if ( uart_open( &ctx->uart, &uart_cfg ) == UART_ERROR ) { + if ( UART_ERROR == uart_open( &ctx->uart, &uart_cfg ) ) + { return UART_ERROR; } uart_set_baud( &ctx->uart, cfg->baud_rate ); @@ -148,60 +159,68 @@ err_t c3gaa_init ( c3gaa_t *ctx, c3gaa_cfg_t *cfg ) { digital_in_init( &ctx->sta, cfg->sta ); digital_in_init( &ctx->ring, cfg->ring ); digital_in_init( &ctx->cts, cfg->cts ); + + digital_out_low ( &ctx->pwk ); + Delay_1sec ( ); + digital_out_high ( &ctx->pwk ); + Delay_1sec ( ); + digital_out_low ( &ctx->pwk ); + Delay_1sec ( ); return UART_SUCCESS; } -void c3gaa_module_power ( c3gaa_t *ctx, uint8_t state ) { - digital_out_write( &ctx->pwk, state ); - Delay_1sec(); - Delay_1sec(); - Delay_1sec(); -} - -err_t c3gaa_generic_write ( c3gaa_t *ctx, char *data_buf, uint16_t len ) { - return uart_write( &ctx->uart, data_buf, len ); +err_t c3gaa_generic_write ( c3gaa_t *ctx, uint8_t *data_in, uint16_t len ) +{ + return uart_write( &ctx->uart, data_in, len ); } -err_t c3gaa_generic_read ( c3gaa_t *ctx, char *data_buf, uint16_t max_len ) { - return uart_read( &ctx->uart, data_buf, max_len ); +err_t c3gaa_generic_read ( c3gaa_t *ctx, uint8_t *data_out, uint16_t len ) +{ + return uart_read( &ctx->uart, data_out, len ); } -void c3gaa_set_pwk_pin ( c3gaa_t *ctx, uint8_t state ) { +void c3gaa_set_pwk_pin ( c3gaa_t *ctx, uint8_t state ) +{ digital_out_write( &ctx->pwk, state ); } -void c3gaa_set_rts_pin ( c3gaa_t *ctx, uint8_t state ) { +void c3gaa_set_rts_pin ( c3gaa_t *ctx, uint8_t state ) +{ digital_out_write( &ctx->rts, state ); } -uint8_t c3gaa_get_cts_pin ( c3gaa_t *ctx ) { +uint8_t c3gaa_get_cts_pin ( c3gaa_t *ctx ) +{ return digital_in_read( &ctx->cts ); } -uint8_t c3gaa_get_sta_pin ( c3gaa_t *ctx ) { +uint8_t c3gaa_get_sta_pin ( c3gaa_t *ctx ) +{ return digital_in_read( &ctx->sta ); } -uint8_t c3gaa_get_ring_pin ( c3gaa_t *ctx ) { +uint8_t c3gaa_get_ring_pin ( c3gaa_t *ctx ) +{ return digital_in_read( &ctx->ring ); } -void c3gaa_send_cmd ( c3gaa_t *ctx, char *cmd ) { - char cr[ 2 ] = { 13, 0 }; - - while ( *cmd != 0 ) { +void c3gaa_send_cmd ( c3gaa_t *ctx, uint8_t *cmd ) +{ + uint8_t carriage_return = 13; + while ( *cmd != 0 ) + { uart_write( &ctx->uart, cmd, 1 ); cmd++; } - - uart_write( &ctx->uart, cr, 1 ); + uart_write( &ctx->uart, &carriage_return, 1 ); Delay_100ms( ); } -void c3gaa_send_cmd_with_parameter ( c3gaa_t *ctx, char *at_cmd_buf, char *param_buf ) { - char final_cmd[ 100 ] = { 0 }; - char check_char[ 2 ] = { '=', 0 }; +void c3gaa_send_cmd_with_par ( c3gaa_t *ctx, uint8_t *at_cmd_buf, uint8_t *param_buf ) +{ + uint8_t final_cmd[ 100 ] = { 0 }; + uint8_t check_char[ 2 ] = { '=', 0 }; strcpy( final_cmd, at_cmd_buf ); strcat( final_cmd, check_char ); @@ -210,9 +229,10 @@ void c3gaa_send_cmd_with_parameter ( c3gaa_t *ctx, char *at_cmd_buf, char *param c3gaa_send_cmd( ctx, final_cmd ); } -void c3gaa_send_cmd_check ( c3gaa_t *ctx, char *at_cmd_buf ) { - char final_cmd[ 100 ] = { 0 }; - char check_char[ 2 ] = { '?', 0 }; +void c3gaa_send_cmd_check ( c3gaa_t *ctx, uint8_t *at_cmd_buf ) +{ + uint8_t final_cmd[ 100 ] = { 0 }; + uint8_t check_char[ 2 ] = { '?', 0 }; strcpy( final_cmd, at_cmd_buf ); strcat( final_cmd, check_char ); @@ -220,9 +240,10 @@ void c3gaa_send_cmd_check ( c3gaa_t *ctx, char *at_cmd_buf ) { c3gaa_send_cmd( ctx, final_cmd ); } -void c3gaa_send_cmd_parameter_check ( c3gaa_t *ctx, char *at_cmd_buf ) { - char final_cmd[ 100 ] = { 0 }; - char check_char[ 3 ] = { '=' , '?', 0 }; +void c3gaa_send_cmd_par_check ( c3gaa_t *ctx, uint8_t *at_cmd_buf ) +{ + uint8_t final_cmd[ 100 ] = { 0 }; + uint8_t check_char[ 3 ] = { '=' , '?', 0 }; strcpy( final_cmd, at_cmd_buf ); strcat( final_cmd, check_char ); @@ -230,54 +251,62 @@ void c3gaa_send_cmd_parameter_check ( c3gaa_t *ctx, char *at_cmd_buf ) { c3gaa_send_cmd( ctx, final_cmd ); } -void c3gaa_set_sim_apn ( c3gaa_t *ctx, char *sim_apn ) { - char final_cmd[ 50 ] = "1,\"IP\",\""; - char end_cmd[ 3 ] = "\""; +void c3gaa_set_sim_apn ( c3gaa_t *ctx, uint8_t *sim_apn ) +{ + uint8_t final_cmd[ 50 ] = "1,\"IP\",\""; + uint8_t end_cmd[ 3 ] = "\""; strcat( final_cmd, sim_apn ); strcat( final_cmd, end_cmd ); - c3gaa_send_cmd_with_parameter( ctx, C3GAA_CMD_CGDCONT, final_cmd ); + c3gaa_send_cmd_with_par( ctx, C3GAA_CMD_CGDCONT, final_cmd ); } -void c3gaa_send_sms_text ( c3gaa_t *ctx, char *phone_number, char *sms_text ) { - char text[ 200 ] = { 0 }; - char cmd_start[] = "AT+CMGS=\""; - char cmd_end[] = "\"\r"; - char txt_end[] = "\032"; +void c3gaa_send_sms_text ( c3gaa_t *ctx, uint8_t *phone_number, uint8_t *sms_text ) +{ + uint8_t text[ 200 ] = { 0 }; + uint8_t cmd_start[ ] = "=\""; + uint8_t cmd_end[ ] = "\"\r"; + uint8_t txt_end[ ] = "\032"; - strcpy( text, cmd_start ); + strcpy( text, C3GAA_CMD_CMGS ); + strcat( text, cmd_start ); strcat( text, phone_number ); strcat( text, cmd_end ); c3gaa_send_cmd( ctx, text ); - memset( text, 0 , 200 ); + memset( text, 0, sizeof ( text ) ); strcpy( text, sms_text ); strcat( text, txt_end ); c3gaa_send_cmd( ctx, text ); } -err_t c3gaa_send_sms_pdu ( c3gaa_t *ctx, char *service_center_number, char *phone_number, char *sms_text ) { - char text[ SMS_MAX_PDU_LENGTH ] = { 0 }; - char pdu_buf[ SMS_MAX_PDU_LENGTH ] = { 0 }; - char byte_buf[ 4 ] = { 0 }; - char ctrl_z[ ] = { 26, 0 }; - int16_t pdu_buf_len; - uint8_t length; - - str_cut_chr ( service_center_number, '+' ); - str_cut_chr ( phone_number, '+' ); +err_t c3gaa_send_sms_pdu ( c3gaa_t *ctx, uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text ) +{ + uint8_t text[ SMS_MAX_PDU_LENGTH ] = { 0 }; + uint8_t pdu_buf[ SMS_MAX_PDU_LENGTH ] = { 0 }; + uint8_t byte_buf[ 4 ] = { 0 }; + uint8_t ctrl_z[ 2 ] = { 26, 0 }; + int16_t pdu_buf_len = 0; + uint8_t length = 0; + uint8_t smsc[ 32 ] = { 0 }; + uint8_t phone_num[ 32 ] = { 0 }; + strcpy ( smsc, service_center_number ); + strcpy ( phone_num, phone_number ); + c3gaa_str_cut_chr ( smsc, '+' ); + c3gaa_str_cut_chr ( phone_num, '+' ); - pdu_buf_len = pdu_encode( service_center_number, phone_number, sms_text, pdu_buf, SMS_MAX_PDU_LENGTH ); + pdu_buf_len = pdu_encode( smsc, phone_num, sms_text, pdu_buf, SMS_MAX_PDU_LENGTH ); - if ( pdu_buf_len < 0 ) { + if ( pdu_buf_len < 0 ) + { return C3GAA_ERROR; } - length = pdu_buf_len - ( ( strlen( service_center_number ) - 1 ) / 2 + 3 ); + length = pdu_buf_len - ( ( strlen( smsc ) - 1 ) / 2 + 3 ); uint8_to_str( length, byte_buf ); - str_cut_chr ( byte_buf, ' '); + c3gaa_str_cut_chr ( byte_buf, ' ' ); strcpy( text, C3GAA_CMD_CMGS ); strcat( text, "=" ); @@ -286,7 +315,8 @@ err_t c3gaa_send_sms_pdu ( c3gaa_t *ctx, char *service_center_number, char *phon c3gaa_send_cmd( ctx, text ); memset( text, 0, SMS_MAX_PDU_LENGTH ); - for ( int16_t cnt = 0; cnt < pdu_buf_len; cnt++ ) { + for ( int16_t cnt = 0; cnt < pdu_buf_len; cnt++ ) + { uint8_to_hex ( pdu_buf[ cnt ], byte_buf ); strcat ( text, byte_buf ); } @@ -297,10 +327,11 @@ err_t c3gaa_send_sms_pdu ( c3gaa_t *ctx, char *service_center_number, char *phon return C3GAA_OK; } -// ----------------------------------------------- PRIVATE FUNCTION DEFINITIONS - -static int16_t pdu_encode( char *service_center_number, char *phone_number, char *sms_text, uint8_t *output_buffer, uint16_t buffer_size ) { - if ( buffer_size < 2 ) { +static int16_t pdu_encode ( uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text, + uint8_t *output_buffer, uint16_t buffer_size ) +{ + if ( buffer_size < 2 ) + { return C3GAA_ERROR; } @@ -308,17 +339,20 @@ static int16_t pdu_encode( char *service_center_number, char *phone_number, char // 1. Set SMS center number. int16_t length = 0; - if ( ( service_center_number != 0 ) && ( strlen ( service_center_number ) > 0 ) ) { + if ( ( service_center_number != 0 ) && ( strlen ( service_center_number ) > 0 ) ) + { output_buffer[ 1 ] = TYPE_OF_ADDRESS_INTERNATIONAL_PHONE; // Add type of address. length = encode_phone_number( service_center_number, output_buffer + 2, buffer_size - 2 ); - if ( length < 0 && length >= 254 ) { + if ( length < 0 && length >= 254 ) + { return C3GAA_ERROR; } length++; } output_buffer[ 0 ] = length; output_buffer_length = length + 1; - if ( output_buffer_length + 4 > buffer_size ) { + if ( output_buffer_length + 4 > buffer_size ) + { return C3GAA_ERROR; // Check if it has space for four more bytes. } @@ -329,9 +363,11 @@ static int16_t pdu_encode( char *service_center_number, char *phone_number, char // 3. Set phone number. output_buffer[ output_buffer_length ] = strlen( phone_number ); output_buffer[ output_buffer_length + 1 ] = TYPE_OF_ADDRESS_INTERNATIONAL_PHONE; - length = encode_phone_number( phone_number, output_buffer + output_buffer_length + 2, buffer_size - output_buffer_length - 2); + length = encode_phone_number( phone_number, output_buffer + output_buffer_length + 2, + buffer_size - output_buffer_length - 2); output_buffer_length += length + 2; - if ( output_buffer_length + 4 > buffer_size ) { + if ( output_buffer_length + 4 > buffer_size ) + { return C3GAA_ERROR; // Check if it has space for four more bytes. } @@ -342,12 +378,15 @@ static int16_t pdu_encode( char *service_center_number, char *phone_number, char // 5. SMS message. int16_t sms_text_length = strlen( sms_text ); - if ( sms_text_length > SMS_MAX_7BIT_TEXT_LENGTH ) { + if ( sms_text_length > SMS_MAX_7BIT_TEXT_LENGTH ) + { return C3GAA_ERROR; } output_buffer[ output_buffer_length++ ] = sms_text_length; - length = encode_pdu_message( sms_text, sms_text_length, output_buffer + output_buffer_length, buffer_size - output_buffer_length ); - if ( length < 0 ) { + length = encode_pdu_message( sms_text, sms_text_length, output_buffer + output_buffer_length, + buffer_size - output_buffer_length ); + if ( length < 0 ) + { return C3GAA_ERROR; } output_buffer_length += length; @@ -355,13 +394,17 @@ static int16_t pdu_encode( char *service_center_number, char *phone_number, char return output_buffer_length; } -static uint8_t swap_decimal_nibble( uint8_t x ) { +static uint8_t swap_decimal_nibble ( uint8_t x ) +{ return ( x / 16 ) + ( ( x % 16 ) * 10 ); } -static int16_t encode_pdu_message( char *sms_text, int16_t sms_text_length, uint8_t *output_buffer, uint16_t buffer_size ) { +static int16_t encode_pdu_message ( uint8_t *sms_text, int16_t sms_text_length, + uint8_t *output_buffer, uint16_t buffer_size ) +{ // Check if output buffer is big enough. - if ( ( sms_text_length * 7 + 7 ) / 8 > buffer_size ) { + if ( ( sms_text_length * 7 + 7 ) / 8 > buffer_size ) + { return C3GAA_ERROR; } @@ -369,46 +412,74 @@ static int16_t encode_pdu_message( char *sms_text, int16_t sms_text_length, uint int16_t carry_on_bits = 1; int16_t i = 0; - for ( ; i < sms_text_length - 1; ++i ) { - output_buffer[ output_buffer_length++ ] = ( ( sms_text[ i ] & BITMASK_7BITS ) >> ( carry_on_bits - 1 ) ) | ( ( sms_text[ i + 1 ] & BITMASK_7BITS ) << ( 8 - carry_on_bits ) ); + for ( ; i < sms_text_length - 1; ++i ) + { + output_buffer[ output_buffer_length++ ] = + ( ( sms_text[ i ] & BITMASK_7BITS ) >> ( carry_on_bits - 1 ) ) | + ( ( sms_text[ i + 1 ] & BITMASK_7BITS ) << ( 8 - carry_on_bits ) ); carry_on_bits++; - if ( carry_on_bits == 8 ) { + if ( carry_on_bits == 8 ) + { carry_on_bits = 1; ++i; } } - - if ( i < sms_text_length ) { + if ( i < sms_text_length ) + { output_buffer[ output_buffer_length++ ] = ( sms_text[ i ] & BITMASK_7BITS ) >> ( carry_on_bits - 1 ); } return output_buffer_length; } -static int16_t encode_phone_number ( char *phone_number, uint8_t *output_buffer, uint16_t buffer_size ) { +static int16_t encode_phone_number ( uint8_t *phone_number, uint8_t *output_buffer, uint16_t buffer_size ) +{ int16_t output_buffer_length = 0; int16_t phone_number_length = strlen( phone_number ); // Check if the output buffer is big enough. - if ( ( phone_number_length + 1 ) / 2 > buffer_size ) { + if ( ( phone_number_length + 1 ) / 2 > buffer_size ) + { return C3GAA_ERROR; } int16_t i = 0; - for ( ; i < phone_number_length; ++i ) { - if ( phone_number[ i ] < '0' && phone_number[ i ] > '9' ) { + for ( ; i < phone_number_length; ++i ) + { + if ( phone_number[ i ] < '0' && phone_number[ i ] > '9' ) + { return C3GAA_ERROR; } - if ( i % 2 == 0 ) { + if ( i % 2 == 0 ) + { output_buffer[ output_buffer_length++ ] = BITMASK_HIGH_4BITS | ( phone_number[ i ] - '0' ); - } else { - output_buffer[ output_buffer_length - 1 ] = ( output_buffer[ output_buffer_length - 1 ] & BITMASK_LOW_4BITS ) | ( ( phone_number[ i ] - '0' ) << 4 ); + } + else + { + output_buffer[ output_buffer_length - 1 ] = + ( output_buffer[ output_buffer_length - 1 ] & BITMASK_LOW_4BITS ) | + ( ( phone_number[ i ] - '0' ) << 4 ); } } return output_buffer_length; } +static void c3gaa_str_cut_chr ( uint8_t *str, uint8_t chr ) +{ + uint16_t cnt_0, cnt_1; + for ( cnt_0 = 0; cnt_0 < strlen( str ); cnt_0++ ) + { + if ( str[ cnt_0 ] == chr ) + { + for ( cnt_1 = cnt_0; cnt_1 < strlen( str ); cnt_1++ ) + { + str[ cnt_1 ] = str[ cnt_1 + 1 ]; + } + } + } +} + // ------------------------------------------------------------------------- END diff --git a/clicks/3gaa/memake.txt b/clicks/3gaa/memake.txt deleted file mode 100644 index 54556fea78..0000000000 --- a/clicks/3gaa/memake.txt +++ /dev/null @@ -1,12 +0,0 @@ -type: subdirs -project: C3GAA - -subdirs: { - lib - example -} - -depends: { - MikroSDK.GenericPointer - MikroSDK.Conversions -} diff --git a/clicks/3gea/CMakeLists.txt b/clicks/3gea/CMakeLists.txt new file mode 100644 index 0000000000..dbbfd94550 --- /dev/null +++ b/clicks/3gea/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(example_c3gea LANGUAGES MikroC) +else() + project(example_c3gea LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_executable(example_c3gea + example/main.c + +) + + +############################ example_c3gea GENERATED CODE START ########################### +find_package(MikroC.Core REQUIRED) +target_link_libraries(example_c3gea PUBLIC MikroC.Core) +find_package(MikroSDK.Board REQUIRED) +target_link_libraries(example_c3gea PUBLIC MikroSDK.Board) +find_package(MikroSDK.Log REQUIRED) +target_link_libraries(example_c3gea PUBLIC MikroSDK.Log) +add_subdirectory(lib_c3gea) +target_link_libraries(example_c3gea PUBLIC Click.3GEA) +############################ example_c3gea GENERATED CODE END ########################### diff --git a/clicks/3gea/README.md b/clicks/3gea/README.md index bbeb7e9a84..95e9b8411a 100644 --- a/clicks/3gea/README.md +++ b/clicks/3gea/README.md @@ -16,8 +16,8 @@ #### Click library -- **Author** : Stefan Ilic -- **Date** : Jul 2021. +- **Author** : Stefan Filipovic +- **Date** : May 2023. - **Type** : UART type @@ -48,44 +48,45 @@ err_t c3gea_init ( c3gea_t *ctx, c3gea_cfg_t *cfg ); #### Example key functions : -- `c3gea_module_power` This function powers ON/OFF the module. +- `c3gea_set_sim_apn` This function sets APN for sim card. ```c -void c3gea_module_power ( c3gea_t *ctx, uint8_t state ); +void c3gea_set_sim_apn ( c3gea_t *ctx, uint8_t *sim_apn ); ``` -- `c3gea_send_cmd_with_parameter` This function sends a command with specified parameter to the click module. +- `c3gea_send_sms_text` This function sends text message to a phone number. ```c -void c3gea_send_cmd_with_parameter ( c3gea_t *ctx, char *at_cmd_buf, char *param_buf ); +void c3gea_send_sms_text ( c3gea_t *ctx, uint8_t *phone_number, uint8_t *sms_text ); ``` -- `c3gea_send_sms_text` This function sends text message to a phone number. +- `c3gea_send_sms_pdu` This function sends text message to a phone number in PDU mode. ```c -void c3gea_send_sms_text ( c3gea_t *ctx, char *phone_number, char *sms_text ); +err_t c3gea_send_sms_pdu ( c3gea_t *ctx, uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text ); ``` ## Example Description -> This example reads and processes data from 3G EA click. +> Application example shows device capability of connecting to the network and sending SMS or TCP/UDP messages using standard "AT" commands. **The demo application is composed of two sections :** ### Application Init -> Initializes the driver and powers up the module, then sets default configuration for connecting the device to network. +> Initializes the driver, tests the communication by sending "AT" command, and after that restarts the device. ```c -void application_init ( void ) { +void application_init ( void ) +{ log_cfg_t log_cfg; /**< Logger config object. */ c3gea_cfg_t c3gea_cfg; /**< Click config object. */ - /** + /** * Logger initialization. * Default baud rate: 115200 * Default log level: LOG_LEVEL_DEBUG - * @note If USB_UART_RX and USB_UART_TX - * are defined as HAL_PIN_NC, you will - * need to define them manually for log to work. + * @note If USB_UART_RX and USB_UART_TX + * are defined as HAL_PIN_NC, you will + * need to define them manually for log to work. * See @b LOG_MAP_USB_UART macro definition for detailed explanation. */ LOG_MAP_USB_UART( log_cfg ); @@ -93,118 +94,87 @@ void application_init ( void ) { log_info( &logger, " Application Init " ); // Click initialization. - c3gea_cfg_setup( &c3gea_cfg ); C3GEA_MAP_MIKROBUS( c3gea_cfg, MIKROBUS_1 ); - c3gea_init( &c3gea, &c3gea_cfg ); - - c3gea_module_power( &c3gea, C3GEA_MODULE_POWER_ON ); + if ( UART_ERROR == c3gea_init( &c3gea, &c3gea_cfg ) ) + { + log_error( &logger, " Application Init Error. " ); + log_info( &logger, " Please, run program again... " ); + for ( ; ; ); + } - // dummy read c3gea_process( ); c3gea_clear_app_buf( ); - - // AT + + // Check communication c3gea_send_cmd( &c3gea, C3GEA_CMD_AT ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - // ATI - product information - c3gea_send_cmd( &c3gea, C3GEA_CMD_ATI ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CGMR - firmware version - c3gea_send_cmd( &c3gea, C3GEA_CMD_CGMR ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CMEE - Report Mobile Equipment Error - c3gea_send_cmd_with_parameter( &c3gea, C3GEA_CMD_CMEE, "2" ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + c3gea_error_check( error_flag ); - // COPS - deregister from network - c3gea_send_cmd_with_parameter( &c3gea, C3GEA_CMD_COPS, "2" ); - Delay_ms( 4000 ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); + // Restart device + #define RESTART_DEVICE "1,1" + c3gea_send_cmd_with_par( &c3gea, C3GEA_CMD_CFUN, RESTART_DEVICE ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + c3gea_error_check( error_flag ); - // CGDCONT - set sim apn - c3gea_set_sim_apn( &c3gea, SIM_APN ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CFUN - full funtionality - c3gea_send_cmd_with_parameter( &c3gea, C3GEA_CMD_CFUN, "1" ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - // COPS - automatic mode - c3gea_send_cmd_with_parameter( &c3gea, C3GEA_CMD_COPS, "0" ); - Delay_ms( 4000 ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CREG - network registration status - c3gea_send_cmd_with_parameter( &c3gea, C3GEA_CMD_CREG, "1" ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - app_buf_len = 0; - app_buf_cnt = 0; - app_connection_status = WAIT_FOR_CONNECTION; log_info( &logger, " Application Task " ); - Delay_ms( 5000 ); + example_state = C3GEA_CONFIGURE_FOR_NETWORK; } ``` ### Application Task -> Waits for device to connect to network and then sends a desired SMS to the selected phone number approximately every 30 seconds. +> Application task is split in few stages: + - C3GEA_CONFIGURE_FOR_NETWORK: + > Sets configuration to device to be able to connect to the network. + - C3GEA_WAIT_FOR_CONNECTION: + > Waits for the network registration indicated via CREG URC event and then checks the connection status. + - C3GEA_CONFIGURE_FOR_EXAMPLE: + > Sets the device configuration for sending SMS or TCP/UDP messages depending on the selected demo example. + - C3GEA_EXAMPLE: + > Depending on the selected demo example, it sends an SMS message (in PDU or TXT mode) or TCP/UDP message. +> By default, the TCP/UDP example is selected. ```c -void application_task ( void ) { - if ( app_connection_status == WAIT_FOR_CONNECTION ) { - // CREG - network registration status - c3gea_send_cmd_check( &c3gea, C3GEA_CMD_CREG ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CSQ - signal quality - c3gea_send_cmd( &c3gea, C3GEA_CMD_CSQ ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 3000 ); - } else { - log_info( &logger, "CONNECTED TO NETWORK" ); - - // SMS message format - PDU mode - c3gea_send_cmd_with_parameter( &c3gea, C3GEA_CMD_CMGF, "0" ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 3000 ); - - for( ; ; ) { - log_printf( &logger, "> Sending message to phone number...\r\n" ); - c3gea_send_sms_pdu ( &c3gea, SIM_SMSC, PHONE_NUMBER_TO_MESSAGE, MESSAGE_CONTENT ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 10000 ); - Delay_ms( 10000 ); - Delay_ms( 10000 ); +void application_task ( void ) +{ + switch ( example_state ) + { + case C3GEA_CONFIGURE_FOR_NETWORK: + { + if ( C3GEA_OK == c3gea_configure_for_network( ) ) + { + example_state = C3GEA_WAIT_FOR_CONNECTION; + } + break; + } + case C3GEA_WAIT_FOR_CONNECTION: + { + if ( C3GEA_OK == c3gea_check_connection( ) ) + { + example_state = C3GEA_CONFIGURE_FOR_EXAMPLE; + } + break; + } + case C3GEA_CONFIGURE_FOR_EXAMPLE: + { + if ( C3GEA_OK == c3gea_configure_for_example( ) ) + { + example_state = C3GEA_EXAMPLE; + } + break; + } + case C3GEA_EXAMPLE: + { + c3gea_example( ); + break; + } + default: + { + log_error( &logger, " Example state." ); + break; } } } @@ -213,13 +183,14 @@ void application_task ( void ) { ## Note -> In order for the example to work, user needs to set the phone number to which he wants -> to send an SMS, and also will need to set an APN and SMSC (required for PDU mode only) of entered SIM card. -> Enter valid data for the following macros: SIM_APN, SIM_SMSC and PHONE_NUMBER_TO_MESSAGE. ->> E.g. - >> * SIM_APN "vipmobile" - >> * SIM_SMSC "+381610401" - >> * PHONE_NUMBER_TO_MESSAGE "+381659999999" +> In order for the examples to work, user needs to set the APN and SMSC (SMS PDU mode only) +of entered SIM card as well as the phone number (SMS mode only) to which he wants to send an SMS. +Enter valid values for the following macros: SIM_APN, SIM_SMSC and PHONE_NUMBER_TO_MESSAGE. +> > Example: +> > - SIM_APN "internet" +> > - SIM_SMSC "+381610401" +> > - PHONE_NUMBER_TO_MESSAGE "+381659999999" + The full application code, and ready to use projects can be installed directly from *NECTO Studio Package Manager*(recommended way), downloaded from our [LibStock™](https://libstock.mikroe.com) or found on [Mikroe github account](https://github.com/MikroElektronika/mikrosdk_click_v2/tree/master/clicks). @@ -227,7 +198,7 @@ The full application code, and ready to use projects can be installed directly f - MikroSDK.Board - MikroSDK.Log -- Click.C3GEA +- Click.3GEA **Additional notes and informations** diff --git a/clicks/3gea/changelog.md b/clicks/3gea/changelog.md index b96039c092..b2ebfc1acd 100644 --- a/clicks/3gea/changelog.md +++ b/clicks/3gea/changelog.md @@ -1,4 +1,4 @@ ## Changelog -### Version 2.0.0.3 +### Version 2.1.0.5 - Initial release diff --git a/clicks/3gea/details.md b/clicks/3gea/details.md index 896ff3782e..3c5ca17e3f 100644 --- a/clicks/3gea/details.md +++ b/clicks/3gea/details.md @@ -15,8 +15,8 @@ #### Click library -- **Author** : Stefan Ilic -- **Date** : Jul 2021. +- **Author** : Stefan Filipovic +- **Date** : May 2023. - **Type** : UART type @@ -47,44 +47,45 @@ err_t c3gea_init ( c3gea_t *ctx, c3gea_cfg_t *cfg ); #### Example key functions : -- `c3gea_module_power` This function powers ON/OFF the module. +- `c3gea_set_sim_apn` This function sets APN for sim card. ```c -void c3gea_module_power ( c3gea_t *ctx, uint8_t state ); +void c3gea_set_sim_apn ( c3gea_t *ctx, uint8_t *sim_apn ); ``` -- `c3gea_send_cmd_with_parameter` This function sends a command with specified parameter to the click module. +- `c3gea_send_sms_text` This function sends text message to a phone number. ```c -void c3gea_send_cmd_with_parameter ( c3gea_t *ctx, char *at_cmd_buf, char *param_buf ); +void c3gea_send_sms_text ( c3gea_t *ctx, uint8_t *phone_number, uint8_t *sms_text ); ``` -- `c3gea_send_sms_text` This function sends text message to a phone number. +- `c3gea_send_sms_pdu` This function sends text message to a phone number in PDU mode. ```c -void c3gea_send_sms_text ( c3gea_t *ctx, char *phone_number, char *sms_text ); +err_t c3gea_send_sms_pdu ( c3gea_t *ctx, uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text ); ``` ## Example Description -> This example reads and processes data from 3G EA click. +> Application example shows device capability of connecting to the network and sending SMS or TCP/UDP messages using standard "AT" commands. **The demo application is composed of two sections :** ### Application Init -> Initializes the driver and powers up the module, then sets default configuration for connecting the device to network. +> Initializes the driver, tests the communication by sending "AT" command, and after that restarts the device. ```c -void application_init ( void ) { +void application_init ( void ) +{ log_cfg_t log_cfg; /**< Logger config object. */ c3gea_cfg_t c3gea_cfg; /**< Click config object. */ - /** + /** * Logger initialization. * Default baud rate: 115200 * Default log level: LOG_LEVEL_DEBUG - * @note If USB_UART_RX and USB_UART_TX - * are defined as HAL_PIN_NC, you will - * need to define them manually for log to work. + * @note If USB_UART_RX and USB_UART_TX + * are defined as HAL_PIN_NC, you will + * need to define them manually for log to work. * See @b LOG_MAP_USB_UART macro definition for detailed explanation. */ LOG_MAP_USB_UART( log_cfg ); @@ -92,118 +93,87 @@ void application_init ( void ) { log_info( &logger, " Application Init " ); // Click initialization. - c3gea_cfg_setup( &c3gea_cfg ); C3GEA_MAP_MIKROBUS( c3gea_cfg, MIKROBUS_1 ); - c3gea_init( &c3gea, &c3gea_cfg ); - - c3gea_module_power( &c3gea, C3GEA_MODULE_POWER_ON ); + if ( UART_ERROR == c3gea_init( &c3gea, &c3gea_cfg ) ) + { + log_error( &logger, " Application Init Error. " ); + log_info( &logger, " Please, run program again... " ); + for ( ; ; ); + } - // dummy read c3gea_process( ); c3gea_clear_app_buf( ); - - // AT + + // Check communication c3gea_send_cmd( &c3gea, C3GEA_CMD_AT ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - // ATI - product information - c3gea_send_cmd( &c3gea, C3GEA_CMD_ATI ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CGMR - firmware version - c3gea_send_cmd( &c3gea, C3GEA_CMD_CGMR ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CMEE - Report Mobile Equipment Error - c3gea_send_cmd_with_parameter( &c3gea, C3GEA_CMD_CMEE, "2" ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + c3gea_error_check( error_flag ); - // COPS - deregister from network - c3gea_send_cmd_with_parameter( &c3gea, C3GEA_CMD_COPS, "2" ); - Delay_ms( 4000 ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); + // Restart device + #define RESTART_DEVICE "1,1" + c3gea_send_cmd_with_par( &c3gea, C3GEA_CMD_CFUN, RESTART_DEVICE ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + c3gea_error_check( error_flag ); - // CGDCONT - set sim apn - c3gea_set_sim_apn( &c3gea, SIM_APN ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CFUN - full funtionality - c3gea_send_cmd_with_parameter( &c3gea, C3GEA_CMD_CFUN, "1" ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - // COPS - automatic mode - c3gea_send_cmd_with_parameter( &c3gea, C3GEA_CMD_COPS, "0" ); - Delay_ms( 4000 ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CREG - network registration status - c3gea_send_cmd_with_parameter( &c3gea, C3GEA_CMD_CREG, "1" ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - app_buf_len = 0; - app_buf_cnt = 0; - app_connection_status = WAIT_FOR_CONNECTION; log_info( &logger, " Application Task " ); - Delay_ms( 5000 ); + example_state = C3GEA_CONFIGURE_FOR_NETWORK; } ``` ### Application Task -> Waits for device to connect to network and then sends a desired SMS to the selected phone number approximately every 30 seconds. +> Application task is split in few stages: + - C3GEA_CONFIGURE_FOR_NETWORK: + > Sets configuration to device to be able to connect to the network. + - C3GEA_WAIT_FOR_CONNECTION: + > Waits for the network registration indicated via CREG URC event and then checks the connection status. + - C3GEA_CONFIGURE_FOR_EXAMPLE: + > Sets the device configuration for sending SMS or TCP/UDP messages depending on the selected demo example. + - C3GEA_EXAMPLE: + > Depending on the selected demo example, it sends an SMS message (in PDU or TXT mode) or TCP/UDP message. +> By default, the TCP/UDP example is selected. ```c -void application_task ( void ) { - if ( app_connection_status == WAIT_FOR_CONNECTION ) { - // CREG - network registration status - c3gea_send_cmd_check( &c3gea, C3GEA_CMD_CREG ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CSQ - signal quality - c3gea_send_cmd( &c3gea, C3GEA_CMD_CSQ ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 3000 ); - } else { - log_info( &logger, "CONNECTED TO NETWORK" ); - - // SMS message format - PDU mode - c3gea_send_cmd_with_parameter( &c3gea, C3GEA_CMD_CMGF, "0" ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 3000 ); - - for( ; ; ) { - log_printf( &logger, "> Sending message to phone number...\r\n" ); - c3gea_send_sms_pdu ( &c3gea, SIM_SMSC, PHONE_NUMBER_TO_MESSAGE, MESSAGE_CONTENT ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 10000 ); - Delay_ms( 10000 ); - Delay_ms( 10000 ); +void application_task ( void ) +{ + switch ( example_state ) + { + case C3GEA_CONFIGURE_FOR_NETWORK: + { + if ( C3GEA_OK == c3gea_configure_for_network( ) ) + { + example_state = C3GEA_WAIT_FOR_CONNECTION; + } + break; + } + case C3GEA_WAIT_FOR_CONNECTION: + { + if ( C3GEA_OK == c3gea_check_connection( ) ) + { + example_state = C3GEA_CONFIGURE_FOR_EXAMPLE; + } + break; + } + case C3GEA_CONFIGURE_FOR_EXAMPLE: + { + if ( C3GEA_OK == c3gea_configure_for_example( ) ) + { + example_state = C3GEA_EXAMPLE; + } + break; + } + case C3GEA_EXAMPLE: + { + c3gea_example( ); + break; + } + default: + { + log_error( &logger, " Example state." ); + break; } } } @@ -212,13 +182,14 @@ void application_task ( void ) { ## Note -> In order for the example to work, user needs to set the phone number to which he wants -> to send an SMS, and also will need to set an APN and SMSC (required for PDU mode only) of entered SIM card. -> Enter valid data for the following macros: SIM_APN, SIM_SMSC and PHONE_NUMBER_TO_MESSAGE. ->> E.g. - >> * SIM_APN "vipmobile" - >> * SIM_SMSC "+381610401" - >> * PHONE_NUMBER_TO_MESSAGE "+381659999999" +> In order for the examples to work, user needs to set the APN and SMSC (SMS PDU mode only) +of entered SIM card as well as the phone number (SMS mode only) to which he wants to send an SMS. +Enter valid values for the following macros: SIM_APN, SIM_SMSC and PHONE_NUMBER_TO_MESSAGE. +> > Example: +> > - SIM_APN "internet" +> > - SIM_SMSC "+381610401" +> > - PHONE_NUMBER_TO_MESSAGE "+381659999999" + The full application code, and ready to use projects can be installed directly from *NECTO Studio Package Manager*(recommended way), downloaded from our [LibStock™](https://libstock.mikroe.com) or found on [Mikroe github account](https://github.com/MikroElektronika/mikrosdk_click_v2/tree/master/clicks). @@ -226,7 +197,7 @@ The full application code, and ready to use projects can be installed directly f - MikroSDK.Board - MikroSDK.Log -- Click.C3GEA +- Click.3GEA **Additional notes and informations** diff --git a/clicks/3gea/doc/doxy/Doxyfile.doxy b/clicks/3gea/doc/doxy/Doxyfile.doxy index 5875a6fd04..7f5bb56595 100644 --- a/clicks/3gea/doc/doxy/Doxyfile.doxy +++ b/clicks/3gea/doc/doxy/Doxyfile.doxy @@ -44,21 +44,21 @@ PROJECT_NUMBER = 2.0.0.0 # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = +PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = +PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = ../clicks/c3gea/temp/Help/doc +OUTPUT_DIRECTORY = ../cmake/c3gea/temp/Help/doc # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -162,7 +162,7 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -171,7 +171,7 @@ STRIP_FROM_PATH = # specify the list of include paths that are normally passed to the compiler # using the -I flag. -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't @@ -238,13 +238,13 @@ TAB_SIZE = 4 # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. -ALIASES = +ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. -TCL_SUBST = +TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For @@ -291,7 +291,7 @@ OPTIMIZE_OUTPUT_VHDL = NO # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. -EXTENSION_MAPPING = +EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable @@ -648,7 +648,7 @@ GENERATE_DEPRECATEDLIST= YES # sections, marked by \if ... \endif and \cond # ... \endcond blocks. -ENABLED_SECTIONS = +ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the @@ -690,7 +690,7 @@ SHOW_NAMESPACES = YES # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. -FILE_VERSION_FILTER = +FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated @@ -703,7 +703,7 @@ FILE_VERSION_FILTER = # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. -LAYOUT_FILE = +LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib @@ -713,7 +713,7 @@ LAYOUT_FILE = # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. -CITE_BIB_FILES = +CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages @@ -778,7 +778,7 @@ WARN_FORMAT = "$file:$line: $text" # messages should be written. If left blank the output is written to standard # error (stderr). -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files @@ -790,9 +790,9 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = ../clicks/c3gea/example \ - ../clicks/c3gea/lib/include \ - ../clicks/c3gea/README.md +INPUT = ../cmake/c3gea/example \ + ../cmake/c3gea/lib_c3gea/include \ + ../cmake/c3gea/README.md # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -877,7 +877,7 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = +EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -893,7 +893,7 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the @@ -904,13 +904,13 @@ EXCLUDE_PATTERNS = # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* -EXCLUDE_SYMBOLS = +EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = ../clicks/c3gea/example +EXAMPLE_PATH = ../cmake/c3gea/example # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and @@ -930,7 +930,7 @@ EXAMPLE_RECURSIVE = YES # that contain images that are to be included in the documentation (see the # \image command). -IMAGE_PATH = +IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program @@ -951,7 +951,7 @@ IMAGE_PATH = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -INPUT_FILTER = +INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the @@ -964,7 +964,7 @@ INPUT_FILTER = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -FILTER_PATTERNS = +FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for @@ -979,14 +979,14 @@ FILTER_SOURCE_FILES = NO # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. -FILTER_SOURCE_PATTERNS = +FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = +USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing @@ -1091,7 +1091,7 @@ CLANG_ASSISTED_PARSING = NO # specified with INPUT and INCLUDE_PATH. # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. -CLANG_OPTIONS = +CLANG_OPTIONS = #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index @@ -1117,7 +1117,7 @@ COLS_IN_ALPHA_INDEX = 5 # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output @@ -1161,7 +1161,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = +HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard @@ -1171,7 +1171,7 @@ HTML_HEADER = # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = +HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of @@ -1183,7 +1183,7 @@ HTML_FOOTER = # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_STYLESHEET = +HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets @@ -1196,7 +1196,7 @@ HTML_STYLESHEET = # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = +HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note @@ -1206,7 +1206,7 @@ HTML_EXTRA_STYLESHEET = # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = +HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to @@ -1335,7 +1335,7 @@ GENERATE_HTMLHELP = NO # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_FILE = +CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, @@ -1343,7 +1343,7 @@ CHM_FILE = # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -HHC_LOCATION = +HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the master .chm file (NO). @@ -1356,7 +1356,7 @@ GENERATE_CHI = NO # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_INDEX_ENCODING = +CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it @@ -1387,7 +1387,7 @@ GENERATE_QHP = NO # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. -QCH_FILE = +QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace @@ -1412,7 +1412,7 @@ QHP_VIRTUAL_FOLDER = ./temp/Help/doc # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom @@ -1420,21 +1420,21 @@ QHP_CUST_FILTER_NAME = # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_ATTRS = +QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_SECT_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. -QHG_LOCATION = +QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To @@ -1567,7 +1567,7 @@ MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_EXTENSIONS = +MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site @@ -1575,7 +1575,7 @@ MATHJAX_EXTENSIONS = # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_CODEFILE = +MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and @@ -1635,7 +1635,7 @@ EXTERNAL_SEARCH = NO # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. -SEARCHENGINE_URL = +SEARCHENGINE_URL = # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed # search data is written to a file for indexing by an external tool. With the @@ -1651,7 +1651,7 @@ SEARCHDATA_FILE = searchdata.xml # projects and redirect the results back to the right project. # This tag requires that the tag SEARCHENGINE is set to YES. -EXTERNAL_SEARCH_ID = +EXTERNAL_SEARCH_ID = # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen # projects other than the one defined by this configuration file, but that are @@ -1661,7 +1661,7 @@ EXTERNAL_SEARCH_ID = # EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... # This tag requires that the tag SEARCHENGINE is set to YES. -EXTRA_SEARCH_MAPPINGS = +EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- # Configuration options related to the LaTeX output @@ -1725,7 +1725,7 @@ PAPER_TYPE = a4 # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. -EXTRA_PACKAGES = +EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for the # generated LaTeX document. The header should contain everything until the first @@ -1741,7 +1741,7 @@ EXTRA_PACKAGES = # to HTML_HEADER. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_HEADER = +LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the # generated LaTeX document. The footer should contain everything after the last @@ -1752,7 +1752,7 @@ LATEX_HEADER = # Note: Only use a user-defined footer if you know what you are doing! # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_FOOTER = +LATEX_FOOTER = # The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined # LaTeX style sheets that are included after the standard style sheets created @@ -1763,7 +1763,7 @@ LATEX_FOOTER = # list). # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_STYLESHEET = +LATEX_EXTRA_STYLESHEET = # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output @@ -1771,7 +1771,7 @@ LATEX_EXTRA_STYLESHEET = # markers available. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_FILES = +LATEX_EXTRA_FILES = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is # prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will @@ -1879,14 +1879,14 @@ RTF_HYPERLINKS = NO # default style sheet that doxygen normally uses. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_STYLESHEET_FILE = +RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is # similar to doxygen's config file. A template extensions file can be generated # using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_EXTENSIONS_FILE = +RTF_EXTENSIONS_FILE = # If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code # with syntax highlighting in the RTF output. @@ -1931,7 +1931,7 @@ MAN_EXTENSION = .3 # MAN_EXTENSION with the initial . removed. # This tag requires that the tag GENERATE_MAN is set to YES. -MAN_SUBDIR = +MAN_SUBDIR = # If the MAN_LINKS tag is set to YES and doxygen generates man output, then it # will generate one additional man file for each entity documented in the real @@ -2044,7 +2044,7 @@ PERLMOD_PRETTY = YES # overwrite each other's variables. # This tag requires that the tag GENERATE_PERLMOD is set to YES. -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor @@ -2085,7 +2085,7 @@ SEARCH_INCLUDES = YES # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = +INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the @@ -2093,7 +2093,7 @@ INCLUDE_PATH = # used. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -INCLUDE_FILE_PATTERNS = +INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that are # defined before the preprocessor is started (similar to the -D option of e.g. @@ -2103,7 +2103,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = +PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -2112,7 +2112,7 @@ PREDEFINED = # definition found in the source code. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will # remove all references to function-like macros that are alone on a line, have @@ -2141,13 +2141,13 @@ SKIP_FUNCTION_MACROS = YES # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. -TAGFILES = +TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create a # tag file that is based on the input files it reads. See section "Linking to # external documentation" for more information about the usage of tag files. -GENERATE_TAGFILE = +GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES, all external class will be listed in # the class index. If set to NO, only the inherited external classes will be @@ -2188,7 +2188,7 @@ CLASS_DIAGRAMS = YES # DIA_PATH tag allows you to specify the directory where the dia binary resides. # If left empty dia is assumed to be found in the default search path. -DIA_PATH = +DIA_PATH = # If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. @@ -2237,7 +2237,7 @@ DOT_FONTSIZE = 10 # the path where dot can find it using this tag. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTPATH = +DOT_FONTPATH = # If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for # each documented class showing the direct and indirect inheritance relations. @@ -2381,26 +2381,26 @@ INTERACTIVE_SVG = NO # found. If left blank, it is assumed the dot tool can be found in the path. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_PATH = +DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the \dotfile # command). # This tag requires that the tag HAVE_DOT is set to YES. -DOTFILE_DIRS = +DOTFILE_DIRS = # The MSCFILE_DIRS tag can be used to specify one or more directories that # contain msc files that are included in the documentation (see the \mscfile # command). -MSCFILE_DIRS = +MSCFILE_DIRS = # The DIAFILE_DIRS tag can be used to specify one or more directories that # contain dia files that are included in the documentation (see the \diafile # command). -DIAFILE_DIRS = +DIAFILE_DIRS = # When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the # path where java can find the plantuml.jar file. If left blank, it is assumed @@ -2408,17 +2408,17 @@ DIAFILE_DIRS = # generate a warning when it encounters a \startuml command in this case and # will not generate output for the diagram. -PLANTUML_JAR_PATH = +PLANTUML_JAR_PATH = # When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a # configuration file for plantuml. -PLANTUML_CFG_FILE = +PLANTUML_CFG_FILE = # When using plantuml, the specified paths are searched for files specified by # the !include statement in a plantuml block. -PLANTUML_INCLUDE_PATH = +PLANTUML_INCLUDE_PATH = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes diff --git a/clicks/3gea/doc/package/manifest.json b/clicks/3gea/doc/package/manifest.json index fd631d67b1..07d4ae3dbd 100644 --- a/clicks/3gea/doc/package/manifest.json +++ b/clicks/3gea/doc/package/manifest.json @@ -1,6 +1,6 @@ { - "architecture": "ARM|PIC|PIC32", - "category": "GSM/LTE", + "architecture": "ARM|PIC|PIC32|RISC-V", + "category": "Click Boards > Wireless connectivity > GSM/LTE", "changelog": "Resources/CHANGELOG.md", "contains": [ "libraries", @@ -8,8 +8,7 @@ "examples", "source_files" ], - "dependency_list": [ - ], + "dependency_list": [], "details": "Resources/DETAILS.md", "display_name": "3G-EA click", "example_list": [ @@ -26,14 +25,16 @@ "name": "mikroe.click.c3gea", "product_link": "https://www.mikroe.com/3g-ea-click", "short_description": "3G-EA click is a versatile cellular network communication solution, featuring the compact 3G UMTS/HSPA Quectel UG95 module. This module features a full set of options for the cellular networking and communication, such as the network indication, embedded TCP/UDP stack, HTTP/HTTPS stack, full GSM/GPRS/EDGE implementation, UMTS/HSDPA/HSUPA protocol implementation and more. 3G-EA click features data-rates of 7.2 Mb/s (downlink) and 5.76 Mb/s (uplink) in HSPA mode. Onboard 16bit audio CODEC IC adds high-quality voice communication capability.", - "supported_compiler": "mikroC AI", + "supported_compiler": "mikroC AI|GCC", "type": "Library", - "related_projects":[ + "related_projects": [ 1802 ], - "_type":"mikroSDK Library", - "version": "2.0.0.3" + "_type": "mikroSDK Library", + "version": "2.1.0.5", + "cmake": true, + "alias": "Click.3GEA", + "subdir_name": "lib_c3gea" } - diff --git a/clicks/3gea/example/CMakeLists.txt b/clicks/3gea/example/CMakeLists.txt new file mode 100644 index 0000000000..73bc2c4f9a --- /dev/null +++ b/clicks/3gea/example/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(example_c3gea LANGUAGES MikroC) +else() + project(example_c3gea LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_executable(example_c3gea + main.c + +) + + +############################ example_c3gea GENERATED CODE START ########################### +find_package(MikroC.Core REQUIRED) +target_link_libraries(example_c3gea PUBLIC MikroC.Core) +find_package(MikroSDK.Board REQUIRED) +target_link_libraries(example_c3gea PUBLIC MikroSDK.Board) +find_package(MikroSDK.Log REQUIRED) +target_link_libraries(example_c3gea PUBLIC MikroSDK.Log) +add_subdirectory(lib_c3gea) +target_link_libraries(example_c3gea PUBLIC Click.3GEA) +############################ example_c3gea GENERATED CODE END ########################### diff --git a/clicks/3gea/example/main.c b/clicks/3gea/example/main.c index 18270ca84e..e9af0dbac4 100644 --- a/clicks/3gea/example/main.c +++ b/clicks/3gea/example/main.c @@ -3,140 +3,210 @@ * @brief 3G-EA Click Example. * * # Description - * This example reads and processes data from 3G-EA click. + * Application example shows device capability of connecting to the network and + * sending SMS or TCP/UDP messages using standard "AT" commands. * * The demo application is composed of two sections : - * - * ## Application Init - * Initializes the driver and powers up the module, then sets default configuration - * for connecting the device to network. - * - * ## Application Task - * Waits for device to connect to network and then sends a desired SMS to the selected phone number - * approximately every 30 seconds. - * + * + * ## Application Init + * Initializes the driver, tests the communication by sending "AT" command, and after that restarts the device. + * + * ## Application Task + * Application task is split in few stages: + * - C3GEA_CONFIGURE_FOR_NETWORK: + * Sets configuration to device to be able to connect to the network. + * + * - C3GEA_WAIT_FOR_CONNECTION: + * Waits for the network registration indicated via CREG URC event and then checks + * the connection status. + * + * - C3GEA_CONFIGURE_FOR_EXAMPLE: + * Sets the device configuration for sending SMS or TCP/UDP messages depending on the selected demo example. + * + * - C3GEA_EXAMPLE: + * Depending on the selected demo example, it sends an SMS message (in PDU or TXT mode) or TCP/UDP message. + * + * By default, the TCP/UDP example is selected. + * * ## Additional Function * - static void c3gea_clear_app_buf ( void ) + * - static err_t c3gea_process ( void ) * - static void c3gea_error_check( err_t error_flag ) * - static void c3gea_log_app_buf ( void ) - * - static void c3gea_check_connection( void ) - * - static err_t c3gea_rsp_check ( void ) - * - static err_t c3gea_process ( void ) - * - * @note - * In order for the example to work, user needs to set the phone number to which he wants - * to send an SMS, and also will need to set an APN and SMSC (required for PDU mode only) of entered SIM card. - * Enter valid data for the following macros: SIM_APN, SIM_SMSC and PHONE_NUMBER_TO_MESSAGE. - * E.g. - SIM_APN "vipmobile" + * - static err_t c3gea_rsp_check ( uint8_t *rsp ) + * - static err_t c3gea_configure_for_connection( void ) + * - static err_t c3gea_check_connection( void ) + * - static err_t c3gea_configure_for_messages( void ) + * - static err_t c3gea_send_message( void ) + * + * @note + * In order for the examples to work, user needs to set the APN and SMSC (SMS PDU mode only) + * of entered SIM card as well as the phone number (SMS mode only) to which he wants to send an SMS. + * Enter valid values for the following macros: SIM_APN, SIM_SMSC and PHONE_NUMBER_TO_MESSAGE. + * Example: + SIM_APN "internet" SIM_SMSC "+381610401" - PHONE_NUMBER_TO_MESSAGE "+38169999999" + PHONE_NUMBER_TO_MESSAGE "+381659999999" * - * @author Stefan Ilic + * @author Stefan Filipovic * */ #include "board.h" #include "log.h" #include "c3gea.h" -#include "string.h" +#include "conversions.h" -#define APP_OK 0 -#define APP_ERROR_DRIVER -1 -#define APP_ERROR_OVERFLOW -2 -#define APP_ERROR_TIMEOUT -3 +// Example selection macros +#define EXAMPLE_TCP_UDP 0 // Example of sending messages to a TCP/UDP echo server +#define EXAMPLE_SMS 1 // Example of sending SMS to a phone number +#define DEMO_EXAMPLE EXAMPLE_TCP_UDP // Example selection macro -#define RSP_OK "OK" -#define RSP_ERROR "ERROR" +// SIM APN config +#define SIM_APN "" // Set valid SIM APN -#define SIM_APN "" // Set valid SIM APN -#define SIM_SMSC "" // Set valid SMS Service Center Address - only in PDU mode -#define PHONE_NUMBER_TO_MESSAGE "" // Set Phone number to message -#define MESSAGE_CONTENT "3G-EA click board - demo example." // Message content +// SMS example parameters +#define SIM_SMSC "" // Set valid SMS Service Center Address - only in SMS PDU mode +#define PHONE_NUMBER_TO_MESSAGE "" // Set Phone number to message +#define SMS_MODE "1" // SMS mode: "0" - PDU, "1" - TXT +// TCP/UDP example parameters +#define REMOTE_IP "77.46.162.162" // TCP/UDP echo server IP address +#define REMOTE_PORT "51111" // TCP/UDP echo server port + +// Message content +#define MESSAGE_CONTENT "3G-EA click board - demo example." + +// Application buffer size +#define APP_BUFFER_SIZE 256 #define PROCESS_BUFFER_SIZE 256 -#define WAIT_FOR_CONNECTION 0 -#define CONNECTED_TO_NETWORK 1 +/** + * @brief Example states. + * @details Predefined enum values for application example state. + */ +typedef enum +{ + C3GEA_CONFIGURE_FOR_NETWORK = 1, + C3GEA_WAIT_FOR_CONNECTION, + C3GEA_CONFIGURE_FOR_EXAMPLE, + C3GEA_EXAMPLE + +} c3gea_example_state_t; static c3gea_t c3gea; static log_t logger; -static char app_buf[ PROCESS_BUFFER_SIZE ] = { 0 }; +/** + * @brief Application example variables. + * @details Variables used in application example. + */ +static uint8_t app_buf[ APP_BUFFER_SIZE ] = { 0 }; static int32_t app_buf_len = 0; -static int32_t app_buf_cnt = 0; - -static uint8_t app_connection_status = WAIT_FOR_CONNECTION; - -static err_t app_error_flag; +static err_t error_flag; +static c3gea_example_state_t example_state; /** - * @brief 3G-EA clearing application buffer. - * @details This function clears memory of application buffer and reset it's length and counter. - * @note None. + * @brief Clearing application buffer. + * @details This function clears memory of application + * buffer and reset its length and counter. */ static void c3gea_clear_app_buf ( void ); /** - * @brief 3G-EA data reading function. - * @details This function reads data from device and concatenates data to application buffer. - * - * @return @li @c 0 - Read some data. + * @brief Data reading function. + * @details This function reads data from device and + * appends it to the application buffer. + * @return @li @c 0 - Some data is read. * @li @c -1 - Nothing is read. - * @li @c -2 - Application buffer overflow. - * * See #err_t definition for detailed explanation. - * @note None. */ static err_t c3gea_process ( void ); /** - * @brief 3G-EA check for errors. - * @details This function checks for different types of errors and logs them on UART. - * @note None. + * @brief Check for errors. + * @details This function checks for different types of + * errors and logs them on UART or logs the response if no errors occured. + * @param[in] error_flag Error flag to check. */ -static void c3gea_error_check( err_t error_flag ); +static void c3gea_error_check ( err_t error_flag ); /** - * @brief 3G-EA logs application buffer. + * @brief Logs application buffer. * @details This function logs data from application buffer. - * @note None. */ static void c3gea_log_app_buf ( void ); /** - * @brief 3G-EA response check. - * @details This function checks for response and returns the status of response. - * - * @return application status. + * @brief Response check. + * @details This function checks for response and + * returns the status of response. + * @param[in] rsp Expected response. + * @return @li @c 0 - OK response. + * @li @c -2 - Timeout error. + * @li @c -3 - Command error. + * @li @c -4 - Unknown error. + * See #err_t definition for detailed explanation. + */ +static err_t c3gea_rsp_check ( uint8_t *rsp ); + +/** + * @brief Configure device for connection to the network. + * @details Sends commands to configure and enable + * connection to the specified network. + * @return @li @c 0 - OK response. + * @li @c -2 - Timeout error. + * @li @c -3 - Command error. + * @li @c -4 - Unknown error. * See #err_t definition for detailed explanation. - * @note None. */ -static err_t c3gea_rsp_check ( void ); +static err_t c3gea_configure_for_network ( void ); /** - * @brief 3G-EA check connection. - * @details This function checks connection to the network and - * logs that status to UART. - * - * @note None. + * @brief Wait for connection signal. + * @details Wait for connection signal from CREG URC. + * @return @li @c 0 - OK response. + * @li @c -2 - Timeout error. + * @li @c -3 - Command error. + * @li @c -4 - Unknown error. + * See #err_t definition for detailed explanation. */ -static void c3gea_check_connection( void ); +static err_t c3gea_check_connection ( void ); -// ------------------------------------------------------ APPLICATION FUNCTIONS +/** + * @brief Configure device for example. + * @details Configure device for the specified example. + * @return @li @c 0 - OK response. + * @li @c -2 - Timeout error. + * @li @c -3 - Command error. + * @li @c -4 - Unknown error. + * See #err_t definition for detailed explanation. + */ +static err_t c3gea_configure_for_example ( void ); +/** + * @brief Execute example. + * @details This function executes SMS or TCP/UDP example depending on the DEMO_EXAMPLE macro. + * @return @li @c 0 - OK response. + * @li @c -2 - Timeout error. + * @li @c -3 - Command error. + * @li @c -4 - Unknown error. + * See #err_t definition for detailed explanation. + */ +static err_t c3gea_example ( void ); -void application_init ( void ) { +void application_init ( void ) +{ log_cfg_t log_cfg; /**< Logger config object. */ c3gea_cfg_t c3gea_cfg; /**< Click config object. */ - /** + /** * Logger initialization. * Default baud rate: 115200 * Default log level: LOG_LEVEL_DEBUG - * @note If USB_UART_RX and USB_UART_TX - * are defined as HAL_PIN_NC, you will - * need to define them manually for log to work. + * @note If USB_UART_RX and USB_UART_TX + * are defined as HAL_PIN_NC, you will + * need to define them manually for log to work. * See @b LOG_MAP_USB_UART macro definition for detailed explanation. */ LOG_MAP_USB_UART( log_cfg ); @@ -144,227 +214,403 @@ void application_init ( void ) { log_info( &logger, " Application Init " ); // Click initialization. - c3gea_cfg_setup( &c3gea_cfg ); C3GEA_MAP_MIKROBUS( c3gea_cfg, MIKROBUS_1 ); - c3gea_init( &c3gea, &c3gea_cfg ); - - c3gea_module_power( &c3gea, C3GEA_MODULE_POWER_ON ); + if ( UART_ERROR == c3gea_init( &c3gea, &c3gea_cfg ) ) + { + log_error( &logger, " Application Init Error. " ); + log_info( &logger, " Please, run program again... " ); + for ( ; ; ); + } - // dummy read c3gea_process( ); c3gea_clear_app_buf( ); - - // AT + + // Check communication c3gea_send_cmd( &c3gea, C3GEA_CMD_AT ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - // ATI - product information - c3gea_send_cmd( &c3gea, C3GEA_CMD_ATI ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CGMR - firmware version - c3gea_send_cmd( &c3gea, C3GEA_CMD_CGMR ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CMEE - Report Mobile Equipment Error - c3gea_send_cmd_with_parameter( &c3gea, C3GEA_CMD_CMEE, "2" ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - // COPS - deregister from network - c3gea_send_cmd_with_parameter( &c3gea, C3GEA_CMD_COPS, "2" ); - Delay_ms( 4000 ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CGDCONT - set sim apn - c3gea_set_sim_apn( &c3gea, SIM_APN ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CFUN - full funtionality - c3gea_send_cmd_with_parameter( &c3gea, C3GEA_CMD_CFUN, "1" ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - // COPS - automatic mode - c3gea_send_cmd_with_parameter( &c3gea, C3GEA_CMD_COPS, "0" ); - Delay_ms( 4000 ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + c3gea_error_check( error_flag ); - // CREG - network registration status - c3gea_send_cmd_with_parameter( &c3gea, C3GEA_CMD_CREG, "1" ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); + // Restart device + #define RESTART_DEVICE "1,1" + c3gea_send_cmd_with_par( &c3gea, C3GEA_CMD_CFUN, RESTART_DEVICE ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + c3gea_error_check( error_flag ); - app_buf_len = 0; - app_buf_cnt = 0; - app_connection_status = WAIT_FOR_CONNECTION; log_info( &logger, " Application Task " ); - Delay_ms( 5000 ); + example_state = C3GEA_CONFIGURE_FOR_NETWORK; } -void application_task ( void ) { - if ( app_connection_status == WAIT_FOR_CONNECTION ) { - // CREG - network registration status - c3gea_send_cmd_check( &c3gea, C3GEA_CMD_CREG ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 500 ); - - // CSQ - signal quality - c3gea_send_cmd( &c3gea, C3GEA_CMD_CSQ ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 3000 ); - } else { - log_info( &logger, "CONNECTED TO NETWORK" ); - - // SMS message format - PDU mode - c3gea_send_cmd_with_parameter( &c3gea, C3GEA_CMD_CMGF, "0" ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 3000 ); - - for( ; ; ) { - log_printf( &logger, "> Sending message to phone number...\r\n" ); - c3gea_send_sms_pdu ( &c3gea, SIM_SMSC, PHONE_NUMBER_TO_MESSAGE, MESSAGE_CONTENT ); - app_error_flag = c3gea_rsp_check( ); - c3gea_error_check( app_error_flag ); - Delay_ms( 10000 ); - Delay_ms( 10000 ); - Delay_ms( 10000 ); +void application_task ( void ) +{ + switch ( example_state ) + { + case C3GEA_CONFIGURE_FOR_NETWORK: + { + if ( C3GEA_OK == c3gea_configure_for_network( ) ) + { + example_state = C3GEA_WAIT_FOR_CONNECTION; + } + break; + } + case C3GEA_WAIT_FOR_CONNECTION: + { + if ( C3GEA_OK == c3gea_check_connection( ) ) + { + example_state = C3GEA_CONFIGURE_FOR_EXAMPLE; + } + break; + } + case C3GEA_CONFIGURE_FOR_EXAMPLE: + { + if ( C3GEA_OK == c3gea_configure_for_example( ) ) + { + example_state = C3GEA_EXAMPLE; + } + break; + } + case C3GEA_EXAMPLE: + { + c3gea_example( ); + break; + } + default: + { + log_error( &logger, " Example state." ); + break; } } } -void main ( void ) { +void main ( void ) +{ application_init( ); - for ( ; ; ) { + for ( ; ; ) + { application_task( ); } } -static void c3gea_clear_app_buf ( void ) { +static void c3gea_clear_app_buf ( void ) +{ memset( app_buf, 0, app_buf_len ); app_buf_len = 0; - app_buf_cnt = 0; } -static err_t c3gea_process ( void ) { - err_t return_flag = APP_ERROR_DRIVER; - int32_t rx_size; - char rx_buff[ PROCESS_BUFFER_SIZE ] = { 0 }; - - rx_size = c3gea_generic_read( &c3gea, rx_buff, PROCESS_BUFFER_SIZE ); - - if ( rx_size > 0 ) { - int32_t buf_cnt = 0; - return_flag = APP_OK; - - if ( app_buf_len + rx_size >= PROCESS_BUFFER_SIZE ) { - c3gea_clear_app_buf( ); - return_flag = APP_ERROR_OVERFLOW; - } else { - buf_cnt = app_buf_len; - app_buf_len += rx_size; +static err_t c3gea_process ( void ) +{ + uint8_t rx_buf[ PROCESS_BUFFER_SIZE ] = { 0 }; + int32_t rx_size = 0; + rx_size = c3gea_generic_read( &c3gea, rx_buf, PROCESS_BUFFER_SIZE ); + if ( rx_size > 0 ) + { + int32_t buf_cnt = app_buf_len; + if ( ( ( app_buf_len + rx_size ) > APP_BUFFER_SIZE ) && ( app_buf_len > 0 ) ) + { + buf_cnt = APP_BUFFER_SIZE - ( ( app_buf_len + rx_size ) - APP_BUFFER_SIZE ); + memmove ( app_buf, &app_buf[ APP_BUFFER_SIZE - buf_cnt ], buf_cnt ); } - - for ( int32_t rx_cnt = 0; rx_cnt < rx_size; rx_cnt++ ) { - if ( rx_buff[ rx_cnt ] != 0 ) { - app_buf[ ( buf_cnt + rx_cnt ) ] = rx_buff[ rx_cnt ]; - } else { - app_buf_len--; - buf_cnt--; + for ( int32_t rx_cnt = 0; rx_cnt < rx_size; rx_cnt++ ) + { + if ( rx_buf[ rx_cnt ] ) + { + app_buf[ buf_cnt++ ] = rx_buf[ rx_cnt ]; + if ( app_buf_len < APP_BUFFER_SIZE ) + { + app_buf_len++; + } } } - } - - return return_flag; + return C3GEA_OK; + } + return C3GEA_ERROR; } -static err_t c3gea_rsp_check ( void ) { - uint16_t timeout_cnt = 0; - uint32_t timeout = 100000; - - err_t error_flag = c3gea_process( ); - - if ( ( error_flag != 0 ) && ( error_flag != -1 ) ) { - return error_flag; - } - - while ( ( strstr( app_buf, RSP_OK ) == 0 ) && ( strstr( app_buf, RSP_ERROR ) == 0 ) ) { - error_flag = c3gea_process( ); - if ( ( error_flag != 0 ) && ( error_flag != -1 ) ) { - return error_flag; - } - - timeout_cnt++; - if ( timeout_cnt > timeout ) { - while ( ( strstr( app_buf, RSP_OK ) == 0 ) && ( strstr( app_buf, RSP_ERROR ) == 0 ) ) { - c3gea_send_cmd( &c3gea, C3GEA_CMD_AT ); - c3gea_process( ); - Delay_ms( 100 ); - } - c3gea_clear_app_buf( ); - return APP_ERROR_TIMEOUT; +static err_t c3gea_rsp_check ( uint8_t *rsp ) +{ + uint32_t timeout_cnt = 0; + uint32_t timeout = 120000; + c3gea_clear_app_buf( ); + c3gea_process( ); + while ( ( 0 == strstr( app_buf, rsp ) ) && + ( 0 == strstr( app_buf, C3GEA_RSP_ERROR ) ) ) + { + c3gea_process( ); + if ( timeout_cnt++ > timeout ) + { + c3gea_clear_app_buf( ); + return C3GEA_ERROR_TIMEOUT; } - Delay_ms( 1 ); } - - c3gea_check_connection(); - - c3gea_log_app_buf(); - - return APP_OK; + Delay_ms( 100 ); + c3gea_process( ); + if ( strstr( app_buf, rsp ) ) + { + return C3GEA_OK; + } + else if ( strstr( app_buf, C3GEA_RSP_ERROR ) ) + { + return C3GEA_ERROR_CMD; + } + else + { + return C3GEA_ERROR_UNKNOWN; + } } -static void c3gea_error_check( err_t error_flag ) { - if ( ( error_flag != 0 ) && ( error_flag != -1 ) ) { - switch ( error_flag ) { - case -2: - log_error( &logger, " Overflow!" ); - break; - case -3: - log_error( &logger, " Timeout!" ); - break; - default: - break; +static void c3gea_error_check ( err_t error_flag ) +{ + switch ( error_flag ) + { + case C3GEA_OK: + { + c3gea_log_app_buf( ); + break; + } + case C3GEA_ERROR: + { + log_error( &logger, " Overflow!" ); + break; + } + case C3GEA_ERROR_TIMEOUT: + { + log_error( &logger, " Timeout!" ); + break; + } + case C3GEA_ERROR_CMD: + { + log_error( &logger, " CMD!" ); + break; + } + case C3GEA_ERROR_UNKNOWN: + default: + { + log_error( &logger, " Unknown!" ); + break; } } + Delay_ms( 500 ); } -static void c3gea_log_app_buf ( void ) { - for ( int32_t buf_cnt = 0; buf_cnt < app_buf_len; buf_cnt++ ) { +static void c3gea_log_app_buf ( void ) +{ + for ( int32_t buf_cnt = 0; buf_cnt < app_buf_len; buf_cnt++ ) + { log_printf( &logger, "%c", app_buf[ buf_cnt ] ); } - log_printf( &logger, "\r\n-----------------------------------\r\n" ); +} + +static err_t c3gea_configure_for_network ( void ) +{ + err_t func_error = C3GEA_OK; +#if ( ( DEMO_EXAMPLE == EXAMPLE_TCP_UDP ) || ( DEMO_EXAMPLE == EXAMPLE_SMS ) ) + Delay_ms ( 5000 ); + // Deregister from network + #define DEREGISTER_FROM_NETWORK "2" + c3gea_send_cmd_with_par( &c3gea, C3GEA_CMD_COPS, DEREGISTER_FROM_NETWORK ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + func_error |= error_flag; + c3gea_error_check( error_flag ); - c3gea_clear_app_buf( ); + // Set SIM APN + c3gea_set_sim_apn( &c3gea, SIM_APN ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + func_error |= error_flag; + c3gea_error_check( error_flag ); + + // Enable full functionality + #define FULL_FUNCTIONALITY "1" + c3gea_send_cmd_with_par( &c3gea, C3GEA_CMD_CFUN, FULL_FUNCTIONALITY ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + func_error |= error_flag; + c3gea_error_check( error_flag ); + + // Enable network registartion + #define ENABLE_REG "2" + c3gea_send_cmd_with_par( &c3gea, C3GEA_CMD_CREG, ENABLE_REG ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + func_error |= error_flag; + c3gea_error_check( error_flag ); + + // Automatic registration + #define AUTOMATIC_REGISTRATION "0" + c3gea_send_cmd_with_par( &c3gea, C3GEA_CMD_COPS, AUTOMATIC_REGISTRATION ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + func_error |= error_flag; + c3gea_error_check( error_flag ); +#endif + return func_error; +} + +static err_t c3gea_check_connection ( void ) +{ +#if ( ( DEMO_EXAMPLE == EXAMPLE_TCP_UDP ) || ( DEMO_EXAMPLE == EXAMPLE_SMS ) ) + #define CONNECTED "+CREG: 2,1" + c3gea_send_cmd_check ( &c3gea, C3GEA_CMD_CREG ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + c3gea_error_check( error_flag ); + if ( strstr( app_buf, CONNECTED ) ) + { + Delay_ms( 100 ); + c3gea_process( ); + c3gea_log_app_buf( ); + log_printf( &logger, "\r\n" ); + c3gea_clear_app_buf( ); + // Check signal quality + c3gea_send_cmd( &c3gea, C3GEA_CMD_CSQ ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + c3gea_error_check( error_flag ); + return error_flag; + } + Delay_ms ( 1000 ); + return C3GEA_ERROR; +#endif + return C3GEA_OK; } -static void c3gea_check_connection( void ) { - #define CONNECTED "+CREG: 1,1" +static err_t c3gea_configure_for_example ( void ) +{ + err_t func_error = C3GEA_OK; +#if ( DEMO_EXAMPLE == EXAMPLE_TCP_UDP ) + #define ACTIVATE_PDP_CONTEXT "1" + c3gea_send_cmd_with_par( &c3gea, C3GEA_CMD_QIACT, ACTIVATE_PDP_CONTEXT ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + func_error |= error_flag; + c3gea_error_check( error_flag ); +#elif ( DEMO_EXAMPLE == EXAMPLE_SMS ) + c3gea_send_cmd_with_par( &c3gea, C3GEA_CMD_CMGF, SMS_MODE ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + func_error |= error_flag; + c3gea_error_check( error_flag ); +#else + #error "No demo example selected" +#endif + return func_error; +} + +static err_t c3gea_example ( void ) +{ + err_t func_error = C3GEA_OK; +#if ( DEMO_EXAMPLE == EXAMPLE_TCP_UDP ) + uint8_t cmd_buf[ 100 ] = { 0 }; + uint8_t tcp_socket_num[ 2 ] = { '0', 0 }; + uint8_t udp_socket_num[ 2 ] = { '1', 0 }; + #define CONTEXT_ID "1," + + // Open TCP socket. + #define TCP_SERVICE_TYPE ",\"TCP\"," + strcpy( cmd_buf, CONTEXT_ID ); + strcat( cmd_buf, tcp_socket_num ); + strcat( cmd_buf, TCP_SERVICE_TYPE ); + strcat( cmd_buf, "\"" ); + strcat( cmd_buf, REMOTE_IP ); + strcat( cmd_buf, "\"" ); + strcat( cmd_buf, "," ); + strcat( cmd_buf, REMOTE_PORT ); + c3gea_send_cmd_with_par( &c3gea, C3GEA_CMD_QIOPEN, cmd_buf ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + func_error |= error_flag; + c3gea_error_check( error_flag ); + + // Open UDP socket. + #define UDP_SERVICE_TYPE ",\"UDP\"," + strcpy( cmd_buf, CONTEXT_ID ); + strcat( cmd_buf, udp_socket_num ); + strcat( cmd_buf, UDP_SERVICE_TYPE ); + strcat( cmd_buf, "\"" ); + strcat( cmd_buf, REMOTE_IP ); + strcat( cmd_buf, "\"" ); + strcat( cmd_buf, "," ); + strcat( cmd_buf, REMOTE_PORT ); + c3gea_send_cmd_with_par( &c3gea, C3GEA_CMD_QIOPEN, cmd_buf ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + func_error |= error_flag; + c3gea_error_check( error_flag ); + + // Get message length + uint8_t message_len_buf[ 10 ] = { 0 }; + uint16_t message_len = strlen( MESSAGE_CONTENT ); + uint16_to_str( message_len, message_len_buf ); + l_trim( message_len_buf ); + r_trim( message_len_buf ); + + // Write message to TCP socket and read response + strcpy( cmd_buf, tcp_socket_num ); + strcat( cmd_buf, "," ); + strcat( cmd_buf, message_len_buf ); + c3gea_send_cmd_with_par( &c3gea, C3GEA_CMD_QISEND, cmd_buf ); + Delay_ms ( 100 ); + c3gea_generic_write ( &c3gea, MESSAGE_CONTENT, message_len ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + func_error |= error_flag; + c3gea_error_check( error_flag ); + Delay_ms ( 1000 ); + c3gea_send_cmd_with_par( &c3gea, C3GEA_CMD_QIRD, cmd_buf ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + func_error |= error_flag; + c3gea_error_check( error_flag ); + + // Write message to UDP socket and read response + strcpy( cmd_buf, udp_socket_num ); + strcat( cmd_buf, "," ); + strcat( cmd_buf, message_len_buf ); + c3gea_send_cmd_with_par( &c3gea, C3GEA_CMD_QISEND, cmd_buf ); + Delay_ms ( 100 ); + c3gea_generic_write ( &c3gea, MESSAGE_CONTENT, message_len ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + func_error |= error_flag; + c3gea_error_check( error_flag ); + Delay_ms ( 1000 ); + c3gea_send_cmd_with_par( &c3gea, C3GEA_CMD_QIRD, cmd_buf ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + func_error |= error_flag; + c3gea_error_check( error_flag ); - if ( strstr( app_buf, CONNECTED ) != 0 ) { - app_connection_status = CONNECTED_TO_NETWORK; + // Close TCP socket + c3gea_send_cmd_with_par( &c3gea, C3GEA_CMD_QICLOSE, tcp_socket_num ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + func_error |= error_flag; + c3gea_error_check( error_flag ); + + // Close UDP socket + c3gea_send_cmd_with_par( &c3gea, C3GEA_CMD_QICLOSE, udp_socket_num ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + func_error |= error_flag; + c3gea_error_check( error_flag ); + Delay_ms( 5000 ); +#elif ( DEMO_EXAMPLE == EXAMPLE_SMS ) + // Check SMS mode + #define CMGF_PDU "+CMGF: 0" + #define CMGF_TXT "+CMGF: 1" + c3gea_send_cmd_check( &c3gea, C3GEA_CMD_CMGF ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + func_error |= error_flag; + c3gea_error_check( error_flag ); + if ( strstr( app_buf, CMGF_PDU ) ) + { + // Send SMS in PDU mode + c3gea_send_sms_pdu( &c3gea, SIM_SMSC, PHONE_NUMBER_TO_MESSAGE, MESSAGE_CONTENT ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + func_error |= error_flag; + c3gea_error_check( error_flag ); + } + else if ( strstr( app_buf, CMGF_TXT ) ) + { + // Send SMS in TXT mode + c3gea_send_sms_text ( &c3gea, PHONE_NUMBER_TO_MESSAGE, MESSAGE_CONTENT ); + error_flag = c3gea_rsp_check( C3GEA_RSP_OK ); + func_error |= error_flag; + c3gea_error_check( error_flag ); } + Delay_ms( 10000 ); + Delay_ms( 10000 ); + Delay_ms( 10000 ); +#else + #error "No demo example selected" +#endif + return func_error; } // ------------------------------------------------------------------------ END diff --git a/clicks/3gea/example/manifest.exm b/clicks/3gea/example/manifest.exm index 8ff8a64132..034357c513 100644 --- a/clicks/3gea/example/manifest.exm +++ b/clicks/3gea/example/manifest.exm @@ -2,7 +2,7 @@ "name": "3G-EA Click", "description": "3G-EA click is a versatile cellular network communication solution, featuring the compact 3G UMTS/HSPA Quectel UG95 module. This module features a full set of options for the cellular networking and communication, such as the network indication, embedded TCP/UDP stack, HTTP/HTTPS stack, full GSM/GPRS/EDGE implementation, UMTS/HSDPA/HSUPA protocol implementation and more. 3G-EA click features data-rates of 7.2 Mb/s (downlink) and 5.76 Mb/s (uplink) in HSPA mode. Onboard 16bit audio CODEC IC adds high-quality voice communication capability.", "image" : "../../Resources/click_icon.png", - "toolchain": ["mikrocarm","mikrocpic","mikrocpic32"], + "toolchain": ["mikrocarm","mikrocpic","mikrocpic32","gcc-riscv"], "hw" : ["click","Quectel UG95"], "category" : ["GSM/LTE"] } diff --git a/clicks/3gea/example/memake.txt b/clicks/3gea/example/memake.txt deleted file mode 100644 index 832d32ef74..0000000000 --- a/clicks/3gea/example/memake.txt +++ /dev/null @@ -1,13 +0,0 @@ -type: executable -target: example_c3gea - -depends: { - MikroC.Core - MikroSDK.Board - MikroSDK.Log - Click.C3GEA -} - -sources: { - main.c -} diff --git a/clicks/3gea/lib/memake.txt b/clicks/3gea/lib/memake.txt deleted file mode 100644 index 4e5d8ec457..0000000000 --- a/clicks/3gea/lib/memake.txt +++ /dev/null @@ -1,38 +0,0 @@ -type: library - -target: lib_c3gea - -sources: { - src/c3gea.c -} - -headers: { - include/c3gea.h -} - -include: { - include -} - -install: { - src(include/c3gea.h) dst(include/c3gea.h) -} - -expInclude: { - include -} - -depends: { - MikroC.Core - MikroSDK.Driver - MikroSDK.Conversions - MikroSDK.GenericPointer -} - -others: { - ../README.md - ../DETAILS.md - ../CHANGELOG.md -} - -alias: Click.C3GEA diff --git a/clicks/3gea/lib_c3gea/CMakeLists.txt b/clicks/3gea/lib_c3gea/CMakeLists.txt new file mode 100644 index 0000000000..308a25145e --- /dev/null +++ b/clicks/3gea/lib_c3gea/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(lib_c3gea LANGUAGES MikroC) +else() + project(lib_c3gea LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_library(lib_c3gea STATIC + src/c3gea.c + include/c3gea.h +) +add_library(Click.3GEA ALIAS lib_c3gea) + + + +target_include_directories(lib_c3gea PUBLIC + include +) + +find_package(MikroC.Core REQUIRED) +target_link_libraries(lib_c3gea PUBLIC MikroC.Core) +find_package(MikroSDK.Driver REQUIRED) +target_link_libraries(lib_c3gea PUBLIC MikroSDK.Driver) +find_package(MikroSDK.Conversions REQUIRED) +target_link_libraries(lib_c3gea PUBLIC MikroSDK.Conversions) +find_package(MikroSDK.GenericPointer REQUIRED) +target_link_libraries(lib_c3gea PUBLIC MikroSDK.GenericPointer) diff --git a/clicks/3gea/lib_c3gea/include/Click.3GEA b/clicks/3gea/lib_c3gea/include/Click.3GEA new file mode 100644 index 0000000000..5f4aa9908d --- /dev/null +++ b/clicks/3gea/lib_c3gea/include/Click.3GEA @@ -0,0 +1 @@ +#include "c3gea.h" diff --git a/clicks/3gea/lib/include/c3gea.h b/clicks/3gea/lib_c3gea/include/c3gea.h similarity index 64% rename from clicks/3gea/lib/include/c3gea.h rename to clicks/3gea/lib_c3gea/include/c3gea.h index ed946103e4..469fbccafc 100644 --- a/clicks/3gea/lib/include/c3gea.h +++ b/clicks/3gea/lib_c3gea/include/c3gea.h @@ -53,38 +53,38 @@ extern "C"{ */ /** - * @brief 3G-EA module power. - * @details Module power state. + * @brief 3G-EA control commands. + * @details Specified setting for control commands of 3G-EA Click driver. */ -#define C3GEA_MODULE_POWER_ON 1 -#define C3GEA_MODULE_POWER_OFF 0 +#define C3GEA_CMD_AT "AT" +#define C3GEA_CMD_ATI "ATI" +#define C3GEA_CMD_CFUN "AT+CFUN" +#define C3GEA_CMD_CREG "AT+CREG" +#define C3GEA_CMD_CGDCONT "AT+CGDCONT" +#define C3GEA_CMD_CSQ "AT+CSQ" +#define C3GEA_CMD_COPS "AT+COPS" +#define C3GEA_CMD_CMGS "AT+CMGS" +#define C3GEA_CMD_CMGF "AT+CMGF" +#define C3GEA_CMD_QIACT "AT+QIACT" +#define C3GEA_CMD_QIOPEN "AT+QIOPEN" +#define C3GEA_CMD_QICLOSE "AT+QICLOSE" +#define C3GEA_CMD_QISEND "AT+QISEND" +#define C3GEA_CMD_QIRD "AT+QIRD" /** - * @brief 3G-EA description setting. - * @details Specified setting for description of 3G-EA Click driver. + * @brief 3G-EA device response for AT commands. + * @details Device response after commands. */ -#define C3GEA_CMD_AT "AT" -#define C3GEA_CMD_ATI "ATI" -#define C3GEA_CMD_CGMR "AT+CGMR" -#define C3GEA_CMD_CFUN "AT+CFUN" -#define C3GEA_CMD_CREG "AT+CREG" -#define C3GEA_CMD_CGREG "AT+CGREG" -#define C3GEA_CMD_CGDCONT "AT+CGDCONT" -#define C3GEA_CMD_CIMI "AT+CIMI" -#define C3GEA_CMD_CMEE "AT+CMEE" -#define C3GEA_CMD_CGATT "AT+CGATT" -#define C3GEA_CMD_CSQ "AT+CSQ" -#define C3GEA_CMD_COPS "AT+COPS" -#define C3GEA_CMD_CMGS "AT+CMGS" -#define C3GEA_CMD_CMGF "AT+CMGF" +#define C3GEA_RSP_OK "OK" +#define C3GEA_RSP_ERROR "ERROR" /** * @brief 3G-EA driver buffer size. * @details Specified size of driver ring buffer. * @note Increase buffer size if needed. */ -#define DRV_RX_BUFFER_SIZE 256 -#define DRV_TX_BUFFER_SIZE 256 +#define C3GEA_RX_DRV_BUFFER_SIZE 256 +#define C3GEA_TX_DRV_BUFFER_SIZE 256 /*! @} */ // c3gea_set @@ -121,20 +121,20 @@ extern "C"{ typedef struct { // Output pins - digital_out_t pwk; - digital_out_t rts; + digital_out_t pwk; /**< Power-up module. */ + digital_out_t rts; /**< UART Request to Send. */ // Input pins - digital_in_t sta; - digital_in_t ring; - digital_in_t cts; + digital_in_t sta; /**< Module status. */ + digital_in_t ring; /**< Ring indicator. */ + digital_in_t cts; /**< UART Clear to Send. */ // Modules - uart_t uart; /**< UART driver object. */ + uart_t uart; /**< UART driver object. */ // Buffers - char uart_rx_buffer[ DRV_RX_BUFFER_SIZE ]; /**< Buffer size. */ - char uart_tx_buffer[ DRV_TX_BUFFER_SIZE ]; /**< Buffer size. */ + char uart_rx_buffer[ C3GEA_RX_DRV_BUFFER_SIZE ]; /**< Buffer size. */ + char uart_tx_buffer[ C3GEA_TX_DRV_BUFFER_SIZE ]; /**< Buffer size. */ } c3gea_t; @@ -145,22 +145,22 @@ typedef struct typedef struct { // Communication gpio pins - pin_name_t rx_pin; /**< RX pin. */ - pin_name_t tx_pin; /**< TX pin. */ + pin_name_t rx_pin; /**< RX pin. */ + pin_name_t tx_pin; /**< TX pin. */ // Additional gpio pins - pin_name_t sta; - pin_name_t pwk; - pin_name_t rts; - pin_name_t ring; - pin_name_t cts; + pin_name_t sta; /**< Module status. */ + pin_name_t pwk; /**< Power-up module. */ + pin_name_t rts; /**< UART Request to Send. */ + pin_name_t ring; /**< Ring indicator. */ + pin_name_t cts; /**< UART Clear to Send. */ // Static variable - uint32_t baud_rate; /**< Clock speed. */ - bool uart_blocking; /**< Wait for interrupt or not. */ - uart_data_bits_t data_bit; /**< Data bits. */ - uart_parity_t parity_bit; /**< Parity bit. */ - uart_stop_bits_t stop_bit; /**< Stop bits. */ + uint32_t baud_rate; /**< Clock speed. */ + bool uart_blocking; /**< Wait for interrupt or not. */ + uart_data_bits_t data_bit; /**< Data bits. */ + uart_parity_t parity_bit; /**< Parity bit. */ + uart_stop_bits_t stop_bit; /**< Stop bits. */ } c3gea_cfg_t; @@ -170,8 +170,11 @@ typedef struct */ typedef enum { - C3GEA_OK = 0, - C3GEA_ERROR = -1 + C3GEA_OK = 0, + C3GEA_ERROR = -1, + C3GEA_ERROR_TIMEOUT = -2, + C3GEA_ERROR_CMD = -3, + C3GEA_ERROR_UNKNOWN = -4 } c3gea_return_value_t; @@ -202,104 +205,87 @@ void c3gea_cfg_setup ( c3gea_cfg_t *cfg ); * See #c3gea_cfg_t object definition for detailed explanation. * @return @li @c 0 - Success, * @li @c -1 - Error. - * * See #err_t definition for detailed explanation. * @note None. */ err_t c3gea_init ( c3gea_t *ctx, c3gea_cfg_t *cfg ); - -/** - * @brief Power ON/OFF the module. - * @details This function powers ON/OFF the module. - * @param ctx Click object. - * @param state 0 - power OFF, 1 - power ON. - * @return Nothing. - * @return None. - */ -void c3gea_module_power ( c3gea_t *ctx, uint8_t state ); - /** * @brief 3G-EA data writing function. * @details This function writes a desired number of data bytes by using UART serial interface. * @param[in] ctx : Click context object. * See #c3gea_t object definition for detailed explanation. - * @param[in] data_buf : Data buffer for sending. + * @param[in] data_in : Data buffer for sending. * @param[in] len : Number of bytes for sending. * @return @li @c >=0 - Success, * @li @c <0 - Error. - * * See #err_t definition for detailed explanation. * @note None. */ -err_t c3gea_generic_write ( c3gea_t *ctx, char *data_buf, uint16_t len ); +err_t c3gea_generic_write ( c3gea_t *ctx, uint8_t *data_in, uint16_t len ); /** * @brief 3G-EA data reading function. * @details This function reads a desired number of data bytes by using UART serial interface. * @param[in] ctx : Click context object. * See #c3gea_t object definition for detailed explanation. - * @param[out] data_buf : Output read data. - * @param[in] max_len : Number of bytes to be read. + * @param[out] data_out : Output read data. + * @param[in] len : Number of bytes to be read. * @return @li @c >0 - Number of data bytes read, * @li @c <=0 - Error/Empty Ring buffer. - * * See #err_t definition for detailed explanation. * @note None. */ -err_t c3gea_generic_read ( c3gea_t *ctx, char *data_buf, uint16_t max_len ); +err_t c3gea_generic_read ( c3gea_t *ctx, uint8_t *data_out, uint16_t len ); /** - * @brief Sets state of the RTS pin. - * @details This function sets RTS pin state. + * @brief 3G-EA set rts pin function. + * @details This function sets the Request to Send (RTS) pin logic state. * @param[in] ctx : Click context object. * See #c3gea_t object definition for detailed explanation. - * @param[in] state Pin state ( 1 or 0 ). - * @return Nothing. + * @param[in] state : Pin logic state. + * @return None. * @note None. */ void c3gea_set_rts_pin ( c3gea_t *ctx, uint8_t state ); /** - * @brief Sets state of the PWK pin. - * @details This function sets PWK pin state. + * @brief 3G-EA set pwk pin function. + * @details This function sets the PWRKEY pin logic state. * @param[in] ctx : Click context object. * See #c3gea_t object definition for detailed explanation. - * @param[in] state Pin state ( 1 or 0 ). - * @return Nothing. + * @param[in] state : Pin logic state. + * @return None. * @note None. */ void c3gea_set_pwk_pin ( c3gea_t *ctx, uint8_t state ); /** - * @brief CTS Pin Get function. - * @details This function allows user to check state of the CTS pin. + * @brief 3G-EA get cts pin function. + * @details This function returns the Clear to Send (CTS) pin logic state. * @param[in] ctx : Click context object. * See #c3gea_t object definition for detailed explanation. - * @return @li @c 0 logical low. - * @li @c 1 logical high. + * @return Pin logic state. * @note None. */ uint8_t c3gea_get_cts_pin ( c3gea_t *ctx ); /** - * @brief STA Pin Get function. - * @details This function allows user to check state of the STA pin. + * @brief 3G-EA get sta pin function. + * @details This function returns the status (STA) pin logic state. * @param[in] ctx : Click context object. * See #c3gea_t object definition for detailed explanation. - * @return @li @c 0 logical low. - * @li @c 1 logical high. + * @return Pin logic state. * @note None. */ uint8_t c3gea_get_sta_pin ( c3gea_t *ctx ); /** - * @brief RING Pin Get function. - * @details This function allows user to check state of the RING pin. + * @brief 3G-EA get ring pin function. + * @details This function returns the ring indication (RING) pin logic state. * @param[in] ctx : Click context object. * See #c3gea_t object definition for detailed explanation. - * @return @li @c 0 logical low. - * @li @c 1 logical high. + * @return Pin logic state. * @note None. */ uint8_t c3gea_get_ring_pin ( c3gea_t *ctx ); @@ -309,83 +295,83 @@ uint8_t c3gea_get_ring_pin ( c3gea_t *ctx ); * @details This function sends a specified command to the click module. * @param[in] ctx : Click context object. * See #c3gea_t object definition for detailed explanation. - * @param[in] cmd Command variable. + * @param[in] cmd : Command variable. * @return Nothing. * @note None. */ -void c3gea_send_cmd ( c3gea_t *ctx, char *cmd ); +void c3gea_send_cmd ( c3gea_t *ctx, uint8_t *cmd ); /** * @brief Send command function with parameter. * @details This function sends a command with specified parameter to the click module. * @param[in] ctx : Click context object. * See #c3gea_t object definition for detailed explanation. - * @param[in] at_cmd_buf Command buffer. - * @param[in] param_buf Parameter buffer. + * @param[in] at_cmd_buf : Command buffer. + * @param[in] param_buf : Parameter buffer. * @return Nothing. * @note None. */ -void c3gea_send_cmd_with_parameter ( c3gea_t *ctx, char *at_cmd_buf, char *param_buf ); +void c3gea_send_cmd_with_par ( c3gea_t *ctx, uint8_t *at_cmd_buf, uint8_t *param_buf ); /** * @brief Check the sent command. * @details This function checks the command that is sent. * @param[in] ctx : Click context object. * See #c3gea_t object definition for detailed explanation. - * @param[in] at_cmd_buf Command buffer. + * @param[in] at_cmd_buf : Command buffer. * @return Nothing. * @note None. */ -void c3gea_send_cmd_check ( c3gea_t *ctx, char *at_cmd_buf ); +void c3gea_send_cmd_check ( c3gea_t *ctx, uint8_t *at_cmd_buf ); /** * @brief Check the command parameters. * @details This function checks the command that is sent. * @param[in] ctx : Click context object. * See #c3gea_t object definition for detailed explanation. - * @param[in] at_cmd_buf Command buffer. + * @param[in] at_cmd_buf : Command buffer. * @return Nothing. * @note None. */ -void c3gea_send_cmd_parameter_check ( c3gea_t *ctx, char *at_cmd_buf ); +void c3gea_send_cmd_par_check ( c3gea_t *ctx, uint8_t *at_cmd_buf ); /** * @brief Set sim card APN. * @details This function sets APN for sim card. * @param[in] ctx : Click context object. * See #c3gea_t object definition for detailed explanation. - * @param[in] sim_apn SIM card APN. + * @param[in] sim_apn : SIM card APN. * @return Nothing. * @note None. */ -void c3gea_set_sim_apn ( c3gea_t *ctx, char *sim_apn ); +void c3gea_set_sim_apn ( c3gea_t *ctx, uint8_t *sim_apn ); /** * @brief 3G-EA send SMS in text mode. * @details This function sends text message to a phone number. * @param[in] ctx : Click context object. * See #c3gea_t object definition for detailed explanation. - * @param[in] phone_number Phone number to message. - * @param[in] sms_text Message to be sent. + * @param[in] phone_number : Phone number to message. + * @param[in] sms_text : Message to be sent. * @return Nothing. * @note None. */ -void c3gea_send_sms_text ( c3gea_t *ctx, char *phone_number, char *sms_text ); +void c3gea_send_sms_text ( c3gea_t *ctx, uint8_t *phone_number, uint8_t *sms_text ); /** * @brief 3G-EA send SMS in PDU mode. * @details This function sends text message to a phone number in PDU mode. * @param[in] ctx : Click context object. * See #c3gea_t object definition for detailed explanation. - * @param[in] service_center_number SMSC of the SIM card. - * @param[in] phone_number Phone number to message. - * @param[in] sms_text Message to be sent. + * @param[in] service_center_number : SMSC of the SIM card. + * @param[in] phone_number : Phone number to message. + * @param[in] sms_text : Message to be sent. * @return @li @c >=0 - Success, * @li @c <0 - Error. * See #err_t definition for detailed explanation. * @note None. */ -err_t c3gea_send_sms_pdu ( c3gea_t *ctx, char *service_center_number, char *phone_number, char *sms_text ); +err_t c3gea_send_sms_pdu ( c3gea_t *ctx, uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text ); #ifdef __cplusplus } diff --git a/clicks/3gea/lib/src/c3gea.c b/clicks/3gea/lib_c3gea/src/c3gea.c similarity index 61% rename from clicks/3gea/lib/src/c3gea.c rename to clicks/3gea/lib_c3gea/src/c3gea.c index a55135fc8d..22a0d75246 100644 --- a/clicks/3gea/lib/src/c3gea.c +++ b/clicks/3gea/lib_c3gea/src/c3gea.c @@ -26,12 +26,13 @@ */ #include "c3gea.h" -#include "string.h" -#include "generic_pointer.h" #include "conversions.h" +#include "generic_pointer.h" -// ------------------------------------------------------------- PRIVATE MACROS - +/** + * @brief PDU macros. + * @details Predefined PDU macros for driver use. + */ #define BITMASK_7BITS 0x7F #define BITMASK_8BITS 0xFF #define BITMASK_HIGH_4BITS 0xF0 @@ -44,8 +45,6 @@ #define SMS_MAX_7BIT_TEXT_LENGTH 160 #define SMS_MAX_PDU_LENGTH 256 -// ---------------------------------------------- PRIVATE FUNCTION DECLARATIONS - /** * @brief Encode message for PDU mode. * @details Encode message for PDU mode and outputs @@ -58,7 +57,8 @@ * @return @li @c >=0 - Length of the SMS encoded message, * @li @c <0 - Error. */ -static int16_t pdu_encode( char *service_center_number, char *phone_number, char *sms_text, uint8_t *output_buffer, uint16_t buffer_size ); +static int16_t pdu_encode ( uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text, + uint8_t *output_buffer, uint16_t buffer_size ); /** * @brief Swap decimal digits of a number. @@ -66,7 +66,7 @@ static int16_t pdu_encode( char *service_center_number, char *phone_number, char * @param[in] x : Decimal number to swap digits. * @return Swapped decimal number. */ -static uint8_t swap_decimal_nibble( uint8_t x ); +static uint8_t swap_decimal_nibble ( uint8_t x ); /** * @brief Encode text content for PDU mode. @@ -79,7 +79,8 @@ static uint8_t swap_decimal_nibble( uint8_t x ); * @return @li @c >=0 - Length of the enccoded text messages, * @li @c <0 - Error. */ -static int16_t encode_pdu_message( char *sms_text, int16_t sms_text_length, uint8_t *output_buffer, uint16_t buffer_size ); +static int16_t encode_pdu_message ( uint8_t *sms_text, int16_t sms_text_length, + uint8_t *output_buffer, uint16_t buffer_size ); /** * @brief Encode phone number for PDU mode. @@ -91,11 +92,19 @@ static int16_t encode_pdu_message( char *sms_text, int16_t sms_text_length, uint * @return @li @c >=0 - Length of the SMS encoded message, * @li @c <0 - Error. */ -static int16_t encode_phone_number ( char *phone_number, uint8_t *output_buffer, uint16_t buffer_size ); +static int16_t encode_phone_number ( uint8_t *phone_number, uint8_t *output_buffer, uint16_t buffer_size ); -// ------------------------------------------------ PUBLIC FUNCTION DEFINITIONS +/** + * @brief 3G-EA str cut chr function. + * @details This function removes all selected characters from string str, + * and returns it to the same str without those characters. + * @param str Address of string. + * @param chr Character to cut. + */ +static void c3gea_str_cut_chr ( uint8_t *str, uint8_t chr ); -void c3gea_cfg_setup ( c3gea_cfg_t *cfg ) { +void c3gea_cfg_setup ( c3gea_cfg_t *cfg ) +{ // Communication gpio pins cfg->rx_pin = HAL_PIN_NC; cfg->tx_pin = HAL_PIN_NC; @@ -114,7 +123,8 @@ void c3gea_cfg_setup ( c3gea_cfg_t *cfg ) { cfg->uart_blocking = false; } -err_t c3gea_init ( c3gea_t *ctx, c3gea_cfg_t *cfg ) { +err_t c3gea_init ( c3gea_t *ctx, c3gea_cfg_t *cfg ) +{ uart_config_t uart_cfg; // Default config @@ -130,7 +140,8 @@ err_t c3gea_init ( c3gea_t *ctx, c3gea_cfg_t *cfg ) { uart_cfg.tx_ring_size = sizeof( ctx->uart_tx_buffer ); uart_cfg.rx_ring_size = sizeof( ctx->uart_rx_buffer ); - if ( uart_open( &ctx->uart, &uart_cfg ) == UART_ERROR ) { + if ( UART_ERROR == uart_open( &ctx->uart, &uart_cfg ) ) + { return UART_ERROR; } uart_set_baud( &ctx->uart, cfg->baud_rate ); @@ -148,60 +159,68 @@ err_t c3gea_init ( c3gea_t *ctx, c3gea_cfg_t *cfg ) { digital_in_init( &ctx->sta, cfg->sta ); digital_in_init( &ctx->ring, cfg->ring ); digital_in_init( &ctx->cts, cfg->cts ); + + digital_out_low ( &ctx->pwk ); + Delay_1sec ( ); + digital_out_high ( &ctx->pwk ); + Delay_1sec ( ); + digital_out_low ( &ctx->pwk ); + Delay_1sec ( ); return UART_SUCCESS; } -void c3gea_module_power ( c3gea_t *ctx, uint8_t state ) { - digital_out_write( &ctx->pwk, state ); - Delay_1sec(); - Delay_1sec(); - Delay_1sec(); -} - -err_t c3gea_generic_write ( c3gea_t *ctx, char *data_buf, uint16_t len ) { - return uart_write( &ctx->uart, data_buf, len ); +err_t c3gea_generic_write ( c3gea_t *ctx, uint8_t *data_in, uint16_t len ) +{ + return uart_write( &ctx->uart, data_in, len ); } -err_t c3gea_generic_read ( c3gea_t *ctx, char *data_buf, uint16_t max_len ) { - return uart_read( &ctx->uart, data_buf, max_len ); +err_t c3gea_generic_read ( c3gea_t *ctx, uint8_t *data_out, uint16_t len ) +{ + return uart_read( &ctx->uart, data_out, len ); } -void c3gea_set_pwk_pin ( c3gea_t *ctx, uint8_t state ) { +void c3gea_set_pwk_pin ( c3gea_t *ctx, uint8_t state ) +{ digital_out_write( &ctx->pwk, state ); } -void c3gea_set_rts_pin ( c3gea_t *ctx, uint8_t state ) { +void c3gea_set_rts_pin ( c3gea_t *ctx, uint8_t state ) +{ digital_out_write( &ctx->rts, state ); } -uint8_t c3gea_get_cts_pin ( c3gea_t *ctx ) { +uint8_t c3gea_get_cts_pin ( c3gea_t *ctx ) +{ return digital_in_read( &ctx->cts ); } -uint8_t c3gea_get_sta_pin ( c3gea_t *ctx ) { +uint8_t c3gea_get_sta_pin ( c3gea_t *ctx ) +{ return digital_in_read( &ctx->sta ); } -uint8_t c3gea_get_ring_pin ( c3gea_t *ctx ) { +uint8_t c3gea_get_ring_pin ( c3gea_t *ctx ) +{ return digital_in_read( &ctx->ring ); } -void c3gea_send_cmd ( c3gea_t *ctx, char *cmd ) { - char cr[ 2 ] = { 13, 0 }; - - while ( *cmd != 0 ) { +void c3gea_send_cmd ( c3gea_t *ctx, uint8_t *cmd ) +{ + uint8_t carriage_return = 13; + while ( *cmd != 0 ) + { uart_write( &ctx->uart, cmd, 1 ); cmd++; } - - uart_write( &ctx->uart, cr, 1 ); + uart_write( &ctx->uart, &carriage_return, 1 ); Delay_100ms( ); } -void c3gea_send_cmd_with_parameter ( c3gea_t *ctx, char *at_cmd_buf, char *param_buf ) { - char final_cmd[ 100 ] = { 0 }; - char check_char[ 2 ] = { '=', 0 }; +void c3gea_send_cmd_with_par ( c3gea_t *ctx, uint8_t *at_cmd_buf, uint8_t *param_buf ) +{ + uint8_t final_cmd[ 100 ] = { 0 }; + uint8_t check_char[ 2 ] = { '=', 0 }; strcpy( final_cmd, at_cmd_buf ); strcat( final_cmd, check_char ); @@ -210,9 +229,10 @@ void c3gea_send_cmd_with_parameter ( c3gea_t *ctx, char *at_cmd_buf, char *param c3gea_send_cmd( ctx, final_cmd ); } -void c3gea_send_cmd_check ( c3gea_t *ctx, char *at_cmd_buf ) { - char final_cmd[ 100 ] = { 0 }; - char check_char[ 2 ] = { '?', 0 }; +void c3gea_send_cmd_check ( c3gea_t *ctx, uint8_t *at_cmd_buf ) +{ + uint8_t final_cmd[ 100 ] = { 0 }; + uint8_t check_char[ 2 ] = { '?', 0 }; strcpy( final_cmd, at_cmd_buf ); strcat( final_cmd, check_char ); @@ -220,9 +240,10 @@ void c3gea_send_cmd_check ( c3gea_t *ctx, char *at_cmd_buf ) { c3gea_send_cmd( ctx, final_cmd ); } -void c3gea_send_cmd_parameter_check ( c3gea_t *ctx, char *at_cmd_buf ) { - char final_cmd[ 100 ] = { 0 }; - char check_char[ 3 ] = { '=' , '?', 0 }; +void c3gea_send_cmd_par_check ( c3gea_t *ctx, uint8_t *at_cmd_buf ) +{ + uint8_t final_cmd[ 100 ] = { 0 }; + uint8_t check_char[ 3 ] = { '=' , '?', 0 }; strcpy( final_cmd, at_cmd_buf ); strcat( final_cmd, check_char ); @@ -230,54 +251,62 @@ void c3gea_send_cmd_parameter_check ( c3gea_t *ctx, char *at_cmd_buf ) { c3gea_send_cmd( ctx, final_cmd ); } -void c3gea_set_sim_apn ( c3gea_t *ctx, char *sim_apn ) { - char final_cmd[ 50 ] = "1,\"IP\",\""; - char end_cmd[ 3 ] = "\""; +void c3gea_set_sim_apn ( c3gea_t *ctx, uint8_t *sim_apn ) +{ + uint8_t final_cmd[ 50 ] = "1,\"IP\",\""; + uint8_t end_cmd[ 3 ] = "\""; strcat( final_cmd, sim_apn ); strcat( final_cmd, end_cmd ); - c3gea_send_cmd_with_parameter( ctx, C3GEA_CMD_CGDCONT, final_cmd ); + c3gea_send_cmd_with_par( ctx, C3GEA_CMD_CGDCONT, final_cmd ); } -void c3gea_send_sms_text ( c3gea_t *ctx, char *phone_number, char *sms_text ) { - char text[ 200 ] = { 0 }; - char cmd_start[] = "AT+CMGS=\""; - char cmd_end[] = "\"\r"; - char txt_end[] = "\032"; +void c3gea_send_sms_text ( c3gea_t *ctx, uint8_t *phone_number, uint8_t *sms_text ) +{ + uint8_t text[ 200 ] = { 0 }; + uint8_t cmd_start[ ] = "=\""; + uint8_t cmd_end[ ] = "\"\r"; + uint8_t txt_end[ ] = "\032"; - strcpy( text, cmd_start ); + strcpy( text, C3GEA_CMD_CMGS ); + strcat( text, cmd_start ); strcat( text, phone_number ); strcat( text, cmd_end ); c3gea_send_cmd( ctx, text ); - memset( text, 0 , 200 ); + memset( text, 0, sizeof ( text ) ); strcpy( text, sms_text ); strcat( text, txt_end ); c3gea_send_cmd( ctx, text ); } -err_t c3gea_send_sms_pdu ( c3gea_t *ctx, char *service_center_number, char *phone_number, char *sms_text ) { - char text[ SMS_MAX_PDU_LENGTH ] = { 0 }; - char pdu_buf[ SMS_MAX_PDU_LENGTH ] = { 0 }; - char byte_buf[ 4 ] = { 0 }; - char ctrl_z[ ] = { 26, 0 }; - int16_t pdu_buf_len; - uint8_t length; +err_t c3gea_send_sms_pdu ( c3gea_t *ctx, uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text ) +{ + uint8_t text[ SMS_MAX_PDU_LENGTH ] = { 0 }; + uint8_t pdu_buf[ SMS_MAX_PDU_LENGTH ] = { 0 }; + uint8_t byte_buf[ 4 ] = { 0 }; + uint8_t ctrl_z[ 2 ] = { 26, 0 }; + int16_t pdu_buf_len = 0; + uint8_t length = 0; + uint8_t smsc[ 32 ] = { 0 }; + uint8_t phone_num[ 32 ] = { 0 }; + strcpy ( smsc, service_center_number ); + strcpy ( phone_num, phone_number ); + c3gea_str_cut_chr ( smsc, '+' ); + c3gea_str_cut_chr ( phone_num, '+' ); - str_cut_chr ( service_center_number, '+' ); - str_cut_chr ( phone_number, '+' ); + pdu_buf_len = pdu_encode( smsc, phone_num, sms_text, pdu_buf, SMS_MAX_PDU_LENGTH ); - pdu_buf_len = pdu_encode( service_center_number, phone_number, sms_text, pdu_buf, SMS_MAX_PDU_LENGTH ); - - if ( pdu_buf_len < 0 ) { + if ( pdu_buf_len < 0 ) + { return C3GEA_ERROR; } - length = pdu_buf_len - ( ( strlen( service_center_number ) - 1 ) / 2 + 3 ); + length = pdu_buf_len - ( ( strlen( smsc ) - 1 ) / 2 + 3 ); uint8_to_str( length, byte_buf ); - str_cut_chr ( byte_buf, ' '); + c3gea_str_cut_chr ( byte_buf, ' ' ); strcpy( text, C3GEA_CMD_CMGS ); strcat( text, "=" ); @@ -286,7 +315,8 @@ err_t c3gea_send_sms_pdu ( c3gea_t *ctx, char *service_center_number, char *phon c3gea_send_cmd( ctx, text ); memset( text, 0, SMS_MAX_PDU_LENGTH ); - for ( int16_t cnt = 0; cnt < pdu_buf_len; cnt++ ) { + for ( int16_t cnt = 0; cnt < pdu_buf_len; cnt++ ) + { uint8_to_hex ( pdu_buf[ cnt ], byte_buf ); strcat ( text, byte_buf ); } @@ -297,10 +327,11 @@ err_t c3gea_send_sms_pdu ( c3gea_t *ctx, char *service_center_number, char *phon return C3GEA_OK; } -// ----------------------------------------------- PRIVATE FUNCTION DEFINITIONS - -static int16_t pdu_encode( char *service_center_number, char *phone_number, char *sms_text, uint8_t *output_buffer, uint16_t buffer_size ) { - if ( buffer_size < 2 ) { +static int16_t pdu_encode ( uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text, + uint8_t *output_buffer, uint16_t buffer_size ) +{ + if ( buffer_size < 2 ) + { return C3GEA_ERROR; } @@ -308,17 +339,20 @@ static int16_t pdu_encode( char *service_center_number, char *phone_number, char // 1. Set SMS center number. int16_t length = 0; - if ( ( service_center_number != 0 ) && ( strlen ( service_center_number ) > 0 ) ) { + if ( ( service_center_number != 0 ) && ( strlen ( service_center_number ) > 0 ) ) + { output_buffer[ 1 ] = TYPE_OF_ADDRESS_INTERNATIONAL_PHONE; // Add type of address. length = encode_phone_number( service_center_number, output_buffer + 2, buffer_size - 2 ); - if ( length < 0 && length >= 254 ) { + if ( length < 0 && length >= 254 ) + { return C3GEA_ERROR; } length++; } output_buffer[ 0 ] = length; output_buffer_length = length + 1; - if ( output_buffer_length + 4 > buffer_size ) { + if ( output_buffer_length + 4 > buffer_size ) + { return C3GEA_ERROR; // Check if it has space for four more bytes. } @@ -329,9 +363,11 @@ static int16_t pdu_encode( char *service_center_number, char *phone_number, char // 3. Set phone number. output_buffer[ output_buffer_length ] = strlen( phone_number ); output_buffer[ output_buffer_length + 1 ] = TYPE_OF_ADDRESS_INTERNATIONAL_PHONE; - length = encode_phone_number( phone_number, output_buffer + output_buffer_length + 2, buffer_size - output_buffer_length - 2); + length = encode_phone_number( phone_number, output_buffer + output_buffer_length + 2, + buffer_size - output_buffer_length - 2); output_buffer_length += length + 2; - if ( output_buffer_length + 4 > buffer_size ) { + if ( output_buffer_length + 4 > buffer_size ) + { return C3GEA_ERROR; // Check if it has space for four more bytes. } @@ -342,12 +378,15 @@ static int16_t pdu_encode( char *service_center_number, char *phone_number, char // 5. SMS message. int16_t sms_text_length = strlen( sms_text ); - if ( sms_text_length > SMS_MAX_7BIT_TEXT_LENGTH ) { + if ( sms_text_length > SMS_MAX_7BIT_TEXT_LENGTH ) + { return C3GEA_ERROR; } output_buffer[ output_buffer_length++ ] = sms_text_length; - length = encode_pdu_message( sms_text, sms_text_length, output_buffer + output_buffer_length, buffer_size - output_buffer_length ); - if ( length < 0 ) { + length = encode_pdu_message( sms_text, sms_text_length, output_buffer + output_buffer_length, + buffer_size - output_buffer_length ); + if ( length < 0 ) + { return C3GEA_ERROR; } output_buffer_length += length; @@ -355,13 +394,17 @@ static int16_t pdu_encode( char *service_center_number, char *phone_number, char return output_buffer_length; } -static uint8_t swap_decimal_nibble( uint8_t x ) { +static uint8_t swap_decimal_nibble ( uint8_t x ) +{ return ( x / 16 ) + ( ( x % 16 ) * 10 ); } -static int16_t encode_pdu_message( char *sms_text, int16_t sms_text_length, uint8_t *output_buffer, uint16_t buffer_size ) { +static int16_t encode_pdu_message ( uint8_t *sms_text, int16_t sms_text_length, + uint8_t *output_buffer, uint16_t buffer_size ) +{ // Check if output buffer is big enough. - if ( ( sms_text_length * 7 + 7 ) / 8 > buffer_size ) { + if ( ( sms_text_length * 7 + 7 ) / 8 > buffer_size ) + { return C3GEA_ERROR; } @@ -371,45 +414,72 @@ static int16_t encode_pdu_message( char *sms_text, int16_t sms_text_length, uint for ( ; i < sms_text_length - 1; ++i ) { - output_buffer[ output_buffer_length++ ] = ( ( sms_text[ i ] & BITMASK_7BITS ) >> ( carry_on_bits - 1 ) ) | ( ( sms_text[ i + 1 ] & BITMASK_7BITS ) << ( 8 - carry_on_bits ) ); + output_buffer[ output_buffer_length++ ] = + ( ( sms_text[ i ] & BITMASK_7BITS ) >> ( carry_on_bits - 1 ) ) | + ( ( sms_text[ i + 1 ] & BITMASK_7BITS ) << ( 8 - carry_on_bits ) ); carry_on_bits++; - if ( carry_on_bits == 8 ) { + if ( carry_on_bits == 8 ) + { carry_on_bits = 1; ++i; } } - - if ( i < sms_text_length ) { + if ( i < sms_text_length ) + { output_buffer[ output_buffer_length++ ] = ( sms_text[ i ] & BITMASK_7BITS ) >> ( carry_on_bits - 1 ); } return output_buffer_length; } -static int16_t encode_phone_number ( char *phone_number, uint8_t *output_buffer, uint16_t buffer_size ) { +static int16_t encode_phone_number ( uint8_t *phone_number, uint8_t *output_buffer, uint16_t buffer_size ) +{ int16_t output_buffer_length = 0; int16_t phone_number_length = strlen( phone_number ); // Check if the output buffer is big enough. - if ( ( phone_number_length + 1 ) / 2 > buffer_size ) { + if ( ( phone_number_length + 1 ) / 2 > buffer_size ) + { return C3GEA_ERROR; } int16_t i = 0; - for ( ; i < phone_number_length; ++i ) { - if ( phone_number[ i ] < '0' && phone_number[ i ] > '9' ) { + for ( ; i < phone_number_length; ++i ) + { + if ( phone_number[ i ] < '0' && phone_number[ i ] > '9' ) + { return C3GEA_ERROR; } - if ( i % 2 == 0 ) { + if ( i % 2 == 0 ) + { output_buffer[ output_buffer_length++ ] = BITMASK_HIGH_4BITS | ( phone_number[ i ] - '0' ); - } else { - output_buffer[ output_buffer_length - 1 ] = ( output_buffer[ output_buffer_length - 1 ] & BITMASK_LOW_4BITS ) | ( ( phone_number[ i ] - '0' ) << 4 ); + } + else + { + output_buffer[ output_buffer_length - 1 ] = + ( output_buffer[ output_buffer_length - 1 ] & BITMASK_LOW_4BITS ) | + ( ( phone_number[ i ] - '0' ) << 4 ); } } return output_buffer_length; } +static void c3gea_str_cut_chr ( uint8_t *str, uint8_t chr ) +{ + uint16_t cnt_0, cnt_1; + for ( cnt_0 = 0; cnt_0 < strlen( str ); cnt_0++ ) + { + if ( str[ cnt_0 ] == chr ) + { + for ( cnt_1 = cnt_0; cnt_1 < strlen( str ); cnt_1++ ) + { + str[ cnt_1 ] = str[ cnt_1 + 1 ]; + } + } + } +} + // ------------------------------------------------------------------------- END diff --git a/clicks/3gea/memake.txt b/clicks/3gea/memake.txt deleted file mode 100644 index d4257832dd..0000000000 --- a/clicks/3gea/memake.txt +++ /dev/null @@ -1,12 +0,0 @@ -type: subdirs -project: C3GEA - -subdirs: { - lib - example -} - -depends: { - MikroSDK.GenericPointer - MikroSDK.Conversions -} diff --git a/clicks/3gsara/CHANGELOG.md b/clicks/3gsara/CHANGELOG.md index 8bafaaf891..aead73c571 100644 --- a/clicks/3gsara/CHANGELOG.md +++ b/clicks/3gsara/CHANGELOG.md @@ -1,4 +1,4 @@ ## Changelog -### Version 2.0.0.9 +### Version 2.1.0.9 - Initial release diff --git a/clicks/3gsara/CMakeLists.txt b/clicks/3gsara/CMakeLists.txt new file mode 100644 index 0000000000..c9963c8b2d --- /dev/null +++ b/clicks/3gsara/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(example_c3gsara LANGUAGES MikroC) +else() + project(example_c3gsara LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_executable(example_c3gsara + example/main.c + +) + + +############################ example_c3gsara GENERATED CODE START ########################### +find_package(MikroC.Core REQUIRED) +target_link_libraries(example_c3gsara PUBLIC MikroC.Core) +find_package(MikroSDK.Board REQUIRED) +target_link_libraries(example_c3gsara PUBLIC MikroSDK.Board) +find_package(MikroSDK.Log REQUIRED) +target_link_libraries(example_c3gsara PUBLIC MikroSDK.Log) +add_subdirectory(lib_c3gsara) +target_link_libraries(example_c3gsara PUBLIC Click.3gSara) +############################ example_c3gsara GENERATED CODE END ########################### diff --git a/clicks/3gsara/DETAILS.md b/clicks/3gsara/DETAILS.md index 1d2a0da161..158a488adf 100644 --- a/clicks/3gsara/DETAILS.md +++ b/clicks/3gsara/DETAILS.md @@ -15,9 +15,9 @@ #### Click library -- **Author** : MikroE Team -- **Date** : Apr 2020. -- **Type** : UART GPS/GNSS type +- **Author** : Stefan Filipovic +- **Date** : May 2023. +- **Type** : UART type # Software Support @@ -35,98 +35,164 @@ Package can be downloaded/installed directly form compilers IDE(recommended way) #### Standard key functions : -- Config Object Initialization function. -> void c3gsara_cfg_setup ( c3gsara_cfg_t *cfg ); - -- Initialization function. -> C3GSARA_RETVAL c3gsara_init ( c3gsara_t *ctx, c3gsara_cfg_t *cfg ); +- `c3gsara_cfg_setup` Config Object Initialization function. +```c +void c3gsara_cfg_setup ( c3gsara_cfg_t *cfg ); +``` + +- `c3gsara_init` Initialization function. +```c +err_t c3gsara_init ( c3gsara_t *ctx, c3gsara_cfg_t *cfg ); +``` #### Example key functions : -- Power module. -> void c3gsara_module_power( c3gsara_t *ctx, uint8_t power_state ); +- `c3gsara_set_sim_apn` This function sets APN for sim card. +```c +void c3gsara_set_sim_apn ( c3gsara_t *ctx, uint8_t *sim_apn ); +``` -- Send command. -> void c3gsara_send_command ( c3gsara_t *ctx, char *command ); +- `c3gsara_send_sms_text` This function sends text message to a phone number. +```c +void c3gsara_send_sms_text ( c3gsara_t *ctx, uint8_t *phone_number, uint8_t *sms_text ); +``` -## Examples Description +- `c3gsara_send_sms_pdu` This function sends text message to a phone number in PDU mode. +```c +err_t c3gsara_send_sms_pdu ( c3gsara_t *ctx, uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text ); +``` -> This example reads and processes data from 3G SARA clicks. +## Example Description + +> Application example shows device capability of connecting to the network and sending SMS or TCP/UDP messages using standard "AT" commands. **The demo application is composed of two sections :** -### Application Init +### Application Init -> Initializes driver and power module. +> Initializes the driver, tests the communication by sending "AT" command, and after that restarts the device. ```c void application_init ( void ) { - log_cfg_t log_cfg; - c3gsara_cfg_t cfg; + log_cfg_t log_cfg; /**< Logger config object. */ + c3gsara_cfg_t c3gsara_cfg; /**< Click config object. */ - /** + /** * Logger initialization. * Default baud rate: 115200 * Default log level: LOG_LEVEL_DEBUG - * @note If USB_UART_RX and USB_UART_TX - * are defined as HAL_PIN_NC, you will - * need to define them manually for log to work. + * @note If USB_UART_RX and USB_UART_TX + * are defined as HAL_PIN_NC, you will + * need to define them manually for log to work. * See @b LOG_MAP_USB_UART macro definition for detailed explanation. */ LOG_MAP_USB_UART( log_cfg ); log_init( &logger, &log_cfg ); - log_info( &logger, "---- Application Init ----" ); - - // Click initialization. + log_info( &logger, " Application Init " ); - c3gsara_cfg_setup( &cfg ); - C3GSARA_MAP_MIKROBUS( cfg, MIKROBUS_1 ); - c3gsara_init( &c3gsara, &cfg ); - - c3gsara_module_power( &c3gsara, true ); - - c3gsara_send_command( &c3gsara, C3GSARA_AT_COMMAND ); - c3gsara_process( ); - c3gsara_send_command( &c3gsara, C3GSARA_AT_COMMAND ); - c3gsara_process( ); - c3gsara_send_command( &c3gsara, C3GSARA_AT_COMMAND ); - c3gsara_process( ); - c3gsara_send_command( &c3gsara, C3GSARA_ATE0_COMMAND ); - c3gsara_process( ); - c3gsara_send_command( &c3gsara, C3GSARA_AT_IFC_COMMAND ); - c3gsara_process( ); - c3gsara_send_command( &c3gsara, C3GSARA_AT_CMGF_COMMAND ); + // Click initialization. + c3gsara_cfg_setup( &c3gsara_cfg ); + C3GSARA_MAP_MIKROBUS( c3gsara_cfg, MIKROBUS_1 ); + if ( UART_ERROR == c3gsara_init( &c3gsara, &c3gsara_cfg ) ) + { + log_error( &logger, " Application Init Error. " ); + log_info( &logger, " Please, run program again... " ); + for ( ; ; ); + } + + c3gsara_set_power_state ( &c3gsara, C3GSARA_POWER_STATE_ON ); + c3gsara_process( ); + c3gsara_clear_app_buf( ); + + // Check communication + c3gsara_send_cmd( &c3gsara, C3GSARA_CMD_AT ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + c3gsara_error_check( error_flag ); + + // Restart device + #define RESTART_DEVICE "1,1" + c3gsara_send_cmd_with_par( &c3gsara, C3GSARA_CMD_CFUN, RESTART_DEVICE ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + c3gsara_error_check( error_flag ); + + log_info( &logger, " Application Task " ); + example_state = C3GSARA_CONFIGURE_FOR_NETWORK; } ``` ### Application Task -> Reads the received data. +> Application task is split in few stages: + - C3GSARA_CONFIGURE_FOR_NETWORK: + > Sets configuration to device to be able to connect to the network. + - C3GSARA_WAIT_FOR_CONNECTION: + > Waits for the network registration indicated via CREG URC event and then checks the connection status. + - C3GSARA_CONFIGURE_FOR_EXAMPLE: + > Sets the device configuration for sending SMS or TCP/UDP messages depending on the selected demo example. + - C3GSARA_EXAMPLE: + > Depending on the selected demo example, it sends an SMS message (in PDU or TXT mode) or TCP/UDP message. +> By default, the TCP/UDP example is selected. ```c void application_task ( void ) { - c3gsara_process( ); - - if ( send_data_cnt == 5 ) - { - c3gsara_send_command( &c3gsara, C3GSARA_ATH_COMMAND ); - c3gsara_process( ); - send_data_cnt = 0; - } - else + switch ( example_state ) { - send_data_cnt++; + case C3GSARA_CONFIGURE_FOR_NETWORK: + { + if ( C3GSARA_OK == c3gsara_configure_for_network( ) ) + { + example_state = C3GSARA_WAIT_FOR_CONNECTION; + } + break; + } + case C3GSARA_WAIT_FOR_CONNECTION: + { + if ( C3GSARA_OK == c3gsara_check_connection( ) ) + { + example_state = C3GSARA_CONFIGURE_FOR_EXAMPLE; + } + break; + } + case C3GSARA_CONFIGURE_FOR_EXAMPLE: + { + if ( C3GSARA_OK == c3gsara_configure_for_example( ) ) + { + example_state = C3GSARA_EXAMPLE; + } + break; + } + case C3GSARA_EXAMPLE: + { + c3gsara_example( ); + break; + } + default: + { + log_error( &logger, " Example state." ); + break; + } } } ``` +## Note + +> In order for the examples to work, user needs to set the APN and SMSC (SMS PDU mode only) +of entered SIM card as well as the phone number (SMS mode only) to which he wants to send an SMS. +Enter valid values for the following macros: SIM_APN, SIM_SMSC and PHONE_NUMBER_TO_MESSAGE. +> > Example: +> > - SIM_APN "internet" +> > - SIM_SMSC "+381610401" +> > - PHONE_NUMBER_TO_MESSAGE "+381659999999" + + The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt. **Other mikroE Libraries used in the example:** diff --git a/clicks/3gsara/README.md b/clicks/3gsara/README.md index bba9de86cb..cd0e147e72 100644 --- a/clicks/3gsara/README.md +++ b/clicks/3gsara/README.md @@ -1,5 +1,5 @@ \mainpage Main Page - + --- # 3G SARA click @@ -16,9 +16,9 @@ #### Click library -- **Author** : MikroE Team -- **Date** : Apr 2020. -- **Type** : UART GPS/GNSS type +- **Author** : Stefan Filipovic +- **Date** : May 2023. +- **Type** : UART type # Software Support @@ -36,98 +36,164 @@ Package can be downloaded/installed directly form compilers IDE(recommended way) #### Standard key functions : -- Config Object Initialization function. -> void c3gsara_cfg_setup ( c3gsara_cfg_t *cfg ); - -- Initialization function. -> C3GSARA_RETVAL c3gsara_init ( c3gsara_t *ctx, c3gsara_cfg_t *cfg ); +- `c3gsara_cfg_setup` Config Object Initialization function. +```c +void c3gsara_cfg_setup ( c3gsara_cfg_t *cfg ); +``` + +- `c3gsara_init` Initialization function. +```c +err_t c3gsara_init ( c3gsara_t *ctx, c3gsara_cfg_t *cfg ); +``` #### Example key functions : -- Power module. -> void c3gsara_module_power( c3gsara_t *ctx, uint8_t power_state ); +- `c3gsara_set_sim_apn` This function sets APN for sim card. +```c +void c3gsara_set_sim_apn ( c3gsara_t *ctx, uint8_t *sim_apn ); +``` + +- `c3gsara_send_sms_text` This function sends text message to a phone number. +```c +void c3gsara_send_sms_text ( c3gsara_t *ctx, uint8_t *phone_number, uint8_t *sms_text ); +``` -- Send command. -> void c3gsara_send_command ( c3gsara_t *ctx, char *command ); +- `c3gsara_send_sms_pdu` This function sends text message to a phone number in PDU mode. +```c +err_t c3gsara_send_sms_pdu ( c3gsara_t *ctx, uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text ); +``` -## Examples Description +## Example Description -> This example reads and processes data from 3G SARA clicks. +> Application example shows device capability of connecting to the network and sending SMS or TCP/UDP messages using standard "AT" commands. **The demo application is composed of two sections :** -### Application Init +### Application Init -> Initializes driver and power module. +> Initializes the driver, tests the communication by sending "AT" command, and after that restarts the device. ```c void application_init ( void ) { - log_cfg_t log_cfg; - c3gsara_cfg_t cfg; + log_cfg_t log_cfg; /**< Logger config object. */ + c3gsara_cfg_t c3gsara_cfg; /**< Click config object. */ - /** + /** * Logger initialization. * Default baud rate: 115200 * Default log level: LOG_LEVEL_DEBUG - * @note If USB_UART_RX and USB_UART_TX - * are defined as HAL_PIN_NC, you will - * need to define them manually for log to work. + * @note If USB_UART_RX and USB_UART_TX + * are defined as HAL_PIN_NC, you will + * need to define them manually for log to work. * See @b LOG_MAP_USB_UART macro definition for detailed explanation. */ LOG_MAP_USB_UART( log_cfg ); log_init( &logger, &log_cfg ); - log_info( &logger, "---- Application Init ----" ); - - // Click initialization. + log_info( &logger, " Application Init " ); - c3gsara_cfg_setup( &cfg ); - C3GSARA_MAP_MIKROBUS( cfg, MIKROBUS_1 ); - c3gsara_init( &c3gsara, &cfg ); - - c3gsara_module_power( &c3gsara, true ); - - c3gsara_send_command( &c3gsara, C3GSARA_AT_COMMAND ); - c3gsara_process( ); - c3gsara_send_command( &c3gsara, C3GSARA_AT_COMMAND ); - c3gsara_process( ); - c3gsara_send_command( &c3gsara, C3GSARA_AT_COMMAND ); - c3gsara_process( ); - c3gsara_send_command( &c3gsara, C3GSARA_ATE0_COMMAND ); - c3gsara_process( ); - c3gsara_send_command( &c3gsara, C3GSARA_AT_IFC_COMMAND ); - c3gsara_process( ); - c3gsara_send_command( &c3gsara, C3GSARA_AT_CMGF_COMMAND ); + // Click initialization. + c3gsara_cfg_setup( &c3gsara_cfg ); + C3GSARA_MAP_MIKROBUS( c3gsara_cfg, MIKROBUS_1 ); + if ( UART_ERROR == c3gsara_init( &c3gsara, &c3gsara_cfg ) ) + { + log_error( &logger, " Application Init Error. " ); + log_info( &logger, " Please, run program again... " ); + for ( ; ; ); + } + + c3gsara_set_power_state ( &c3gsara, C3GSARA_POWER_STATE_ON ); + c3gsara_process( ); + c3gsara_clear_app_buf( ); + + // Check communication + c3gsara_send_cmd( &c3gsara, C3GSARA_CMD_AT ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + c3gsara_error_check( error_flag ); + + // Restart device + #define RESTART_DEVICE "1,1" + c3gsara_send_cmd_with_par( &c3gsara, C3GSARA_CMD_CFUN, RESTART_DEVICE ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + c3gsara_error_check( error_flag ); + + log_info( &logger, " Application Task " ); + example_state = C3GSARA_CONFIGURE_FOR_NETWORK; } ``` ### Application Task -> Reads the received data. +> Application task is split in few stages: + - C3GSARA_CONFIGURE_FOR_NETWORK: + > Sets configuration to device to be able to connect to the network. + - C3GSARA_WAIT_FOR_CONNECTION: + > Waits for the network registration indicated via CREG URC event and then checks the connection status. + - C3GSARA_CONFIGURE_FOR_EXAMPLE: + > Sets the device configuration for sending SMS or TCP/UDP messages depending on the selected demo example. + - C3GSARA_EXAMPLE: + > Depending on the selected demo example, it sends an SMS message (in PDU or TXT mode) or TCP/UDP message. +> By default, the TCP/UDP example is selected. ```c void application_task ( void ) { - c3gsara_process( ); - - if ( send_data_cnt == 5 ) - { - c3gsara_send_command( &c3gsara, C3GSARA_ATH_COMMAND ); - c3gsara_process( ); - send_data_cnt = 0; - } - else + switch ( example_state ) { - send_data_cnt++; + case C3GSARA_CONFIGURE_FOR_NETWORK: + { + if ( C3GSARA_OK == c3gsara_configure_for_network( ) ) + { + example_state = C3GSARA_WAIT_FOR_CONNECTION; + } + break; + } + case C3GSARA_WAIT_FOR_CONNECTION: + { + if ( C3GSARA_OK == c3gsara_check_connection( ) ) + { + example_state = C3GSARA_CONFIGURE_FOR_EXAMPLE; + } + break; + } + case C3GSARA_CONFIGURE_FOR_EXAMPLE: + { + if ( C3GSARA_OK == c3gsara_configure_for_example( ) ) + { + example_state = C3GSARA_EXAMPLE; + } + break; + } + case C3GSARA_EXAMPLE: + { + c3gsara_example( ); + break; + } + default: + { + log_error( &logger, " Example state." ); + break; + } } } ``` +## Note + +> In order for the examples to work, user needs to set the APN and SMSC (SMS PDU mode only) +of entered SIM card as well as the phone number (SMS mode only) to which he wants to send an SMS. +Enter valid values for the following macros: SIM_APN, SIM_SMSC and PHONE_NUMBER_TO_MESSAGE. +> > Example: +> > - SIM_APN "internet" +> > - SIM_SMSC "+381610401" +> > - PHONE_NUMBER_TO_MESSAGE "+381659999999" + + The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt. **Other mikroE Libraries used in the example:** diff --git a/clicks/3gsara/doc/doxy/Doxyfile.doxy b/clicks/3gsara/doc/doxy/Doxyfile.doxy index ec50a236c3..4ae128f268 100644 --- a/clicks/3gsara/doc/doxy/Doxyfile.doxy +++ b/clicks/3gsara/doc/doxy/Doxyfile.doxy @@ -44,21 +44,21 @@ PROJECT_NUMBER = 2.0.0.0 # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = +PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = +PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = ../clicks/c3gsara/temp/Help/doc +OUTPUT_DIRECTORY = ../cmake/c3gsara/temp/Help/doc # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -162,7 +162,7 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -171,7 +171,7 @@ STRIP_FROM_PATH = # specify the list of include paths that are normally passed to the compiler # using the -I flag. -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't @@ -238,13 +238,13 @@ TAB_SIZE = 4 # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. -ALIASES = +ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. -TCL_SUBST = +TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For @@ -291,7 +291,7 @@ OPTIMIZE_OUTPUT_VHDL = NO # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. -EXTENSION_MAPPING = +EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable @@ -648,7 +648,7 @@ GENERATE_DEPRECATEDLIST= YES # sections, marked by \if ... \endif and \cond # ... \endcond blocks. -ENABLED_SECTIONS = +ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the @@ -690,7 +690,7 @@ SHOW_NAMESPACES = YES # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. -FILE_VERSION_FILTER = +FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated @@ -703,7 +703,7 @@ FILE_VERSION_FILTER = # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. -LAYOUT_FILE = +LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib @@ -713,7 +713,7 @@ LAYOUT_FILE = # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. -CITE_BIB_FILES = +CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages @@ -778,7 +778,7 @@ WARN_FORMAT = "$file:$line: $text" # messages should be written. If left blank the output is written to standard # error (stderr). -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files @@ -790,9 +790,9 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = ../clicks/c3gsara/example \ - ../clicks/c3gsara/lib/include \ - ../clicks/c3gsara/README.md +INPUT = ../cmake/c3gsara/example \ + ../cmake/c3gsara/lib_c3gsara/include \ + ../cmake/c3gsara/README.md # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -877,7 +877,7 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = +EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -893,7 +893,7 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the @@ -904,13 +904,13 @@ EXCLUDE_PATTERNS = # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* -EXCLUDE_SYMBOLS = +EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = ../clicks/c3gsara/example +EXAMPLE_PATH = ../cmake/c3gsara/example # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and @@ -930,7 +930,7 @@ EXAMPLE_RECURSIVE = YES # that contain images that are to be included in the documentation (see the # \image command). -IMAGE_PATH = +IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program @@ -951,7 +951,7 @@ IMAGE_PATH = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -INPUT_FILTER = +INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the @@ -964,7 +964,7 @@ INPUT_FILTER = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -FILTER_PATTERNS = +FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for @@ -979,14 +979,14 @@ FILTER_SOURCE_FILES = NO # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. -FILTER_SOURCE_PATTERNS = +FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = +USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing @@ -1091,7 +1091,7 @@ CLANG_ASSISTED_PARSING = NO # specified with INPUT and INCLUDE_PATH. # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. -CLANG_OPTIONS = +CLANG_OPTIONS = #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index @@ -1117,7 +1117,7 @@ COLS_IN_ALPHA_INDEX = 5 # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output @@ -1161,7 +1161,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = +HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard @@ -1171,7 +1171,7 @@ HTML_HEADER = # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = +HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of @@ -1183,7 +1183,7 @@ HTML_FOOTER = # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_STYLESHEET = +HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets @@ -1196,7 +1196,7 @@ HTML_STYLESHEET = # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = +HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note @@ -1206,7 +1206,7 @@ HTML_EXTRA_STYLESHEET = # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = +HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to @@ -1335,7 +1335,7 @@ GENERATE_HTMLHELP = YES # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_FILE = +CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, @@ -1343,7 +1343,7 @@ CHM_FILE = # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -HHC_LOCATION = +HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the master .chm file (NO). @@ -1356,7 +1356,7 @@ GENERATE_CHI = NO # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_INDEX_ENCODING = +CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it @@ -1387,7 +1387,7 @@ GENERATE_QHP = NO # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. -QCH_FILE = +QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace @@ -1412,7 +1412,7 @@ QHP_VIRTUAL_FOLDER = ./temp/Help/doc # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom @@ -1420,21 +1420,21 @@ QHP_CUST_FILTER_NAME = # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_ATTRS = +QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_SECT_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. -QHG_LOCATION = +QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To @@ -1567,7 +1567,7 @@ MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_EXTENSIONS = +MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site @@ -1575,7 +1575,7 @@ MATHJAX_EXTENSIONS = # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_CODEFILE = +MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and @@ -1635,7 +1635,7 @@ EXTERNAL_SEARCH = NO # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. -SEARCHENGINE_URL = +SEARCHENGINE_URL = # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed # search data is written to a file for indexing by an external tool. With the @@ -1651,7 +1651,7 @@ SEARCHDATA_FILE = searchdata.xml # projects and redirect the results back to the right project. # This tag requires that the tag SEARCHENGINE is set to YES. -EXTERNAL_SEARCH_ID = +EXTERNAL_SEARCH_ID = # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen # projects other than the one defined by this configuration file, but that are @@ -1661,7 +1661,7 @@ EXTERNAL_SEARCH_ID = # EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... # This tag requires that the tag SEARCHENGINE is set to YES. -EXTRA_SEARCH_MAPPINGS = +EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- # Configuration options related to the LaTeX output @@ -1725,7 +1725,7 @@ PAPER_TYPE = a4 # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. -EXTRA_PACKAGES = +EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for the # generated LaTeX document. The header should contain everything until the first @@ -1741,7 +1741,7 @@ EXTRA_PACKAGES = # to HTML_HEADER. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_HEADER = +LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the # generated LaTeX document. The footer should contain everything after the last @@ -1752,7 +1752,7 @@ LATEX_HEADER = # Note: Only use a user-defined footer if you know what you are doing! # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_FOOTER = +LATEX_FOOTER = # The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined # LaTeX style sheets that are included after the standard style sheets created @@ -1763,7 +1763,7 @@ LATEX_FOOTER = # list). # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_STYLESHEET = +LATEX_EXTRA_STYLESHEET = # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output @@ -1771,7 +1771,7 @@ LATEX_EXTRA_STYLESHEET = # markers available. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_FILES = +LATEX_EXTRA_FILES = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is # prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will @@ -1879,14 +1879,14 @@ RTF_HYPERLINKS = NO # default style sheet that doxygen normally uses. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_STYLESHEET_FILE = +RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is # similar to doxygen's config file. A template extensions file can be generated # using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_EXTENSIONS_FILE = +RTF_EXTENSIONS_FILE = # If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code # with syntax highlighting in the RTF output. @@ -1931,7 +1931,7 @@ MAN_EXTENSION = .3 # MAN_EXTENSION with the initial . removed. # This tag requires that the tag GENERATE_MAN is set to YES. -MAN_SUBDIR = +MAN_SUBDIR = # If the MAN_LINKS tag is set to YES and doxygen generates man output, then it # will generate one additional man file for each entity documented in the real @@ -2044,7 +2044,7 @@ PERLMOD_PRETTY = YES # overwrite each other's variables. # This tag requires that the tag GENERATE_PERLMOD is set to YES. -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor @@ -2085,7 +2085,7 @@ SEARCH_INCLUDES = YES # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = +INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the @@ -2093,7 +2093,7 @@ INCLUDE_PATH = # used. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -INCLUDE_FILE_PATTERNS = +INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that are # defined before the preprocessor is started (similar to the -D option of e.g. @@ -2103,7 +2103,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = +PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -2112,7 +2112,7 @@ PREDEFINED = # definition found in the source code. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will # remove all references to function-like macros that are alone on a line, have @@ -2141,13 +2141,13 @@ SKIP_FUNCTION_MACROS = YES # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. -TAGFILES = +TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create a # tag file that is based on the input files it reads. See section "Linking to # external documentation" for more information about the usage of tag files. -GENERATE_TAGFILE = +GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES, all external class will be listed in # the class index. If set to NO, only the inherited external classes will be @@ -2196,14 +2196,14 @@ CLASS_DIAGRAMS = YES # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. -MSCGEN_PATH = +MSCGEN_PATH = # You can include diagrams made with dia in doxygen documentation. Doxygen will # then run dia to produce the diagram and insert it in the documentation. The # DIA_PATH tag allows you to specify the directory where the dia binary resides. # If left empty dia is assumed to be found in the default search path. -DIA_PATH = +DIA_PATH = # If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. @@ -2252,7 +2252,7 @@ DOT_FONTSIZE = 10 # the path where dot can find it using this tag. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTPATH = +DOT_FONTPATH = # If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for # each documented class showing the direct and indirect inheritance relations. @@ -2396,26 +2396,26 @@ INTERACTIVE_SVG = NO # found. If left blank, it is assumed the dot tool can be found in the path. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_PATH = +DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the \dotfile # command). # This tag requires that the tag HAVE_DOT is set to YES. -DOTFILE_DIRS = +DOTFILE_DIRS = # The MSCFILE_DIRS tag can be used to specify one or more directories that # contain msc files that are included in the documentation (see the \mscfile # command). -MSCFILE_DIRS = +MSCFILE_DIRS = # The DIAFILE_DIRS tag can be used to specify one or more directories that # contain dia files that are included in the documentation (see the \diafile # command). -DIAFILE_DIRS = +DIAFILE_DIRS = # When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the # path where java can find the plantuml.jar file. If left blank, it is assumed @@ -2423,17 +2423,17 @@ DIAFILE_DIRS = # generate a warning when it encounters a \startuml command in this case and # will not generate output for the diagram. -PLANTUML_JAR_PATH = +PLANTUML_JAR_PATH = # When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a # configuration file for plantuml. -PLANTUML_CFG_FILE = +PLANTUML_CFG_FILE = # When using plantuml, the specified paths are searched for files specified by # the !include statement in a plantuml block. -PLANTUML_INCLUDE_PATH = +PLANTUML_INCLUDE_PATH = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes @@ -2494,7 +2494,3 @@ GENERATE_LEGEND = YES # This tag requires that the tag HAVE_DOT is set to YES. DOT_CLEANUP = YES - - - - diff --git a/clicks/3gsara/doc/package/manifest.json b/clicks/3gsara/doc/package/manifest.json index c7857475cb..efbe298944 100644 --- a/clicks/3gsara/doc/package/manifest.json +++ b/clicks/3gsara/doc/package/manifest.json @@ -1,6 +1,6 @@ { - "architecture": "ARM|PIC|PIC32", - "category": "GSM/LTE", + "architecture": "ARM|PIC|PIC32|RISC-V", + "category": "Click Boards > Wireless connectivity > GSM/LTE", "changelog": "Resources/CHANGELOG.md", "contains": [ "libraries", @@ -8,8 +8,7 @@ "examples", "source_files" ], - "dependency_list": [ - ], + "dependency_list": [], "details": "Resources/DETAILS.md", "display_name": "3G SARA click", "example_list": [ @@ -26,15 +25,14 @@ "name": "mikroe.click.c3gsara", "product_link": "https://www.mikroe.com/3g-sara-click", "short_description": "3G SARA click is a versatile cellular network communication solution, featuring the compact 3.75G UMTS/HSPA SARA U-201 modem from u-blox.", - "supported_compiler": "mikroC AI", + "supported_compiler": "mikroC AI|GCC", "type": "Library", - "_type":"mikroSDK Library", - "related_projects":[ + "_type": "mikroSDK Library", + "related_projects": [ 1938 ], - "_type": "mikroSDK Library", - "version": "2.0.0.9" + "version": "2.1.0.9", + "cmake": true, + "alias": "Click.3gSara", + "subdir_name": "lib_c3gsara" } - - - diff --git a/clicks/3gsara/example/CMakeLists.txt b/clicks/3gsara/example/CMakeLists.txt new file mode 100644 index 0000000000..ef0df387af --- /dev/null +++ b/clicks/3gsara/example/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(example_c3gsara LANGUAGES MikroC) +else() + project(example_c3gsara LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_executable(example_c3gsara + main.c + +) + + +############################ example_c3gsara GENERATED CODE START ########################### +find_package(MikroC.Core REQUIRED) +target_link_libraries(example_c3gsara PUBLIC MikroC.Core) +find_package(MikroSDK.Board REQUIRED) +target_link_libraries(example_c3gsara PUBLIC MikroSDK.Board) +find_package(MikroSDK.Log REQUIRED) +target_link_libraries(example_c3gsara PUBLIC MikroSDK.Log) +add_subdirectory(lib_c3gsara) +target_link_libraries(example_c3gsara PUBLIC Click.3gSara) +############################ example_c3gsara GENERATED CODE END ########################### diff --git a/clicks/3gsara/example/main.c b/clicks/3gsara/example/main.c index ba09cc169f..cf6b9539f8 100644 --- a/clicks/3gsara/example/main.c +++ b/clicks/3gsara/example/main.c @@ -1,169 +1,696 @@ /*! - * \file - * \brief 3gSara Click example - * + * @file main.c + * @brief 3G SARA Click Example. + * * # Description - * This example reads and processes data from 3G SARA clicks. + * Application example shows device capability of connecting to the network and + * sending SMS or TCP/UDP messages using standard "AT" commands. * * The demo application is composed of two sections : - * - * ## Application Init - * Initializes driver and power module. - * - * ## Application Task - * Reads the received data. - * + * + * ## Application Init + * Initializes the driver, tests the communication by sending "AT" command, and after that restarts the device. + * + * ## Application Task + * Application task is split in few stages: + * - C3GSARA_CONFIGURE_FOR_NETWORK: + * Sets configuration to device to be able to connect to the network. + * + * - C3GSARA_WAIT_FOR_CONNECTION: + * Waits for the network registration indicated via CREG URC event and then checks + * the connection status. + * + * - C3GSARA_CONFIGURE_FOR_EXAMPLE: + * Sets the device configuration for sending SMS or TCP/UDP messages depending on the selected demo example. + * + * - C3GSARA_EXAMPLE: + * Depending on the selected demo example, it sends an SMS message (in PDU or TXT mode) or TCP/UDP message. + * + * By default, the TCP/UDP example is selected. + * * ## Additional Function - * - c3gsara_process ( ) - The general process of collecting presponce - * that sends a module. - * - * \author MikroE Team + * - static void c3gsara_clear_app_buf ( void ) + * - static err_t c3gsara_process ( void ) + * - static void c3gsara_error_check( err_t error_flag ) + * - static void c3gsara_log_app_buf ( void ) + * - static err_t c3gsara_rsp_check ( uint8_t *rsp ) + * - static err_t c3gsara_configure_for_connection( void ) + * - static err_t c3gsara_check_connection( void ) + * - static err_t c3gsara_configure_for_messages( void ) + * - static err_t c3gsara_send_message( void ) + * + * @note + * In order for the examples to work, user needs to set the APN and SMSC (SMS PDU mode only) + * of entered SIM card as well as the phone number (SMS mode only) to which he wants to send an SMS. + * Enter valid values for the following macros: SIM_APN, SIM_SMSC and PHONE_NUMBER_TO_MESSAGE. + * Example: + SIM_APN "internet" + SIM_SMSC "+381610401" + PHONE_NUMBER_TO_MESSAGE "+381659999999" + * + * @author Stefan Filipovic * */ -// ------------------------------------------------------------------- INCLUDES #include "board.h" #include "log.h" #include "c3gsara.h" -#include "string.h" +#include "conversions.h" + +// Example selection macros +#define EXAMPLE_TCP_UDP 0 // Example of sending messages to a TCP/UDP echo server +#define EXAMPLE_SMS 1 // Example of sending SMS to a phone number +#define DEMO_EXAMPLE EXAMPLE_TCP_UDP // Example selection macro + +// SIM APN config +#define SIM_APN "" // Set valid SIM APN -#define PROCESS_COUNTER 10 -#define PROCESS_RX_BUFFER_SIZE 500 -#define PROCESS_CURRENT_BUFFER_SIZE 500 +// SMS example parameters +#define SIM_SMSC "" // Set valid SMS Service Center Address - only in SMS PDU mode +#define PHONE_NUMBER_TO_MESSAGE "" // Set Phone number to message +#define SMS_MODE "1" // SMS mode: "0" - PDU, "1" - TXT -// ------------------------------------------------------------------ VARIABLES +// TCP/UDP example parameters +#define REMOTE_IP "77.46.162.162" // TCP/UDP echo server IP address +#define REMOTE_PORT "51111" // TCP/UDP echo server port -#define DEMO_APP_RECEIVER -//#define DEMO_APP_TRANSMITER +// Message content +#define MESSAGE_CONTENT "3G SARA click board - demo example." + +// Application buffer size +#define APP_BUFFER_SIZE 256 +#define PROCESS_BUFFER_SIZE 256 + +/** + * @brief Example states. + * @details Predefined enum values for application example state. + */ +typedef enum +{ + C3GSARA_CONFIGURE_FOR_NETWORK = 1, + C3GSARA_WAIT_FOR_CONNECTION, + C3GSARA_CONFIGURE_FOR_EXAMPLE, + C3GSARA_EXAMPLE + +} c3gsara_example_state_t; static c3gsara_t c3gsara; static log_t logger; -#define C3GSARA_AT_COMMAND "AT" -#define C3GSARA_ATE0_COMMAND "ATE0" -#define C3GSARA_AT_IFC_COMMAND "AT+IFC=2,2" -#define C3GSARA_AT_CMGF_COMMAND "AT+CMGF=1" -#define C3GSARA_ATH_COMMAND "ATH" +/** + * @brief Application example variables. + * @details Variables used in application example. + */ +static uint8_t app_buf[ APP_BUFFER_SIZE ] = { 0 }; +static int32_t app_buf_len = 0; +static err_t error_flag; +static c3gsara_example_state_t example_state; -static char current_rx_buf[ PROCESS_CURRENT_BUFFER_SIZE ]; -static uint8_t send_data_cnt = 0; +/** + * @brief Clearing application buffer. + * @details This function clears memory of application + * buffer and reset its length and counter. + */ +static void c3gsara_clear_app_buf ( void ); -// ------------------------------------------------------- ADDITIONAL FUNCTIONS +/** + * @brief Data reading function. + * @details This function reads data from device and + * appends it to the application buffer. + * @return @li @c 0 - Some data is read. + * @li @c -1 - Nothing is read. + * See #err_t definition for detailed explanation. + */ +static err_t c3gsara_process ( void ); -static void c3gsara_process ( void ) +/** + * @brief Check for errors. + * @details This function checks for different types of + * errors and logs them on UART or logs the response if no errors occured. + * @param[in] error_flag Error flag to check. + */ +static void c3gsara_error_check ( err_t error_flag ); + +/** + * @brief Logs application buffer. + * @details This function logs data from application buffer. + */ +static void c3gsara_log_app_buf ( void ); + +/** + * @brief Response check. + * @details This function checks for response and + * returns the status of response. + * @param[in] rsp Expected response. + * @return @li @c 0 - OK response. + * @li @c -2 - Timeout error. + * @li @c -3 - Command error. + * @li @c -4 - Unknown error. + * See #err_t definition for detailed explanation. + */ +static err_t c3gsara_rsp_check ( uint8_t *rsp ); + +/** + * @brief Configure device for connection to the network. + * @details Sends commands to configure and enable + * connection to the specified network. + * @return @li @c 0 - OK response. + * @li @c -2 - Timeout error. + * @li @c -3 - Command error. + * @li @c -4 - Unknown error. + * See #err_t definition for detailed explanation. + */ +static err_t c3gsara_configure_for_network ( void ); + +/** + * @brief Wait for connection signal. + * @details Wait for connection signal from CREG URC. + * @return @li @c 0 - OK response. + * @li @c -2 - Timeout error. + * @li @c -3 - Command error. + * @li @c -4 - Unknown error. + * See #err_t definition for detailed explanation. + */ +static err_t c3gsara_check_connection ( void ); + +/** + * @brief Configure device for example. + * @details Configure device for the specified example. + * @return @li @c 0 - OK response. + * @li @c -2 - Timeout error. + * @li @c -3 - Command error. + * @li @c -4 - Unknown error. + * See #err_t definition for detailed explanation. + */ +static err_t c3gsara_configure_for_example ( void ); + +/** + * @brief Execute example. + * @details This function executes SMS or TCP/UDP example depending on the DEMO_EXAMPLE macro. + * @return @li @c 0 - OK response. + * @li @c -2 - Timeout error. + * @li @c -3 - Command error. + * @li @c -4 - Unknown error. + * See #err_t definition for detailed explanation. + */ +static err_t c3gsara_example ( void ); + +void application_init ( void ) { - int32_t rsp_size; - uint16_t rsp_cnt = 0; + log_cfg_t log_cfg; /**< Logger config object. */ + c3gsara_cfg_t c3gsara_cfg; /**< Click config object. */ + + /** + * Logger initialization. + * Default baud rate: 115200 + * Default log level: LOG_LEVEL_DEBUG + * @note If USB_UART_RX and USB_UART_TX + * are defined as HAL_PIN_NC, you will + * need to define them manually for log to work. + * See @b LOG_MAP_USB_UART macro definition for detailed explanation. + */ + LOG_MAP_USB_UART( log_cfg ); + log_init( &logger, &log_cfg ); + log_info( &logger, " Application Init " ); + + // Click initialization. + c3gsara_cfg_setup( &c3gsara_cfg ); + C3GSARA_MAP_MIKROBUS( c3gsara_cfg, MIKROBUS_1 ); + if ( UART_ERROR == c3gsara_init( &c3gsara, &c3gsara_cfg ) ) + { + log_error( &logger, " Application Init Error. " ); + log_info( &logger, " Please, run program again... " ); + for ( ; ; ); + } - char uart_rx_buffer[ PROCESS_RX_BUFFER_SIZE ] = { 0 }; - uint8_t check_buf_cnt; - uint8_t process_cnt = PROCESS_COUNTER; + c3gsara_set_power_state ( &c3gsara, C3GSARA_POWER_STATE_ON ); - // Clear current buffer - memset( current_rx_buf, 0 , PROCESS_CURRENT_BUFFER_SIZE ); + c3gsara_process( ); + c3gsara_clear_app_buf( ); + + // Check communication + c3gsara_send_cmd( &c3gsara, C3GSARA_CMD_AT ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + c3gsara_error_check( error_flag ); - while( process_cnt != 0 ) - { - rsp_size = c3gsara_generic_read( &c3gsara, &uart_rx_buffer, PROCESS_RX_BUFFER_SIZE ); + // Restart device + #define RESTART_DEVICE "1,1" + c3gsara_send_cmd_with_par( &c3gsara, C3GSARA_CMD_CFUN, RESTART_DEVICE ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + c3gsara_error_check( error_flag ); + + log_info( &logger, " Application Task " ); + example_state = C3GSARA_CONFIGURE_FOR_NETWORK; +} - if ( rsp_size > 0 ) - { - // Validation of the received data - for ( check_buf_cnt = 0; check_buf_cnt < rsp_size; check_buf_cnt++ ) +void application_task ( void ) +{ + switch ( example_state ) + { + case C3GSARA_CONFIGURE_FOR_NETWORK: + { + if ( C3GSARA_OK == c3gsara_configure_for_network( ) ) { - if ( uart_rx_buffer[ check_buf_cnt ] == 0 ) - { - uart_rx_buffer[ check_buf_cnt ] = 13; - } + example_state = C3GSARA_WAIT_FOR_CONNECTION; } - - // Storages data in current buffer - rsp_cnt += rsp_size; - if ( rsp_cnt < PROCESS_CURRENT_BUFFER_SIZE ) + break; + } + case C3GSARA_WAIT_FOR_CONNECTION: + { + if ( C3GSARA_OK == c3gsara_check_connection( ) ) { - strncat( current_rx_buf, uart_rx_buffer, rsp_size ); + example_state = C3GSARA_CONFIGURE_FOR_EXAMPLE; } - - // Clear RX buffer - memset( uart_rx_buffer, 0, PROCESS_RX_BUFFER_SIZE ); - } - else - { - process_cnt--; - - // Process delay - Delay_ms( 100 ); + break; + } + case C3GSARA_CONFIGURE_FOR_EXAMPLE: + { + if ( C3GSARA_OK == c3gsara_configure_for_example( ) ) + { + example_state = C3GSARA_EXAMPLE; + } + break; + } + case C3GSARA_EXAMPLE: + { + c3gsara_example( ); + break; + } + default: + { + log_error( &logger, " Example state." ); + break; } } - log_printf( &logger, "%s", current_rx_buf ); } -// ------------------------------------------------------ APPLICATION FUNCTIONS - -void application_init ( void ) +void main ( void ) { - log_cfg_t log_cfg; - c3gsara_cfg_t cfg; - - /** - * Logger initialization. - * Default baud rate: 115200 - * Default log level: LOG_LEVEL_DEBUG - * @note If USB_UART_RX and USB_UART_TX - * are defined as HAL_PIN_NC, you will - * need to define them manually for log to work. - * See @b LOG_MAP_USB_UART macro definition for detailed explanation. - */ - LOG_MAP_USB_UART( log_cfg ); - log_init( &logger, &log_cfg ); - log_info( &logger, "---- Application Init ----" ); - - // Click initialization. + application_init( ); - c3gsara_cfg_setup( &cfg ); - C3GSARA_MAP_MIKROBUS( cfg, MIKROBUS_1 ); - c3gsara_init( &c3gsara, &cfg ); + for ( ; ; ) + { + application_task( ); + } +} - c3gsara_module_power( &c3gsara, true ); +static void c3gsara_clear_app_buf ( void ) +{ + memset( app_buf, 0, app_buf_len ); + app_buf_len = 0; +} - c3gsara_send_command( &c3gsara, C3GSARA_AT_COMMAND ); - c3gsara_process( ); - c3gsara_send_command( &c3gsara, C3GSARA_AT_COMMAND ); - c3gsara_process( ); - c3gsara_send_command( &c3gsara, C3GSARA_AT_COMMAND ); - c3gsara_process( ); - c3gsara_send_command( &c3gsara, C3GSARA_ATE0_COMMAND ); - c3gsara_process( ); - c3gsara_send_command( &c3gsara, C3GSARA_AT_IFC_COMMAND ); - c3gsara_process( ); - c3gsara_send_command( &c3gsara, C3GSARA_AT_CMGF_COMMAND ); - c3gsara_process( ); +static err_t c3gsara_process ( void ) +{ + uint8_t rx_buf[ PROCESS_BUFFER_SIZE ] = { 0 }; + int32_t rx_size = 0; + rx_size = c3gsara_generic_read( &c3gsara, rx_buf, PROCESS_BUFFER_SIZE ); + if ( rx_size > 0 ) + { + int32_t buf_cnt = app_buf_len; + if ( ( ( app_buf_len + rx_size ) > APP_BUFFER_SIZE ) && ( app_buf_len > 0 ) ) + { + buf_cnt = APP_BUFFER_SIZE - ( ( app_buf_len + rx_size ) - APP_BUFFER_SIZE ); + memmove ( app_buf, &app_buf[ APP_BUFFER_SIZE - buf_cnt ], buf_cnt ); + } + for ( int32_t rx_cnt = 0; rx_cnt < rx_size; rx_cnt++ ) + { + if ( rx_buf[ rx_cnt ] ) + { + app_buf[ buf_cnt++ ] = rx_buf[ rx_cnt ]; + if ( app_buf_len < APP_BUFFER_SIZE ) + { + app_buf_len++; + } + } + } + return C3GSARA_OK; + } + return C3GSARA_ERROR; } -void application_task ( void ) +static err_t c3gsara_rsp_check ( uint8_t *rsp ) { + uint32_t timeout_cnt = 0; + uint32_t timeout = 120000; + c3gsara_clear_app_buf( ); c3gsara_process( ); - - if ( send_data_cnt == 5 ) + while ( ( 0 == strstr( app_buf, rsp ) ) && + ( 0 == strstr( app_buf, C3GSARA_RSP_ERROR ) ) ) { - c3gsara_send_command( &c3gsara, C3GSARA_ATH_COMMAND ); c3gsara_process( ); - send_data_cnt = 0; + if ( timeout_cnt++ > timeout ) + { + c3gsara_clear_app_buf( ); + return C3GSARA_ERROR_TIMEOUT; + } + Delay_ms( 1 ); + } + Delay_ms( 100 ); + c3gsara_process( ); + if ( strstr( app_buf, rsp ) ) + { + return C3GSARA_OK; + } + else if ( strstr( app_buf, C3GSARA_RSP_ERROR ) ) + { + return C3GSARA_ERROR_CMD; } else { - send_data_cnt++; + return C3GSARA_ERROR_UNKNOWN; } } -void main ( void ) +static void c3gsara_error_check ( err_t error_flag ) { - application_init( ); + switch ( error_flag ) + { + case C3GSARA_OK: + { + c3gsara_log_app_buf( ); + break; + } + case C3GSARA_ERROR: + { + log_error( &logger, " Overflow!" ); + break; + } + case C3GSARA_ERROR_TIMEOUT: + { + log_error( &logger, " Timeout!" ); + break; + } + case C3GSARA_ERROR_CMD: + { + log_error( &logger, " CMD!" ); + break; + } + case C3GSARA_ERROR_UNKNOWN: + default: + { + log_error( &logger, " Unknown!" ); + break; + } + } + Delay_ms( 500 ); +} + +static void c3gsara_log_app_buf ( void ) +{ + for ( int32_t buf_cnt = 0; buf_cnt < app_buf_len; buf_cnt++ ) + { + log_printf( &logger, "%c", app_buf[ buf_cnt ] ); + } +} + +static err_t c3gsara_configure_for_network ( void ) +{ + err_t func_error = C3GSARA_OK; +#if ( ( DEMO_EXAMPLE == EXAMPLE_TCP_UDP ) || ( DEMO_EXAMPLE == EXAMPLE_SMS ) ) + Delay_ms ( 5000 ); + // Deregister from network + #define DEREGISTER_FROM_NETWORK "2" + c3gsara_send_cmd_with_par( &c3gsara, C3GSARA_CMD_COPS, DEREGISTER_FROM_NETWORK ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + func_error |= error_flag; + c3gsara_error_check( error_flag ); + + // Set SIM APN + c3gsara_set_sim_apn( &c3gsara, SIM_APN ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + func_error |= error_flag; + c3gsara_error_check( error_flag ); + + // Enable full functionality + #define FULL_FUNCTIONALITY "1" + c3gsara_send_cmd_with_par( &c3gsara, C3GSARA_CMD_CFUN, FULL_FUNCTIONALITY ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + func_error |= error_flag; + c3gsara_error_check( error_flag ); + // Enable network registartion + #define ENABLE_REG "2" + c3gsara_send_cmd_with_par( &c3gsara, C3GSARA_CMD_CREG, ENABLE_REG ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + func_error |= error_flag; + c3gsara_error_check( error_flag ); + + // Automatic registration + #define AUTOMATIC_REGISTRATION "0" + c3gsara_send_cmd_with_par( &c3gsara, C3GSARA_CMD_COPS, AUTOMATIC_REGISTRATION ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + func_error |= error_flag; + c3gsara_error_check( error_flag ); +#endif + return func_error; +} + +static err_t c3gsara_check_connection ( void ) +{ +#if ( ( DEMO_EXAMPLE == EXAMPLE_TCP_UDP ) || ( DEMO_EXAMPLE == EXAMPLE_SMS ) ) + #define CONNECTED "+CREG: 2,1" + c3gsara_send_cmd_check ( &c3gsara, C3GSARA_CMD_CREG ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + c3gsara_error_check( error_flag ); + if ( strstr( app_buf, CONNECTED ) ) + { + Delay_ms( 100 ); + c3gsara_process( ); + c3gsara_log_app_buf( ); + log_printf( &logger, "\r\n" ); + c3gsara_clear_app_buf( ); + // Check signal quality + c3gsara_send_cmd( &c3gsara, C3GSARA_CMD_CSQ ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + c3gsara_error_check( error_flag ); + return error_flag; + } + Delay_ms ( 1000 ); + return C3GSARA_ERROR; +#endif + return C3GSARA_OK; +} + +static err_t c3gsara_configure_for_example ( void ) +{ + err_t func_error = C3GSARA_OK; +#if ( DEMO_EXAMPLE == EXAMPLE_TCP_UDP ) + #define ACTIVATE_PDP_CONTEXT "1,1" + c3gsara_send_cmd_with_par( &c3gsara, C3GSARA_CMD_CGACT, ACTIVATE_PDP_CONTEXT ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + func_error |= error_flag; + c3gsara_error_check( error_flag ); + #define ACTIVATE_PDP_PROFILE "1,3" + c3gsara_send_cmd_with_par( &c3gsara, C3GSARA_CMD_UPSDA, ACTIVATE_PDP_PROFILE ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + func_error |= error_flag; + c3gsara_error_check( error_flag ); +#elif ( DEMO_EXAMPLE == EXAMPLE_SMS ) + c3gsara_send_cmd_with_par( &c3gsara, C3GSARA_CMD_CMGF, SMS_MODE ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + func_error |= error_flag; + c3gsara_error_check( error_flag ); +#else + #error "No demo example selected" +#endif + return func_error; +} + +static err_t c3gsara_example ( void ) +{ + err_t func_error = C3GSARA_OK; +#if ( DEMO_EXAMPLE == EXAMPLE_TCP_UDP ) + uint8_t cmd_buf[ 100 ] = { 0 }; + uint8_t urc_buf[ 20 ] = { 0 }; + uint16_t timeout_cnt = 0; + uint16_t timeout = 30000; + uint8_t * __generic_ptr socket_num_buf = 0; + uint8_t tcp_socket_num[ 2 ] = { 0 }; + uint8_t udp_socket_num[ 2 ] = { 0 }; + + // Create TCP socket + #define RSP_USOCR "+USOCR: " + #define TCP_PROTOCOL "6" + c3gsara_send_cmd_with_par ( &c3gsara, C3GSARA_CMD_USOCR, TCP_PROTOCOL ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + func_error |= error_flag; + socket_num_buf = strstr( app_buf, RSP_USOCR ) + strlen ( RSP_USOCR ); + tcp_socket_num[ 0 ] = *socket_num_buf; + c3gsara_error_check( error_flag ); + + // Create UDP socket + #define UDP_PROTOCOL "17" + c3gsara_send_cmd_with_par ( &c3gsara, C3GSARA_CMD_USOCR, UDP_PROTOCOL ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + func_error |= error_flag; + socket_num_buf = strstr( app_buf, RSP_USOCR ) + strlen ( RSP_USOCR ); + udp_socket_num[ 0 ] = *socket_num_buf; + c3gsara_error_check( error_flag ); + + // Connect TCP socket to remote IP and port + strcpy( cmd_buf, tcp_socket_num ); + strcat( cmd_buf, ",\"" ); + strcat( cmd_buf, REMOTE_IP ); + strcat( cmd_buf, "\"," ); + strcat( cmd_buf, REMOTE_PORT ); + c3gsara_send_cmd_with_par( &c3gsara, C3GSARA_CMD_USOCO, cmd_buf ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + func_error |= error_flag; + c3gsara_error_check( error_flag ); + + // Connect UDP socket to remote IP and port + strcpy( cmd_buf, udp_socket_num ); + strcat( cmd_buf, ",\"" ); + strcat( cmd_buf, REMOTE_IP ); + strcat( cmd_buf, "\"," ); + strcat( cmd_buf, REMOTE_PORT ); + c3gsara_send_cmd_with_par ( &c3gsara, C3GSARA_CMD_USOCO, cmd_buf ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + func_error |= error_flag; + c3gsara_error_check( error_flag ); + + // Get message length + uint8_t message_len_buf[ 5 ] = { 0 }; + uint16_t message_len = strlen( MESSAGE_CONTENT ); + uint16_to_str( message_len, message_len_buf ); + l_trim( message_len_buf ); + r_trim( message_len_buf ); + + // Write message to TCP socket + strcpy( cmd_buf, tcp_socket_num ); + strcat( cmd_buf, "," ); + strcat( cmd_buf, message_len_buf ); + strcat( cmd_buf, ",\"" ); + strcat( cmd_buf, MESSAGE_CONTENT ); + strcat( cmd_buf, "\"" ); + c3gsara_send_cmd_with_par ( &c3gsara, C3GSARA_CMD_USOWR, cmd_buf ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + func_error |= error_flag; + c3gsara_error_check( error_flag ); + + // Read response message from TCP socket + #define URC_READ_SOCKET_DATA_TCP "+UUSORD: " + strcpy( urc_buf, URC_READ_SOCKET_DATA_TCP ); + strcat( urc_buf, tcp_socket_num ); for ( ; ; ) { - application_task( ); + c3gsara_process( ); + uint8_t * __generic_ptr start_response_buf = strstr( app_buf, urc_buf ); + if ( start_response_buf ) + { + Delay_ms( 100 ); + c3gsara_process( ); + uint8_t response_len_buf[ 5 ] = { 0 }; + uint8_t * __generic_ptr start_response_len = strstr( start_response_buf, "," ) + 1; + memcpy ( response_len_buf, start_response_len, app_buf_len - ( start_response_len - app_buf ) ); + strcpy( cmd_buf, tcp_socket_num ); + strcat( cmd_buf, "," ); + strcat( cmd_buf, response_len_buf ); + c3gsara_log_app_buf( ); + c3gsara_clear_app_buf( ); + c3gsara_send_cmd_with_par ( &c3gsara, C3GSARA_CMD_USORD, cmd_buf ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + func_error |= error_flag; + c3gsara_error_check( error_flag ); + break; + } + if ( timeout_cnt++ > timeout ) + { + break; + } + Delay_ms( 1 ); + } + timeout_cnt = 0; + + // Write message to UDP socket + strcpy( cmd_buf, udp_socket_num ); + strcat( cmd_buf, "," ); + strcat( cmd_buf, message_len_buf ); + strcat( cmd_buf, ",\"" ); + strcat( cmd_buf, MESSAGE_CONTENT ); + strcat( cmd_buf, "\"" ); + c3gsara_send_cmd_with_par( &c3gsara, C3GSARA_CMD_USOWR, cmd_buf ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + func_error |= error_flag; + c3gsara_error_check( error_flag ); + + // Read response message from UDP socket + #define URC_READ_SOCKET_DATA_UDP "+UUSORD: " + strcpy( urc_buf, URC_READ_SOCKET_DATA_UDP ); + strcat( urc_buf, udp_socket_num ); + for ( ; ; ) + { + c3gsara_process( ); + uint8_t * __generic_ptr start_response_buf = strstr( app_buf, urc_buf ); + if ( start_response_buf ) + { + Delay_ms( 100 ); + c3gsara_process( ); + uint8_t response_len_buf[ 5 ] = { 0 }; + uint8_t * __generic_ptr start_response_len = strstr( start_response_buf, "," ) + 1; + memcpy ( response_len_buf, start_response_len, app_buf_len - ( start_response_len - app_buf ) ); + strcpy( cmd_buf, udp_socket_num ); + strcat( cmd_buf, "," ); + strcat( cmd_buf, response_len_buf ); + c3gsara_log_app_buf( ); + c3gsara_clear_app_buf( ); + c3gsara_send_cmd_with_par ( &c3gsara, C3GSARA_CMD_USORF, cmd_buf ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + func_error |= error_flag; + c3gsara_error_check( error_flag ); + break; + } + if ( timeout_cnt++ > timeout ) + { + break; + } + Delay_ms( 1 ); + } + + // Close TCP socket + c3gsara_send_cmd_with_par ( &c3gsara, C3GSARA_CMD_USOCL, tcp_socket_num ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + func_error |= error_flag; + c3gsara_error_check( error_flag ); + + // Close UDP socket + c3gsara_send_cmd_with_par ( &c3gsara, C3GSARA_CMD_USOCL, udp_socket_num ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + func_error |= error_flag; + c3gsara_error_check( error_flag ); + Delay_ms( 5000 ); +#elif ( DEMO_EXAMPLE == EXAMPLE_SMS ) + // Check SMS mode + #define CMGF_PDU "+CMGF: 0" + #define CMGF_TXT "+CMGF: 1" + c3gsara_send_cmd_check( &c3gsara, C3GSARA_CMD_CMGF ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + func_error |= error_flag; + c3gsara_error_check( error_flag ); + if ( strstr( app_buf, CMGF_PDU ) ) + { + // Send SMS in PDU mode + c3gsara_send_sms_pdu( &c3gsara, SIM_SMSC, PHONE_NUMBER_TO_MESSAGE, MESSAGE_CONTENT ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + func_error |= error_flag; + c3gsara_error_check( error_flag ); + } + else if ( strstr( app_buf, CMGF_TXT ) ) + { + // Send SMS in TXT mode + c3gsara_send_sms_text ( &c3gsara, PHONE_NUMBER_TO_MESSAGE, MESSAGE_CONTENT ); + error_flag = c3gsara_rsp_check( C3GSARA_RSP_OK ); + func_error |= error_flag; + c3gsara_error_check( error_flag ); } + Delay_ms( 10000 ); + Delay_ms( 10000 ); + Delay_ms( 10000 ); +#else + #error "No demo example selected" +#endif + return func_error; } // ------------------------------------------------------------------------ END diff --git a/clicks/3gsara/example/manifest.exm b/clicks/3gsara/example/manifest.exm index 31db3cd84e..8d2f6333dc 100644 --- a/clicks/3gsara/example/manifest.exm +++ b/clicks/3gsara/example/manifest.exm @@ -2,7 +2,7 @@ "name": "3G SARA Click", "description": "3G SARA click is a versatile cellular network communication solution, featuring the compact 3.75G UMTS/HSPA SARA U-201 modem from u-blox.", "image" : "../../Resources/click_icon.png", - "toolchain": ["mikrocarm","mikrocpic","mikrocpic32"], + "toolchain": ["mikrocarm","mikrocpic","mikrocpic32","gcc-riscv"], "hw" : ["click","SARA U-201"], - "category" : ["GSM/LTE,3G UMTS"] + "category" : ["Click Boards > Wireless connectivity > GSM/LTE"] } diff --git a/clicks/3gsara/example/memake.txt b/clicks/3gsara/example/memake.txt deleted file mode 100644 index 1839ea2661..0000000000 --- a/clicks/3gsara/example/memake.txt +++ /dev/null @@ -1,17 +0,0 @@ -type: executable -target: example_c3gsara - -depends: { - MikroC.Core - MikroSDK.Board - MikroSDK.Log - Click.3gSara -} - -uses: { - MikroC.Core -} - -sources: { - main.c -} diff --git a/clicks/3gsara/lib/include/c3gsara.h b/clicks/3gsara/lib/include/c3gsara.h deleted file mode 100644 index 573401056b..0000000000 --- a/clicks/3gsara/lib/include/c3gsara.h +++ /dev/null @@ -1,215 +0,0 @@ -/* - * MikroSDK - MikroE Software Development Kit - * Copyright© 2020 MikroElektronika d.o.o. - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE - * OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/*! - * \file - * - * \brief This file contains API for 3G SARA Click driver. - * - * \addtogroup c3gsara 3G SARA Click Driver - * @{ - */ -// ---------------------------------------------------------------------------- - -#ifndef C3GSARA_H -#define C3GSARA_H - -#include "drv_digital_out.h" -#include "drv_digital_in.h" -#include "drv_uart.h" - -// -------------------------------------------------------------- PUBLIC MACROS -/** - * \defgroup macros Macros - * \{ - */ - -/** - * \defgroup map_mikrobus MikroBUS - * \{ - */ -#define C3GSARA_MAP_MIKROBUS( cfg, mikrobus ) \ - cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \ - cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \ - cfg.stat = MIKROBUS( mikrobus, MIKROBUS_AN ); \ - cfg.pwr = MIKROBUS( mikrobus, MIKROBUS_RST ); \ - cfg.rts = MIKROBUS( mikrobus, MIKROBUS_CS ); \ - cfg.ri = MIKROBUS( mikrobus, MIKROBUS_PWM ); \ - cfg.cts = MIKROBUS( mikrobus, MIKROBUS_INT ) -/** \} */ - -/** - * \defgroup error_code Error Code - * \{ - */ -#define C3GSARA_RETVAL uint8_t - -#define C3GSARA_OK 0x00 -#define C3GSARA_INIT_ERROR 0xFF -/** \} */ - -/** - * \defgroup driver Driver define - * \{ - */ -#define DRV_RX_BUFFER_SIZE 500 -/** \} */ - -/** \} */ // End group macro -// --------------------------------------------------------------- PUBLIC TYPES -/** - * \defgroup type Types - * \{ - */ -/** - * @brief Click ctx object definition. - */ -typedef struct -{ - // Output pins - - digital_out_t pwr; - digital_out_t rts; - - // Input pins - - digital_in_t stat; - digital_in_t ri; - digital_in_t cts; - - // Modules - - uart_t uart; - - char uart_rx_buffer[ DRV_RX_BUFFER_SIZE ]; - char uart_tx_buffer[ DRV_RX_BUFFER_SIZE ]; - -} c3gsara_t; - -/** - * @brief Click configuration structure definition. - */ -typedef struct -{ - // Communication gpio pins - - pin_name_t rx_pin; - pin_name_t tx_pin; - - // Additional gpio pins - - pin_name_t stat; - pin_name_t pwr; - pin_name_t rts; - pin_name_t ri; - pin_name_t cts; - - // static variable - - uint32_t baud_rate; // Clock speed. - bool uart_blocking; - uart_data_bits_t data_bit; // Data bits. - uart_parity_t parity_bit; // Parity bit. - uart_stop_bits_t stop_bit; // Stop bits. - -} c3gsara_cfg_t; - -/** - * @brief Error type - */ -typedef uint8_t c3gsara_error_t; - -/** \} */ // End types group -// ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS - -/** - * \defgroup public_function Public function - * \{ - */ - -#ifdef __cplusplus -extern "C"{ -#endif - -/** - * @brief Config Object Initialization function. - * - * @param cfg Click configuration structure. - * - * @description This function initializes click configuration structure to init state. - * @note All used pins will be set to unconnected state. - */ -void c3gsara_cfg_setup ( c3gsara_cfg_t *cfg ); - -/** - * @brief Initialization function. - * @param c3gsara Click object. - * @param cfg Click configuration structure. - * - * @description This function initializes all necessary pins and peripherals used for this click. - */ -C3GSARA_RETVAL c3gsara_init ( c3gsara_t *ctx, c3gsara_cfg_t *cfg ); - -/** - * @brief Power module. - * - * @param c3gsara Click object. - * @param power_state power state ( 1, 0 ). - */ -void c3gsara_module_power( c3gsara_t *ctx, uint8_t power_state ); - -/** - * @brief Generic write function. - * @param c3gsara Click object. - * @param data_buf Data buffer for sends. - * @param len Number of bytes for sends. - */ -void c3gsara_generic_write ( c3gsara_t *ctx, char *data_buf, uint16_t len ); - -/** - * @brief Generic read function. - * @param c3gsara Click object. - * @param data_buf Data buffer for read data. - * @param max_len The maximum length of data that can be read. - * @return Number of reads data. - */ -int32_t c3gsara_generic_read ( c3gsara_t *ctx, char *data_buf, uint16_t max_len ); - -/** - * @brief Send command. - * - * @param c3gsara Click object. - * @param command Command to be send. - */ -void c3gsara_send_command ( c3gsara_t *ctx, char *command ); - -#ifdef __cplusplus -} -#endif -#endif // _C3GSARA_H_ - -/** \} */ // End public_function group -/// \} // End click Driver group -/*! @} */ -// ------------------------------------------------------------------------- END diff --git a/clicks/3gsara/lib/memake.txt b/clicks/3gsara/lib/memake.txt deleted file mode 100644 index a96ec52f62..0000000000 --- a/clicks/3gsara/lib/memake.txt +++ /dev/null @@ -1,40 +0,0 @@ -type: library - -target: lib_c3gsara - -alias: Click.3gSara - -sources: { - src/c3gsara.c -} - -headers: { - include/c3gsara.h -} - -include: { - include -} - -install: { - src(include/c3gsara.h) dst(include/c3gsara.h) -} - -expInclude: { - include -} - -depends: { - MikroC.Core - MikroSDK.Driver -} - -uses: { - MikroC.Core -} - -others: { - ../README.md - ../DETAILS.md - ../CHANGELOG.md -} diff --git a/clicks/3gsara/lib/src/c3gsara.c b/clicks/3gsara/lib/src/c3gsara.c deleted file mode 100644 index f6dac708db..0000000000 --- a/clicks/3gsara/lib/src/c3gsara.c +++ /dev/null @@ -1,158 +0,0 @@ -/* - * MikroSDK - MikroE Software Development Kit - * Copyright© 2020 MikroElektronika d.o.o. - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE - * OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/*! - * \file - * - */ - -#include "c3gsara.h" -#include "string.h" - -// ------------------------------------------------ PUBLIC FUNCTION DEFINITIONS - -void c3gsara_cfg_setup ( c3gsara_cfg_t *cfg ) -{ - // Communication gpio pins - - cfg->rx_pin = HAL_PIN_NC; - cfg->tx_pin = HAL_PIN_NC; - - // Additional gpio pins - - cfg->stat = HAL_PIN_NC; - cfg->pwr = HAL_PIN_NC; - cfg->rts = HAL_PIN_NC; - cfg->ri = HAL_PIN_NC; - cfg->cts = HAL_PIN_NC; - - cfg->baud_rate = 115200; - cfg->data_bit = UART_DATA_BITS_DEFAULT; - cfg->parity_bit = UART_PARITY_DEFAULT; - cfg->stop_bit = UART_STOP_BITS_DEFAULT; - cfg->uart_blocking = false; -} - -C3GSARA_RETVAL c3gsara_init ( c3gsara_t *ctx, c3gsara_cfg_t *cfg ) -{ - uart_config_t uart_cfg; - - uart_configure_default( &uart_cfg ); - - // Ring buffer mapping - ctx->uart.tx_ring_buffer = ctx->uart_tx_buffer; - ctx->uart.rx_ring_buffer = ctx->uart_rx_buffer; - - // UART module config - uart_cfg.rx_pin = cfg->rx_pin; // UART RX pin. - uart_cfg.tx_pin = cfg->tx_pin; // UART TX pin. - uart_cfg.tx_ring_size = sizeof( ctx->uart_tx_buffer ); - uart_cfg.rx_ring_size = sizeof( ctx->uart_rx_buffer ); - - uart_open( &ctx->uart, &uart_cfg ); - uart_set_baud( &ctx->uart, cfg->baud_rate ); - uart_set_parity( &ctx->uart, cfg->parity_bit ); - uart_set_stop_bits( &ctx->uart, cfg->stop_bit ); - uart_set_data_bits( &ctx->uart, cfg->data_bit ); - - uart_set_blocking( &ctx->uart, cfg->uart_blocking ); - - // Output pins - - digital_out_init( &ctx->pwr, cfg->pwr ); - digital_out_init( &ctx->rts, cfg->rts ); - - // Input pins - - digital_in_init( &ctx->stat, cfg->stat ); - digital_in_init( &ctx->ri, cfg->ri ); - digital_in_init( &ctx->cts, cfg->cts ); - - return C3GSARA_OK; -} - -void c3gsara_module_power( c3gsara_t *ctx, uint8_t power_state ) -{ - if ( 0 != power_state ) - { -// POWER ON SEQUENCE - digital_out_low( &ctx->pwr ); - Delay_100ms( ); - digital_out_high( &ctx->pwr ); - Delay_100ms( ); - digital_out_low( &ctx->pwr ); - Delay_1sec( ); - Delay_1sec( ); - Delay_1sec( ); - Delay_1sec( ); - Delay_1sec( ); - Delay_1sec( ); - Delay_1sec( ); - Delay_1sec( ); - Delay_1sec( ); - Delay_1sec( ); - Delay_1sec( ); - Delay_1sec( ); - Delay_1sec( ); - Delay_1sec( ); - Delay_1sec( ); - Delay_1sec( ); - Delay_1sec( ); - Delay_1sec( ); - Delay_1sec( ); - Delay_1sec( ); - } - else - { -// POWER OFF SEQUENCE - - } -} - -void c3gsara_generic_write ( c3gsara_t *ctx, char *data_buf, uint16_t len ) -{ - uart_write( &ctx->uart, data_buf, len ); -} - -int32_t c3gsara_generic_read ( c3gsara_t *ctx, char *data_buf, uint16_t max_len ) -{ - return uart_read( &ctx->uart, data_buf, max_len ); -} - -void c3gsara_send_command ( c3gsara_t *ctx, char *command ) -{ - char tmp_buf[ 100 ]; - uint8_t len; - - memset( tmp_buf, 0, 100 ); - len = strlen( command ); - - strncpy( tmp_buf, command, len ); - strcat( tmp_buf, "\r\n" ); - - c3gsara_generic_write( ctx, tmp_buf, strlen( tmp_buf ) ); -} - -// ------------------------------------------------------------------------- END - diff --git a/clicks/3gsara/lib_c3gsara/CMakeLists.txt b/clicks/3gsara/lib_c3gsara/CMakeLists.txt new file mode 100644 index 0000000000..aa85824f10 --- /dev/null +++ b/clicks/3gsara/lib_c3gsara/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(lib_c3gsara LANGUAGES MikroC) +else() + project(lib_c3gsara LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_library(lib_c3gsara STATIC + src/c3gsara.c + include/c3gsara.h +) +add_library(Click.3gSara ALIAS lib_c3gsara) + + + +target_include_directories(lib_c3gsara PUBLIC + include +) + +find_package(MikroC.Core REQUIRED) +target_link_libraries(lib_c3gsara PUBLIC MikroC.Core) +find_package(MikroSDK.Driver REQUIRED) +target_link_libraries(lib_c3gsara PUBLIC MikroSDK.Driver) +find_package(MikroSDK.Conversions REQUIRED) +target_link_libraries(lib_c3gsara PUBLIC MikroSDK.Conversions) +find_package(MikroSDK.GenericPointer REQUIRED) +target_link_libraries(lib_c3gsara PUBLIC MikroSDK.GenericPointer) diff --git a/clicks/3gsara/lib_c3gsara/include/Click.3gSara b/clicks/3gsara/lib_c3gsara/include/Click.3gSara new file mode 100644 index 0000000000..039bed1e75 --- /dev/null +++ b/clicks/3gsara/lib_c3gsara/include/Click.3gSara @@ -0,0 +1 @@ +#include "c3gsara.h" diff --git a/clicks/3gsara/lib_c3gsara/include/c3gsara.h b/clicks/3gsara/lib_c3gsara/include/c3gsara.h new file mode 100644 index 0000000000..6603e74e2f --- /dev/null +++ b/clicks/3gsara/lib_c3gsara/include/c3gsara.h @@ -0,0 +1,405 @@ +/**************************************************************************** +** Copyright (C) 2020 MikroElektronika d.o.o. +** Contact: https://www.mikroe.com/contact +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and associated documentation files (the "Software"), to deal +** in the Software without restriction, including without limitation the rights +** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +** copies of the Software, and to permit persons to whom the Software is +** furnished to do so, subject to the following conditions: +** The above copyright notice and this permission notice shall be +** included in all copies or substantial portions of the Software. +** +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +** USE OR OTHER DEALINGS IN THE SOFTWARE. +****************************************************************************/ + +/*! + * @file c3gsara.h + * @brief This file contains API for 3G SARA Click Driver. + */ + +#ifndef C3GSARA_H +#define C3GSARA_H + +#ifdef __cplusplus +extern "C"{ +#endif + +#include "drv_digital_out.h" +#include "drv_digital_in.h" +#include "drv_uart.h" + +/*! + * @addtogroup c3gsara 3G SARA Click Driver + * @brief API for configuring and manipulating 3G SARA Click driver. + * @{ + */ + +/** + * @defgroup c3gsara_set 3G SARA Device Settings + * @brief Settings for registers of 3G SARA Click driver. + */ + +/** + * @addtogroup c3gsara_set + * @{ + */ + +/** + * @brief 3G SARA control commands. + * @details Specified setting for control commands of 3G SARA Click driver. + */ +#define C3GSARA_CMD_AT "AT" +#define C3GSARA_CMD_ATI "ATI" +#define C3GSARA_CMD_CFUN "AT+CFUN" +#define C3GSARA_CMD_CREG "AT+CREG" +#define C3GSARA_CMD_CGDCONT "AT+CGDCONT" +#define C3GSARA_CMD_CSQ "AT+CSQ" +#define C3GSARA_CMD_COPS "AT+COPS" +#define C3GSARA_CMD_CMGS "AT+CMGS" +#define C3GSARA_CMD_CMGF "AT+CMGF" +#define C3GSARA_CMD_CGACT "AT+CGACT" +#define C3GSARA_CMD_UPSDA "AT+UPSDA" +#define C3GSARA_CMD_USOCR "AT+USOCR" +#define C3GSARA_CMD_USOCO "AT+USOCO" +#define C3GSARA_CMD_USOWR "AT+USOWR" +#define C3GSARA_CMD_USORD "AT+USORD" +#define C3GSARA_CMD_USORF "AT+USORF" +#define C3GSARA_CMD_USOCL "AT+USOCL" + +/** + * @brief 3G SARA device response for AT commands. + * @details Device response after commands. + */ +#define C3GSARA_RSP_OK "OK" +#define C3GSARA_RSP_ERROR "ERROR" + +/** + * @brief 3G SARA power state settings. + * @details Specified power state settings of 3G SARA Click driver. + */ +#define C3GSARA_POWER_STATE_OFF 0 +#define C3GSARA_POWER_STATE_ON 1 + +/** + * @brief 3G SARA driver buffer size. + * @details Specified size of driver ring buffer. + * @note Increase buffer size if needed. + */ +#define C3GSARA_RX_DRV_BUFFER_SIZE 256 +#define C3GSARA_TX_DRV_BUFFER_SIZE 256 + +/*! @} */ // c3gsara_set + +/** + * @defgroup c3gsara_map 3G SARA MikroBUS Map + * @brief MikroBUS pin mapping of 3G SARA Click driver. + */ + +/** + * @addtogroup c3gsara_map + * @{ + */ + +/** + * @brief MikroBUS pin mapping. + * @details Mapping pins of 3G SARA Click to the selected MikroBUS. + */ +#define C3GSARA_MAP_MIKROBUS( cfg, mikrobus ) \ + cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \ + cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \ + cfg.sta = MIKROBUS( mikrobus, MIKROBUS_AN ); \ + cfg.pwk = MIKROBUS( mikrobus, MIKROBUS_RST ); \ + cfg.rts = MIKROBUS( mikrobus, MIKROBUS_CS ); \ + cfg.ring = MIKROBUS( mikrobus, MIKROBUS_PWM ); \ + cfg.cts = MIKROBUS( mikrobus, MIKROBUS_INT ) + +/*! @} */ // c3gsara_map +/*! @} */ // c3gsara + +/** + * @brief 3G SARA Click context object. + * @details Context object definition of 3G SARA Click driver. + */ +typedef struct +{ + // Output pins + digital_out_t pwk; /**< Power-up module. */ + digital_out_t rts; /**< UART Ready to Send. */ + + // Input pins + digital_in_t sta; /**< Module status. */ + digital_in_t ring; /**< Ring indicator. */ + digital_in_t cts; /**< UART Clear to Send. */ + + // Modules + uart_t uart; /**< UART driver object. */ + + // Buffers + char uart_rx_buffer[ C3GSARA_RX_DRV_BUFFER_SIZE ]; /**< Buffer size. */ + char uart_tx_buffer[ C3GSARA_TX_DRV_BUFFER_SIZE ]; /**< Buffer size. */ + +} c3gsara_t; + +/** + * @brief 3G SARA Click configuration object. + * @details Configuration object definition of 3G SARA Click driver. + */ +typedef struct +{ + // Communication gpio pins + pin_name_t rx_pin; /**< RX pin. */ + pin_name_t tx_pin; /**< TX pin. */ + + // Additional gpio pins + pin_name_t sta; /**< Module status. */ + pin_name_t pwk; /**< Power-up module. */ + pin_name_t rts; /**< UART Ready to Send. */ + pin_name_t ring; /**< Ring indicator. */ + pin_name_t cts; /**< UART Clear to Send. */ + + // Static variable + uint32_t baud_rate; /**< Clock speed. */ + bool uart_blocking; /**< Wait for interrupt or not. */ + uart_data_bits_t data_bit; /**< Data bits. */ + uart_parity_t parity_bit; /**< Parity bit. */ + uart_stop_bits_t stop_bit; /**< Stop bits. */ + +} c3gsara_cfg_t; + +/** + * @brief 3G SARA Click return value data. + * @details Predefined enum values for driver return values. + */ +typedef enum +{ + C3GSARA_OK = 0, + C3GSARA_ERROR = -1, + C3GSARA_ERROR_TIMEOUT = -2, + C3GSARA_ERROR_CMD = -3, + C3GSARA_ERROR_UNKNOWN = -4 + +} c3gsara_return_value_t; + +/*! + * @addtogroup c3gsara 3G SARA Click Driver + * @brief API for configuring and manipulating 3G SARA Click driver. + * @{ + */ + +/** + * @brief 3G SARA configuration object setup function. + * @details This function initializes click configuration structure to initial + * values. + * @param[out] cfg : Click configuration structure. + * See #c3gsara_cfg_t object definition for detailed explanation. + * @return Nothing. + * @note The all used pins will be set to unconnected state. + */ +void c3gsara_cfg_setup ( c3gsara_cfg_t *cfg ); + +/** + * @brief 3G SARA initialization function. + * @details This function initializes all necessary pins and peripherals used + * for this click board. + * @param[out] ctx : Click context object. + * See #c3gsara_t object definition for detailed explanation. + * @param[in] cfg : Click configuration structure. + * See #c3gsara_cfg_t object definition for detailed explanation. + * @return @li @c 0 - Success, + * @li @c -1 - Error. + * See #err_t definition for detailed explanation. + * @note None. + */ +err_t c3gsara_init ( c3gsara_t *ctx, c3gsara_cfg_t *cfg ); + +/** + * @brief 3G SARA data writing function. + * @details This function writes a desired number of data bytes by using UART serial interface. + * @param[in] ctx : Click context object. + * See #c3gsara_t object definition for detailed explanation. + * @param[in] data_in : Data buffer for sending. + * @param[in] len : Number of bytes for sending. + * @return @li @c >=0 - Success, + * @li @c <0 - Error. + * See #err_t definition for detailed explanation. + * @note None. + */ +err_t c3gsara_generic_write ( c3gsara_t *ctx, uint8_t *data_in, uint16_t len ); + +/** + * @brief 3G SARA data reading function. + * @details This function reads a desired number of data bytes by using UART serial interface. + * @param[in] ctx : Click context object. + * See #c3gsara_t object definition for detailed explanation. + * @param[out] data_out : Output read data. + * @param[in] len : Number of bytes to be read. + * @return @li @c >0 - Number of data bytes read, + * @li @c <=0 - Error/Empty Ring buffer. + * See #err_t definition for detailed explanation. + * @note None. + */ +err_t c3gsara_generic_read ( c3gsara_t *ctx, uint8_t *data_out, uint16_t len ); + +/** + * @brief 3G SARA set power state function. + * @details This function sets a desired power state by toggling PWR pin with a specific time for low state. + * @param[in] ctx : Click context object. + * See #c3gsara_t object definition for detailed explanation. + * @param[in] state : @li @c 0 - Power OFF, + * @li @c 1 - Power ON. + * @return None. + * @note None. + */ +void c3gsara_set_power_state ( c3gsara_t *ctx, uint8_t state ); + +/** + * @brief 3G SARA set rts pin function. + * @details This function sets the Ready to Send (RTS) pin logic state. + * @param[in] ctx : Click context object. + * See #c3gsara_t object definition for detailed explanation. + * @param[in] state : Pin logic state. + * @return None. + * @note None. + */ +void c3gsara_set_rts_pin ( c3gsara_t *ctx, uint8_t state ); + +/** + * @brief 3G SARA set pwk pin function. + * @details This function sets the PWRKEY pin logic state. + * @param[in] ctx : Click context object. + * See #c3gsara_t object definition for detailed explanation. + * @param[in] state : Pin logic state. + * @return None. + * @note None. + */ +void c3gsara_set_pwk_pin ( c3gsara_t *ctx, uint8_t state ); + +/** + * @brief 3G SARA get cts pin function. + * @details This function returns the Clear to Send (CTS) pin logic state. + * @param[in] ctx : Click context object. + * See #c3gsara_t object definition for detailed explanation. + * @return Pin logic state. + * @note None. + */ +uint8_t c3gsara_get_cts_pin ( c3gsara_t *ctx ); + +/** + * @brief 3G SARA get sta pin function. + * @details This function returns the status (STA) pin logic state. + * @param[in] ctx : Click context object. + * See #c3gsara_t object definition for detailed explanation. + * @return Pin logic state. + * @note None. + */ +uint8_t c3gsara_get_sta_pin ( c3gsara_t *ctx ); + +/** + * @brief 3G SARA get ring pin function. + * @details This function returns the ring indication (RING) pin logic state. + * @param[in] ctx : Click context object. + * See #c3gsara_t object definition for detailed explanation. + * @return Pin logic state. + * @note None. + */ +uint8_t c3gsara_get_ring_pin ( c3gsara_t *ctx ); + +/** + * @brief Send command function. + * @details This function sends a specified command to the click module. + * @param[in] ctx : Click context object. + * See #c3gsara_t object definition for detailed explanation. + * @param[in] cmd : Command variable. + * @return Nothing. + * @note None. + */ +void c3gsara_send_cmd ( c3gsara_t *ctx, uint8_t *cmd ); + +/** + * @brief Send command function with parameter. + * @details This function sends a command with specified parameter to the click module. + * @param[in] ctx : Click context object. + * See #c3gsara_t object definition for detailed explanation. + * @param[in] at_cmd_buf : Command buffer. + * @param[in] param_buf : Parameter buffer. + * @return Nothing. + * @note None. + */ +void c3gsara_send_cmd_with_par ( c3gsara_t *ctx, uint8_t *at_cmd_buf, uint8_t *param_buf ); + +/** + * @brief Check the sent command. + * @details This function checks the command that is sent. + * @param[in] ctx : Click context object. + * See #c3gsara_t object definition for detailed explanation. + * @param[in] at_cmd_buf : Command buffer. + * @return Nothing. + * @note None. + */ +void c3gsara_send_cmd_check ( c3gsara_t *ctx, uint8_t *at_cmd_buf ); + +/** + * @brief Check the command parameters. + * @details This function checks the command that is sent. + * @param[in] ctx : Click context object. + * See #c3gsara_t object definition for detailed explanation. + * @param[in] at_cmd_buf : Command buffer. + * @return Nothing. + * @note None. + */ +void c3gsara_send_cmd_par_check ( c3gsara_t *ctx, uint8_t *at_cmd_buf ); + +/** + * @brief Set sim card APN. + * @details This function sets APN for sim card. + * @param[in] ctx : Click context object. + * See #c3gsara_t object definition for detailed explanation. + * @param[in] sim_apn : SIM card APN. + * @return Nothing. + * @note None. + */ +void c3gsara_set_sim_apn ( c3gsara_t *ctx, uint8_t *sim_apn ); + +/** + * @brief 3G SARA send SMS in text mode. + * @details This function sends text message to a phone number. + * @param[in] ctx : Click context object. + * See #c3gsara_t object definition for detailed explanation. + * @param[in] phone_number : Phone number to message. + * @param[in] sms_text : Message to be sent. + * @return Nothing. + * @note None. + */ +void c3gsara_send_sms_text ( c3gsara_t *ctx, uint8_t *phone_number, uint8_t *sms_text ); + +/** + * @brief 3G SARA send SMS in PDU mode. + * @details This function sends text message to a phone number in PDU mode. + * @param[in] ctx : Click context object. + * See #c3gsara_t object definition for detailed explanation. + * @param[in] service_center_number : SMSC of the SIM card. + * @param[in] phone_number : Phone number to message. + * @param[in] sms_text : Message to be sent. + * @return @li @c >=0 - Success, + * @li @c <0 - Error. + * See #err_t definition for detailed explanation. + * @note None. + */ +err_t c3gsara_send_sms_pdu ( c3gsara_t *ctx, uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text ); + +#ifdef __cplusplus +} +#endif +#endif // C3GSARA_H + +/*! @} */ // c3gsara + +// ------------------------------------------------------------------------ END diff --git a/clicks/3gsara/lib_c3gsara/src/c3gsara.c b/clicks/3gsara/lib_c3gsara/src/c3gsara.c new file mode 100644 index 0000000000..9e6eed7db4 --- /dev/null +++ b/clicks/3gsara/lib_c3gsara/src/c3gsara.c @@ -0,0 +1,496 @@ +/**************************************************************************** +** Copyright (C) 2020 MikroElektronika d.o.o. +** Contact: https://www.mikroe.com/contact +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and associated documentation files (the "Software"), to deal +** in the Software without restriction, including without limitation the rights +** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +** copies of the Software, and to permit persons to whom the Software is +** furnished to do so, subject to the following conditions: +** The above copyright notice and this permission notice shall be +** included in all copies or substantial portions of the Software. +** +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +** USE OR OTHER DEALINGS IN THE SOFTWARE. +****************************************************************************/ + +/*! + * @file c3gsara.c + * @brief 3G SARA Click Driver. + */ + +#include "c3gsara.h" +#include "conversions.h" +#include "generic_pointer.h" + +/** + * @brief PDU macros. + * @details Predefined PDU macros for driver use. + */ +#define BITMASK_7BITS 0x7F +#define BITMASK_8BITS 0xFF +#define BITMASK_HIGH_4BITS 0xF0 +#define BITMASK_LOW_4BITS 0x0F +#define TYPE_OF_ADDRESS_INTERNATIONAL_PHONE 0x91 +#define TYPE_OF_ADDRESS_NATIONAL_SUBSCRIBER 0xC8 +#define SMS_DELIVER_ONE_MESSAGE 0x04 +#define SMS_DELIVER_ONE_MESSAGE 0x04 +#define SMS_SUBMIT 0x11 +#define SMS_MAX_7BIT_TEXT_LENGTH 160 +#define SMS_MAX_PDU_LENGTH 256 + +/** + * @brief Encode message for PDU mode. + * @details Encode message for PDU mode and outputs + * the encoded message into output buffer. + * @param[in] service_center_number : Service center of devices SIM. + * @param[in] phone_number : Phone number to send message to. + * @param[in] sms_text : SMS text. + * @param[out] output_buffer : Output PDU encoded message. + * @param[in] buffer_size : Output buffer size. + * @return @li @c >=0 - Length of the SMS encoded message, + * @li @c <0 - Error. + */ +static int16_t pdu_encode ( uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text, + uint8_t *output_buffer, uint16_t buffer_size ); + +/** + * @brief Swap decimal digits of a number. + * @details Swap decimal digits of a number (e.g. 12 -> 21). + * @param[in] x : Decimal number to swap digits. + * @return Swapped decimal number. + */ +static uint8_t swap_decimal_nibble ( uint8_t x ); + +/** + * @brief Encode text content for PDU mode. + * @details Encode text content for PDU mode and + * outputs the encoded message into output buffer. + * @param[in] sms_text : Sms text content to encode + * @param[in] sms_text_length : Length of the text message. + * @param[out] output_buffer : Output PDU encoded text message. + * @param[in] buffer_size : Output buffer size. + * @return @li @c >=0 - Length of the enccoded text messages, + * @li @c <0 - Error. + */ +static int16_t encode_pdu_message ( uint8_t *sms_text, int16_t sms_text_length, + uint8_t *output_buffer, uint16_t buffer_size ); + +/** + * @brief Encode phone number for PDU mode. + * @details Encode phone number for PDU mode and + * outputs the encoded message into output buffer. + * @param[in] phone_number : Phone number to send message to. + * @param[out] output_buffer : Output PDU encoded message. + * @param[in] buffer_size : Output buffer size. + * @return @li @c >=0 - Length of the SMS encoded message, + * @li @c <0 - Error. + */ +static int16_t encode_phone_number ( uint8_t *phone_number, uint8_t *output_buffer, uint16_t buffer_size ); + +/** + * @brief 3G SARA str cut chr function. + * @details This function removes all selected characters from string str, + * and returns it to the same str without those characters. + * @param str Address of string. + * @param chr Character to cut. + */ +static void c3gsara_str_cut_chr ( uint8_t *str, uint8_t chr ); + +void c3gsara_cfg_setup ( c3gsara_cfg_t *cfg ) +{ + // Communication gpio pins + cfg->rx_pin = HAL_PIN_NC; + cfg->tx_pin = HAL_PIN_NC; + + // Additional gpio pins + cfg->sta = HAL_PIN_NC; + cfg->pwk = HAL_PIN_NC; + cfg->rts = HAL_PIN_NC; + cfg->ring = HAL_PIN_NC; + cfg->cts = HAL_PIN_NC; + + cfg->baud_rate = 115200; + cfg->data_bit = UART_DATA_BITS_DEFAULT; + cfg->parity_bit = UART_PARITY_DEFAULT; + cfg->stop_bit = UART_STOP_BITS_DEFAULT; + cfg->uart_blocking = false; +} + +err_t c3gsara_init ( c3gsara_t *ctx, c3gsara_cfg_t *cfg ) +{ + uart_config_t uart_cfg; + + // Default config + uart_configure_default( &uart_cfg ); + + // Ring buffer mapping + ctx->uart.tx_ring_buffer = ctx->uart_tx_buffer; + ctx->uart.rx_ring_buffer = ctx->uart_rx_buffer; + + // UART module config + uart_cfg.rx_pin = cfg->rx_pin; // UART RX pin. + uart_cfg.tx_pin = cfg->tx_pin; // UART TX pin. + uart_cfg.tx_ring_size = sizeof( ctx->uart_tx_buffer ); + uart_cfg.rx_ring_size = sizeof( ctx->uart_rx_buffer ); + + if ( UART_ERROR == uart_open( &ctx->uart, &uart_cfg ) ) + { + return UART_ERROR; + } + uart_set_baud( &ctx->uart, cfg->baud_rate ); + uart_set_parity( &ctx->uart, cfg->parity_bit ); + uart_set_stop_bits( &ctx->uart, cfg->stop_bit ); + uart_set_data_bits( &ctx->uart, cfg->data_bit ); + + uart_set_blocking( &ctx->uart, cfg->uart_blocking ); + + // Output pins + digital_out_init( &ctx->pwk, cfg->pwk ); + digital_out_init( &ctx->rts, cfg->rts ); + + // Input pins + digital_in_init( &ctx->sta, cfg->sta ); + digital_in_init( &ctx->ring, cfg->ring ); + digital_in_init( &ctx->cts, cfg->cts ); + + digital_out_high ( &ctx->pwk ); + + return UART_SUCCESS; +} + +err_t c3gsara_generic_write ( c3gsara_t *ctx, uint8_t *data_in, uint16_t len ) +{ + return uart_write( &ctx->uart, data_in, len ); +} + +err_t c3gsara_generic_read ( c3gsara_t *ctx, uint8_t *data_out, uint16_t len ) +{ + return uart_read( &ctx->uart, data_out, len ); +} + +void c3gsara_set_power_state ( c3gsara_t *ctx, uint8_t state ) +{ + digital_out_low ( &ctx->pwk ); + if ( C3GSARA_POWER_STATE_ON == state ) + { + Delay_50us ( ); + } + else + { + Delay_1sec ( ); + Delay_1sec ( ); + } + digital_out_high ( &ctx->pwk ); + Delay_1sec ( ); +} + +void c3gsara_set_pwk_pin ( c3gsara_t *ctx, uint8_t state ) +{ + digital_out_write( &ctx->pwk, state ); +} + +void c3gsara_set_rts_pin ( c3gsara_t *ctx, uint8_t state ) +{ + digital_out_write( &ctx->rts, state ); +} + +uint8_t c3gsara_get_cts_pin ( c3gsara_t *ctx ) +{ + return digital_in_read( &ctx->cts ); +} + +uint8_t c3gsara_get_sta_pin ( c3gsara_t *ctx ) +{ + return digital_in_read( &ctx->sta ); +} + +uint8_t c3gsara_get_ring_pin ( c3gsara_t *ctx ) +{ + return digital_in_read( &ctx->ring ); +} + +void c3gsara_send_cmd ( c3gsara_t *ctx, uint8_t *cmd ) +{ + uint8_t carriage_return = 13; + while ( *cmd != 0 ) + { + uart_write( &ctx->uart, cmd, 1 ); + cmd++; + } + uart_write( &ctx->uart, &carriage_return, 1 ); + Delay_100ms( ); +} + +void c3gsara_send_cmd_with_par ( c3gsara_t *ctx, uint8_t *at_cmd_buf, uint8_t *param_buf ) +{ + uint8_t final_cmd[ 100 ] = { 0 }; + uint8_t check_char[ 2 ] = { '=', 0 }; + + strcpy( final_cmd, at_cmd_buf ); + strcat( final_cmd, check_char ); + strcat( final_cmd, param_buf ); + + c3gsara_send_cmd( ctx, final_cmd ); +} + +void c3gsara_send_cmd_check ( c3gsara_t *ctx, uint8_t *at_cmd_buf ) +{ + uint8_t final_cmd[ 100 ] = { 0 }; + uint8_t check_char[ 2 ] = { '?', 0 }; + + strcpy( final_cmd, at_cmd_buf ); + strcat( final_cmd, check_char ); + + c3gsara_send_cmd( ctx, final_cmd ); +} + +void c3gsara_send_cmd_par_check ( c3gsara_t *ctx, uint8_t *at_cmd_buf ) +{ + uint8_t final_cmd[ 100 ] = { 0 }; + uint8_t check_char[ 3 ] = { '=' , '?', 0 }; + + strcpy( final_cmd, at_cmd_buf ); + strcat( final_cmd, check_char ); + + c3gsara_send_cmd( ctx, final_cmd ); +} + +void c3gsara_set_sim_apn ( c3gsara_t *ctx, uint8_t *sim_apn ) +{ + uint8_t final_cmd[ 50 ] = "1,\"IP\",\""; + uint8_t end_cmd[ 3 ] = "\""; + + strcat( final_cmd, sim_apn ); + strcat( final_cmd, end_cmd ); + + c3gsara_send_cmd_with_par( ctx, C3GSARA_CMD_CGDCONT, final_cmd ); +} + +void c3gsara_send_sms_text ( c3gsara_t *ctx, uint8_t *phone_number, uint8_t *sms_text ) +{ + uint8_t text[ 200 ] = { 0 }; + uint8_t cmd_start[ ] = "=\""; + uint8_t cmd_end[ ] = "\"\r"; + uint8_t txt_end[ ] = "\032"; + + strcpy( text, C3GSARA_CMD_CMGS ); + strcat( text, cmd_start ); + strcat( text, phone_number ); + strcat( text, cmd_end ); + + c3gsara_send_cmd( ctx, text ); + memset( text, 0, sizeof ( text ) ); + + strcpy( text, sms_text ); + strcat( text, txt_end ); + c3gsara_send_cmd( ctx, text ); +} + +err_t c3gsara_send_sms_pdu ( c3gsara_t *ctx, uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text ) +{ + uint8_t text[ SMS_MAX_PDU_LENGTH ] = { 0 }; + uint8_t pdu_buf[ SMS_MAX_PDU_LENGTH ] = { 0 }; + uint8_t byte_buf[ 4 ] = { 0 }; + uint8_t ctrl_z[ 2 ] = { 26, 0 }; + int16_t pdu_buf_len = 0; + uint8_t length = 0; + uint8_t smsc[ 32 ] = { 0 }; + uint8_t phone_num[ 32 ] = { 0 }; + strcpy ( smsc, service_center_number ); + strcpy ( phone_num, phone_number ); + c3gsara_str_cut_chr ( smsc, '+' ); + c3gsara_str_cut_chr ( phone_num, '+' ); + + pdu_buf_len = pdu_encode( smsc, phone_num, sms_text, pdu_buf, SMS_MAX_PDU_LENGTH ); + + if ( pdu_buf_len < 0 ) + { + return C3GSARA_ERROR; + } + + length = pdu_buf_len - ( ( strlen( smsc ) - 1 ) / 2 + 3 ); + uint8_to_str( length, byte_buf ); + c3gsara_str_cut_chr ( byte_buf, ' ' ); + + strcpy( text, C3GSARA_CMD_CMGS ); + strcat( text, "=" ); + strcat( text, byte_buf ); + + c3gsara_send_cmd( ctx, text ); + memset( text, 0, SMS_MAX_PDU_LENGTH ); + + for ( int16_t cnt = 0; cnt < pdu_buf_len; cnt++ ) + { + uint8_to_hex ( pdu_buf[ cnt ], byte_buf ); + strcat ( text, byte_buf ); + } + strcat( text, ctrl_z ); + + c3gsara_send_cmd( ctx, text ); + + return C3GSARA_OK; +} + +static int16_t pdu_encode ( uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text, + uint8_t *output_buffer, uint16_t buffer_size ) +{ + if ( buffer_size < 2 ) + { + return C3GSARA_ERROR; + } + + int16_t output_buffer_length = 0; + + // 1. Set SMS center number. + int16_t length = 0; + if ( ( service_center_number != 0 ) && ( strlen ( service_center_number ) > 0 ) ) + { + output_buffer[ 1 ] = TYPE_OF_ADDRESS_INTERNATIONAL_PHONE; // Add type of address. + length = encode_phone_number( service_center_number, output_buffer + 2, buffer_size - 2 ); + if ( length < 0 && length >= 254 ) + { + return C3GSARA_ERROR; + } + length++; + } + output_buffer[ 0 ] = length; + output_buffer_length = length + 1; + if ( output_buffer_length + 4 > buffer_size ) + { + return C3GSARA_ERROR; // Check if it has space for four more bytes. + } + + // 2. Set type of message. + output_buffer[ output_buffer_length++ ] = SMS_SUBMIT; + output_buffer[ output_buffer_length++ ] = 0x00; // Message reference. + + // 3. Set phone number. + output_buffer[ output_buffer_length ] = strlen( phone_number ); + output_buffer[ output_buffer_length + 1 ] = TYPE_OF_ADDRESS_INTERNATIONAL_PHONE; + length = encode_phone_number( phone_number, output_buffer + output_buffer_length + 2, + buffer_size - output_buffer_length - 2); + output_buffer_length += length + 2; + if ( output_buffer_length + 4 > buffer_size ) + { + return C3GSARA_ERROR; // Check if it has space for four more bytes. + } + + // 4. Protocol identifiers. + output_buffer[ output_buffer_length++ ] = 0x00; // TP-PID: Protocol identifier. + output_buffer[ output_buffer_length++ ] = 0x00; // TP-DCS: Data coding scheme. + output_buffer[ output_buffer_length++ ] = 0xB0; // TP-VP: Validity: 10 days + + // 5. SMS message. + int16_t sms_text_length = strlen( sms_text ); + if ( sms_text_length > SMS_MAX_7BIT_TEXT_LENGTH ) + { + return C3GSARA_ERROR; + } + output_buffer[ output_buffer_length++ ] = sms_text_length; + length = encode_pdu_message( sms_text, sms_text_length, output_buffer + output_buffer_length, + buffer_size - output_buffer_length ); + if ( length < 0 ) + { + return C3GSARA_ERROR; + } + output_buffer_length += length; + + return output_buffer_length; +} + +static uint8_t swap_decimal_nibble ( uint8_t x ) +{ + return ( x / 16 ) + ( ( x % 16 ) * 10 ); +} + +static int16_t encode_pdu_message ( uint8_t *sms_text, int16_t sms_text_length, + uint8_t *output_buffer, uint16_t buffer_size ) +{ + // Check if output buffer is big enough. + if ( ( sms_text_length * 7 + 7 ) / 8 > buffer_size ) + { + return C3GSARA_ERROR; + } + + int16_t output_buffer_length = 0; + int16_t carry_on_bits = 1; + int16_t i = 0; + + for ( ; i < sms_text_length - 1; ++i ) + { + output_buffer[ output_buffer_length++ ] = + ( ( sms_text[ i ] & BITMASK_7BITS ) >> ( carry_on_bits - 1 ) ) | + ( ( sms_text[ i + 1 ] & BITMASK_7BITS ) << ( 8 - carry_on_bits ) ); + carry_on_bits++; + if ( carry_on_bits == 8 ) + { + carry_on_bits = 1; + ++i; + } + } + + if ( i < sms_text_length ) + { + output_buffer[ output_buffer_length++ ] = ( sms_text[ i ] & BITMASK_7BITS ) >> ( carry_on_bits - 1 ); + } + + return output_buffer_length; +} + +static int16_t encode_phone_number ( uint8_t *phone_number, uint8_t *output_buffer, uint16_t buffer_size ) +{ + int16_t output_buffer_length = 0; + int16_t phone_number_length = strlen( phone_number ); + + // Check if the output buffer is big enough. + if ( ( phone_number_length + 1 ) / 2 > buffer_size ) + { + return C3GSARA_ERROR; + } + + int16_t i = 0; + for ( ; i < phone_number_length; ++i ) + { + if ( phone_number[ i ] < '0' && phone_number[ i ] > '9' ) + { + return C3GSARA_ERROR; + } + + if ( i % 2 == 0 ) + { + output_buffer[ output_buffer_length++ ] = BITMASK_HIGH_4BITS | ( phone_number[ i ] - '0' ); + } + else + { + output_buffer[ output_buffer_length - 1 ] = + ( output_buffer[ output_buffer_length - 1 ] & BITMASK_LOW_4BITS ) | + ( ( phone_number[ i ] - '0' ) << 4 ); + } + } + + return output_buffer_length; +} + +static void c3gsara_str_cut_chr ( uint8_t *str, uint8_t chr ) +{ + uint16_t cnt_0, cnt_1; + for ( cnt_0 = 0; cnt_0 < strlen( str ); cnt_0++ ) + { + if ( str[ cnt_0 ] == chr ) + { + for ( cnt_1 = cnt_0; cnt_1 < strlen( str ); cnt_1++ ) + { + str[ cnt_1 ] = str[ cnt_1 + 1 ]; + } + } + } +} + +// ------------------------------------------------------------------------- END diff --git a/clicks/3gsara/memake.txt b/clicks/3gsara/memake.txt deleted file mode 100644 index a906db6739..0000000000 --- a/clicks/3gsara/memake.txt +++ /dev/null @@ -1,7 +0,0 @@ -type: subdirs -project: 3gSara - -subdirs: { - lib - example -} diff --git a/clicks/4x4rgb/CHANGELOG.md b/clicks/4x4rgb/CHANGELOG.md index 31991a78f3..400d5062a0 100644 --- a/clicks/4x4rgb/CHANGELOG.md +++ b/clicks/4x4rgb/CHANGELOG.md @@ -1,4 +1,4 @@ ## Changelog -### Version 2.0.0.10 +### Version 2.1.0.12 - Initial release diff --git a/clicks/4x4rgb/CMakeLists.txt b/clicks/4x4rgb/CMakeLists.txt new file mode 100644 index 0000000000..fce9e8086a --- /dev/null +++ b/clicks/4x4rgb/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(example_c4x4rgb LANGUAGES MikroC) +else() + project(example_c4x4rgb LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_executable(example_c4x4rgb + example/main.c + +) + + +############################ example_c4x4rgb GENERATED CODE START ########################### +find_package(MikroC.Core REQUIRED) +target_link_libraries(example_c4x4rgb PUBLIC MikroC.Core) +find_package(MikroSDK.Board REQUIRED) +target_link_libraries(example_c4x4rgb PUBLIC MikroSDK.Board) +find_package(MikroSDK.Log REQUIRED) +target_link_libraries(example_c4x4rgb PUBLIC MikroSDK.Log) +add_subdirectory(lib_c4x4rgb) +target_link_libraries(example_c4x4rgb PUBLIC Click.4x4Rgb) +############################ example_c4x4rgb GENERATED CODE END ########################### diff --git a/clicks/4x4rgb/DETAILS.md b/clicks/4x4rgb/DETAILS.md index b6426e4c8a..8162a71925 100644 --- a/clicks/4x4rgb/DETAILS.md +++ b/clicks/4x4rgb/DETAILS.md @@ -2,7 +2,7 @@ --- # 4x4 RGB click -4x4 RGB click is a matrix of 16 intelligent RGB elements, forming a 4x4 display screen. +4x4 RGB click is a matrix of 16 intelligent RGB elements, forming a 4x4 display screen.

@@ -35,23 +35,31 @@ Package can be downloaded/installed directly form compilers IDE(recommended way) #### Standard key functions : -- Config Object Initialization function. -> void c4x4rgb_cfg_setup ( c4x4rgb_cfg_t *cfg ); - -- Initialization function. -> C4X4RGB_RETVAL c4x4rgb_init ( c4x4rgb_t *ctx, c4x4rgb_cfg_t *cfg ); +- `c4x4rgb_cfg_setup` This function initializes click configuration structure to init state. +```c +void c4x4rgb_cfg_setup ( c4x4rgb_cfg_t *cfg, drv_logic_t logic_zero, drv_logic_t logic_one, uint8_t select_ctrl_pin ); +``` + +- `c4x4rgb_init` This function initializes all necessary pins and peripherals used for this click. +```c +err_t c4x4rgb_init ( c4x4rgb_t *ctx, c4x4rgb_cfg_t *cfg ); +``` #### Example key functions : -- Function for setting color color of one diode. -> err_t c4x4rgb_set_diode ( c4x4rgb_t *ctx, uint32_t diode_num, uint32_t diode_color ); +- `c4x4rgb_set_diode` This function allows to set color of one diode. +```c +err_t c4x4rgb_set_diode ( c4x4rgb_t *ctx, uint32_t diode_num, uint32_t diode_color ); +``` -- Function for filling color of ever diode. -> void c4x4rgb_fill_screen ( c4x4rgb_t *ctx, uint32_t fill_color, uint16_t fill_delay ); +- `c4x4rgb_fill_screen` This function sets every diode on selected color. +```c +void c4x4rgb_fill_screen ( c4x4rgb_t *ctx, uint32_t fill_color ); +``` ## Examples Description -> This application is used for powering 4x4 RGB LED matrices. +> This application is used for powering 4x4 RGB LED matrix. **The demo application is composed of two sections :** @@ -70,10 +78,9 @@ void application_init ( void ) C4X4RGB_MAP_MIKROBUS( cfg, MIKROBUS_1 ); c4x4rgb_init( &c4x4rgb, &cfg ); - c4x4rgb_fill_screen( &c4x4rgb, C4X4RGB_COLOR_WHITE, 5 ); + c4x4rgb_fill_screen( &c4x4rgb, C4X4RGB_COLOR_WHITE ); Delay_ms( 100 ); - c4x4rgb_color_mash(); Delay_ms( 2000 ); } @@ -110,7 +117,7 @@ void application_task ( void ) c4x4rgb_snake_return( C4X4RGB_COLOR_PURPLE ); Delay_ms( 1000 ); - c4x4rgb_fill_screen( &c4x4rgb, C4X4RGB_COLOR_WHITE, 50 ); + c4x4rgb_fill_screen( &c4x4rgb, C4X4RGB_COLOR_WHITE ); Delay_ms( 100 ); } diff --git a/clicks/4x4rgb/README.md b/clicks/4x4rgb/README.md index 1e8299e982..a9b3aac128 100644 --- a/clicks/4x4rgb/README.md +++ b/clicks/4x4rgb/README.md @@ -3,7 +3,7 @@ --- # 4x4 RGB click -4x4 RGB click is a matrix of 16 intelligent RGB elements, forming a 4x4 display screen. +4x4 RGB click is a matrix of 16 intelligent RGB elements, forming a 4x4 display screen.

@@ -36,23 +36,31 @@ Package can be downloaded/installed directly form compilers IDE(recommended way) #### Standard key functions : -- Config Object Initialization function. -> void c4x4rgb_cfg_setup ( c4x4rgb_cfg_t *cfg ); - -- Initialization function. -> C4X4RGB_RETVAL c4x4rgb_init ( c4x4rgb_t *ctx, c4x4rgb_cfg_t *cfg ); +- `c4x4rgb_cfg_setup` This function initializes click configuration structure to init state. +```c +void c4x4rgb_cfg_setup ( c4x4rgb_cfg_t *cfg, drv_logic_t logic_zero, drv_logic_t logic_one, uint8_t select_ctrl_pin ); +``` + +- `c4x4rgb_init` This function initializes all necessary pins and peripherals used for this click. +```c +err_t c4x4rgb_init ( c4x4rgb_t *ctx, c4x4rgb_cfg_t *cfg ); +``` #### Example key functions : -- Function for setting color color of one diode. -> err_t c4x4rgb_set_diode ( c4x4rgb_t *ctx, uint32_t diode_num, uint32_t diode_color ); +- `c4x4rgb_set_diode` This function allows to set color of one diode. +```c +err_t c4x4rgb_set_diode ( c4x4rgb_t *ctx, uint32_t diode_num, uint32_t diode_color ); +``` -- Function for filling color of ever diode. -> void c4x4rgb_fill_screen ( c4x4rgb_t *ctx, uint32_t fill_color, uint16_t fill_delay ); +- `c4x4rgb_fill_screen` This function sets every diode on selected color. +```c +void c4x4rgb_fill_screen ( c4x4rgb_t *ctx, uint32_t fill_color ); +``` ## Examples Description -> This application is used for powering 4x4 RGB LED matrices. +> This application is used for powering 4x4 RGB LED matrix. **The demo application is composed of two sections :** @@ -71,10 +79,9 @@ void application_init ( void ) C4X4RGB_MAP_MIKROBUS( cfg, MIKROBUS_1 ); c4x4rgb_init( &c4x4rgb, &cfg ); - c4x4rgb_fill_screen( &c4x4rgb, C4X4RGB_COLOR_WHITE, 5 ); + c4x4rgb_fill_screen( &c4x4rgb, C4X4RGB_COLOR_WHITE ); Delay_ms( 100 ); - c4x4rgb_color_mash(); Delay_ms( 2000 ); } @@ -111,7 +118,7 @@ void application_task ( void ) c4x4rgb_snake_return( C4X4RGB_COLOR_PURPLE ); Delay_ms( 1000 ); - c4x4rgb_fill_screen( &c4x4rgb, C4X4RGB_COLOR_WHITE, 50 ); + c4x4rgb_fill_screen( &c4x4rgb, C4X4RGB_COLOR_WHITE ); Delay_ms( 100 ); } diff --git a/clicks/4x4rgb/doc/doxy/Doxyfile.doxy b/clicks/4x4rgb/doc/doxy/Doxyfile.doxy index 5fd18ba854..4258ef7082 100644 --- a/clicks/4x4rgb/doc/doxy/Doxyfile.doxy +++ b/clicks/4x4rgb/doc/doxy/Doxyfile.doxy @@ -44,21 +44,21 @@ PROJECT_NUMBER = 2.0.0.0 # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = +PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = +PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = ../clicks/c4x4rgb/temp/Help/doc +OUTPUT_DIRECTORY = ../cmake/c4x4rgb/temp/Help/doc # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -162,7 +162,7 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -171,7 +171,7 @@ STRIP_FROM_PATH = # specify the list of include paths that are normally passed to the compiler # using the -I flag. -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't @@ -238,13 +238,13 @@ TAB_SIZE = 4 # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. -ALIASES = +ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. -TCL_SUBST = +TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For @@ -291,7 +291,7 @@ OPTIMIZE_OUTPUT_VHDL = NO # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. -EXTENSION_MAPPING = +EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable @@ -648,7 +648,7 @@ GENERATE_DEPRECATEDLIST= YES # sections, marked by \if ... \endif and \cond # ... \endcond blocks. -ENABLED_SECTIONS = +ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the @@ -690,7 +690,7 @@ SHOW_NAMESPACES = YES # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. -FILE_VERSION_FILTER = +FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated @@ -703,7 +703,7 @@ FILE_VERSION_FILTER = # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. -LAYOUT_FILE = +LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib @@ -713,7 +713,7 @@ LAYOUT_FILE = # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. -CITE_BIB_FILES = +CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages @@ -778,7 +778,7 @@ WARN_FORMAT = "$file:$line: $text" # messages should be written. If left blank the output is written to standard # error (stderr). -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files @@ -790,9 +790,9 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = ../clicks/c4x4rgb/example \ - ../clicks/c4x4rgb/lib/include \ - ../clicks/c4x4rgb/README.md +INPUT = ../cmake/c4x4rgb/example \ + ../cmake/c4x4rgb/lib_c4x4rgb/include \ + ../cmake/c4x4rgb/README.md # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -877,7 +877,7 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = +EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -893,7 +893,7 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the @@ -904,13 +904,13 @@ EXCLUDE_PATTERNS = # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* -EXCLUDE_SYMBOLS = +EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = ../clicks/c4x4rgb/example +EXAMPLE_PATH = ../cmake/c4x4rgb/example # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and @@ -930,7 +930,7 @@ EXAMPLE_RECURSIVE = YES # that contain images that are to be included in the documentation (see the # \image command). -IMAGE_PATH = +IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program @@ -951,7 +951,7 @@ IMAGE_PATH = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -INPUT_FILTER = +INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the @@ -964,7 +964,7 @@ INPUT_FILTER = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -FILTER_PATTERNS = +FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for @@ -979,14 +979,14 @@ FILTER_SOURCE_FILES = NO # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. -FILTER_SOURCE_PATTERNS = +FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = +USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing @@ -1091,7 +1091,7 @@ CLANG_ASSISTED_PARSING = NO # specified with INPUT and INCLUDE_PATH. # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. -CLANG_OPTIONS = +CLANG_OPTIONS = #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index @@ -1117,7 +1117,7 @@ COLS_IN_ALPHA_INDEX = 5 # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output @@ -1161,7 +1161,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = +HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard @@ -1171,7 +1171,7 @@ HTML_HEADER = # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = +HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of @@ -1183,7 +1183,7 @@ HTML_FOOTER = # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_STYLESHEET = +HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets @@ -1196,7 +1196,7 @@ HTML_STYLESHEET = # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = +HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note @@ -1206,7 +1206,7 @@ HTML_EXTRA_STYLESHEET = # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = +HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to @@ -1335,7 +1335,7 @@ GENERATE_HTMLHELP = NO # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_FILE = +CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, @@ -1343,7 +1343,7 @@ CHM_FILE = # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -HHC_LOCATION = +HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the master .chm file (NO). @@ -1356,7 +1356,7 @@ GENERATE_CHI = NO # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_INDEX_ENCODING = +CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it @@ -1387,7 +1387,7 @@ GENERATE_QHP = NO # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. -QCH_FILE = +QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace @@ -1412,7 +1412,7 @@ QHP_VIRTUAL_FOLDER = ./temp/Help/doc # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom @@ -1420,21 +1420,21 @@ QHP_CUST_FILTER_NAME = # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_ATTRS = +QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_SECT_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. -QHG_LOCATION = +QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To @@ -1567,7 +1567,7 @@ MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_EXTENSIONS = +MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site @@ -1575,7 +1575,7 @@ MATHJAX_EXTENSIONS = # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_CODEFILE = +MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and @@ -1635,7 +1635,7 @@ EXTERNAL_SEARCH = NO # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. -SEARCHENGINE_URL = +SEARCHENGINE_URL = # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed # search data is written to a file for indexing by an external tool. With the @@ -1651,7 +1651,7 @@ SEARCHDATA_FILE = searchdata.xml # projects and redirect the results back to the right project. # This tag requires that the tag SEARCHENGINE is set to YES. -EXTERNAL_SEARCH_ID = +EXTERNAL_SEARCH_ID = # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen # projects other than the one defined by this configuration file, but that are @@ -1661,7 +1661,7 @@ EXTERNAL_SEARCH_ID = # EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... # This tag requires that the tag SEARCHENGINE is set to YES. -EXTRA_SEARCH_MAPPINGS = +EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- # Configuration options related to the LaTeX output @@ -1725,7 +1725,7 @@ PAPER_TYPE = a4 # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. -EXTRA_PACKAGES = +EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for the # generated LaTeX document. The header should contain everything until the first @@ -1741,7 +1741,7 @@ EXTRA_PACKAGES = # to HTML_HEADER. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_HEADER = +LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the # generated LaTeX document. The footer should contain everything after the last @@ -1752,7 +1752,7 @@ LATEX_HEADER = # Note: Only use a user-defined footer if you know what you are doing! # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_FOOTER = +LATEX_FOOTER = # The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined # LaTeX style sheets that are included after the standard style sheets created @@ -1763,7 +1763,7 @@ LATEX_FOOTER = # list). # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_STYLESHEET = +LATEX_EXTRA_STYLESHEET = # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output @@ -1771,7 +1771,7 @@ LATEX_EXTRA_STYLESHEET = # markers available. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_FILES = +LATEX_EXTRA_FILES = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is # prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will @@ -1879,14 +1879,14 @@ RTF_HYPERLINKS = NO # default style sheet that doxygen normally uses. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_STYLESHEET_FILE = +RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is # similar to doxygen's config file. A template extensions file can be generated # using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_EXTENSIONS_FILE = +RTF_EXTENSIONS_FILE = # If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code # with syntax highlighting in the RTF output. @@ -1931,7 +1931,7 @@ MAN_EXTENSION = .3 # MAN_EXTENSION with the initial . removed. # This tag requires that the tag GENERATE_MAN is set to YES. -MAN_SUBDIR = +MAN_SUBDIR = # If the MAN_LINKS tag is set to YES and doxygen generates man output, then it # will generate one additional man file for each entity documented in the real @@ -2044,7 +2044,7 @@ PERLMOD_PRETTY = YES # overwrite each other's variables. # This tag requires that the tag GENERATE_PERLMOD is set to YES. -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor @@ -2085,7 +2085,7 @@ SEARCH_INCLUDES = YES # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = +INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the @@ -2093,7 +2093,7 @@ INCLUDE_PATH = # used. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -INCLUDE_FILE_PATTERNS = +INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that are # defined before the preprocessor is started (similar to the -D option of e.g. @@ -2103,7 +2103,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = +PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -2112,7 +2112,7 @@ PREDEFINED = # definition found in the source code. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will # remove all references to function-like macros that are alone on a line, have @@ -2141,13 +2141,13 @@ SKIP_FUNCTION_MACROS = YES # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. -TAGFILES = +TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create a # tag file that is based on the input files it reads. See section "Linking to # external documentation" for more information about the usage of tag files. -GENERATE_TAGFILE = +GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES, all external class will be listed in # the class index. If set to NO, only the inherited external classes will be @@ -2188,7 +2188,7 @@ CLASS_DIAGRAMS = YES # DIA_PATH tag allows you to specify the directory where the dia binary resides. # If left empty dia is assumed to be found in the default search path. -DIA_PATH = +DIA_PATH = # If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. @@ -2237,7 +2237,7 @@ DOT_FONTSIZE = 10 # the path where dot can find it using this tag. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTPATH = +DOT_FONTPATH = # If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for # each documented class showing the direct and indirect inheritance relations. @@ -2381,26 +2381,26 @@ INTERACTIVE_SVG = NO # found. If left blank, it is assumed the dot tool can be found in the path. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_PATH = +DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the \dotfile # command). # This tag requires that the tag HAVE_DOT is set to YES. -DOTFILE_DIRS = +DOTFILE_DIRS = # The MSCFILE_DIRS tag can be used to specify one or more directories that # contain msc files that are included in the documentation (see the \mscfile # command). -MSCFILE_DIRS = +MSCFILE_DIRS = # The DIAFILE_DIRS tag can be used to specify one or more directories that # contain dia files that are included in the documentation (see the \diafile # command). -DIAFILE_DIRS = +DIAFILE_DIRS = # When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the # path where java can find the plantuml.jar file. If left blank, it is assumed @@ -2408,17 +2408,17 @@ DIAFILE_DIRS = # generate a warning when it encounters a \startuml command in this case and # will not generate output for the diagram. -PLANTUML_JAR_PATH = +PLANTUML_JAR_PATH = # When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a # configuration file for plantuml. -PLANTUML_CFG_FILE = +PLANTUML_CFG_FILE = # When using plantuml, the specified paths are searched for files specified by # the !include statement in a plantuml block. -PLANTUML_INCLUDE_PATH = +PLANTUML_INCLUDE_PATH = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes diff --git a/clicks/4x4rgb/doc/package/manifest.json b/clicks/4x4rgb/doc/package/manifest.json index 3f572048ee..eca3086139 100644 --- a/clicks/4x4rgb/doc/package/manifest.json +++ b/clicks/4x4rgb/doc/package/manifest.json @@ -1,6 +1,6 @@ { - "architecture": "ARM|PIC32", - "category": "LED Matrix", + "architecture": "ARM|PIC32|RISC-V", + "category": "Click Boards > Display & LED > LED matrix", "changelog": "Resources/CHANGELOG.md", "contains": [ "libraries", @@ -8,8 +8,7 @@ "examples", "source_files" ], - "dependency_list": [ - ], + "dependency_list": [], "details": "Resources/DETAILS.md", "display_name": "4x4 RGB click", "example_list": [ @@ -25,24 +24,17 @@ }, "name": "mikroe.click.c4x4rgb", "product_link": "https://www.mikroe.com/4x4-rgb-click", - "short_description": "4x4 RGB click is a matrix of 16 intelligent RGB elements, forming a 4x4 display screen. ", - "supported_compiler": "mikroC AI", + "short_description": "4x4 RGB click is a matrix of 16 intelligent RGB elements, forming a 4x4 display screen.", + "supported_compiler": "mikroC AI|GCC", "type": "Library", - "_type":"mikroSDK Library", - "related_projects":[ + "_type": "mikroSDK Library", + "related_projects": [ 1413 ], - "_type": "mikroSDK Library", - "related_project": [ 3499 ], - "version": "2.0.0.10" + "version": "2.1.0.12", + "cmake": true, + "alias": "Click.4x4Rgb", + "subdir_name": "lib_c4x4rgb" } - - - - - - - - diff --git a/clicks/4x4rgb/example/CMakeLists.txt b/clicks/4x4rgb/example/CMakeLists.txt new file mode 100644 index 0000000000..aca1c1cd6b --- /dev/null +++ b/clicks/4x4rgb/example/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(example_c4x4rgb LANGUAGES MikroC) +else() + project(example_c4x4rgb LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_executable(example_c4x4rgb + main.c + +) + + +############################ example_c4x4rgb GENERATED CODE START ########################### +find_package(MikroC.Core REQUIRED) +target_link_libraries(example_c4x4rgb PUBLIC MikroC.Core) +find_package(MikroSDK.Board REQUIRED) +target_link_libraries(example_c4x4rgb PUBLIC MikroSDK.Board) +find_package(MikroSDK.Log REQUIRED) +target_link_libraries(example_c4x4rgb PUBLIC MikroSDK.Log) +add_subdirectory(lib_c4x4rgb) +target_link_libraries(example_c4x4rgb PUBLIC Click.4x4Rgb) +############################ example_c4x4rgb GENERATED CODE END ########################### diff --git a/clicks/4x4rgb/example/main.c b/clicks/4x4rgb/example/main.c index 815c981fb7..73367a44ca 100644 --- a/clicks/4x4rgb/example/main.c +++ b/clicks/4x4rgb/example/main.c @@ -3,7 +3,7 @@ * \brief 4x4 RGB Click example * * # Description - * This application is used for powering 4x4 RGB LED matrices. + * This application is used for powering 4x4 RGB LED matrix. * * The demo application is composed of two sections : * @@ -17,7 +17,7 @@ * These LEDs actually consist of three single colored LEDs ( Red, Green and Blue ) in a single package. * Various colors can be reproduced by mixing the intensity of each LED. * - * *note:* + * @note * **Diodes layout:** * ---------------------- * | 13 | 14 | 15 | 16 | @@ -29,18 +29,18 @@ * | 1 | 2 | 3 | 4 | * ---------------------- * - * Timeing sequence chart: + * Timing sequence chart: * -----------| T0L * T0H |______________ * Logic 0: - * T0H ~ 200-500ns - * T0L ~ 650-1050ns + * T0H: 350ns (+/-150ns) + * T0L: 800ns (+/-150ns) * * -----------| T1L * T1H |______________ * Logic 1: - * T1H ~ 550-850ns - * T1L ~ 450-750ns + * T1H: 700ns (+/-150ns) + * T1L: 600ns (+/-150ns) * * \author MikroE Team * @@ -48,48 +48,108 @@ #include "board.h" #include "c4x4rgb.h" -#ifdef __MIKROC_AI_FOR_ARM__ - -#ifdef __STM32__/*< STM32F407ZG*/ - -#define D_S 2 -#define D_L 4 - -#define DELAY_SHORT \ - Delay_Cyc( D_S ); - -#define DELAY_LONG \ - Delay_Cyc( D_L ); - -#elif __KINETIS__/*< MK64FN1M0VDC12*/ - -#define DELAY_SHORT - -#define DELAY_LONG \ - asm nop - +// Delay adjustment for specific systems. +#ifdef STM32F407ZG + /*< Adjusted for STM32F407ZG */ + #define DELAY_TOH Delay_Cyc( 4 ); // ~340ns + #define DELAY_TOL Delay_Cyc( 6 ); // ~800ns + #define DELAY_T1H Delay_Cyc( 10 ); // ~700ns + #define DELAY_T1L Delay_Cyc( 3 ); // ~620ns +#elif MK64FN1M0VDC12 + /*< Adjusted for MK64FN1M0VDC12 */ + #define DELAY_TOH \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; // ~350ns + #define DELAY_TOL Delay_Cyc( 2 ); // ~800ns + #define DELAY_T1H Delay_Cyc( 6 ); // ~680ns + #define DELAY_T1L \ + asm nop; \ + asm nop; \ + asm nop; // ~600ns +#elif TM4C129XNCZAD + /*< Adjusted for TM4C129XNCZAD */ + #define DELAY_TOH \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; // ~350ns + #define DELAY_TOL // ~880ns + #define DELAY_T1H Delay_Cyc( 4 ); // ~720ns + #define DELAY_T1L // ~880ns +#elif GD32VF103VBT6 + /*< Adjusted for GD32VF103VBT6 */ + #define DELAY_TOH \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); // ~350ns + #define DELAY_TOL \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); \ + asm("nop"); // ~800ns + #define DELAY_T1H Delay_Cyc( 2 ); // ~680ns + #define DELAY_T1L // ~620ns +#elif PIC32MX795F512L + /*< Adjusted for PIC32MX795F512L */ + #define DELAY_TOH \ + asm nop; \ + asm nop; \ + asm nop; \ + asm nop; // ~360ns + #define DELAY_TOL // ~1020ns + #define DELAY_T1H Delay_Cyc( 3 ); // ~780ns + #define DELAY_T1L // ~1020ns +#else + #error "Logic delays are not defined for the selected system" #endif -#elif __MIKROC_AI_FOR_PIC32__ /*< PIC32MZ2048EFH144 */ - -#define D_L 4 - -#define DELAY_SHORT \ - asm nop - -#define DELAY_LONG \ - Delay_Cyc( D_L ); -#endif - -/*< You need to define long and short delay */ -#if !defined(DELAY_SHORT) && !defined(DELAY_LONG) - -#define DELAY_SHORT -#define DELAY_LONG - -#endif - - #define SNAKE_DELAY 50 #define MASH_DELAY 100 @@ -114,10 +174,9 @@ void application_init ( void ) C4X4RGB_MAP_MIKROBUS( cfg, MIKROBUS_1 ); c4x4rgb_init( &c4x4rgb, &cfg ); - c4x4rgb_fill_screen( &c4x4rgb, C4X4RGB_COLOR_WHITE, 5 ); + c4x4rgb_fill_screen( &c4x4rgb, C4X4RGB_COLOR_WHITE ); Delay_ms( 100 ); - c4x4rgb_color_mash(); Delay_ms( 2000 ); } @@ -142,7 +201,7 @@ void application_task ( void ) c4x4rgb_snake_return( C4X4RGB_COLOR_PURPLE ); Delay_ms( 1000 ); - c4x4rgb_fill_screen( &c4x4rgb, C4X4RGB_COLOR_WHITE, 50 ); + c4x4rgb_fill_screen( &c4x4rgb, C4X4RGB_COLOR_WHITE ); Delay_ms( 100 ); } @@ -159,18 +218,18 @@ void main ( void ) static void c4x4rgb_logic_zero ( void ) { - digital_out_high( &c4x4rgb.ctrl_pin ); - DELAY_SHORT; - digital_out_low( &c4x4rgb.ctrl_pin ); - DELAY_LONG; + hal_ll_gpio_set_pin_output( &c4x4rgb.ctrl_pin.pin ); + DELAY_TOH; + hal_ll_gpio_clear_pin_output( &c4x4rgb.ctrl_pin.pin ); + DELAY_TOL; } static void c4x4rgb_logic_one ( void ) { - digital_out_high( &c4x4rgb.ctrl_pin ); - DELAY_LONG; - digital_out_low( &c4x4rgb.ctrl_pin ); - DELAY_SHORT; + hal_ll_gpio_set_pin_output( &c4x4rgb.ctrl_pin.pin ); + DELAY_T1H; + hal_ll_gpio_clear_pin_output( &c4x4rgb.ctrl_pin.pin ); + DELAY_T1L; } static void c4x4rgb_color_mash ( void ) diff --git a/clicks/4x4rgb/example/manifest.exm b/clicks/4x4rgb/example/manifest.exm index 81b9e476b5..8a13717325 100644 --- a/clicks/4x4rgb/example/manifest.exm +++ b/clicks/4x4rgb/example/manifest.exm @@ -1,8 +1,8 @@ { "name": "4x4 RGB Click", - "description": "4x4 RGB click is a matrix of 16 intelligent RGB elements, forming a 4x4 display screen. ", + "description": "4x4 RGB click is a matrix of 16 intelligent RGB elements, forming a 4x4 display screen.", "image" : "../../Resources/click_icon.png", - "toolchain": ["mikrocarm","mikrocpic32"], + "toolchain": ["mikrocarm","mikrocpic32","gcc-riscv"], "hw" : ["click","MCP1826"], "category" : ["LED Matrix"] } diff --git a/clicks/4x4rgb/example/memake.txt b/clicks/4x4rgb/example/memake.txt deleted file mode 100644 index 1c52d3ddc5..0000000000 --- a/clicks/4x4rgb/example/memake.txt +++ /dev/null @@ -1,17 +0,0 @@ -type: executable -target: example_c4x4rgb - -depends: { - MikroC.Core - MikroSDK.Board - MikroSDK.Log - Click.4x4Rgb -} - -uses: { - MikroC.Core -} - -sources: { - main.c -} diff --git a/clicks/4x4rgb/lib/memake.txt b/clicks/4x4rgb/lib/memake.txt deleted file mode 100644 index ba11d1c8e6..0000000000 --- a/clicks/4x4rgb/lib/memake.txt +++ /dev/null @@ -1,40 +0,0 @@ -type: library - -target: lib_c4x4rgb - -alias: Click.4x4Rgb - -sources: { - src/c4x4rgb.c -} - -headers: { - include/c4x4rgb.h -} - -include: { - include -} - -install: { - src(include/c4x4rgb.h) dst(include/c4x4rgb.h) -} - -expInclude: { - include -} - -depends: { - MikroC.Core - MikroSDK.Driver -} - -uses: { - MikroC.Core -} - -others: { - ../README.md - ../DETAILS.md - ../CHANGELOG.md -} diff --git a/clicks/4x4rgb/lib_c4x4rgb/CMakeLists.txt b/clicks/4x4rgb/lib_c4x4rgb/CMakeLists.txt new file mode 100644 index 0000000000..d9136a2fcf --- /dev/null +++ b/clicks/4x4rgb/lib_c4x4rgb/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(lib_c4x4rgb LANGUAGES MikroC) +else() + project(lib_c4x4rgb LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_library(lib_c4x4rgb STATIC + src/c4x4rgb.c + include/c4x4rgb.h +) +add_library(Click.4x4Rgb ALIAS lib_c4x4rgb) + + + +target_include_directories(lib_c4x4rgb PUBLIC + include +) + +find_package(MikroC.Core REQUIRED) +target_link_libraries(lib_c4x4rgb PUBLIC MikroC.Core) +find_package(MikroSDK.Driver REQUIRED) +target_link_libraries(lib_c4x4rgb PUBLIC MikroSDK.Driver) diff --git a/clicks/4x4rgb/lib_c4x4rgb/include/Click.4x4Rgb b/clicks/4x4rgb/lib_c4x4rgb/include/Click.4x4Rgb new file mode 100644 index 0000000000..24fc86901b --- /dev/null +++ b/clicks/4x4rgb/lib_c4x4rgb/include/Click.4x4Rgb @@ -0,0 +1 @@ +#include "c4x4rgb.h" diff --git a/clicks/4x4rgb/lib/include/c4x4rgb.h b/clicks/4x4rgb/lib_c4x4rgb/include/c4x4rgb.h similarity index 89% rename from clicks/4x4rgb/lib/include/c4x4rgb.h rename to clicks/4x4rgb/lib_c4x4rgb/include/c4x4rgb.h index 8f671ed422..23a830e2eb 100644 --- a/clicks/4x4rgb/lib/include/c4x4rgb.h +++ b/clicks/4x4rgb/lib_c4x4rgb/include/c4x4rgb.h @@ -49,19 +49,17 @@ * \{ */ #define C4X4RGB_MAP_MIKROBUS( cfg, mikrobus ) \ - cfg.in1= MIKROBUS( mikrobus, MIKROBUS_RST ); \ - cfg.in2= MIKROBUS( mikrobus, MIKROBUS_CS ); \ - cfg.out= MIKROBUS( mikrobus, MIKROBUS_PWM ) + cfg.in1 = MIKROBUS( mikrobus, MIKROBUS_RST ); \ + cfg.in2 = MIKROBUS( mikrobus, MIKROBUS_CS ); \ + cfg.out = MIKROBUS( mikrobus, MIKROBUS_PWM ) /** \} */ /** * \defgroup error_code Error Code * \{ */ -#define C4X4RGB_RETVAL uint8_t - -#define C4X4RGB_OK 0x00 -#define C4X4RGB_INIT_ERROR 0xFF +#define C4X4RGB_OK 0 +#define C4X4RGB_ERROR -1 /** \} */ @@ -105,7 +103,6 @@ typedef void ( *drv_logic_t ) ( void ); typedef struct { // Output pins - digital_out_t in1; digital_out_t in2; digital_out_t out; @@ -113,10 +110,10 @@ typedef struct digital_out_t ctrl_pin; // Function pointers - drv_logic_t logic_zero; drv_logic_t logic_one; - + + uint32_t diode_array[ 16 ]; } c4x4rgb_t; @@ -126,7 +123,6 @@ typedef struct typedef struct { // Additional gpio pins - pin_name_t in1; pin_name_t in2; pin_name_t out; @@ -134,7 +130,6 @@ typedef struct uint8_t ctrl_pin; // Function pointers - drv_logic_t logic_zero; drv_logic_t logic_one; @@ -171,7 +166,7 @@ void c4x4rgb_cfg_setup ( c4x4rgb_cfg_t *cfg, drv_logic_t logic_zero, drv_logic_t * @param ctx Click object. * @param cfg Click configuration structure. */ -C4X4RGB_RETVAL c4x4rgb_init ( c4x4rgb_t *ctx, c4x4rgb_cfg_t *cfg ); +err_t c4x4rgb_init ( c4x4rgb_t *ctx, c4x4rgb_cfg_t *cfg ); /** * @brief Function for setting color color of one diode. @@ -179,7 +174,7 @@ C4X4RGB_RETVAL c4x4rgb_init ( c4x4rgb_t *ctx, c4x4rgb_cfg_t *cfg ); * * @param ctx Click object. * @param diode_num Desired diode to control - * @param diode_color Desiered color + * @param diode_color Desired color * * @return @li @c 0 - Success, * @li @c -1 - Error. @@ -191,10 +186,9 @@ err_t c4x4rgb_set_diode ( c4x4rgb_t *ctx, uint32_t diode_num, uint32_t diode_col * @details This function sets every diode on selected color. * * @param ctx Click object. - * @param fill_color Desiered color - * @param fill_delay Delay between changeing diode color. + * @param fill_color Desired color */ -void c4x4rgb_fill_screen ( c4x4rgb_t *ctx, uint32_t fill_color, uint16_t fill_delay ); +void c4x4rgb_fill_screen ( c4x4rgb_t *ctx, uint32_t fill_color ); #ifdef __cplusplus } diff --git a/clicks/4x4rgb/lib/src/c4x4rgb.c b/clicks/4x4rgb/lib_c4x4rgb/src/c4x4rgb.c similarity index 54% rename from clicks/4x4rgb/lib/src/c4x4rgb.c rename to clicks/4x4rgb/lib_c4x4rgb/src/c4x4rgb.c index 2f510fa4b7..eef244c8db 100644 --- a/clicks/4x4rgb/lib/src/c4x4rgb.c +++ b/clicks/4x4rgb/lib_c4x4rgb/src/c4x4rgb.c @@ -29,22 +29,9 @@ #include "c4x4rgb.h" +static void dev_init_diode ( c4x4rgb_t *ctx, uint32_t a_rgb_color, uint8_t diode_num ); - -// ------------------------------------------------ PRIVATE VARIABLES - -static uint32_t diode_array[ 16 ]; -uint32_t * array; - -// ------------------------------------------------ PUBLIC FUNCTION DECLARATIONS - -static void dev_delay ( uint16_t delay_time, char delay_unit ); - -static void dev_init_diode ( c4x4rgb_t *ctx, uint32_t a_rgb_color, uint32_t diode_num ); - -static void dev_set_color ( c4x4rgb_t *ctx, uint32_t diode_num ); - -// ------------------------------------------------ PUBLIC FUNCTION DEFINITIONS +static void dev_set_color ( c4x4rgb_t *ctx, uint8_t diode_num ); void c4x4rgb_cfg_setup ( c4x4rgb_cfg_t *cfg, drv_logic_t logic_zero, drv_logic_t logic_one, uint8_t select_ctrl_pin ) { @@ -59,7 +46,7 @@ void c4x4rgb_cfg_setup ( c4x4rgb_cfg_t *cfg, drv_logic_t logic_zero, drv_logic_t cfg->ctrl_pin = select_ctrl_pin; } -C4X4RGB_RETVAL c4x4rgb_init ( c4x4rgb_t *ctx, c4x4rgb_cfg_t *cfg ) +err_t c4x4rgb_init ( c4x4rgb_t *ctx, c4x4rgb_cfg_t *cfg ) { // Output pins digital_out_init( &ctx->in1, cfg->in1 ); @@ -69,7 +56,7 @@ C4X4RGB_RETVAL c4x4rgb_init ( c4x4rgb_t *ctx, c4x4rgb_cfg_t *cfg ) ctx->logic_zero = cfg->logic_zero; ctx->logic_one = cfg->logic_one; - if ( cfg->ctrl_pin == C4X4RGB_CTRL_PIN_IN2 ) + if ( C4X4RGB_CTRL_PIN_IN2 == cfg->ctrl_pin ) { ctx->ctrl_pin = ctx->in2; } @@ -78,93 +65,59 @@ C4X4RGB_RETVAL c4x4rgb_init ( c4x4rgb_t *ctx, c4x4rgb_cfg_t *cfg ) ctx->ctrl_pin = ctx->in1; } - array = &diode_array[ 0 ]; - return C4X4RGB_OK; } err_t c4x4rgb_set_diode ( c4x4rgb_t *ctx, uint32_t diode_num, uint32_t diode_color ) { - uint32_t cnt_i; - - if (diode_num > 16) - return -1; - - for ( cnt_i = 0; cnt_i < 16; cnt_i++ ) + if ( diode_num > 16 ) + { + return C4X4RGB_ERROR; + } + for ( uint8_t cnt_i = 0; cnt_i < 16; cnt_i++ ) { - if ( cnt_i == diode_num - 1 ) + if ( ( diode_num - 1 ) == cnt_i ) { dev_init_diode( ctx, diode_color, cnt_i ); dev_set_color( ctx, cnt_i ); } else { - dev_set_color( ctx, cnt_i ); + dev_set_color( ctx, cnt_i ); } } - - dev_delay( 60, 'u' ); // reset delay - return 0; + Delay_60us( ); // reset delay + return C4X4RGB_OK; } - - -void c4x4rgb_fill_screen ( c4x4rgb_t *ctx, uint32_t fill_color, uint16_t fill_delay ) +void c4x4rgb_fill_screen ( c4x4rgb_t *ctx, uint32_t fill_color ) { - int8_t cnt_i; - - for ( cnt_i = 0 ; cnt_i < 16; cnt_i++ ) + for ( uint8_t cnt_i = 0 ; cnt_i < 16; cnt_i++ ) { - c4x4rgb_set_diode( ctx, cnt_i+1, fill_color ); - dev_delay( fill_delay, 'm' ); + c4x4rgb_set_diode( ctx, cnt_i + 1, fill_color ); + Delay_5ms ( ); } } - -// ------------------------------------------------ PUBLIC FUNCTION DEFINITIONS - -static void dev_delay ( uint16_t delay_time, char delay_unit ) +static void dev_init_diode ( c4x4rgb_t *ctx, uint32_t a_rgb_color, uint8_t diode_num ) { - uint16_t cnt; - - if ( delay_unit == 'm' ) // delay for milliseconds - { - for ( cnt = 0; cnt < delay_time; cnt++ ) - { - Delay_1ms( ); - } - } - - if ( delay_unit == 'u' ) // delay for microseconds - { - for ( cnt = 0; cnt < delay_time; cnt++ ) - { - Delay_1us( ); - } - } + ctx->diode_array[ diode_num ] = ( a_rgb_color & 0x000000FF ) | + ( ( a_rgb_color & 0x00FF0000 ) >> 8 ) | + ( ( a_rgb_color & 0x0000FF00 ) << 8 ); } -static void dev_init_diode ( c4x4rgb_t *ctx, uint32_t a_rgb_color, uint32_t diode_num ) +static void dev_set_color ( c4x4rgb_t *ctx, uint8_t diode_num ) { - *( array + diode_num ) = ( a_rgb_color & 0x000000FF ) | ( ( ( a_rgb_color & 0x00FF0000 ) >> 16 ) << 8 ) | ( ( ( a_rgb_color & 0x0000FF00 ) >> 8 ) << 16 ); -} - -static void dev_set_color ( c4x4rgb_t *ctx, uint32_t diode_num ) -{ - uint32_t cnt_i; - uint32_t tmp; - - tmp = 1; - - for ( cnt_i = 0; cnt_i < 24; cnt_i++ ) + uint32_t tmp = 1; + for ( uint8_t cnt_i = 0; cnt_i < 24; cnt_i++ ) { - if ( ( ( *( array + diode_num ) ) & ( tmp << ( 23 - cnt_i ) ) ) == 0 ) + if ( ctx->diode_array[ diode_num ] & ( 1ul << ( 23 - cnt_i ) ) ) { - ctx->logic_zero( ); + ctx->logic_one( ); } else { - ctx->logic_one( ); + ctx->logic_zero( ); } } } diff --git a/clicks/4x4rgb/memake.txt b/clicks/4x4rgb/memake.txt deleted file mode 100644 index dbe86cacad..0000000000 --- a/clicks/4x4rgb/memake.txt +++ /dev/null @@ -1,7 +0,0 @@ -type: subdirs -project: 4x4Rgb - -subdirs: { - lib - example -} diff --git a/clicks/6dofimu17/CMakeLists.txt b/clicks/6dofimu17/CMakeLists.txt new file mode 100644 index 0000000000..77b7b2d14e --- /dev/null +++ b/clicks/6dofimu17/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(example_c6dofimu17 LANGUAGES MikroC) +else() + project(example_c6dofimu17 LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_executable(example_c6dofimu17 + example/main.c + +) + + +############################ example_c6dofimu17 GENERATED CODE START ########################### +find_package(MikroC.Core REQUIRED) +target_link_libraries(example_c6dofimu17 PUBLIC MikroC.Core) +find_package(MikroSDK.Board REQUIRED) +target_link_libraries(example_c6dofimu17 PUBLIC MikroSDK.Board) +find_package(MikroSDK.Log REQUIRED) +target_link_libraries(example_c6dofimu17 PUBLIC MikroSDK.Log) +add_subdirectory(lib_c6dofimu17) +target_link_libraries(example_c6dofimu17 PUBLIC Click.6DOFIMU17) +############################ example_c6dofimu17 GENERATED CODE END ########################### diff --git a/clicks/6dofimu17/README.md b/clicks/6dofimu17/README.md index 36b1571047..07f2768b81 100644 --- a/clicks/6dofimu17/README.md +++ b/clicks/6dofimu17/README.md @@ -70,7 +70,7 @@ err_t c6dofimu17_get_temperature ( c6dofimu17_t *ctx, float *temperature ); ## Example Description -> his library contains API for 6DOF IMU 17 Click driver. +> This library contains API for 6DOF IMU 17 Click driver. > The library initializes and defines the I2C or SPI bus drivers > to write and read data from registers. > The library also includes a function for reading @@ -147,7 +147,7 @@ void application_init ( void ) > Measures and displays acceleration and gyroscope data for X-axis, Y-axis, and Z-axis > and the temperature in degrees Celsius. > Results are being sent to the USART terminal where the user can track their changes. -> This task repeats every 1 sec. +> This task repeats every 100 ms. ```c @@ -156,18 +156,18 @@ void application_task ( void ) c6dofimu17_axis_t accel_data; c6dofimu17_axis_t gyro_data; float temperature; - - c6dofimu17_get_accel_data( &c6dofimu17, &accel_data ); - c6dofimu17_get_gyro_data( &c6dofimu17, &gyro_data ); - c6dofimu17_get_temperature( &c6dofimu17, &temperature ); - - log_printf( &logger, "\t Accel X: %d\t|\tGyro X: %d\r\n", accel_data.x, gyro_data.x ); - log_printf( &logger, "\t Accel Y: %d\t|\tGyro Y: %d\r\n", accel_data.y, gyro_data.y ); - log_printf( &logger, "\t Accel Z: %d\t|\tGyro Z: %d\r\n", accel_data.z, gyro_data.z ); - log_printf( &logger, "\t- - - - - - - - - - - - - - - - - - -\r\n" ); - log_printf( &logger, "\t\t Temperature: %.2f C\r\n", temperature ); - log_printf( &logger, "\t--------------------------------------\r\n" ); - Delay_ms( 1000 ); + if ( ( C6DOFIMU17_OK == c6dofimu17_get_accel_data( &c6dofimu17, &accel_data ) ) && + ( C6DOFIMU17_OK == c6dofimu17_get_gyro_data( &c6dofimu17, &gyro_data ) ) && + ( C6DOFIMU17_OK == c6dofimu17_get_temperature( &c6dofimu17, &temperature ) ) ) + { + log_printf( &logger, "\t Accel X: %d\t|\tGyro X: %d\r\n", accel_data.x, gyro_data.x ); + log_printf( &logger, "\t Accel Y: %d\t|\tGyro Y: %d\r\n", accel_data.y, gyro_data.y ); + log_printf( &logger, "\t Accel Z: %d\t|\tGyro Z: %d\r\n", accel_data.z, gyro_data.z ); + log_printf( &logger, "\t- - - - - - - - - - - - - - - - - - -\r\n" ); + log_printf( &logger, "\t\t Temperature: %.2f C\r\n", temperature ); + log_printf( &logger, "\t--------------------------------------\r\n" ); + } + Delay_ms( 100 ); } ``` diff --git a/clicks/6dofimu17/changelog.md b/clicks/6dofimu17/changelog.md index 045bcb30cf..b2ebfc1acd 100644 --- a/clicks/6dofimu17/changelog.md +++ b/clicks/6dofimu17/changelog.md @@ -1,4 +1,4 @@ ## Changelog -### Version 2.0.0.5 +### Version 2.1.0.5 - Initial release diff --git a/clicks/6dofimu17/details.md b/clicks/6dofimu17/details.md index d917ebd481..6ccb0a31f2 100644 --- a/clicks/6dofimu17/details.md +++ b/clicks/6dofimu17/details.md @@ -69,7 +69,7 @@ err_t c6dofimu17_get_temperature ( c6dofimu17_t *ctx, float *temperature ); ## Example Description -> his library contains API for 6DOF IMU 17 Click driver. +> This library contains API for 6DOF IMU 17 Click driver. > The library initializes and defines the I2C or SPI bus drivers > to write and read data from registers. > The library also includes a function for reading @@ -146,7 +146,7 @@ void application_init ( void ) > Measures and displays acceleration and gyroscope data for X-axis, Y-axis, and Z-axis > and the temperature in degrees Celsius. > Results are being sent to the USART terminal where the user can track their changes. -> This task repeats every 1 sec. +> This task repeats every 100 ms. ```c @@ -155,18 +155,18 @@ void application_task ( void ) c6dofimu17_axis_t accel_data; c6dofimu17_axis_t gyro_data; float temperature; - - c6dofimu17_get_accel_data( &c6dofimu17, &accel_data ); - c6dofimu17_get_gyro_data( &c6dofimu17, &gyro_data ); - c6dofimu17_get_temperature( &c6dofimu17, &temperature ); - - log_printf( &logger, "\t Accel X: %d\t|\tGyro X: %d\r\n", accel_data.x, gyro_data.x ); - log_printf( &logger, "\t Accel Y: %d\t|\tGyro Y: %d\r\n", accel_data.y, gyro_data.y ); - log_printf( &logger, "\t Accel Z: %d\t|\tGyro Z: %d\r\n", accel_data.z, gyro_data.z ); - log_printf( &logger, "\t- - - - - - - - - - - - - - - - - - -\r\n" ); - log_printf( &logger, "\t\t Temperature: %.2f C\r\n", temperature ); - log_printf( &logger, "\t--------------------------------------\r\n" ); - Delay_ms( 1000 ); + if ( ( C6DOFIMU17_OK == c6dofimu17_get_accel_data( &c6dofimu17, &accel_data ) ) && + ( C6DOFIMU17_OK == c6dofimu17_get_gyro_data( &c6dofimu17, &gyro_data ) ) && + ( C6DOFIMU17_OK == c6dofimu17_get_temperature( &c6dofimu17, &temperature ) ) ) + { + log_printf( &logger, "\t Accel X: %d\t|\tGyro X: %d\r\n", accel_data.x, gyro_data.x ); + log_printf( &logger, "\t Accel Y: %d\t|\tGyro Y: %d\r\n", accel_data.y, gyro_data.y ); + log_printf( &logger, "\t Accel Z: %d\t|\tGyro Z: %d\r\n", accel_data.z, gyro_data.z ); + log_printf( &logger, "\t- - - - - - - - - - - - - - - - - - -\r\n" ); + log_printf( &logger, "\t\t Temperature: %.2f C\r\n", temperature ); + log_printf( &logger, "\t--------------------------------------\r\n" ); + } + Delay_ms( 100 ); } ``` diff --git a/clicks/6dofimu17/doc/doxy/Doxyfile.doxy b/clicks/6dofimu17/doc/doxy/Doxyfile.doxy index dfd13f0187..1d211b609d 100644 --- a/clicks/6dofimu17/doc/doxy/Doxyfile.doxy +++ b/clicks/6dofimu17/doc/doxy/Doxyfile.doxy @@ -44,21 +44,21 @@ PROJECT_NUMBER = 2.0.0.0 # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = +PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = +PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = ../clicks/c6dofimu17/temp/Help/doc +OUTPUT_DIRECTORY = ../cmake/c6dofimu17/temp/Help/doc # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -162,7 +162,7 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -171,7 +171,7 @@ STRIP_FROM_PATH = # specify the list of include paths that are normally passed to the compiler # using the -I flag. -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't @@ -238,13 +238,13 @@ TAB_SIZE = 4 # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. -ALIASES = +ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. -TCL_SUBST = +TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For @@ -291,7 +291,7 @@ OPTIMIZE_OUTPUT_VHDL = NO # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. -EXTENSION_MAPPING = +EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable @@ -648,7 +648,7 @@ GENERATE_DEPRECATEDLIST= YES # sections, marked by \if ... \endif and \cond # ... \endcond blocks. -ENABLED_SECTIONS = +ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the @@ -690,7 +690,7 @@ SHOW_NAMESPACES = YES # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. -FILE_VERSION_FILTER = +FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated @@ -703,7 +703,7 @@ FILE_VERSION_FILTER = # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. -LAYOUT_FILE = +LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib @@ -713,7 +713,7 @@ LAYOUT_FILE = # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. -CITE_BIB_FILES = +CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages @@ -778,7 +778,7 @@ WARN_FORMAT = "$file:$line: $text" # messages should be written. If left blank the output is written to standard # error (stderr). -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files @@ -790,9 +790,9 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = ../clicks/c6dofimu17/example \ - ../clicks/c6dofimu17/lib/include \ - ../clicks/c6dofimu17/README.md +INPUT = ../cmake/c6dofimu17/example \ + ../cmake/c6dofimu17/lib_c6dofimu17/include \ + ../cmake/c6dofimu17/README.md # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -877,7 +877,7 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = +EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -893,7 +893,7 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the @@ -904,13 +904,13 @@ EXCLUDE_PATTERNS = # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* -EXCLUDE_SYMBOLS = +EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = ../clicks/c6dofimu17/example +EXAMPLE_PATH = ../cmake/c6dofimu17/example # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and @@ -930,7 +930,7 @@ EXAMPLE_RECURSIVE = YES # that contain images that are to be included in the documentation (see the # \image command). -IMAGE_PATH = +IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program @@ -951,7 +951,7 @@ IMAGE_PATH = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -INPUT_FILTER = +INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the @@ -964,7 +964,7 @@ INPUT_FILTER = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -FILTER_PATTERNS = +FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for @@ -979,14 +979,14 @@ FILTER_SOURCE_FILES = NO # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. -FILTER_SOURCE_PATTERNS = +FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = +USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing @@ -1091,7 +1091,7 @@ CLANG_ASSISTED_PARSING = NO # specified with INPUT and INCLUDE_PATH. # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. -CLANG_OPTIONS = +CLANG_OPTIONS = #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index @@ -1117,7 +1117,7 @@ COLS_IN_ALPHA_INDEX = 5 # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output @@ -1161,7 +1161,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = +HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard @@ -1171,7 +1171,7 @@ HTML_HEADER = # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = +HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of @@ -1183,7 +1183,7 @@ HTML_FOOTER = # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_STYLESHEET = +HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets @@ -1196,7 +1196,7 @@ HTML_STYLESHEET = # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = +HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note @@ -1206,7 +1206,7 @@ HTML_EXTRA_STYLESHEET = # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = +HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to @@ -1335,7 +1335,7 @@ GENERATE_HTMLHELP = NO # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_FILE = +CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, @@ -1343,7 +1343,7 @@ CHM_FILE = # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -HHC_LOCATION = +HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the master .chm file (NO). @@ -1356,7 +1356,7 @@ GENERATE_CHI = NO # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_INDEX_ENCODING = +CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it @@ -1387,7 +1387,7 @@ GENERATE_QHP = NO # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. -QCH_FILE = +QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace @@ -1412,7 +1412,7 @@ QHP_VIRTUAL_FOLDER = ./temp/Help/doc # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom @@ -1420,21 +1420,21 @@ QHP_CUST_FILTER_NAME = # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_ATTRS = +QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_SECT_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. -QHG_LOCATION = +QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To @@ -1567,7 +1567,7 @@ MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_EXTENSIONS = +MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site @@ -1575,7 +1575,7 @@ MATHJAX_EXTENSIONS = # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_CODEFILE = +MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and @@ -1635,7 +1635,7 @@ EXTERNAL_SEARCH = NO # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. -SEARCHENGINE_URL = +SEARCHENGINE_URL = # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed # search data is written to a file for indexing by an external tool. With the @@ -1651,7 +1651,7 @@ SEARCHDATA_FILE = searchdata.xml # projects and redirect the results back to the right project. # This tag requires that the tag SEARCHENGINE is set to YES. -EXTERNAL_SEARCH_ID = +EXTERNAL_SEARCH_ID = # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen # projects other than the one defined by this configuration file, but that are @@ -1661,7 +1661,7 @@ EXTERNAL_SEARCH_ID = # EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... # This tag requires that the tag SEARCHENGINE is set to YES. -EXTRA_SEARCH_MAPPINGS = +EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- # Configuration options related to the LaTeX output @@ -1725,7 +1725,7 @@ PAPER_TYPE = a4 # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. -EXTRA_PACKAGES = +EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for the # generated LaTeX document. The header should contain everything until the first @@ -1741,7 +1741,7 @@ EXTRA_PACKAGES = # to HTML_HEADER. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_HEADER = +LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the # generated LaTeX document. The footer should contain everything after the last @@ -1752,7 +1752,7 @@ LATEX_HEADER = # Note: Only use a user-defined footer if you know what you are doing! # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_FOOTER = +LATEX_FOOTER = # The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined # LaTeX style sheets that are included after the standard style sheets created @@ -1763,7 +1763,7 @@ LATEX_FOOTER = # list). # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_STYLESHEET = +LATEX_EXTRA_STYLESHEET = # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output @@ -1771,7 +1771,7 @@ LATEX_EXTRA_STYLESHEET = # markers available. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_FILES = +LATEX_EXTRA_FILES = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is # prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will @@ -1879,14 +1879,14 @@ RTF_HYPERLINKS = NO # default style sheet that doxygen normally uses. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_STYLESHEET_FILE = +RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is # similar to doxygen's config file. A template extensions file can be generated # using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_EXTENSIONS_FILE = +RTF_EXTENSIONS_FILE = # If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code # with syntax highlighting in the RTF output. @@ -1931,7 +1931,7 @@ MAN_EXTENSION = .3 # MAN_EXTENSION with the initial . removed. # This tag requires that the tag GENERATE_MAN is set to YES. -MAN_SUBDIR = +MAN_SUBDIR = # If the MAN_LINKS tag is set to YES and doxygen generates man output, then it # will generate one additional man file for each entity documented in the real @@ -2044,7 +2044,7 @@ PERLMOD_PRETTY = YES # overwrite each other's variables. # This tag requires that the tag GENERATE_PERLMOD is set to YES. -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor @@ -2085,7 +2085,7 @@ SEARCH_INCLUDES = YES # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = +INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the @@ -2093,7 +2093,7 @@ INCLUDE_PATH = # used. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -INCLUDE_FILE_PATTERNS = +INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that are # defined before the preprocessor is started (similar to the -D option of e.g. @@ -2103,7 +2103,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = +PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -2112,7 +2112,7 @@ PREDEFINED = # definition found in the source code. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will # remove all references to function-like macros that are alone on a line, have @@ -2141,13 +2141,13 @@ SKIP_FUNCTION_MACROS = YES # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. -TAGFILES = +TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create a # tag file that is based on the input files it reads. See section "Linking to # external documentation" for more information about the usage of tag files. -GENERATE_TAGFILE = +GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES, all external class will be listed in # the class index. If set to NO, only the inherited external classes will be @@ -2188,7 +2188,7 @@ CLASS_DIAGRAMS = YES # DIA_PATH tag allows you to specify the directory where the dia binary resides. # If left empty dia is assumed to be found in the default search path. -DIA_PATH = +DIA_PATH = # If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. @@ -2237,7 +2237,7 @@ DOT_FONTSIZE = 10 # the path where dot can find it using this tag. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTPATH = +DOT_FONTPATH = # If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for # each documented class showing the direct and indirect inheritance relations. @@ -2381,26 +2381,26 @@ INTERACTIVE_SVG = NO # found. If left blank, it is assumed the dot tool can be found in the path. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_PATH = +DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the \dotfile # command). # This tag requires that the tag HAVE_DOT is set to YES. -DOTFILE_DIRS = +DOTFILE_DIRS = # The MSCFILE_DIRS tag can be used to specify one or more directories that # contain msc files that are included in the documentation (see the \mscfile # command). -MSCFILE_DIRS = +MSCFILE_DIRS = # The DIAFILE_DIRS tag can be used to specify one or more directories that # contain dia files that are included in the documentation (see the \diafile # command). -DIAFILE_DIRS = +DIAFILE_DIRS = # When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the # path where java can find the plantuml.jar file. If left blank, it is assumed @@ -2408,17 +2408,17 @@ DIAFILE_DIRS = # generate a warning when it encounters a \startuml command in this case and # will not generate output for the diagram. -PLANTUML_JAR_PATH = +PLANTUML_JAR_PATH = # When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a # configuration file for plantuml. -PLANTUML_CFG_FILE = +PLANTUML_CFG_FILE = # When using plantuml, the specified paths are searched for files specified by # the !include statement in a plantuml block. -PLANTUML_INCLUDE_PATH = +PLANTUML_INCLUDE_PATH = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes diff --git a/clicks/6dofimu17/doc/package/manifest.json b/clicks/6dofimu17/doc/package/manifest.json index 178f6689cc..6d01237cc9 100644 --- a/clicks/6dofimu17/doc/package/manifest.json +++ b/clicks/6dofimu17/doc/package/manifest.json @@ -1,6 +1,6 @@ { - "architecture": "ARM|PIC|PIC32", - "category": "Motion", + "architecture": "ARM|PIC|PIC32|RISC-V|AVR", + "category": "Click Boards > Sensors > Motion", "changelog": "Resources/CHANGELOG.md", "contains": [ "libraries", @@ -8,8 +8,7 @@ "examples", "source_files" ], - "dependency_list": [ - ], + "dependency_list": [], "details": "Resources/DETAILS.md", "display_name": "6DOF IMU 17 click", "example_list": [ @@ -26,12 +25,11 @@ "name": "mikroe.click.c6dofimu17", "product_link": "https://www.mikroe.com/6dof-imu-17-click", "short_description": "6DOF IMU 17 Click is a compact add-on board that contains a 6-axis inertial measurement unit. This board features the IIM-42652, a 6-axis SmartIndustrial™ MotionTracking device that supports an extended operating temperature range for industrial applications from TDK InvenSense. It combines a 3-axis gyroscope and a 3-axis accelerometer featuring a 2K-byte FIFO that can lower the traffic on the serial bus interface (SPI or I2C) and reduce power consumption by allowing the system processor to burst read sensor data and then go into a low-power mode.", - "supported_compiler": "mikroC AI", + "supported_compiler": "mikroC AI|GCC", "type": "Library", - "_type":"mikroSDK Library", - "version": "2.0.0.5" + "_type": "mikroSDK Library", + "version": "2.1.0.5", + "cmake": true, + "alias": "Click.6DOFIMU17", + "subdir_name": "lib_c6dofimu17" } - - - - diff --git a/clicks/6dofimu17/example/CMakeLists.txt b/clicks/6dofimu17/example/CMakeLists.txt new file mode 100644 index 0000000000..1bca46af04 --- /dev/null +++ b/clicks/6dofimu17/example/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(example_c6dofimu17 LANGUAGES MikroC) +else() + project(example_c6dofimu17 LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_executable(example_c6dofimu17 + main.c + +) + + +############################ example_c6dofimu17 GENERATED CODE START ########################### +find_package(MikroC.Core REQUIRED) +target_link_libraries(example_c6dofimu17 PUBLIC MikroC.Core) +find_package(MikroSDK.Board REQUIRED) +target_link_libraries(example_c6dofimu17 PUBLIC MikroSDK.Board) +find_package(MikroSDK.Log REQUIRED) +target_link_libraries(example_c6dofimu17 PUBLIC MikroSDK.Log) +add_subdirectory(lib_c6dofimu17) +target_link_libraries(example_c6dofimu17 PUBLIC Click.6DOFIMU17) +############################ example_c6dofimu17 GENERATED CODE END ########################### diff --git a/clicks/6dofimu17/example/main.c b/clicks/6dofimu17/example/main.c index 2930ed6e7d..eb4e332779 100644 --- a/clicks/6dofimu17/example/main.c +++ b/clicks/6dofimu17/example/main.c @@ -22,7 +22,7 @@ * Measures and displays acceleration and gyroscope data for X-axis, Y-axis, and Z-axis * and the temperature in degrees Celsius. * Results are being sent to the USART terminal where the user can track their changes. - * This task repeats every 1 sec. + * This task repeats every 100 ms. * * @author Nenad Filipovic * @@ -92,18 +92,18 @@ void application_task ( void ) c6dofimu17_axis_t accel_data; c6dofimu17_axis_t gyro_data; float temperature; - - c6dofimu17_get_accel_data( &c6dofimu17, &accel_data ); - c6dofimu17_get_gyro_data( &c6dofimu17, &gyro_data ); - c6dofimu17_get_temperature( &c6dofimu17, &temperature ); - - log_printf( &logger, "\t Accel X: %d\t|\tGyro X: %d\r\n", accel_data.x, gyro_data.x ); - log_printf( &logger, "\t Accel Y: %d\t|\tGyro Y: %d\r\n", accel_data.y, gyro_data.y ); - log_printf( &logger, "\t Accel Z: %d\t|\tGyro Z: %d\r\n", accel_data.z, gyro_data.z ); - log_printf( &logger, "\t- - - - - - - - - - - - - - - - - - -\r\n" ); - log_printf( &logger, "\t\t Temperature: %.2f C\r\n", temperature ); - log_printf( &logger, "\t--------------------------------------\r\n" ); - Delay_ms( 1000 ); + if ( ( C6DOFIMU17_OK == c6dofimu17_get_accel_data( &c6dofimu17, &accel_data ) ) && + ( C6DOFIMU17_OK == c6dofimu17_get_gyro_data( &c6dofimu17, &gyro_data ) ) && + ( C6DOFIMU17_OK == c6dofimu17_get_temperature( &c6dofimu17, &temperature ) ) ) + { + log_printf( &logger, "\t Accel X: %d\t|\tGyro X: %d\r\n", accel_data.x, gyro_data.x ); + log_printf( &logger, "\t Accel Y: %d\t|\tGyro Y: %d\r\n", accel_data.y, gyro_data.y ); + log_printf( &logger, "\t Accel Z: %d\t|\tGyro Z: %d\r\n", accel_data.z, gyro_data.z ); + log_printf( &logger, "\t- - - - - - - - - - - - - - - - - - -\r\n" ); + log_printf( &logger, "\t\t Temperature: %.2f C\r\n", temperature ); + log_printf( &logger, "\t--------------------------------------\r\n" ); + } + Delay_ms( 100 ); } void main ( void ) diff --git a/clicks/6dofimu17/example/manifest.exm b/clicks/6dofimu17/example/manifest.exm index 22a10b9051..8335ca03b4 100644 --- a/clicks/6dofimu17/example/manifest.exm +++ b/clicks/6dofimu17/example/manifest.exm @@ -2,7 +2,7 @@ "name": "6DOF IMU 17 Click", "description": "6DOF IMU 17 Click is a compact add-on board that contains a 6-axis inertial measurement unit. This board features the IIM-42652, a 6-axis SmartIndustrial™ MotionTracking device that supports an extended operating temperature range for industrial applications from TDK InvenSense. It combines a 3-axis gyroscope and a 3-axis accelerometer featuring a 2K-byte FIFO that can lower the traffic on the serial bus interface (SPI or I2C) and reduce power consumption by allowing the system processor to burst read sensor data and then go into a low-power mode.", "image" : "../../Resources/click_icon.png", - "toolchain": ["mikrocarm","mikrocpic","mikrocpic32"], + "toolchain": ["mikrocarm","mikrocpic","mikrocpic32","gcc-riscv","mikrocavr"], "hw" : ["click","IIM-42652"], "category" : ["Motion"] } diff --git a/clicks/6dofimu17/example/memake.txt b/clicks/6dofimu17/example/memake.txt deleted file mode 100644 index 7d75cd17ac..0000000000 --- a/clicks/6dofimu17/example/memake.txt +++ /dev/null @@ -1,13 +0,0 @@ -type: executable -target: example_c6dofimu17 - -depends: { - MikroC.Core - MikroSDK.Board - MikroSDK.Log - Click.6DOFIMU17 -} - -sources: { - main.c -} diff --git a/clicks/6dofimu17/lib/memake.txt b/clicks/6dofimu17/lib/memake.txt deleted file mode 100644 index 38aecb82be..0000000000 --- a/clicks/6dofimu17/lib/memake.txt +++ /dev/null @@ -1,49 +0,0 @@ -type: library -target: lib_c6dofimu17 - -#begin python -import re - -if ( re.match("(^PIC18F(.+)[KQ]4[23]$)|(^PIC32(.+)$)",MEMAKE_MCU_NAME) ): - sample_mode_reg_case = "SAMPLE_REG_CASE_1" -else: - sample_mode_reg_case = "SAMPLE_REG_CASE_2" -#end python - -defines: { - <[sample_mode_reg_case]> -} - -sources: { - src/c6dofimu17.c -} - -headers: { - include/c6dofimu17.h -} - -include: { - include -} - -install: { - src(include/c6dofimu17.h) dst(include/c6dofimu17.h) - src(include/spi_specifics.h) dst(include/spi_specifics.h) -} - -expInclude: { - include -} - -depends: { - MikroC.Core - MikroSDK.Driver -} - -others: { - ../README.md - ../DETAILS.md - ../CHANGELOG.md -} - -alias: Click.6DOFIMU17 diff --git a/clicks/6dofimu17/lib_c6dofimu17/CMakeLists.txt b/clicks/6dofimu17/lib_c6dofimu17/CMakeLists.txt new file mode 100644 index 0000000000..216ce8bf3b --- /dev/null +++ b/clicks/6dofimu17/lib_c6dofimu17/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(lib_c6dofimu17 LANGUAGES MikroC) +else() + project(lib_c6dofimu17 LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_library(lib_c6dofimu17 STATIC + src/c6dofimu17.c + include/c6dofimu17.h +) +add_library(Click.6DOFIMU17 ALIAS lib_c6dofimu17) + +if (${MCU_NAME} MATCHES "(^PIC18F(.+)[KQ]4[23]$)|(^PIC32(.+)$)") + set(sample_mode_reg_case "SAMPLE_REG_CASE_1") +else() + set(sample_mode_reg_case "SAMPLE_REG_CASE_2") +endif() + +target_compile_definitions(lib_c6dofimu17 PUBLIC ${sample_mode_reg_case}) + + +target_include_directories(lib_c6dofimu17 PUBLIC + include +) + +find_package(MikroC.Core REQUIRED) +target_link_libraries(lib_c6dofimu17 PUBLIC MikroC.Core) +find_package(MikroSDK.Driver REQUIRED) +target_link_libraries(lib_c6dofimu17 PUBLIC MikroSDK.Driver) diff --git a/clicks/6dofimu17/lib_c6dofimu17/include/Click.6DOFIMU17 b/clicks/6dofimu17/lib_c6dofimu17/include/Click.6DOFIMU17 new file mode 100644 index 0000000000..d61e8dbbbf --- /dev/null +++ b/clicks/6dofimu17/lib_c6dofimu17/include/Click.6DOFIMU17 @@ -0,0 +1 @@ +#include "c6dofimu17.h" diff --git a/clicks/6dofimu17/lib/include/c6dofimu17.h b/clicks/6dofimu17/lib_c6dofimu17/include/c6dofimu17.h similarity index 98% rename from clicks/6dofimu17/lib/include/c6dofimu17.h rename to clicks/6dofimu17/lib_c6dofimu17/include/c6dofimu17.h index eae2f836ad..020f6497ac 100644 --- a/clicks/6dofimu17/lib/include/c6dofimu17.h +++ b/clicks/6dofimu17/lib_c6dofimu17/include/c6dofimu17.h @@ -635,7 +635,7 @@ err_t c6dofimu17_temperature_enable ( c6dofimu17_t *ctx ); * See #err_t definition for detailed explanation. * @note None. */ -err_t c6dofimu17_gyroscope_enable ( c6dofimu17_t *ctx ); +err_t c6dofimu17_gyro_enable ( c6dofimu17_t *ctx ); /** * @brief 6DOF IMU 17 accelerometer enable function. @@ -650,7 +650,7 @@ err_t c6dofimu17_gyroscope_enable ( c6dofimu17_t *ctx ); * See #err_t definition for detailed explanation. * @note None. */ -err_t c6dofimu17_accelerometer_enable ( c6dofimu17_t *ctx ); +err_t c6dofimu17_accel_enable ( c6dofimu17_t *ctx ); /** * @brief 6DOF IMU 17 set config gyroscope function. @@ -666,7 +666,7 @@ err_t c6dofimu17_accelerometer_enable ( c6dofimu17_t *ctx ); * See #err_t definition for detailed explanation. * @note None. */ -err_t c6dofimu17_set_config_gyroscope ( c6dofimu17_t *ctx, c6dofimu17_gyro_cfg_t gyro_cfg ); +err_t c6dofimu17_set_config_gyro ( c6dofimu17_t *ctx, c6dofimu17_gyro_cfg_t gyro_cfg ); /** * @brief 6DOF IMU 17 get config gyroscope function. @@ -682,7 +682,7 @@ err_t c6dofimu17_set_config_gyroscope ( c6dofimu17_t *ctx, c6dofimu17_gyro_cfg_t * See #err_t definition for detailed explanation. * @note None. */ -err_t c6dofimu17_get_config_gyroscope ( c6dofimu17_t *ctx, c6dofimu17_gyro_cfg_t *gyro_cfg ); +err_t c6dofimu17_get_config_gyro ( c6dofimu17_t *ctx, c6dofimu17_gyro_cfg_t *gyro_cfg ); /** * @brief 6DOF IMU 17 set config accelerometer function. @@ -698,7 +698,7 @@ err_t c6dofimu17_get_config_gyroscope ( c6dofimu17_t *ctx, c6dofimu17_gyro_cfg_t * See #err_t definition for detailed explanation. * @note None. */ -err_t c6dofimu17_set_config_accelerometer ( c6dofimu17_t *ctx, c6dofimu17_accel_cfg_t accel_cfg ); +err_t c6dofimu17_set_config_accel ( c6dofimu17_t *ctx, c6dofimu17_accel_cfg_t accel_cfg ); /** * @brief 6DOF IMU 17 get config accelerometer function. @@ -714,7 +714,7 @@ err_t c6dofimu17_set_config_accelerometer ( c6dofimu17_t *ctx, c6dofimu17_accel_ * See #err_t definition for detailed explanation. * @note None. */ -err_t c6dofimu17_get_config_accelerometer ( c6dofimu17_t *ctx, c6dofimu17_accel_cfg_t *accel_cfg ); +err_t c6dofimu17_get_config_accel ( c6dofimu17_t *ctx, c6dofimu17_accel_cfg_t *accel_cfg ); /** * @brief 6DOF IMU 17 soft reset function. diff --git a/clicks/6dofimu17/lib/include/spi_specifics.h b/clicks/6dofimu17/lib_c6dofimu17/include/spi_specifics.h similarity index 100% rename from clicks/6dofimu17/lib/include/spi_specifics.h rename to clicks/6dofimu17/lib_c6dofimu17/include/spi_specifics.h diff --git a/clicks/6dofimu17/lib/src/c6dofimu17.c b/clicks/6dofimu17/lib_c6dofimu17/src/c6dofimu17.c similarity index 94% rename from clicks/6dofimu17/lib/src/c6dofimu17.c rename to clicks/6dofimu17/lib_c6dofimu17/src/c6dofimu17.c index c3f1a72fd4..3c36748de6 100644 --- a/clicks/6dofimu17/lib/src/c6dofimu17.c +++ b/clicks/6dofimu17/lib_c6dofimu17/src/c6dofimu17.c @@ -135,7 +135,7 @@ void c6dofimu17_cfg_setup ( c6dofimu17_cfg_t *cfg ) cfg->spi_mode = SPI_MASTER_MODE_0; cfg->cs_polarity = SPI_MASTER_CHIP_SELECT_POLARITY_ACTIVE_LOW; - cfg->drv_sel = C6DOFIMU17_DRV_SEL_I2C; + cfg->drv_sel = C6DOFIMU17_DRV_SEL_SPI; } void c6dofimu17_drv_interface_selection ( c6dofimu17_cfg_t *cfg, c6dofimu17_drv_t drv_sel ) @@ -231,10 +231,10 @@ err_t c6dofimu17_default_cfg ( c6dofimu17_t *ctx ) c6dofimu17_temperature_enable( ctx ); c6dofimu17_config_delay( ); - c6dofimu17_gyroscope_enable( ctx ); + c6dofimu17_gyro_enable( ctx ); c6dofimu17_config_delay( ); - c6dofimu17_accelerometer_enable( ctx ); + c6dofimu17_accel_enable( ctx ); c6dofimu17_config_delay( ); gyro_cfg.gyro_fs_sel = C6DOFIMU17_SET_GYRO_FS_SEL_2000_dps; @@ -242,7 +242,7 @@ err_t c6dofimu17_default_cfg ( c6dofimu17_t *ctx ) gyro_cfg.gyro_ui_filt_ord = C6DOFIMU17_SET_GYRO_UI_FILT_ORD_2st; gyro_cfg.gyro_dec2_m2_ord = C6DOFIMU17_SET_GYRO_DEC2_M2_ORD_3st; gyro_cfg.gyro_ui_filt_bw = C6DOFIMU17_SET_GYRO_UI_FILT_BW_ODR_4; - c6dofimu17_set_config_gyroscope( ctx, gyro_cfg ); + c6dofimu17_set_config_gyro( ctx, gyro_cfg ); c6dofimu17_config_delay( ); accel_cfg.accel_fs_sel = C6DOFIMU17_SET_ACCEL_FS_SEL_16g; @@ -250,7 +250,7 @@ err_t c6dofimu17_default_cfg ( c6dofimu17_t *ctx ) accel_cfg.accel_ui_filt_bw = C6DOFIMU17_SET_ACCEL_UI_FILT_BW_ODR_4; accel_cfg.accel_ui_filt_ord = C6DOFIMU17_SET_ACCEL_UI_FILT_ORD_2st; accel_cfg.accel_dec2_m2_ord = C6DOFIMU17_SET_ACCEL_DEC2_M2_ORD_3st; - c6dofimu17_set_config_accelerometer( ctx, accel_cfg ); + c6dofimu17_set_config_accel( ctx, accel_cfg ); c6dofimu17_config_delay( ); return C6DOFIMU17_OK; @@ -272,10 +272,7 @@ err_t c6dofimu17_bank_selection ( c6dofimu17_t *ctx, uint8_t bank_sel ) { return C6DOFIMU17_ERROR; } - - err_t err_flag = c6dofimu17_generic_write( ctx, C6DOFIMU17_REG_BANK_SEL, &bank_sel, 1 ); - - return err_flag; + return c6dofimu17_generic_write( ctx, C6DOFIMU17_REG_BANK_SEL, &bank_sel, 1 ); } uint8_t c6dofimu17_get_interrupt ( c6dofimu17_t *ctx ) @@ -285,9 +282,7 @@ uint8_t c6dofimu17_get_interrupt ( c6dofimu17_t *ctx ) err_t c6dofimu17_get_device_id ( c6dofimu17_t *ctx, uint8_t *device_id ) { - err_t err_flag = c6dofimu17_generic_read( ctx, C6DOFIMU17_REG_WHO_AM_I, device_id, 1 ); - - return err_flag; + return c6dofimu17_generic_read( ctx, C6DOFIMU17_REG_WHO_AM_I, device_id, 1 ); } err_t c6dofimu17_temperature_enable ( c6dofimu17_t *ctx ) @@ -303,7 +298,7 @@ err_t c6dofimu17_temperature_enable ( c6dofimu17_t *ctx ) return err_flag; } -err_t c6dofimu17_gyroscope_enable ( c6dofimu17_t *ctx ) +err_t c6dofimu17_gyro_enable ( c6dofimu17_t *ctx ) { uint8_t tmp; @@ -316,7 +311,7 @@ err_t c6dofimu17_gyroscope_enable ( c6dofimu17_t *ctx ) return err_flag; } -err_t c6dofimu17_accelerometer_enable ( c6dofimu17_t *ctx ) +err_t c6dofimu17_accel_enable ( c6dofimu17_t *ctx ) { uint8_t tmp; @@ -329,7 +324,7 @@ err_t c6dofimu17_accelerometer_enable ( c6dofimu17_t *ctx ) return err_flag; } -err_t c6dofimu17_set_config_gyroscope ( c6dofimu17_t *ctx, c6dofimu17_gyro_cfg_t gyro_cfg ) +err_t c6dofimu17_set_config_gyro ( c6dofimu17_t *ctx, c6dofimu17_gyro_cfg_t gyro_cfg ) { uint8_t tmp; @@ -352,7 +347,7 @@ err_t c6dofimu17_set_config_gyroscope ( c6dofimu17_t *ctx, c6dofimu17_gyro_cfg_t return err_flag; } -err_t c6dofimu17_get_config_gyroscope ( c6dofimu17_t *ctx, c6dofimu17_gyro_cfg_t *gyro_cfg ) +err_t c6dofimu17_get_config_gyro ( c6dofimu17_t *ctx, c6dofimu17_gyro_cfg_t *gyro_cfg ) { uint8_t tmp; @@ -373,7 +368,7 @@ err_t c6dofimu17_get_config_gyroscope ( c6dofimu17_t *ctx, c6dofimu17_gyro_cfg_t return err_flag; } -err_t c6dofimu17_set_config_accelerometer ( c6dofimu17_t *ctx, c6dofimu17_accel_cfg_t accel_cfg ) +err_t c6dofimu17_set_config_accel ( c6dofimu17_t *ctx, c6dofimu17_accel_cfg_t accel_cfg ) { uint8_t tmp; @@ -396,7 +391,7 @@ err_t c6dofimu17_set_config_accelerometer ( c6dofimu17_t *ctx, c6dofimu17_accel_ return err_flag; } -err_t c6dofimu17_get_config_accelerometer ( c6dofimu17_t *ctx, c6dofimu17_accel_cfg_t *accel_cfg ) +err_t c6dofimu17_get_config_accel ( c6dofimu17_t *ctx, c6dofimu17_accel_cfg_t *accel_cfg ) { uint8_t tmp; @@ -547,7 +542,6 @@ static err_t c6dofimu17_spi_read ( c6dofimu17_t *ctx, uint8_t reg, uint8_t *data spi_master_select_device( ctx->chip_select ); err_t error_flag = spi_master_write_then_read( &ctx->spi, ®_adr, 1, data_out, len ); spi_master_deselect_device( ctx->chip_select ); - return error_flag; } diff --git a/clicks/6dofimu17/memake.txt b/clicks/6dofimu17/memake.txt deleted file mode 100644 index f5e4fc48c2..0000000000 --- a/clicks/6dofimu17/memake.txt +++ /dev/null @@ -1,8 +0,0 @@ -type: subdirs - -project: 6DOFIMU17 - -subdirs: { - lib - example -} diff --git a/clicks/7segrgb/CHANGELOG.md b/clicks/7segrgb/CHANGELOG.md index 0e0081a0b3..400d5062a0 100644 --- a/clicks/7segrgb/CHANGELOG.md +++ b/clicks/7segrgb/CHANGELOG.md @@ -1,4 +1,4 @@ ## Changelog -### Version 2.0.0.11 +### Version 2.1.0.12 - Initial release diff --git a/clicks/7segrgb/CMakeLists.txt b/clicks/7segrgb/CMakeLists.txt new file mode 100644 index 0000000000..0865ccdf75 --- /dev/null +++ b/clicks/7segrgb/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(example_c7segrgb LANGUAGES MikroC) +else() + project(example_c7segrgb LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_executable(example_c7segrgb + example/main.c + +) + + +############################ example_c7segrgb GENERATED CODE START ########################### +find_package(MikroC.Core REQUIRED) +target_link_libraries(example_c7segrgb PUBLIC MikroC.Core) +find_package(MikroSDK.Board REQUIRED) +target_link_libraries(example_c7segrgb PUBLIC MikroSDK.Board) +find_package(MikroSDK.Log REQUIRED) +target_link_libraries(example_c7segrgb PUBLIC MikroSDK.Log) +add_subdirectory(lib_c7segrgb) +target_link_libraries(example_c7segrgb PUBLIC Click.7SegRgb) +############################ example_c7segrgb GENERATED CODE END ########################### diff --git a/clicks/7segrgb/DETAILS.md b/clicks/7segrgb/DETAILS.md index 8301dc2914..8cf8bc67b6 100644 --- a/clicks/7segrgb/DETAILS.md +++ b/clicks/7segrgb/DETAILS.md @@ -35,23 +35,27 @@ Package can be downloaded/installed directly form compilers IDE(recommended way) #### Standard key functions : -- Config Object Initialization function. -> void c7segrgb_cfg_setup ( c7segrgb_cfg_t *cfg ); - -- Initialization function. -> C7SEGRGB_RETVAL c7segrgb_init ( c7segrgb_t *ctx, c7segrgb_cfg_t *cfg ); - -- Click Default Configuration function. -> void c7segrgb_default_cfg ( c7segrgb_t *ctx ); +- `c7segrgb_cfg_setup` This function initializes click configuration structure to init state. +```c +void c7segrgb_cfg_setup ( c7segrgb_cfg_t *cfg ); +``` +- `c7segrgb_init` This function initializes all necessary pins and peripherals used for this click. +```c +err_t c7segrgb_init ( c7segrgb_t *ctx, c7segrgb_cfg_t *cfg ); +``` #### Example key functions : -- The function sets character and it's color. -> void c7segrgb_set_num ( c7segrgb_t *ctx, uint8_t character, uint8_t green_brightness, uint8_t red_brightness, uint8_t blue_brightness ); +- `c7segrgb_set_num` The function sets character and its color. +```c +void c7segrgb_set_num ( c7segrgb_t *ctx, uint8_t character, uint8_t green_brightness, uint8_t red_brightness, uint8_t blue_brightness ); +``` - - The function sets the state and color of every segment from click board object segment array data. -> void c7segrgb_set_seven_seg ( c7segrgb_t *ctx ); +- `c7segrgb_set_seven_seg` The function sets the state and color of every segment from click board object segment array data. +```c +void c7segrgb_set_seven_seg ( c7segrgb_t *ctx ); +``` ## Examples Description @@ -68,25 +72,9 @@ Package can be downloaded/installed directly form compilers IDE(recommended way) void application_init ( void ) { - log_cfg_t log_cfg; c7segrgb_cfg_t cfg; - /** - * Logger initialization. - * Default baud rate: 115200 - * Default log level: LOG_LEVEL_DEBUG - * @note If USB_UART_RX and USB_UART_TX - * are defined as HAL_PIN_NC, you will - * need to define them manually for log to work. - * See @b LOG_MAP_USB_UART macro definition for detailed explanation. - */ - LOG_MAP_USB_UART( log_cfg ); - log_init( &logger, &log_cfg ); - log_info( &logger, "---- Application Init ----" ); - // Click initialization. - - c7segrgb_cfg_setup( &cfg ); cfg.logic_one = &logic_one; cfg.logic_zero = &logic_zero; @@ -112,12 +100,9 @@ void application_init ( void ) void application_task ( void ) { - uint8_t cnt_i; - uint8_t cnt_j; - - for ( cnt_i = 0; cnt_i < 10; cnt_i++ ) + for ( uint8_t cnt_i = 0; cnt_i < 10; cnt_i++ ) { - for ( cnt_j = 10; cnt_j > 0; cnt_j-- ) + for ( uint8_t cnt_j = 10; cnt_j > 0; cnt_j-- ) { c7segrgb_set_num( &c7segrgb, CHARACTER_TABLE[ cnt_i ], 4 * cnt_i, 4 * cnt_j, cnt_i * cnt_j ); Delay_ms( 100 ); @@ -156,8 +141,6 @@ void application_task ( void ) c7segrgb_set_num( &c7segrgb, C7SEGRGB_NINE, 20, 10, 30 ); Delay_ms( 1000 ); - - c7segrgb_pwm_low( &c7segrgb ); } ``` diff --git a/clicks/7segrgb/README.md b/clicks/7segrgb/README.md index 6fdbed686c..3247835778 100644 --- a/clicks/7segrgb/README.md +++ b/clicks/7segrgb/README.md @@ -36,23 +36,27 @@ Package can be downloaded/installed directly form compilers IDE(recommended way) #### Standard key functions : -- Config Object Initialization function. -> void c7segrgb_cfg_setup ( c7segrgb_cfg_t *cfg ); - -- Initialization function. -> C7SEGRGB_RETVAL c7segrgb_init ( c7segrgb_t *ctx, c7segrgb_cfg_t *cfg ); - -- Click Default Configuration function. -> void c7segrgb_default_cfg ( c7segrgb_t *ctx ); +- `c7segrgb_cfg_setup` This function initializes click configuration structure to init state. +```c +void c7segrgb_cfg_setup ( c7segrgb_cfg_t *cfg ); +``` +- `c7segrgb_init` This function initializes all necessary pins and peripherals used for this click. +```c +err_t c7segrgb_init ( c7segrgb_t *ctx, c7segrgb_cfg_t *cfg ); +``` #### Example key functions : -- The function sets character and it's color. -> void c7segrgb_set_num ( c7segrgb_t *ctx, uint8_t character, uint8_t green_brightness, uint8_t red_brightness, uint8_t blue_brightness ); +- `c7segrgb_set_num` The function sets character and its color. +```c +void c7segrgb_set_num ( c7segrgb_t *ctx, uint8_t character, uint8_t green_brightness, uint8_t red_brightness, uint8_t blue_brightness ); +``` - - The function sets the state and color of every segment from click board object segment array data. -> void c7segrgb_set_seven_seg ( c7segrgb_t *ctx ); +- `c7segrgb_set_seven_seg` The function sets the state and color of every segment from click board object segment array data. +```c +void c7segrgb_set_seven_seg ( c7segrgb_t *ctx ); +``` ## Examples Description @@ -69,25 +73,9 @@ Package can be downloaded/installed directly form compilers IDE(recommended way) void application_init ( void ) { - log_cfg_t log_cfg; c7segrgb_cfg_t cfg; - /** - * Logger initialization. - * Default baud rate: 115200 - * Default log level: LOG_LEVEL_DEBUG - * @note If USB_UART_RX and USB_UART_TX - * are defined as HAL_PIN_NC, you will - * need to define them manually for log to work. - * See @b LOG_MAP_USB_UART macro definition for detailed explanation. - */ - LOG_MAP_USB_UART( log_cfg ); - log_init( &logger, &log_cfg ); - log_info( &logger, "---- Application Init ----" ); - // Click initialization. - - c7segrgb_cfg_setup( &cfg ); cfg.logic_one = &logic_one; cfg.logic_zero = &logic_zero; @@ -113,12 +101,9 @@ void application_init ( void ) void application_task ( void ) { - uint8_t cnt_i; - uint8_t cnt_j; - - for ( cnt_i = 0; cnt_i < 10; cnt_i++ ) + for ( uint8_t cnt_i = 0; cnt_i < 10; cnt_i++ ) { - for ( cnt_j = 10; cnt_j > 0; cnt_j-- ) + for ( uint8_t cnt_j = 10; cnt_j > 0; cnt_j-- ) { c7segrgb_set_num( &c7segrgb, CHARACTER_TABLE[ cnt_i ], 4 * cnt_i, 4 * cnt_j, cnt_i * cnt_j ); Delay_ms( 100 ); @@ -157,8 +142,6 @@ void application_task ( void ) c7segrgb_set_num( &c7segrgb, C7SEGRGB_NINE, 20, 10, 30 ); Delay_ms( 1000 ); - - c7segrgb_pwm_low( &c7segrgb ); } ``` diff --git a/clicks/7segrgb/doc/doxy/Doxyfile.doxy b/clicks/7segrgb/doc/doxy/Doxyfile.doxy index facfc073af..cd5cef7907 100644 --- a/clicks/7segrgb/doc/doxy/Doxyfile.doxy +++ b/clicks/7segrgb/doc/doxy/Doxyfile.doxy @@ -44,21 +44,21 @@ PROJECT_NUMBER = 2.0.0.0 # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = +PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = +PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = ../clicks/c7segrgb/temp/Help/doc +OUTPUT_DIRECTORY = ../cmake/c7segrgb/temp/Help/doc # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -162,7 +162,7 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -171,7 +171,7 @@ STRIP_FROM_PATH = # specify the list of include paths that are normally passed to the compiler # using the -I flag. -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't @@ -238,13 +238,13 @@ TAB_SIZE = 4 # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. -ALIASES = +ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. -TCL_SUBST = +TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For @@ -291,7 +291,7 @@ OPTIMIZE_OUTPUT_VHDL = NO # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. -EXTENSION_MAPPING = +EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable @@ -648,7 +648,7 @@ GENERATE_DEPRECATEDLIST= YES # sections, marked by \if ... \endif and \cond # ... \endcond blocks. -ENABLED_SECTIONS = +ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the @@ -690,7 +690,7 @@ SHOW_NAMESPACES = YES # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. -FILE_VERSION_FILTER = +FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated @@ -703,7 +703,7 @@ FILE_VERSION_FILTER = # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. -LAYOUT_FILE = +LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib @@ -713,7 +713,7 @@ LAYOUT_FILE = # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. -CITE_BIB_FILES = +CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages @@ -778,7 +778,7 @@ WARN_FORMAT = "$file:$line: $text" # messages should be written. If left blank the output is written to standard # error (stderr). -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files @@ -790,9 +790,9 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = ../clicks/c7segrgb/example \ - ../clicks/c7segrgb/lib/include \ - ../clicks/c7segrgb/README.md +INPUT = ../cmake/c7segrgb/example \ + ../cmake/c7segrgb/lib_c7segrgb/include \ + ../cmake/c7segrgb/README.md # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -877,7 +877,7 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = +EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -893,7 +893,7 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the @@ -904,13 +904,13 @@ EXCLUDE_PATTERNS = # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* -EXCLUDE_SYMBOLS = +EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = ../clicks/c7segrgb/example +EXAMPLE_PATH = ../cmake/c7segrgb/example # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and @@ -930,7 +930,7 @@ EXAMPLE_RECURSIVE = YES # that contain images that are to be included in the documentation (see the # \image command). -IMAGE_PATH = +IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program @@ -951,7 +951,7 @@ IMAGE_PATH = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -INPUT_FILTER = +INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the @@ -964,7 +964,7 @@ INPUT_FILTER = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -FILTER_PATTERNS = +FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for @@ -979,14 +979,14 @@ FILTER_SOURCE_FILES = NO # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. -FILTER_SOURCE_PATTERNS = +FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = +USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing @@ -1091,7 +1091,7 @@ CLANG_ASSISTED_PARSING = NO # specified with INPUT and INCLUDE_PATH. # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. -CLANG_OPTIONS = +CLANG_OPTIONS = #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index @@ -1117,7 +1117,7 @@ COLS_IN_ALPHA_INDEX = 5 # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output @@ -1161,7 +1161,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = +HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard @@ -1171,7 +1171,7 @@ HTML_HEADER = # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = +HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of @@ -1183,7 +1183,7 @@ HTML_FOOTER = # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_STYLESHEET = +HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets @@ -1196,7 +1196,7 @@ HTML_STYLESHEET = # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = +HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note @@ -1206,7 +1206,7 @@ HTML_EXTRA_STYLESHEET = # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = +HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to @@ -1335,7 +1335,7 @@ GENERATE_HTMLHELP = YES # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_FILE = +CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, @@ -1343,7 +1343,7 @@ CHM_FILE = # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -HHC_LOCATION = +HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the master .chm file (NO). @@ -1356,7 +1356,7 @@ GENERATE_CHI = NO # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_INDEX_ENCODING = +CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it @@ -1387,7 +1387,7 @@ GENERATE_QHP = NO # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. -QCH_FILE = +QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace @@ -1412,7 +1412,7 @@ QHP_VIRTUAL_FOLDER = ./temp/Help/doc # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom @@ -1420,21 +1420,21 @@ QHP_CUST_FILTER_NAME = # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_ATTRS = +QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_SECT_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. -QHG_LOCATION = +QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To @@ -1567,7 +1567,7 @@ MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_EXTENSIONS = +MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site @@ -1575,7 +1575,7 @@ MATHJAX_EXTENSIONS = # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_CODEFILE = +MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and @@ -1635,7 +1635,7 @@ EXTERNAL_SEARCH = NO # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. -SEARCHENGINE_URL = +SEARCHENGINE_URL = # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed # search data is written to a file for indexing by an external tool. With the @@ -1651,7 +1651,7 @@ SEARCHDATA_FILE = searchdata.xml # projects and redirect the results back to the right project. # This tag requires that the tag SEARCHENGINE is set to YES. -EXTERNAL_SEARCH_ID = +EXTERNAL_SEARCH_ID = # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen # projects other than the one defined by this configuration file, but that are @@ -1661,7 +1661,7 @@ EXTERNAL_SEARCH_ID = # EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... # This tag requires that the tag SEARCHENGINE is set to YES. -EXTRA_SEARCH_MAPPINGS = +EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- # Configuration options related to the LaTeX output @@ -1725,7 +1725,7 @@ PAPER_TYPE = a4 # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. -EXTRA_PACKAGES = +EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for the # generated LaTeX document. The header should contain everything until the first @@ -1741,7 +1741,7 @@ EXTRA_PACKAGES = # to HTML_HEADER. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_HEADER = +LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the # generated LaTeX document. The footer should contain everything after the last @@ -1752,7 +1752,7 @@ LATEX_HEADER = # Note: Only use a user-defined footer if you know what you are doing! # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_FOOTER = +LATEX_FOOTER = # The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined # LaTeX style sheets that are included after the standard style sheets created @@ -1763,7 +1763,7 @@ LATEX_FOOTER = # list). # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_STYLESHEET = +LATEX_EXTRA_STYLESHEET = # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output @@ -1771,7 +1771,7 @@ LATEX_EXTRA_STYLESHEET = # markers available. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_FILES = +LATEX_EXTRA_FILES = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is # prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will @@ -1879,14 +1879,14 @@ RTF_HYPERLINKS = NO # default style sheet that doxygen normally uses. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_STYLESHEET_FILE = +RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is # similar to doxygen's config file. A template extensions file can be generated # using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_EXTENSIONS_FILE = +RTF_EXTENSIONS_FILE = # If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code # with syntax highlighting in the RTF output. @@ -1931,7 +1931,7 @@ MAN_EXTENSION = .3 # MAN_EXTENSION with the initial . removed. # This tag requires that the tag GENERATE_MAN is set to YES. -MAN_SUBDIR = +MAN_SUBDIR = # If the MAN_LINKS tag is set to YES and doxygen generates man output, then it # will generate one additional man file for each entity documented in the real @@ -2044,7 +2044,7 @@ PERLMOD_PRETTY = YES # overwrite each other's variables. # This tag requires that the tag GENERATE_PERLMOD is set to YES. -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor @@ -2085,7 +2085,7 @@ SEARCH_INCLUDES = YES # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = +INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the @@ -2093,7 +2093,7 @@ INCLUDE_PATH = # used. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -INCLUDE_FILE_PATTERNS = +INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that are # defined before the preprocessor is started (similar to the -D option of e.g. @@ -2103,7 +2103,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = +PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -2112,7 +2112,7 @@ PREDEFINED = # definition found in the source code. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will # remove all references to function-like macros that are alone on a line, have @@ -2141,13 +2141,13 @@ SKIP_FUNCTION_MACROS = YES # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. -TAGFILES = +TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create a # tag file that is based on the input files it reads. See section "Linking to # external documentation" for more information about the usage of tag files. -GENERATE_TAGFILE = +GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES, all external class will be listed in # the class index. If set to NO, only the inherited external classes will be @@ -2196,14 +2196,14 @@ CLASS_DIAGRAMS = YES # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. -MSCGEN_PATH = +MSCGEN_PATH = # You can include diagrams made with dia in doxygen documentation. Doxygen will # then run dia to produce the diagram and insert it in the documentation. The # DIA_PATH tag allows you to specify the directory where the dia binary resides. # If left empty dia is assumed to be found in the default search path. -DIA_PATH = +DIA_PATH = # If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. @@ -2252,7 +2252,7 @@ DOT_FONTSIZE = 10 # the path where dot can find it using this tag. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTPATH = +DOT_FONTPATH = # If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for # each documented class showing the direct and indirect inheritance relations. @@ -2396,26 +2396,26 @@ INTERACTIVE_SVG = NO # found. If left blank, it is assumed the dot tool can be found in the path. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_PATH = +DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the \dotfile # command). # This tag requires that the tag HAVE_DOT is set to YES. -DOTFILE_DIRS = +DOTFILE_DIRS = # The MSCFILE_DIRS tag can be used to specify one or more directories that # contain msc files that are included in the documentation (see the \mscfile # command). -MSCFILE_DIRS = +MSCFILE_DIRS = # The DIAFILE_DIRS tag can be used to specify one or more directories that # contain dia files that are included in the documentation (see the \diafile # command). -DIAFILE_DIRS = +DIAFILE_DIRS = # When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the # path where java can find the plantuml.jar file. If left blank, it is assumed @@ -2423,17 +2423,17 @@ DIAFILE_DIRS = # generate a warning when it encounters a \startuml command in this case and # will not generate output for the diagram. -PLANTUML_JAR_PATH = +PLANTUML_JAR_PATH = # When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a # configuration file for plantuml. -PLANTUML_CFG_FILE = +PLANTUML_CFG_FILE = # When using plantuml, the specified paths are searched for files specified by # the !include statement in a plantuml block. -PLANTUML_INCLUDE_PATH = +PLANTUML_INCLUDE_PATH = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes @@ -2494,7 +2494,3 @@ GENERATE_LEGEND = YES # This tag requires that the tag HAVE_DOT is set to YES. DOT_CLEANUP = YES - - - - diff --git a/clicks/7segrgb/doc/package/manifest.json b/clicks/7segrgb/doc/package/manifest.json index e808a00cb9..2920c31117 100644 --- a/clicks/7segrgb/doc/package/manifest.json +++ b/clicks/7segrgb/doc/package/manifest.json @@ -1,6 +1,6 @@ { - "architecture": "ARM|PIC32", - "category": "LED segment", + "architecture": "ARM|PIC32|RISC-V", + "category": "Click Boards > Display & LED > LED segment", "changelog": "Resources/CHANGELOG.md", "contains": [ "libraries", @@ -8,8 +8,7 @@ "examples", "source_files" ], - "dependency_list": [ - ], +"dependency_list": [], "details": "Resources/DETAILS.md", "display_name": "7-SEG RGB click", "example_list": [ @@ -26,23 +25,14 @@ "name": "mikroe.click.c7segrgb", "product_link": "https://www.mikroe.com/7-seg-rgb-click", "short_description": "7-SEG RGB click carries a full color single 7 segment digit display. The click is designed to run on either 3.3V or 5V power supply. It communicates with the target microcontroller over the CS, and PWM pin on the mikroBUS™ line.", - "supported_compiler": "mikroC AI", + "supported_compiler": "mikroC AI|GCC", "type": "Library", - "_type":"mikroSDK Library", - "related_projects":[ + "_type": "mikroSDK Library", + "related_projects": [ 2135 ], - "_type": "mikroSDK Library", - "version": "2.0.0.11" + "version": "2.1.0.12", + "cmake": true, + "alias": "Click.7SegRgb", + "subdir_name": "lib_c7segrgb" } - - - - - - - - - - - diff --git a/clicks/7segrgb/example/CMakeLists.txt b/clicks/7segrgb/example/CMakeLists.txt new file mode 100644 index 0000000000..9d81a1d017 --- /dev/null +++ b/clicks/7segrgb/example/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(example_c7segrgb LANGUAGES MikroC) +else() + project(example_c7segrgb LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_executable(example_c7segrgb + main.c + +) + + +############################ example_c7segrgb GENERATED CODE START ########################### +find_package(MikroC.Core REQUIRED) +target_link_libraries(example_c7segrgb PUBLIC MikroC.Core) +find_package(MikroSDK.Board REQUIRED) +target_link_libraries(example_c7segrgb PUBLIC MikroSDK.Board) +find_package(MikroSDK.Log REQUIRED) +target_link_libraries(example_c7segrgb PUBLIC MikroSDK.Log) +add_subdirectory(lib_c7segrgb) +target_link_libraries(example_c7segrgb PUBLIC Click.7SegRgb) +############################ example_c7segrgb GENERATED CODE END ########################### diff --git a/clicks/7segrgb/example/main.c b/clicks/7segrgb/example/main.c index 159d3e4475..faad2e1447 100644 --- a/clicks/7segrgb/example/main.c +++ b/clicks/7segrgb/example/main.c @@ -16,7 +16,7 @@ * This is an example which demonstrates the use of 7-SEG RGB Click board. * This simple example shows all ten digits in different colors on 7-SEG RGB click. * - * *note:* + * @note *

  * Additional Functions :
  * void logic_one ( )  - Generic logic one function.
@@ -30,18 +30,18 @@
  *     4|   |2
  *      |_3_|.7
  * 
- * Timeing sequence chart:
+ * Timing sequence chart:
  *          -----------|     T0L
  *              T0H    |______________
  * Logic 0: 
- *          T0H ~ 250-550ns
- *          T0L ~ 700-1000ns
+ *          T0H: 400ns (+/-150ns)
+ *          T0L: 850ns (+/-150ns)
  * 
  *          -----------|     T1L
  *              T1H    |______________
  * Logic 1: 
- *          T1H ~ 700-1000ns
- *          T1L ~ 250-550ns
+ *          T1H: 850ns (+/-150ns)
+ *          T1L: 400ns (+/-150ns)
  * 
  * \author MikroE Team
  *
@@ -49,60 +49,131 @@
 // ------------------------------------------------------------------- INCLUDES
 
 #include "board.h"
-#include "log.h"
 #include "c7segrgb.h"
 
-#ifdef __MIKROC_AI_FOR_ARM__
-
-#ifdef __STM32__/*< STM32F407ZG*/
-
-#define D_S    3
-#define D_L    9
-
-#define DELAY_SHORT \
-    Delay_Cyc( D_S );
-    
-#define DELAY_LONG \
-    Delay_Cyc( D_L );
-    
-#elif __KINETIS__/*< MKV58F1M0VLQ24*/
-    
-#define D_S    2
-#define D_L    11
-
-#define DELAY_SHORT \
-    Delay_Cyc( D_S );
-    
-#define DELAY_LONG \
-    Delay_Cyc( D_L );
-    
+// Delay adjustment for specific systems.
+#ifdef STM32F407ZG
+    /*< Adjusted for STM32F407ZG */
+    #define DELAY_TOH Delay_Cyc( 5 );   // ~400ns
+    #define DELAY_TOL Delay_Cyc( 8 );   // ~860ns
+    #define DELAY_T1H Delay_Cyc( 13 );  // ~880ns
+    #define DELAY_T1L                   // ~420ns
+#elif MK64FN1M0VDC12
+    /*< Adjusted for MK64FN1M0VDC12 */
+    #define DELAY_TOH \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop;                // ~400ns
+    #define DELAY_TOL Delay_Cyc( 4 );   // ~880ns
+    #define DELAY_T1H Delay_Cyc( 8 );   // ~840ns
+    #define DELAY_T1L                   // ~500ns
+#elif TM4C129XNCZAD
+    /*< Adjusted for TM4C129XNCZAD */
+    #define DELAY_TOH \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop;                // ~400ns
+    #define DELAY_TOL                   // ~880ns
+    #define DELAY_T1H Delay_Cyc( 6 );   // ~840ns
+    #define DELAY_T1L                   // ~880ns
+#elif GD32VF103VBT6
+    /*< Adjusted for GD32VF103VBT6 */
+    #define DELAY_TOH \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop");             // ~400ns
+    #define DELAY_TOL \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop"); \
+                asm("nop");             // ~840ns
+    #define DELAY_T1H Delay_Cyc( 4 );   // ~880ns
+    #define DELAY_T1L                   // ~620ns
+#elif PIC32MX795F512L
+    /*< Adjusted for PIC32MX795F512L */
+    #define DELAY_TOH \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop; \
+                asm nop;                // ~400ns
+    #define DELAY_TOL                   // ~1020ns
+    #define DELAY_T1H Delay_Cyc( 4 );   // ~880ns
+    #define DELAY_T1L                   // ~1020ns
+#else
+    #error "Logic delays are not defined for the selected system"
 #endif
 
-#elif __MIKROC_AI_FOR_PIC32__ /*< PIC32MZ2048EFH144 */
-
-#define D_L    4
-    
-#define DELAY_SHORT \
-    asm nop
-    
-#define DELAY_LONG \
-    Delay_Cyc( D_L );
-#endif
-    
-/*< You need to define long and short delay */
-#if !defined(DELAY_SHORT) && !defined(DELAY_LONG)
-
-#define DELAY_SHORT     
-#define DELAY_LONG 
-
-#endif
-
-
-
 // ------------------------------------------------------------------ VARIABLES
 
 static c7segrgb_t c7segrgb;
-static log_t logger;
 
 static uint8_t CHARACTER_TABLE[ 10 ] = 
 {
@@ -118,60 +189,43 @@ static uint8_t CHARACTER_TABLE[ 10 ] =
     0x6F  // '9'
 };
                                        
-static c7segrgb_segment_t segments_data[ 8 ] = {
-    { true , 40, 0, 0},
-    { true , 0, 40, 0},
-    { true , 0, 0, 40},
-    { true , 10, 40, 40},
-    { true , 40, 10, 40},
-    { true , 40, 40, 10},
-    { true , 10, 20, 30},
-    { true , 30, 20, 10}
+static c7segrgb_segment_t segments_data[ 8 ] = 
+{
+    { true, 40, 0, 0 },
+    { true, 0, 40, 0 },
+    { true, 0, 0, 40 },
+    { true, 10, 40, 40 },
+    { true, 40, 10, 40 },
+    { true, 40, 40, 10 },
+    { true, 10, 20, 30 },
+    { true, 30, 20, 10 }
 };
 
 // ------------------------------------------------------- ADDITIONAL FUNCTIONS
 
 void logic_one ( void )
 {
-    digital_out_high( &c7segrgb.pwm );
-    DELAY_LONG;
-    
-    digital_out_low( &c7segrgb.pwm);
-    DELAY_SHORT;
+    hal_ll_gpio_set_pin_output( &c7segrgb.pwm.pin );
+    DELAY_T1H;
+    hal_ll_gpio_clear_pin_output( &c7segrgb.pwm.pin );
+    DELAY_T1L;
 }
 
 void logic_zero ( void )
 {
-    digital_out_high( &c7segrgb.pwm );
-    DELAY_SHORT;
-    
-    digital_out_low( &c7segrgb.pwm);
-    DELAY_LONG;
+    hal_ll_gpio_set_pin_output( &c7segrgb.pwm.pin );
+    DELAY_TOH;
+    hal_ll_gpio_clear_pin_output( &c7segrgb.pwm.pin );
+    DELAY_TOL;
 }
 
 // ------------------------------------------------------ APPLICATION FUNCTIONS
 
 void application_init ( void )
 {
-    log_cfg_t log_cfg;
     c7segrgb_cfg_t cfg;
 
-    /** 
-     * Logger initialization.
-     * Default baud rate: 115200
-     * Default log level: LOG_LEVEL_DEBUG
-     * @note If USB_UART_RX and USB_UART_TX 
-     * are defined as HAL_PIN_NC, you will 
-     * need to define them manually for log to work. 
-     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
-     */
-    LOG_MAP_USB_UART( log_cfg );
-    log_init( &logger, &log_cfg );
-    log_info( &logger, "---- Application Init ----" );
-
     //  Click initialization.
-
-
     c7segrgb_cfg_setup( &cfg );
     cfg.logic_one = &logic_one;
     cfg.logic_zero = &logic_zero;
@@ -188,12 +242,9 @@ void application_init ( void )
 
 void application_task ( void )
 {
-    uint8_t cnt_i;
-    uint8_t cnt_j;
-    
-    for ( cnt_i = 0; cnt_i < 10; cnt_i++ )
+    for ( uint8_t cnt_i = 0; cnt_i < 10; cnt_i++ )
     {
-        for ( cnt_j = 10; cnt_j > 0; cnt_j-- )
+        for ( uint8_t cnt_j = 10; cnt_j > 0; cnt_j-- )
         {
             c7segrgb_set_num( &c7segrgb, CHARACTER_TABLE[ cnt_i ], 4 * cnt_i, 4 * cnt_j, cnt_i * cnt_j );
             Delay_ms( 100 );
@@ -232,8 +283,6 @@ void application_task ( void )
 
     c7segrgb_set_num( &c7segrgb, C7SEGRGB_NINE, 20, 10, 30 );
     Delay_ms( 1000 );
-     
-    c7segrgb_pwm_low( &c7segrgb );
 }
 
 void main ( void )
diff --git a/clicks/7segrgb/example/manifest.exm b/clicks/7segrgb/example/manifest.exm
index 708d79eaec..afa001022d 100644
--- a/clicks/7segrgb/example/manifest.exm
+++ b/clicks/7segrgb/example/manifest.exm
@@ -2,7 +2,7 @@
     "name": "7-SEG RGB Click",
     "description": "7-SEG RGB click carries a full color single 7 segment digit display. The click is designed to run on either 3.3V or 5V power supply. It communicates with the target microcontroller over the CS, and PWM pin on the mikroBUS™ line.",
     "image" : "../../Resources/click_icon.png",
-    "toolchain": ["mikrocarm","mikrocpic32"],
+    "toolchain": ["mikrocarm","mikrocpic32","gcc-riscv"],
     "hw" : ["click","7-SEG RGB"],
     "category" : ["LED segment"] 
 }
diff --git a/clicks/7segrgb/example/memake.txt b/clicks/7segrgb/example/memake.txt
deleted file mode 100644
index 67add6ed85..0000000000
--- a/clicks/7segrgb/example/memake.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-type: executable
-target: example_c7segrgb
-
-depends: {
-    MikroC.Core
-    MikroSDK.Board
-    MikroSDK.Log
-    Click.7SegRgb
-}
-
-uses: {
-    MikroC.Core
-}
-
-sources: {
-    main.c
-}
diff --git a/clicks/7segrgb/lib/memake.txt b/clicks/7segrgb/lib/memake.txt
deleted file mode 100644
index 8074a75c1c..0000000000
--- a/clicks/7segrgb/lib/memake.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-type: library
-
-target: lib_c7segrgb
-
-alias: Click.7SegRgb
-
-sources: {
-    src/c7segrgb.c
-}
-
-headers: {
-    include/c7segrgb.h
-}
-
-include: {
-    include
-}
-
-install: {
-    src(include/c7segrgb.h) dst(include/c7segrgb.h)
-}
-
-expInclude: {
-    include
-}
-
-depends: {
-    MikroC.Core
-    MikroSDK.Driver
-}
-
-uses: {
-    MikroC.Core
-}
-
-others: {
-    ../README.md
-    ../DETAILS.md
-    ../CHANGELOG.md
-}
diff --git a/clicks/7segrgb/lib_c7segrgb/CMakeLists.txt b/clicks/7segrgb/lib_c7segrgb/CMakeLists.txt
new file mode 100644
index 0000000000..5ad9db805e
--- /dev/null
+++ b/clicks/7segrgb/lib_c7segrgb/CMakeLists.txt
@@ -0,0 +1,27 @@
+cmake_minimum_required(VERSION 3.21)
+if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC")
+    project(lib_c7segrgb LANGUAGES MikroC)
+else()
+    project(lib_c7segrgb LANGUAGES C ASM)
+endif()
+
+if (NOT PROJECT_TYPE)
+    set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE)
+endif()
+
+add_library(lib_c7segrgb STATIC
+        src/c7segrgb.c
+        include/c7segrgb.h
+)
+add_library(Click.7SegRgb  ALIAS lib_c7segrgb)
+
+
+
+target_include_directories(lib_c7segrgb PUBLIC
+        include
+)
+
+find_package(MikroC.Core REQUIRED)
+target_link_libraries(lib_c7segrgb PUBLIC MikroC.Core)
+find_package(MikroSDK.Driver REQUIRED)
+target_link_libraries(lib_c7segrgb PUBLIC MikroSDK.Driver)
diff --git a/clicks/7segrgb/lib_c7segrgb/include/Click.7SegRgb b/clicks/7segrgb/lib_c7segrgb/include/Click.7SegRgb
new file mode 100644
index 0000000000..5583f32e79
--- /dev/null
+++ b/clicks/7segrgb/lib_c7segrgb/include/Click.7SegRgb
@@ -0,0 +1 @@
+#include "c7segrgb.h"
diff --git a/clicks/7segrgb/lib/include/c7segrgb.h b/clicks/7segrgb/lib_c7segrgb/include/c7segrgb.h
similarity index 84%
rename from clicks/7segrgb/lib/include/c7segrgb.h
rename to clicks/7segrgb/lib_c7segrgb/include/c7segrgb.h
index 0f228f24d2..a6330a24e6 100644
--- a/clicks/7segrgb/lib/include/c7segrgb.h
+++ b/clicks/7segrgb/lib_c7segrgb/include/c7segrgb.h
@@ -57,27 +57,25 @@
  * \defgroup error_code Error Code
  * \{
  */
-#define C7SEGRGB_RETVAL  uint8_t
-
-#define C7SEGRGB_OK           0x00
-#define C7SEGRGB_INIT_ERROR   0xFF
+#define C7SEGRGB_OK             0
+#define C7SEGRGB_ERROR         -1
 /** \} */
 
 /**
  * \defgroup C7SEGRGB_variables C7SEGRGB Variables
  * \{
  */
-#define C7SEGRGB_ONE          0x06
-#define C7SEGRGB_TWO          0x5B
-#define C7SEGRGB_THREE        0x4F
-#define C7SEGRGB_FOUR         0x66
-#define C7SEGRGB_FIVE         0x6D
-#define C7SEGRGB_SIX          0x7D
-#define C7SEGRGB_SEVEN        0x07
-#define C7SEGRGB_EIGHT        0x7F
-#define C7SEGRGB_NINE         0x6F
-#define C7SEGRGB_ZERO         0x3F
-#define C7SEGRGB_POINT        0x80
+#define C7SEGRGB_ONE            0x06
+#define C7SEGRGB_TWO            0x5B
+#define C7SEGRGB_THREE          0x4F
+#define C7SEGRGB_FOUR           0x66
+#define C7SEGRGB_FIVE           0x6D
+#define C7SEGRGB_SIX            0x7D
+#define C7SEGRGB_SEVEN          0x07
+#define C7SEGRGB_EIGHT          0x7F
+#define C7SEGRGB_NINE           0x6F
+#define C7SEGRGB_ZERO           0x3F
+#define C7SEGRGB_POINT          0x80
 /** \} */
 
 /**
@@ -85,8 +83,6 @@
  */
 typedef void ( *drv_logic_t ) ( void );
 
-
-
 /** \} */ // End group macro 
 // --------------------------------------------------------------- PUBLIC TYPES
 /**
@@ -99,7 +95,7 @@ typedef void ( *drv_logic_t ) ( void );
  */
 typedef struct
 {
-    bool logic_lvl;
+    uint8_t logic_lvl;
     uint8_t green;
     uint8_t red;
     uint8_t blue;
@@ -119,8 +115,8 @@ typedef struct
     drv_logic_t logic_zero;
     drv_logic_t logic_one;
     
-    //Pointer to segments data that is array of 8 items for each segment and point on click board
-    c7segrgb_segment_t *segments;
+    // Segments data array of 8 items for each segment
+    c7segrgb_segment_t segments[ 8 ];
 
 } c7segrgb_t;
 
@@ -168,7 +164,7 @@ void c7segrgb_cfg_setup ( c7segrgb_cfg_t *cfg );
  * 
  * @description This function initializes all necessary pins and peripherals used for this click.
  */
-C7SEGRGB_RETVAL c7segrgb_init ( c7segrgb_t *ctx, c7segrgb_cfg_t *cfg );
+err_t c7segrgb_init ( c7segrgb_t *ctx, c7segrgb_cfg_t *cfg );
 
 /**
  * @brief Sets the state low of CS pin function
@@ -204,10 +200,10 @@ void c7segrgb_pwm_low ( c7segrgb_t *ctx );
  *
  * @description The function sets the state high of PWM pin on 7-SEG RGB Click board.
  */
-void c7segrgb_pwm_high( c7segrgb_t *ctx );
+void c7segrgb_pwm_high ( c7segrgb_t *ctx );
 
 /**
- * @brief Sets the state high of PWM pin function
+ * @brief Sets the character and its color function
  * 
  * @param ctx               Click object.
  * @param character         Char to be written.
@@ -230,9 +226,10 @@ void c7segrgb_pwm_high( c7segrgb_t *ctx );
  *        0x80 - .
  *  
* - * @description The function sets character and it's color. + * @description The function sets character and its color. */ -void c7segrgb_set_num ( c7segrgb_t *ctx, uint8_t character, uint8_t green_brightness, uint8_t red_brightness, uint8_t blue_brightness ); +void c7segrgb_set_num ( c7segrgb_t *ctx, uint8_t character, uint8_t green_brightness, + uint8_t red_brightness, uint8_t blue_brightness ); /** * @brief Sets all segments data. diff --git a/clicks/7segrgb/lib/src/c7segrgb.c b/clicks/7segrgb/lib_c7segrgb/src/c7segrgb.c similarity index 63% rename from clicks/7segrgb/lib/src/c7segrgb.c rename to clicks/7segrgb/lib_c7segrgb/src/c7segrgb.c index c9aa02e172..ef2b95cf28 100644 --- a/clicks/7segrgb/lib/src/c7segrgb.c +++ b/clicks/7segrgb/lib_c7segrgb/src/c7segrgb.c @@ -29,10 +29,6 @@ #include "c7segrgb.h" -// - -static c7segrgb_segment_t segmentar[ 8 ]; - // ------------------------------------------------ PRIVATE FUNCTION DECLARATIONS static void dev_set_color ( c7segrgb_t *ctx, uint8_t green, uint8_t red, uint8_t blue ); @@ -50,62 +46,51 @@ void c7segrgb_cfg_setup ( c7segrgb_cfg_t *cfg ) cfg->logic_zero = 0; } -C7SEGRGB_RETVAL c7segrgb_init ( c7segrgb_t *ctx, c7segrgb_cfg_t *cfg ) +err_t c7segrgb_init ( c7segrgb_t *ctx, c7segrgb_cfg_t *cfg ) { - ctx->logic_one = cfg->logic_one; ctx->logic_zero = cfg->logic_zero; - if ( ( ctx->logic_one == 0 ) || ( ctx->logic_zero == 0 ) ) - return C7SEGRGB_INIT_ERROR; - + if ( ( 0 == ctx->logic_one ) || ( 0 == ctx->logic_zero ) ) + { + return C7SEGRGB_ERROR; + } // Output pins + digital_out_init ( &ctx->cs, cfg->cs ); + digital_out_init ( &ctx->pwm, cfg->pwm ); - digital_out_init( &ctx->cs, cfg->cs ); - digital_out_init( &ctx->pwm, cfg->pwm ); - - digital_out_low( &ctx->cs ); - digital_out_low( &ctx->pwm ); - - ctx->segments = segmentar; + digital_out_low ( &ctx->cs ); + digital_out_low ( &ctx->pwm ); return C7SEGRGB_OK; } - void c7segrgb_cs_low ( c7segrgb_t *ctx ) { - digital_out_low( &ctx->cs ); + digital_out_low ( &ctx->cs ); } void c7segrgb_cs_high ( c7segrgb_t *ctx ) { - digital_out_high( &ctx->cs ); + digital_out_high ( &ctx->cs ); } void c7segrgb_pwm_low ( c7segrgb_t *ctx ) { - digital_out_low( &ctx->pwm); + digital_out_low ( &ctx->pwm); } void c7segrgb_pwm_high ( c7segrgb_t *ctx ) { - digital_out_high( &ctx->pwm ); + digital_out_high ( &ctx->pwm ); } - - - -void c7segrgb_set_num ( c7segrgb_t *ctx, uint8_t character, uint8_t green_brightness, uint8_t red_brightness, uint8_t blue_brightness ) +void c7segrgb_set_num ( c7segrgb_t *ctx, uint8_t character, uint8_t green_brightness, + uint8_t red_brightness, uint8_t blue_brightness ) { - uint8_t tmp; - uint8_t cnt; - - for ( cnt = 0; cnt < 8; cnt++ ) + for ( uint8_t cnt = 0; cnt < 8; cnt++ ) { - tmp = character >> cnt & 1; - - if ( tmp ) + if ( ( character >> cnt ) & 1 ) { dev_set_color( ctx, green_brightness, red_brightness, blue_brightness ); } @@ -118,14 +103,11 @@ void c7segrgb_set_num ( c7segrgb_t *ctx, uint8_t character, uint8_t green_brigh void c7segrgb_set_seven_seg ( c7segrgb_t *ctx ) { - uint8_t tmp; - uint8_t cnt; - for ( uint8_t cnt = 0; cnt < 8; cnt++ ) { - if ( ctx->segments[cnt].logic_lvl ) + if ( ctx->segments[ cnt ].logic_lvl ) { - dev_set_color( ctx, ctx->segments[cnt].green, ctx->segments[cnt].red, ctx->segments[cnt].blue ); + dev_set_color( ctx, ctx->segments[ cnt ].green, ctx->segments[ cnt ].red, ctx->segments[ cnt ].blue ); } else { @@ -138,42 +120,10 @@ void c7segrgb_set_seven_seg ( c7segrgb_t *ctx ) static void dev_set_color ( c7segrgb_t *ctx, uint8_t green, uint8_t red, uint8_t blue ) { - uint8_t tmp; - int8_t cnt; - - for ( cnt = 7; cnt > -1; cnt-- ) - { - tmp = green >> cnt & 1; - - if ( tmp ) - { - ctx->logic_one( ); - } - else - { - ctx->logic_zero( ); - } - } - - for ( cnt = 7; cnt > -1; cnt-- ) - { - tmp = red >> cnt & 1; - - if ( tmp ) - { - ctx->logic_one( ); - } - else - { - ctx->logic_zero( ); - } - } - - for ( cnt = 7; cnt > -1; cnt-- ) + uint32_t w_data = ( ( uint32_t ) green << 16 ) | ( ( uint32_t ) red << 8 ) | blue; + for ( int8_t cnt = 23; cnt >= 0; cnt-- ) { - tmp = blue >> cnt & 1; - - if ( tmp ) + if ( w_data & ( 1ul << cnt ) ) { ctx->logic_one( ); } diff --git a/clicks/7segrgb/memake.txt b/clicks/7segrgb/memake.txt deleted file mode 100644 index 69b9fe3925..0000000000 --- a/clicks/7segrgb/memake.txt +++ /dev/null @@ -1,7 +0,0 @@ -type: subdirs -project: 7SegRgb - -subdirs: { - lib - example -} diff --git a/clicks/accel15/CMakeLists.txt b/clicks/accel15/CMakeLists.txt new file mode 100644 index 0000000000..6e000ad692 --- /dev/null +++ b/clicks/accel15/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(example_accel15 LANGUAGES MikroC) +else() + project(example_accel15 LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_executable(example_accel15 + example/main.c + +) + + +############################ example_accel15 GENERATED CODE START ########################### +find_package(MikroC.Core REQUIRED) +target_link_libraries(example_accel15 PUBLIC MikroC.Core) +find_package(MikroSDK.Board REQUIRED) +target_link_libraries(example_accel15 PUBLIC MikroSDK.Board) +find_package(MikroSDK.Log REQUIRED) +target_link_libraries(example_accel15 PUBLIC MikroSDK.Log) +add_subdirectory(lib_accel15) +target_link_libraries(example_accel15 PUBLIC Click.Accel15) +############################ example_accel15 GENERATED CODE END ########################### diff --git a/clicks/accel15/README.md b/clicks/accel15/README.md index 17db1538eb..1b43c73011 100644 --- a/clicks/accel15/README.md +++ b/clicks/accel15/README.md @@ -43,19 +43,19 @@ void accel15_cfg_setup ( accel15_cfg_t *cfg ); - `accel15_init` Initialization function. ```c -ACCEL15_RETVAL accel15_init ( accel15_t *ctx, accel15_cfg_t *cfg ); +err_t accel15_init ( accel15_t *ctx, accel15_cfg_t *cfg ); ``` - `accel15_default_cfg` Click Default Configuration function. ```c -void accel15_default_cfg ( accel15_t *ctx ); +err_t accel15_default_cfg ( accel15_t *ctx ); ``` #### Example key functions : - `accel15_get_axis_data` Accel 15 get accelerometer axis function. ```c -void accel15_get_axis_data ( accel15_t *ctx, accel15_axis_t *axis ); +err_t accel15_get_axis_data ( accel15_t *ctx, accel15_axis_t *axis ); ``` - `accel15_generic_write` Accel 15 data writing function. @@ -85,7 +85,8 @@ err_t accel15_generic_read ( accel15_t *ctx, uint8_t reg, uint8_t *data_out, uin ```c -void application_init ( void ) { +void application_init ( void ) +{ log_cfg_t log_cfg; /**< Logger config object. */ accel15_cfg_t accel15_cfg; /**< Click config object. */ @@ -105,30 +106,30 @@ void application_init ( void ) { log_printf( &logger, "-------------------------\r\n" ); // Click initialization. - accel15_cfg_setup( &accel15_cfg ); ACCEL15_MAP_MIKROBUS( accel15_cfg, MIKROBUS_1 ); err_t init_flag = accel15_init( &accel15, &accel15_cfg ); - if ( ( init_flag == I2C_MASTER_ERROR ) || ( init_flag == SPI_MASTER_ERROR ) ) { + if ( ( I2C_MASTER_ERROR == init_flag ) || ( SPI_MASTER_ERROR == init_flag ) ) + { log_error( &logger, " Application Init Error. " ); log_info( &logger, " Please, run program again... " ); - for ( ; ; ); } - if ( accel15_check_id( &accel15 ) == 0 ) { - log_printf( &logger, " Communication OK \r\n" ); - log_printf( &logger, "-------------------------\r\n" ); - } - else { + if ( ACCEL15_ERROR == accel15_check_id( &accel15 ) ) + { log_printf( &logger, " Communication ERROR \r\n" ); log_printf( &logger, " Reset the device \r\n" ); log_printf( &logger, "-------------------------\r\n" ); - for ( ; ; ); } - accel15_default_cfg ( &accel15 ); + if ( ACCEL15_ERROR == accel15_default_cfg ( &accel15 ) ) + { + log_error( &logger, " Default configuration." ); + for ( ; ; ); + } + log_printf( &logger, " Application Task \r\n" ); log_printf( &logger, "-------------------------\r\n" ); Delay_ms( 100 ); @@ -140,20 +141,21 @@ void application_init ( void ) { > Measures and displays acceleration data for X-axis, Y-axis, and Z-axis. > Results are being sent to the USART terminal where the user can track their changes. -> This task repeats every 1 sec. +> This task repeats at data output rate which is set to 12.5 Hz. ```c -void application_task ( void ) { - if ( accel15_get_int_1( &accel15 ) == ACCEL15_DRDY ) { - accel15_get_axis_data( &accel15, &axis ); - - log_printf( &logger, "\tX : %5d \r\n", axis.x ); - log_printf( &logger, "\tY : %5d \r\n", axis.y ); - log_printf( &logger, "\tZ : %5d \r\n", axis.z ); - log_printf( &logger, "-------------------------\r\n" ); - - Delay_ms( 1000 ); +void application_task ( void ) +{ + if ( ACCEL15_DRDY == accel15_get_int_1( &accel15 ) ) + { + if ( ACCEL15_OK == accel15_get_axis_data( &accel15, &axis ) ) + { + log_printf( &logger, "\tX : %d \r\n", axis.x ); + log_printf( &logger, "\tY : %d \r\n", axis.y ); + log_printf( &logger, "\tZ : %d \r\n", axis.z ); + log_printf( &logger, "-------------------------\r\n" ); + } } } diff --git a/clicks/accel15/changelog.md b/clicks/accel15/changelog.md index 045bcb30cf..8ce49e7776 100644 --- a/clicks/accel15/changelog.md +++ b/clicks/accel15/changelog.md @@ -1,4 +1,4 @@ ## Changelog -### Version 2.0.0.5 +### Version 2.1.0.7 - Initial release diff --git a/clicks/accel15/details.md b/clicks/accel15/details.md index 6869de63c3..bb84ba4ce4 100644 --- a/clicks/accel15/details.md +++ b/clicks/accel15/details.md @@ -42,19 +42,19 @@ void accel15_cfg_setup ( accel15_cfg_t *cfg ); - `accel15_init` Initialization function. ```c -ACCEL15_RETVAL accel15_init ( accel15_t *ctx, accel15_cfg_t *cfg ); +err_t accel15_init ( accel15_t *ctx, accel15_cfg_t *cfg ); ``` - `accel15_default_cfg` Click Default Configuration function. ```c -void accel15_default_cfg ( accel15_t *ctx ); +err_t accel15_default_cfg ( accel15_t *ctx ); ``` #### Example key functions : - `accel15_get_axis_data` Accel 15 get accelerometer axis function. ```c -void accel15_get_axis_data ( accel15_t *ctx, accel15_axis_t *axis ); +err_t accel15_get_axis_data ( accel15_t *ctx, accel15_axis_t *axis ); ``` - `accel15_generic_write` Accel 15 data writing function. @@ -84,7 +84,8 @@ err_t accel15_generic_read ( accel15_t *ctx, uint8_t reg, uint8_t *data_out, uin ```c -void application_init ( void ) { +void application_init ( void ) +{ log_cfg_t log_cfg; /**< Logger config object. */ accel15_cfg_t accel15_cfg; /**< Click config object. */ @@ -104,30 +105,30 @@ void application_init ( void ) { log_printf( &logger, "-------------------------\r\n" ); // Click initialization. - accel15_cfg_setup( &accel15_cfg ); ACCEL15_MAP_MIKROBUS( accel15_cfg, MIKROBUS_1 ); err_t init_flag = accel15_init( &accel15, &accel15_cfg ); - if ( ( init_flag == I2C_MASTER_ERROR ) || ( init_flag == SPI_MASTER_ERROR ) ) { + if ( ( I2C_MASTER_ERROR == init_flag ) || ( SPI_MASTER_ERROR == init_flag ) ) + { log_error( &logger, " Application Init Error. " ); log_info( &logger, " Please, run program again... " ); - for ( ; ; ); } - if ( accel15_check_id( &accel15 ) == 0 ) { - log_printf( &logger, " Communication OK \r\n" ); - log_printf( &logger, "-------------------------\r\n" ); - } - else { + if ( ACCEL15_ERROR == accel15_check_id( &accel15 ) ) + { log_printf( &logger, " Communication ERROR \r\n" ); log_printf( &logger, " Reset the device \r\n" ); log_printf( &logger, "-------------------------\r\n" ); - for ( ; ; ); } - accel15_default_cfg ( &accel15 ); + if ( ACCEL15_ERROR == accel15_default_cfg ( &accel15 ) ) + { + log_error( &logger, " Default configuration." ); + for ( ; ; ); + } + log_printf( &logger, " Application Task \r\n" ); log_printf( &logger, "-------------------------\r\n" ); Delay_ms( 100 ); @@ -139,20 +140,21 @@ void application_init ( void ) { > Measures and displays acceleration data for X-axis, Y-axis, and Z-axis. > Results are being sent to the USART terminal where the user can track their changes. -> This task repeats every 1 sec. +> This task repeats at data output rate which is set to 12.5 Hz. ```c -void application_task ( void ) { - if ( accel15_get_int_1( &accel15 ) == ACCEL15_DRDY ) { - accel15_get_axis_data( &accel15, &axis ); - - log_printf( &logger, "\tX : %5d \r\n", axis.x ); - log_printf( &logger, "\tY : %5d \r\n", axis.y ); - log_printf( &logger, "\tZ : %5d \r\n", axis.z ); - log_printf( &logger, "-------------------------\r\n" ); - - Delay_ms( 1000 ); +void application_task ( void ) +{ + if ( ACCEL15_DRDY == accel15_get_int_1( &accel15 ) ) + { + if ( ACCEL15_OK == accel15_get_axis_data( &accel15, &axis ) ) + { + log_printf( &logger, "\tX : %d \r\n", axis.x ); + log_printf( &logger, "\tY : %d \r\n", axis.y ); + log_printf( &logger, "\tZ : %d \r\n", axis.z ); + log_printf( &logger, "-------------------------\r\n" ); + } } } diff --git a/clicks/accel15/doc/doxy/Doxyfile.doxy b/clicks/accel15/doc/doxy/Doxyfile.doxy index d142abefc6..f7bb97f032 100644 --- a/clicks/accel15/doc/doxy/Doxyfile.doxy +++ b/clicks/accel15/doc/doxy/Doxyfile.doxy @@ -44,21 +44,21 @@ PROJECT_NUMBER = 2.0.0.0 # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = +PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = +PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = ../clicks/accel15/temp/Help/doc +OUTPUT_DIRECTORY = ../cmake/accel15/temp/Help/doc # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -162,7 +162,7 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -171,7 +171,7 @@ STRIP_FROM_PATH = # specify the list of include paths that are normally passed to the compiler # using the -I flag. -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't @@ -238,13 +238,13 @@ TAB_SIZE = 4 # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. -ALIASES = +ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. -TCL_SUBST = +TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For @@ -291,7 +291,7 @@ OPTIMIZE_OUTPUT_VHDL = NO # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. -EXTENSION_MAPPING = +EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable @@ -648,7 +648,7 @@ GENERATE_DEPRECATEDLIST= YES # sections, marked by \if ... \endif and \cond # ... \endcond blocks. -ENABLED_SECTIONS = +ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the @@ -690,7 +690,7 @@ SHOW_NAMESPACES = YES # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. -FILE_VERSION_FILTER = +FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated @@ -703,7 +703,7 @@ FILE_VERSION_FILTER = # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. -LAYOUT_FILE = +LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib @@ -713,7 +713,7 @@ LAYOUT_FILE = # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. -CITE_BIB_FILES = +CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages @@ -778,7 +778,7 @@ WARN_FORMAT = "$file:$line: $text" # messages should be written. If left blank the output is written to standard # error (stderr). -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files @@ -790,9 +790,9 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = ../clicks/accel15/example \ - ../clicks/accel15/lib/include \ - ../clicks/accel15/README.md +INPUT = ../cmake/accel15/example \ + ../cmake/accel15/lib_accel15/include \ + ../cmake/accel15/README.md # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -877,7 +877,7 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = +EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -893,7 +893,7 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the @@ -904,13 +904,13 @@ EXCLUDE_PATTERNS = # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* -EXCLUDE_SYMBOLS = +EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = ../clicks/accel15/example +EXAMPLE_PATH = ../cmake/accel15/example # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and @@ -930,7 +930,7 @@ EXAMPLE_RECURSIVE = YES # that contain images that are to be included in the documentation (see the # \image command). -IMAGE_PATH = +IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program @@ -951,7 +951,7 @@ IMAGE_PATH = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -INPUT_FILTER = +INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the @@ -964,7 +964,7 @@ INPUT_FILTER = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -FILTER_PATTERNS = +FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for @@ -979,14 +979,14 @@ FILTER_SOURCE_FILES = NO # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. -FILTER_SOURCE_PATTERNS = +FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = +USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing @@ -1091,7 +1091,7 @@ CLANG_ASSISTED_PARSING = NO # specified with INPUT and INCLUDE_PATH. # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. -CLANG_OPTIONS = +CLANG_OPTIONS = #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index @@ -1117,7 +1117,7 @@ COLS_IN_ALPHA_INDEX = 5 # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output @@ -1161,7 +1161,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = +HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard @@ -1171,7 +1171,7 @@ HTML_HEADER = # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = +HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of @@ -1183,7 +1183,7 @@ HTML_FOOTER = # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_STYLESHEET = +HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets @@ -1196,7 +1196,7 @@ HTML_STYLESHEET = # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = +HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note @@ -1206,7 +1206,7 @@ HTML_EXTRA_STYLESHEET = # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = +HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to @@ -1335,7 +1335,7 @@ GENERATE_HTMLHELP = NO # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_FILE = +CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, @@ -1343,7 +1343,7 @@ CHM_FILE = # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -HHC_LOCATION = +HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the master .chm file (NO). @@ -1356,7 +1356,7 @@ GENERATE_CHI = NO # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_INDEX_ENCODING = +CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it @@ -1387,7 +1387,7 @@ GENERATE_QHP = NO # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. -QCH_FILE = +QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace @@ -1412,7 +1412,7 @@ QHP_VIRTUAL_FOLDER = ./temp/Help/doc # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom @@ -1420,21 +1420,21 @@ QHP_CUST_FILTER_NAME = # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_ATTRS = +QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_SECT_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. -QHG_LOCATION = +QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To @@ -1567,7 +1567,7 @@ MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_EXTENSIONS = +MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site @@ -1575,7 +1575,7 @@ MATHJAX_EXTENSIONS = # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_CODEFILE = +MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and @@ -1635,7 +1635,7 @@ EXTERNAL_SEARCH = NO # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. -SEARCHENGINE_URL = +SEARCHENGINE_URL = # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed # search data is written to a file for indexing by an external tool. With the @@ -1651,7 +1651,7 @@ SEARCHDATA_FILE = searchdata.xml # projects and redirect the results back to the right project. # This tag requires that the tag SEARCHENGINE is set to YES. -EXTERNAL_SEARCH_ID = +EXTERNAL_SEARCH_ID = # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen # projects other than the one defined by this configuration file, but that are @@ -1661,7 +1661,7 @@ EXTERNAL_SEARCH_ID = # EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... # This tag requires that the tag SEARCHENGINE is set to YES. -EXTRA_SEARCH_MAPPINGS = +EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- # Configuration options related to the LaTeX output @@ -1725,7 +1725,7 @@ PAPER_TYPE = a4 # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. -EXTRA_PACKAGES = +EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for the # generated LaTeX document. The header should contain everything until the first @@ -1741,7 +1741,7 @@ EXTRA_PACKAGES = # to HTML_HEADER. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_HEADER = +LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the # generated LaTeX document. The footer should contain everything after the last @@ -1752,7 +1752,7 @@ LATEX_HEADER = # Note: Only use a user-defined footer if you know what you are doing! # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_FOOTER = +LATEX_FOOTER = # The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined # LaTeX style sheets that are included after the standard style sheets created @@ -1763,7 +1763,7 @@ LATEX_FOOTER = # list). # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_STYLESHEET = +LATEX_EXTRA_STYLESHEET = # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output @@ -1771,7 +1771,7 @@ LATEX_EXTRA_STYLESHEET = # markers available. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_FILES = +LATEX_EXTRA_FILES = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is # prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will @@ -1879,14 +1879,14 @@ RTF_HYPERLINKS = NO # default style sheet that doxygen normally uses. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_STYLESHEET_FILE = +RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is # similar to doxygen's config file. A template extensions file can be generated # using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_EXTENSIONS_FILE = +RTF_EXTENSIONS_FILE = # If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code # with syntax highlighting in the RTF output. @@ -1931,7 +1931,7 @@ MAN_EXTENSION = .3 # MAN_EXTENSION with the initial . removed. # This tag requires that the tag GENERATE_MAN is set to YES. -MAN_SUBDIR = +MAN_SUBDIR = # If the MAN_LINKS tag is set to YES and doxygen generates man output, then it # will generate one additional man file for each entity documented in the real @@ -2044,7 +2044,7 @@ PERLMOD_PRETTY = YES # overwrite each other's variables. # This tag requires that the tag GENERATE_PERLMOD is set to YES. -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor @@ -2085,7 +2085,7 @@ SEARCH_INCLUDES = YES # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = +INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the @@ -2093,7 +2093,7 @@ INCLUDE_PATH = # used. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -INCLUDE_FILE_PATTERNS = +INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that are # defined before the preprocessor is started (similar to the -D option of e.g. @@ -2103,7 +2103,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = +PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -2112,7 +2112,7 @@ PREDEFINED = # definition found in the source code. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will # remove all references to function-like macros that are alone on a line, have @@ -2141,13 +2141,13 @@ SKIP_FUNCTION_MACROS = YES # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. -TAGFILES = +TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create a # tag file that is based on the input files it reads. See section "Linking to # external documentation" for more information about the usage of tag files. -GENERATE_TAGFILE = +GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES, all external class will be listed in # the class index. If set to NO, only the inherited external classes will be @@ -2188,7 +2188,7 @@ CLASS_DIAGRAMS = YES # DIA_PATH tag allows you to specify the directory where the dia binary resides. # If left empty dia is assumed to be found in the default search path. -DIA_PATH = +DIA_PATH = # If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. @@ -2237,7 +2237,7 @@ DOT_FONTSIZE = 10 # the path where dot can find it using this tag. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTPATH = +DOT_FONTPATH = # If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for # each documented class showing the direct and indirect inheritance relations. @@ -2381,26 +2381,26 @@ INTERACTIVE_SVG = NO # found. If left blank, it is assumed the dot tool can be found in the path. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_PATH = +DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the \dotfile # command). # This tag requires that the tag HAVE_DOT is set to YES. -DOTFILE_DIRS = +DOTFILE_DIRS = # The MSCFILE_DIRS tag can be used to specify one or more directories that # contain msc files that are included in the documentation (see the \mscfile # command). -MSCFILE_DIRS = +MSCFILE_DIRS = # The DIAFILE_DIRS tag can be used to specify one or more directories that # contain dia files that are included in the documentation (see the \diafile # command). -DIAFILE_DIRS = +DIAFILE_DIRS = # When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the # path where java can find the plantuml.jar file. If left blank, it is assumed @@ -2408,17 +2408,17 @@ DIAFILE_DIRS = # generate a warning when it encounters a \startuml command in this case and # will not generate output for the diagram. -PLANTUML_JAR_PATH = +PLANTUML_JAR_PATH = # When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a # configuration file for plantuml. -PLANTUML_CFG_FILE = +PLANTUML_CFG_FILE = # When using plantuml, the specified paths are searched for files specified by # the !include statement in a plantuml block. -PLANTUML_INCLUDE_PATH = +PLANTUML_INCLUDE_PATH = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes diff --git a/clicks/accel15/doc/package/manifest.json b/clicks/accel15/doc/package/manifest.json index 98c79c20ea..8d8352e417 100644 --- a/clicks/accel15/doc/package/manifest.json +++ b/clicks/accel15/doc/package/manifest.json @@ -1,6 +1,6 @@ { - "architecture": "ARM|PIC|PIC32", - "category": "Motion", + "architecture": "ARM|PIC|PIC32|RISC-V|AVR", + "category": "Click Boards > Sensors > Motion", "changelog": "Resources/CHANGELOG.md", "contains": [ "libraries", @@ -8,8 +8,7 @@ "examples", "source_files" ], - "dependency_list": [ - ], + "dependency_list": [], "details": "Resources/DETAILS.md", "display_name": "Accel 15 click", "example_list": [ @@ -26,13 +25,11 @@ "name": "mikroe.click.accel15", "product_link": "https://www.mikroe.com/accel-15-click", "short_description": "Accel 15 Click is a compact add-on board that contains a longevity acceleration sensor. This board features the BMA490L, a high-performance 16-bit digital triaxial acceleration sensor with extended availability of up to ten years from Bosch Sensortech. It allows selectable full-scale acceleration measurements in ranges of ±2g, ±4g, ±8g, and ±16g in three axes with a configurable host interface that supports both I2C and SPI serial communication and with intelligent on-chip motion-triggered interrupt features. Intelligent signal processing and evaluation in the accelerometer ASIC enables advanced gesture recognition for numerous industrial IoT applications where low power consumption is vital. This Click board™ is suitable for home appliances, power tools, and other industrial products whose lifetime is essential.", - "supported_compiler": "mikroC AI", + "supported_compiler": "mikroC AI|GCC", "type": "Library", - "_type":"mikroSDK Library", - "version": "2.0.0.5" + "_type": "mikroSDK Library", + "version": "2.1.0.7", + "cmake": true, + "alias": "Click.Accel15", + "subdir_name": "lib_accel15" } - - - - - diff --git a/clicks/accel15/example/CMakeLists.txt b/clicks/accel15/example/CMakeLists.txt new file mode 100644 index 0000000000..8a0018bfc9 --- /dev/null +++ b/clicks/accel15/example/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(example_accel15 LANGUAGES MikroC) +else() + project(example_accel15 LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_executable(example_accel15 + main.c + +) + + +############################ example_accel15 GENERATED CODE START ########################### +find_package(MikroC.Core REQUIRED) +target_link_libraries(example_accel15 PUBLIC MikroC.Core) +find_package(MikroSDK.Board REQUIRED) +target_link_libraries(example_accel15 PUBLIC MikroSDK.Board) +find_package(MikroSDK.Log REQUIRED) +target_link_libraries(example_accel15 PUBLIC MikroSDK.Log) +add_subdirectory(lib_accel15) +target_link_libraries(example_accel15 PUBLIC Click.Accel15) +############################ example_accel15 GENERATED CODE END ########################### diff --git a/clicks/accel15/example/main.c b/clicks/accel15/example/main.c index 20f868d656..f294969be2 100644 --- a/clicks/accel15/example/main.c +++ b/clicks/accel15/example/main.c @@ -18,7 +18,7 @@ * ## Application Task * Measures and displays acceleration data for X-axis, Y-axis, and Z-axis. * Results are being sent to the USART terminal where the user can track their changes. - * This task repeats every 1 sec. + * This task repeats at data output rate which is set to 12.5 Hz. * * @author Nenad Filipovic * @@ -32,7 +32,8 @@ static accel15_t accel15; static log_t logger; static accel15_axis_t axis; -void application_init ( void ) { +void application_init ( void ) +{ log_cfg_t log_cfg; /**< Logger config object. */ accel15_cfg_t accel15_cfg; /**< Click config object. */ @@ -52,52 +53,55 @@ void application_init ( void ) { log_printf( &logger, "-------------------------\r\n" ); // Click initialization. - accel15_cfg_setup( &accel15_cfg ); ACCEL15_MAP_MIKROBUS( accel15_cfg, MIKROBUS_1 ); err_t init_flag = accel15_init( &accel15, &accel15_cfg ); - if ( ( init_flag == I2C_MASTER_ERROR ) || ( init_flag == SPI_MASTER_ERROR ) ) { + if ( ( I2C_MASTER_ERROR == init_flag ) || ( SPI_MASTER_ERROR == init_flag ) ) + { log_error( &logger, " Application Init Error. " ); log_info( &logger, " Please, run program again... " ); - for ( ; ; ); } - if ( accel15_check_id( &accel15 ) == 0 ) { - log_printf( &logger, " Communication OK \r\n" ); - log_printf( &logger, "-------------------------\r\n" ); - } - else { + if ( ACCEL15_ERROR == accel15_check_id( &accel15 ) ) + { log_printf( &logger, " Communication ERROR \r\n" ); log_printf( &logger, " Reset the device \r\n" ); log_printf( &logger, "-------------------------\r\n" ); - for ( ; ; ); } - accel15_default_cfg ( &accel15 ); + if ( ACCEL15_ERROR == accel15_default_cfg ( &accel15 ) ) + { + log_error( &logger, " Default configuration." ); + for ( ; ; ); + } + log_printf( &logger, " Application Task \r\n" ); log_printf( &logger, "-------------------------\r\n" ); Delay_ms( 100 ); } -void application_task ( void ) { - if ( accel15_get_int_1( &accel15 ) == ACCEL15_DRDY ) { - accel15_get_axis_data( &accel15, &axis ); - - log_printf( &logger, "\tX : %5d \r\n", axis.x ); - log_printf( &logger, "\tY : %5d \r\n", axis.y ); - log_printf( &logger, "\tZ : %5d \r\n", axis.z ); - log_printf( &logger, "-------------------------\r\n" ); - - Delay_ms( 1000 ); +void application_task ( void ) +{ + if ( ACCEL15_DRDY == accel15_get_int_1( &accel15 ) ) + { + if ( ACCEL15_OK == accel15_get_axis_data( &accel15, &axis ) ) + { + log_printf( &logger, "\tX : %d \r\n", axis.x ); + log_printf( &logger, "\tY : %d \r\n", axis.y ); + log_printf( &logger, "\tZ : %d \r\n", axis.z ); + log_printf( &logger, "-------------------------\r\n" ); + } } } -void main ( void ) { +void main ( void ) +{ application_init( ); - for ( ; ; ) { + for ( ; ; ) + { application_task( ); } } diff --git a/clicks/accel15/example/manifest.exm b/clicks/accel15/example/manifest.exm index 505ce64198..31f9e68834 100644 --- a/clicks/accel15/example/manifest.exm +++ b/clicks/accel15/example/manifest.exm @@ -2,7 +2,7 @@ "name": "Accel 15 Click", "description": "Accel 15 Click is a compact add-on board that contains a longevity acceleration sensor. This board features the BMA490L, a high-performance 16-bit digital triaxial acceleration sensor with extended availability of up to ten years from Bosch Sensortech. It allows selectable full-scale acceleration measurements in ranges of ±2g, ±4g, ±8g, and ±16g in three axes with a configurable host interface that supports both I2C and SPI serial communication and with intelligent on-chip motion-triggered interrupt features. Intelligent signal processing and evaluation in the accelerometer ASIC enables advanced gesture recognition for numerous industrial IoT applications where low power consumption is vital. This Click board™ is suitable for home appliances, power tools, and other industrial products whose lifetime is essential.", "image" : "../../Resources/click_icon.png", - "toolchain": ["mikrocarm","mikrocpic","mikrocpic32"], + "toolchain": ["mikrocarm","mikrocpic","mikrocpic32","gcc-riscv","mikrocavr"], "hw" : ["click","BMA490L"], "category" : ["Motion"] } diff --git a/clicks/accel15/example/memake.txt b/clicks/accel15/example/memake.txt deleted file mode 100644 index 9b113adf22..0000000000 --- a/clicks/accel15/example/memake.txt +++ /dev/null @@ -1,13 +0,0 @@ -type: executable -target: example_accel15 - -depends: { - MikroC.Core - MikroSDK.Board - MikroSDK.Log - Click.Accel15 -} - -sources: { - main.c -} diff --git a/clicks/accel15/lib/memake.txt b/clicks/accel15/lib/memake.txt deleted file mode 100644 index 66d8d55cbf..0000000000 --- a/clicks/accel15/lib/memake.txt +++ /dev/null @@ -1,36 +0,0 @@ -type: library - -target: lib_accel15 - -sources: { - src/accel15.c -} - -headers: { - include/accel15.h -} - -include: { - include -} - -install: { - src(include/accel15.h) dst(include/accel15.h) -} - -expInclude: { - include -} - -depends: { - MikroC.Core - MikroSDK.Driver -} - -others: { - ../README.md - ../DETAILS.md - ../CHANGELOG.md -} - -alias: Click.Accel15 diff --git a/clicks/accel15/lib/src/accel15.c b/clicks/accel15/lib/src/accel15.c deleted file mode 100644 index 08b9698a5b..0000000000 --- a/clicks/accel15/lib/src/accel15.c +++ /dev/null @@ -1,487 +0,0 @@ -/**************************************************************************** -** Copyright (C) 2020 MikroElektronika d.o.o. -** Contact: https://www.mikroe.com/contact -** -** Permission is hereby granted, free of charge, to any person obtaining a copy -** of this software and associated documentation files (the "Software"), to deal -** in the Software without restriction, including without limitation the rights -** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -** copies of the Software, and to permit persons to whom the Software is -** furnished to do so, subject to the following conditions: -** The above copyright notice and this permission notice shall be -** included in all copies or substantial portions of the Software. -** -** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -** USE OR OTHER DEALINGS IN THE SOFTWARE. -****************************************************************************/ - -/*! - * @file accel15.c - * @brief Accel 15 Click Driver. - */ - -#include "accel15.h" - -/** - * @brief Dummy data. - * @details Definition of dummy data. - */ -#define DUMMY 0x00 - -// ---------------------------------------------- PRIVATE FUNCTION DECLARATIONS - -/** - * @brief Accel 15 configuration delay function. - * @details Configuration delay for 100 milliseconds. - * - * @note None. - */ - -static void accel15_config_delay ( void ); - -/** - * @brief Accel 15 I2C writing function. - * @details This function writes a desired number of data bytes starting from - * the selected register by using I2C serial interface. - * @param[in] ctx : Click context object. - * See #accel15_t object definition for detailed explanation. - * @param[in] reg : Start register address. - * @param[in] data_in : Data to be written. - * @param[in] len : Number of bytes to be written. - * @return @li @c 0 - Success, - * @li @c -1 - Error. - * - * See #err_t definition for detailed explanation. - * @note None. - */ -static err_t accel15_i2c_write ( accel15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len ); - -/** - * @brief Accel 15 I2C reading function. - * @details This function reads a desired number of data bytes starting from - * the selected register by using I2C serial interface. - * @param[in] ctx : Click context object. - * See #accel15_t object definition for detailed explanation. - * @param[in] reg : Start register address. - * @param[out] data_out : Output read data. - * @param[in] len : Number of bytes to be read. - * @return @li @c 0 - Success, - * @li @c -1 - Error. - * - * See #err_t definition for detailed explanation. - * @note None. - */ -static err_t accel15_i2c_read ( accel15_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len ); - -/** - * @brief Accel 15 SPI writing function. - * @details This function writes a desired number of data bytes starting from - * the selected register by using SPI serial interface. - * @param[in] ctx : Click context object. - * See #accel15_t object definition for detailed explanation. - * @param[in] reg : Start register address. - * @param[in] data_in : Data to be written. - * @param[in] len : Number of bytes to be written. - * @return @li @c 0 - Success, - * @li @c -1 - Error. - * - * See #err_t definition for detailed explanation. - * @note None. - */ -static err_t accel15_spi_write ( accel15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len ); - -/** - * @brief Accel 15 SPI reading function. - * @details This function reads a desired number of data bytes starting from - * the selected register by using SPI serial interface. - * @param[in] ctx : Click context object. - * See #accel15_t object definition for detailed explanation. - * @param[in] reg : Start register address. - * @param[out] data_out : Output read data. - * @param[in] len : Number of bytes to be read. - * @return @li @c 0 - Success, - * @li @c -1 - Error. - * - * See #err_t definition for detailed explanation. - * @note None. - */ -static err_t accel15_spi_read ( accel15_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len ); - -// ------------------------------------------------ PUBLIC FUNCTION DEFINITIONS - -void accel15_cfg_setup ( accel15_cfg_t *cfg ) { - cfg->scl = HAL_PIN_NC; - cfg->sda = HAL_PIN_NC; - cfg->sck = HAL_PIN_NC; - cfg->miso = HAL_PIN_NC; - cfg->mosi = HAL_PIN_NC; - cfg->cs = HAL_PIN_NC; - cfg->i2 = HAL_PIN_NC; - cfg->i1 = HAL_PIN_NC; - - cfg->i2c_speed = I2C_MASTER_SPEED_STANDARD; - cfg->i2c_address = ACCEL15_SET_DEV_ADDR_GND; - - cfg->spi_speed = 100000; - cfg->spi_mode = SPI_MASTER_MODE_0; - cfg->cs_polarity = SPI_MASTER_CHIP_SELECT_POLARITY_ACTIVE_LOW; - - cfg->drv_sel = ACCEL15_DRV_SEL_I2C; -} - -void accel15_drv_interface_selection ( accel15_cfg_t *cfg, accel15_drv_t drv_sel ) { - cfg->drv_sel = drv_sel; -} - -err_t accel15_init ( accel15_t *ctx, accel15_cfg_t *cfg ) { - ctx->drv_sel = cfg->drv_sel; - - if ( ctx->drv_sel == ACCEL15_DRV_SEL_I2C ) { - i2c_master_config_t i2c_cfg; - - i2c_master_configure_default( &i2c_cfg ); - - i2c_cfg.scl = cfg->scl; - i2c_cfg.sda = cfg->sda; - - ctx->slave_address = cfg->i2c_address; - - if ( i2c_master_open( &ctx->i2c, &i2c_cfg ) == I2C_MASTER_ERROR ) { - return I2C_MASTER_ERROR; - } - - if ( i2c_master_set_slave_address( &ctx->i2c, ctx->slave_address ) == I2C_MASTER_ERROR ) { - return I2C_MASTER_ERROR; - } - - if ( i2c_master_set_speed( &ctx->i2c, cfg->i2c_speed ) == I2C_MASTER_ERROR ) { - return I2C_MASTER_ERROR; - } - - ctx->read_f = accel15_i2c_read; - ctx->write_f = accel15_i2c_write; - } else { - spi_master_config_t spi_cfg; - - spi_master_configure_default( &spi_cfg ); - - spi_cfg.sck = cfg->sck; - spi_cfg.miso = cfg->miso; - spi_cfg.mosi = cfg->mosi; - - ctx->chip_select = cfg->cs; - - if ( spi_master_open( &ctx->spi, &spi_cfg ) == SPI_MASTER_ERROR ) { - return SPI_MASTER_ERROR; - } - - if ( spi_master_set_default_write_data( &ctx->spi, DUMMY ) == SPI_MASTER_ERROR ) { - return SPI_MASTER_ERROR; - } - - if ( spi_master_set_mode( &ctx->spi, cfg->spi_mode ) == SPI_MASTER_ERROR ) { - return SPI_MASTER_ERROR; - } - - if ( spi_master_set_speed( &ctx->spi, cfg->spi_speed ) == SPI_MASTER_ERROR ) { - return SPI_MASTER_ERROR; - } - - spi_master_set_chip_select_polarity( cfg->cs_polarity ); - spi_master_deselect_device( ctx->chip_select ); - - ctx->read_f = accel15_spi_read; - ctx->write_f = accel15_spi_write; - } - - digital_in_init( &ctx->i2, cfg->i2 ); - digital_in_init( &ctx->i1, cfg->i1 ); - - return 0; -} - -void accel15_default_cfg ( accel15_t *ctx ) { - - // Click default configuration. - uint8_t tx_buf[ 1 ]; - uint8_t bma490l_config_file[ 1300 ] = { - 0xc8, 0x2e, 0x00, 0x2e, 0xc8, 0x2e, 0x00, 0x2e, 0xc8, 0x2e, 0x00, 0x2e, 0xc8, 0x2e, 0x00, 0x2e, 0xc8, 0x2e, 0x00, - 0x2e, 0xc8, 0x2e, 0x00, 0x2e, 0xc8, 0x2e, 0x00, 0x2e, 0x80, 0x2e, 0x58, 0x01, 0x80, 0x2e, 0x74, 0x02, 0xb0, 0xf0, - 0x10, 0x30, 0x21, 0x2e, 0x16, 0xf0, 0x80, 0x2e, 0xeb, 0x00, 0x19, 0x50, 0x17, 0x52, 0x01, 0x42, 0x3b, 0x80, 0x41, - 0x30, 0x01, 0x42, 0x3c, 0x80, 0x00, 0x2e, 0x01, 0x40, 0x01, 0x42, 0x21, 0x2e, 0xff, 0xaf, 0xb8, 0x2e, 0x9b, 0x95, - 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, - 0x00, 0x80, 0x2e, 0x18, 0x00, 0xfd, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2e, - 0x55, 0xf0, 0xc0, 0x2e, 0x21, 0x2e, 0x55, 0xf0, 0x80, 0x2e, 0x18, 0x00, 0xfd, 0x2d, 0xaa, 0x00, 0x05, 0x00, 0xaa, - 0x00, 0x05, 0x00, 0x40, 0x48, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x2e, 0x80, 0x00, 0x20, 0x26, 0x98, 0x2e, 0xef, 0x00, 0x10, 0x30, 0x21, 0x2e, - 0x59, 0xf0, 0x98, 0x2e, 0x38, 0x00, 0x98, 0x2e, 0x7f, 0x01, 0x98, 0x2e, 0x8e, 0x01, 0x00, 0x2e, 0x00, 0x2e, 0xd0, - 0x2e, 0x98, 0x2e, 0xce, 0x00, 0x01, 0x2e, 0x34, 0x00, 0x00, 0xb2, 0x0d, 0x2f, 0x00, 0x30, 0x21, 0x2e, 0x34, 0x00, - 0x01, 0x50, 0x98, 0x2e, 0x13, 0x01, 0x01, 0x50, 0x03, 0x52, 0x98, 0x2e, 0x00, 0xb0, 0x01, 0x50, 0x05, 0x52, 0x98, - 0x2e, 0x00, 0xb0, 0x98, 0x2e, 0x38, 0x00, 0xe6, 0x2d, 0x13, 0x52, 0x40, 0x30, 0x42, 0x40, 0x90, 0x0a, 0x42, 0x42, - 0x58, 0x84, 0x07, 0x52, 0xa1, 0x42, 0x71, 0x3c, 0x09, 0x56, 0x83, 0x42, 0xa9, 0x84, 0x83, 0x32, 0x84, 0x40, 0x61, - 0x08, 0x4b, 0x0a, 0x81, 0x42, 0x82, 0x82, 0x02, 0x3f, 0x43, 0x40, 0x9a, 0x08, 0x52, 0x42, 0x40, 0x42, 0x7e, 0x80, - 0x61, 0x30, 0x01, 0x42, 0x10, 0x50, 0x01, 0x2e, 0x40, 0xf0, 0x1a, 0x90, 0xfb, 0x7f, 0x20, 0x2f, 0x03, 0x30, 0x0d, - 0x50, 0x34, 0x33, 0x06, 0x30, 0x11, 0x52, 0x0b, 0x54, 0x55, 0x32, 0x1d, 0x1a, 0xe3, 0x22, 0x18, 0x1a, 0x0f, 0x58, - 0xe3, 0x22, 0x04, 0x30, 0xd5, 0x40, 0xb5, 0x0d, 0xe1, 0xbe, 0x6f, 0xbb, 0x80, 0x91, 0xa9, 0x0d, 0x01, 0x89, 0xb5, - 0x23, 0x10, 0xa1, 0xf7, 0x2f, 0xda, 0x0e, 0x34, 0x33, 0xeb, 0x2f, 0x01, 0x2e, 0x25, 0x00, 0x70, 0x1a, 0x00, 0x30, - 0x21, 0x30, 0x02, 0x2c, 0x08, 0x22, 0x30, 0x30, 0x00, 0xb2, 0x06, 0x2f, 0x21, 0x2e, 0x59, 0xf0, 0x98, 0x2e, 0x38, - 0x00, 0x00, 0x2e, 0x00, 0x2e, 0xd0, 0x2e, 0xfb, 0x6f, 0xf0, 0x5f, 0xb8, 0x2e, 0x1d, 0x50, 0x05, 0x2e, 0x00, 0xf0, - 0x17, 0x56, 0xd3, 0x0f, 0x01, 0x40, 0xf4, 0x33, 0xcc, 0x08, 0x0d, 0x2f, 0xf4, 0x30, 0x94, 0x08, 0xb9, 0x88, 0x02, - 0xa3, 0x04, 0x2f, 0x1b, 0x58, 0x4c, 0x0a, 0x87, 0xa2, 0x05, 0x2c, 0xcb, 0x22, 0x17, 0x54, 0x4a, 0x0a, 0xf2, 0x3b, - 0xca, 0x08, 0x3c, 0x80, 0x27, 0x2e, 0x59, 0xf0, 0x01, 0x40, 0x01, 0x42, 0xb8, 0x2e, 0x1a, 0x24, 0x26, 0x00, 0x80, - 0x2e, 0x58, 0x00, 0x00, 0x31, 0xc0, 0x2e, 0x21, 0x2e, 0xba, 0xf0, 0x12, 0x30, 0x12, 0x42, 0x02, 0x30, 0x12, 0x42, - 0x12, 0x42, 0x12, 0x42, 0x02, 0x42, 0x03, 0x80, 0x41, 0x84, 0x11, 0x42, 0x02, 0x42, 0xb8, 0x2e, 0x44, 0x47, 0x35, - 0x00, 0x46, 0x00, 0x4f, 0x00, 0xaf, 0x00, 0xff, 0x00, 0xff, 0xb7, 0x00, 0x02, 0x00, 0xb0, 0x05, 0x80, 0xb1, 0xf0, - 0x88, 0x00, 0x80, 0x00, 0x5e, 0xf0, 0xc0, 0x00, 0x59, 0xf0, 0x89, 0xf0, 0x38, 0x00, 0x40, 0x00, 0x42, 0x00, 0x60, - 0x50, 0x03, 0x2e, 0x45, 0x00, 0xe0, 0x7f, 0xf1, 0x7f, 0xdb, 0x7f, 0x30, 0x30, 0x15, 0x54, 0x0a, 0x1a, 0x28, 0x2f, - 0x1a, 0x25, 0x7a, 0x82, 0x00, 0x30, 0x43, 0x30, 0x32, 0x30, 0x05, 0x30, 0x04, 0x30, 0xf6, 0x6f, 0xf2, 0x09, 0xfc, - 0x13, 0xc2, 0xab, 0xb3, 0x09, 0xef, 0x23, 0x80, 0xb3, 0xe6, 0x6f, 0xb7, 0x01, 0x00, 0x2e, 0x8b, 0x41, 0x4b, 0x42, - 0x03, 0x2f, 0x46, 0x40, 0x86, 0x17, 0x81, 0x8d, 0x46, 0x42, 0x41, 0x8b, 0x23, 0xbd, 0xb3, 0xbd, 0x03, 0x89, 0x41, - 0x82, 0x07, 0x0c, 0x43, 0xa3, 0xe6, 0x2f, 0xe1, 0x6f, 0xa2, 0x6f, 0x52, 0x42, 0x00, 0x2e, 0xb2, 0x6f, 0x52, 0x42, - 0x00, 0x2e, 0xc2, 0x6f, 0x42, 0x42, 0x03, 0xb2, 0x06, 0x2f, 0x01, 0x2e, 0x59, 0xf0, 0x01, 0x32, 0x01, 0x0a, 0x21, - 0x2e, 0x59, 0xf0, 0x06, 0x2d, 0x01, 0x2e, 0x59, 0xf0, 0xf1, 0x3d, 0x01, 0x08, 0x21, 0x2e, 0x59, 0xf0, 0xdb, 0x6f, - 0xa0, 0x5f, 0xb8, 0x2e, 0x60, 0x50, 0xc3, 0x7f, 0xd4, 0x7f, 0xe7, 0x7f, 0xf6, 0x7f, 0xb2, 0x7f, 0xa5, 0x7f, 0x36, - 0x30, 0x07, 0x2e, 0x01, 0xf0, 0xbe, 0xbd, 0xbe, 0xbb, 0x1f, 0x58, 0x77, 0x05, 0x01, 0x56, 0x21, 0x54, 0x27, 0x41, - 0x06, 0x41, 0xf8, 0xbf, 0xbe, 0x0b, 0xb5, 0x11, 0xd6, 0x42, 0x03, 0x89, 0x5a, 0x0e, 0xf6, 0x2f, 0x12, 0x30, 0x25, - 0x2e, 0x34, 0x00, 0x02, 0x31, 0x25, 0x2e, 0xb8, 0xf0, 0xd4, 0x6f, 0xc3, 0x6f, 0xe7, 0x6f, 0xb2, 0x6f, 0xa5, 0x6f, - 0xf6, 0x6f, 0xa0, 0x5f, 0xc8, 0x2e, 0x10, 0x50, 0x23, 0x52, 0x03, 0x50, 0xfb, 0x7f, 0x98, 0x2e, 0xf3, 0x00, 0x03, - 0x52, 0x45, 0x82, 0x10, 0x30, 0x50, 0x42, 0x60, 0x30, 0xfb, 0x6f, 0xc0, 0x2e, 0x40, 0x42, 0xf0, 0x5f, 0x10, 0x50, - 0x25, 0x52, 0x05, 0x50, 0xfb, 0x7f, 0x98, 0x2e, 0xf3, 0x00, 0x05, 0x52, 0x45, 0x82, 0x00, 0x30, 0x50, 0x42, 0x70, - 0x30, 0xfb, 0x6f, 0xc0, 0x2e, 0x40, 0x42, 0xf0, 0x5f, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, - 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, - 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, - 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, - 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, - 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, - 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, - 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, - 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, - 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, - 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0xfd, 0x2d, 0x46, 0x86, - 0x70, 0x50, 0xe5, 0x40, 0xc3, 0x88, 0x42, 0x84, 0x04, 0x41, 0xc3, 0x40, 0x06, 0x41, 0x6d, 0xbb, 0xc2, 0x7f, 0xf5, - 0x7f, 0x80, 0xb3, 0xe6, 0x7f, 0xd0, 0x7f, 0xb3, 0x7f, 0x12, 0x30, 0x5e, 0x2f, 0x31, 0x25, 0x55, 0x40, 0x41, 0x91, - 0xa1, 0x7f, 0x0f, 0x2f, 0x01, 0x30, 0xc1, 0x42, 0x00, 0x2e, 0xc2, 0x6f, 0x13, 0x40, 0x93, 0x42, 0x00, 0x2e, 0x13, - 0x40, 0x93, 0x42, 0x00, 0x2e, 0x00, 0x40, 0x80, 0x42, 0xbd, 0x80, 0xc0, 0x2e, 0x01, 0x42, 0x90, 0x5f, 0xc7, 0x86, - 0x01, 0x30, 0xc5, 0x40, 0xfb, 0x86, 0x45, 0x41, 0x04, 0x41, 0x43, 0xbe, 0xc3, 0xbb, 0xd5, 0xbe, 0x55, 0xba, 0x97, - 0x7f, 0x05, 0x30, 0xd1, 0x15, 0xf7, 0x09, 0xc0, 0xb3, 0x09, 0x2f, 0x06, 0x40, 0xc7, 0x40, 0xb7, 0x05, 0x07, 0x30, - 0x80, 0xa9, 0xfe, 0x05, 0xb7, 0x23, 0x74, 0x0f, 0x55, 0x23, 0xe6, 0x6f, 0x41, 0x82, 0x01, 0x80, 0xc1, 0x86, 0x43, - 0xa2, 0xec, 0x2f, 0xb0, 0x6f, 0xa4, 0x6f, 0x28, 0x1a, 0xd1, 0x6f, 0xc3, 0x6f, 0x02, 0x2f, 0x02, 0x30, 0x18, 0x2c, - 0x02, 0x43, 0x05, 0x41, 0x6a, 0x29, 0x96, 0x6f, 0x05, 0x43, 0x6e, 0x0e, 0x10, 0x2f, 0xf4, 0x6f, 0x00, 0xb3, 0x03, - 0x2f, 0x3f, 0x89, 0x94, 0x14, 0x25, 0x2e, 0x5e, 0xf0, 0x41, 0x25, 0x23, 0x25, 0x15, 0x41, 0x95, 0x42, 0x00, 0x2e, - 0x15, 0x41, 0x95, 0x42, 0x00, 0x2e, 0x04, 0x41, 0x84, 0x42, 0x00, 0x90, 0x09, 0x2f, 0x50, 0x40, 0xd0, 0x42, 0x00, - 0x2e, 0x50, 0x40, 0xd0, 0x42, 0x00, 0x2e, 0x40, 0x40, 0x02, 0x2c, 0xc0, 0x42, 0x42, 0x42, 0x90, 0x5f, 0xb8, 0x2e, - 0x00, 0x2e, 0x10, 0x24, 0x8a, 0x02, 0x11, 0x24, 0x00, 0x0c, 0x12, 0x24, 0x80, 0x2e, 0x13, 0x24, 0x18, 0x00, 0x12, - 0x42, 0x13, 0x42, 0x41, 0x1a, 0xfb, 0x2f, 0x10, 0x24, 0x50, 0x39, 0x11, 0x24, 0x21, 0x2e, 0x21, 0x2e, 0x10, 0x00, - 0x23, 0x2e, 0x11, 0x00, 0x80, 0x2e, 0x10, 0x00 -}; - - if ( ctx->drv_sel == ACCEL15_DRV_SEL_SPI ) { - tx_buf[ 0 ] = ACCEL15_NV_DISABLE_I2C; - - accel15_generic_write( ctx, ACCEL15_REG_NV_CONFIG, tx_buf, 1 ); - accel15_config_delay( ); - } - - tx_buf[ 0 ] = ACCEL15_SOFT_RESET; - accel15_generic_write( ctx, ACCEL15_REG_CMD, tx_buf, 1 ); - accel15_config_delay( ); - - tx_buf[ 0 ] = ACCEL15_APS_OFF | ACCEL15_FSW_ON; - accel15_generic_write( ctx, ACCEL15_REG_POWER_CONF, tx_buf, 1 ); - accel15_config_delay( ); - - tx_buf[ 0 ] = ACCEL15_INIT_START; - accel15_generic_write( ctx, ACCEL15_REG_INIT_CTRL, tx_buf, 1 ); - accel15_config_delay( ); - - accel15_generic_write( ctx, ACCEL15_REG_FEATURE_CONFIG, bma490l_config_file, ACCEL15_RD_WR_MAX_LEN ); - accel15_config_delay( ); - - tx_buf[ 0 ] = ACCEL15_INIT_STOP; - accel15_generic_write( ctx, ACCEL15_REG_INIT_CTRL, tx_buf, 1 ); - accel15_config_delay( ); - - tx_buf[ 0 ] = ACCEL15_ACCEL_ON; - accel15_generic_write( ctx, ACCEL15_REG_POWER_CTRL, tx_buf, 1 ); - accel15_config_delay( ); -} - -err_t accel15_generic_write ( accel15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len ) { - return ctx->write_f( ctx, reg, data_in, len ); -} - -err_t accel15_generic_read ( accel15_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len ) { - return ctx->read_f( ctx, reg, data_out, len ); -} - -void accel15_soft_reset ( accel15_t *ctx ) { - uint8_t tx_buf[ 1 ]; - - tx_buf[ 0 ] = ACCEL15_SOFT_RESET; - - accel15_generic_write( ctx, ACCEL15_REG_CMD, tx_buf, 1 ); -} - -err_t accel15_check_id ( accel15_t *ctx ) { - uint8_t id_val; - err_t return_flag = -1; - - return_flag |= accel15_generic_read( ctx, ACCEL15_REG_CHIP_ID, &id_val, 1 ); - - if ( id_val == ACCEL15_CHIP_ID ) { - return_flag = 0; - } - - return return_flag; -} - -uint8_t accel15_get_error ( accel15_t *ctx ) { - uint8_t error; - - accel15_generic_read( ctx, ACCEL15_REG_ERROR, &error, 1 ); - - return error; -} - -uint8_t accel15_get_status ( accel15_t *ctx ) { - uint8_t status; - - accel15_generic_read( ctx, ACCEL15_REG_STATUS, &status, 1 ); - - return status; -} - -void accel15_enable_accel ( accel15_t *ctx ) { - uint8_t buf[ 1 ]; - - accel15_generic_read( ctx, ACCEL15_REG_POWER_CTRL, buf, 1 ); - - buf[ 0 ] |= ACCEL15_X_AXIS_EN; - - accel15_generic_write( ctx, ACCEL15_REG_POWER_CTRL, buf, 1 ); -} - -void accel15_cfg_accel ( accel15_t *ctx, uint8_t acc_odr, uint8_t g_range ) { - uint8_t buf[ 1 ]; - - accel15_generic_read( ctx, ACCEL15_REG_ACCEL_CONFIG, buf, 1 ); - - acc_odr &= ACCEL15_ACCEL_ODR_MSK; - buf[ 0 ] |= acc_odr; - - accel15_generic_write( ctx, ACCEL15_REG_ACCEL_CONFIG, buf, 1 ); - - accel15_generic_read( ctx, ACCEL15_REG_ACCEL_RANGE, buf, 1 ); - - g_range &= ACCEL15_ACCEL_RANGE_MSK; - buf[ 0 ] |= acc_odr; - - accel15_generic_write( ctx, ACCEL15_REG_ACCEL_RANGE, buf, 1 ); -} - -uint8_t accel15_get_internal_status ( accel15_t *ctx ) { - uint8_t int_status; - - accel15_generic_read( ctx, ACCEL15_REG_INTERNAL_STAT, &int_status, 1 ); - - int_status &= ACCEL15_CONFIG_STREAM_MESSAGE_MSK; - - return int_status; -} - -void accel15_get_axis_data ( accel15_t *ctx, accel15_axis_t *axis ) { - uint8_t rx_buf[ 6 ]; - uint16_t tmp; - - accel15_generic_read( ctx, ACCEL15_REG_DATA_8, rx_buf, 6 ); - - tmp = rx_buf[ 1 ]; - tmp <<= 8; - tmp |= rx_buf[ 0 ]; - - axis->x = ( int16_t ) tmp; - - tmp = rx_buf[ 3 ]; - tmp <<= 8; - tmp |= rx_buf[ 2 ]; - - axis->y = ( int16_t ) tmp; - - tmp = rx_buf[ 5 ]; - tmp <<= 8; - tmp |= rx_buf[ 4 ]; - - axis->z = ( int16_t ) tmp; -} - -uint8_t accel15_get_int_1 ( accel15_t *ctx ) { - return digital_in_read( &ctx->i1 ); -} - -uint8_t accel15_get_int_2 ( accel15_t *ctx ) { - return digital_in_read( &ctx->i2 ); -} - -// ----------------------------------------------- PRIVATE FUNCTION DEFINITIONS - -static void accel15_config_delay ( void ) -{ - Delay_100ms( ); -} - -static err_t accel15_i2c_write ( accel15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len ) { - uint8_t tx_buf[ 257 ]; - uint8_t cnt; - - tx_buf[ 0 ] = reg; - - for ( cnt = 1; cnt <= len; cnt++ ) { - tx_buf[ cnt ] = data_in[ cnt - 1 ]; - } - - return i2c_master_write( &ctx->i2c, tx_buf, len + 1 ); -} - -static err_t accel15_i2c_read ( accel15_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len ) { - return i2c_master_write_then_read( &ctx->i2c, ®, 1, data_out, len ); -} - -static err_t accel15_spi_write ( accel15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len ) { - uint8_t tx_buf[ 257 ]; - uint8_t cnt; - - tx_buf[ 0 ] = reg; - tx_buf[ 0 ] |= ACCEL15_SPI_WRITE; - - for ( cnt = 1; cnt <= len; cnt++ ) { - tx_buf[ cnt ] = data_in[ cnt - 1 ]; - } - - spi_master_select_device( ctx->chip_select ); - err_t error_flag = spi_master_write( &ctx->spi, tx_buf, len + 1 ); - spi_master_deselect_device( ctx->chip_select ); - - return error_flag; -} - -static err_t accel15_spi_read ( accel15_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len ) { - uint8_t tx_buf[ 2 ]; - - tx_buf[ 0 ] = reg; - tx_buf[ 0 ] |= ACCEL15_SPI_READ; - tx_buf[ 1 ] = DUMMY; - - spi_master_select_device( ctx->chip_select ); - err_t error_flag = spi_master_write_then_read( &ctx->spi, tx_buf, 2, data_out, len ); - spi_master_deselect_device( ctx->chip_select ); - - return error_flag; -} - -// ------------------------------------------------------------------------ END diff --git a/clicks/accel15/lib_accel15/CMakeLists.txt b/clicks/accel15/lib_accel15/CMakeLists.txt new file mode 100644 index 0000000000..d20a254b2f --- /dev/null +++ b/clicks/accel15/lib_accel15/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(lib_accel15 LANGUAGES MikroC) +else() + project(lib_accel15 LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_library(lib_accel15 STATIC + src/accel15.c + include/accel15.h +) +add_library(Click.Accel15 ALIAS lib_accel15) + + + +target_include_directories(lib_accel15 PUBLIC + include +) + +find_package(MikroC.Core REQUIRED) +target_link_libraries(lib_accel15 PUBLIC MikroC.Core) +find_package(MikroSDK.Driver REQUIRED) +target_link_libraries(lib_accel15 PUBLIC MikroSDK.Driver) diff --git a/clicks/accel15/lib_accel15/include/Click.Accel15 b/clicks/accel15/lib_accel15/include/Click.Accel15 new file mode 100644 index 0000000000..cf7f139544 --- /dev/null +++ b/clicks/accel15/lib_accel15/include/Click.Accel15 @@ -0,0 +1 @@ +#include "accel15.h" diff --git a/clicks/accel15/lib/include/accel15.h b/clicks/accel15/lib_accel15/include/accel15.h similarity index 90% rename from clicks/accel15/lib/include/accel15.h rename to clicks/accel15/lib_accel15/include/accel15.h index cb26e32481..a0584de4a6 100644 --- a/clicks/accel15/lib/include/accel15.h +++ b/clicks/accel15/lib_accel15/include/accel15.h @@ -37,9 +37,6 @@ extern "C"{ #include "drv_i2c_master.h" #include "drv_spi_master.h" - - - /*! * @addtogroup accel15 Accel 15 Click Driver * @brief API for configuring and manipulating Accel 15 Click driver. @@ -83,6 +80,9 @@ extern "C"{ #define ACCEL15_REG_AUX_DEV_ID 0x4B #define ACCEL15_REG_AUX_IF_CONF 0x4C #define ACCEL15_REG_AUX_RD 0x4D +#define ACCEL15_REG_INT1_IO_CTRL 0x53 +#define ACCEL15_REG_INT2_IO_CTRL 0x54 +#define ACCEL15_REG_INT_LATCH 0x55 #define ACCEL15_REG_INT_MAP_1 0x56 #define ACCEL15_REG_INT_MAP_2 0x57 #define ACCEL15_REG_INT_MAP_DATA 0x58 @@ -125,7 +125,7 @@ extern "C"{ #define ACCEL15_CHIP_ID 0x1A #define ACCEL15_FEATURE_SIZE 0x0C #define ACCEL15_RD_WR_MIN_LEN 0x02 -#define ACCEL15_RD_WR_MAX_LEN 0x0514 +#define ACCEL15_RD_WR_MAX_LEN 1300 /** * @brief Accel 15 feature start address. @@ -178,6 +178,36 @@ extern "C"{ #define ACCEL15_NO_MOT_INT 0x40 #define ACCEL15_ERROR_INT 0x80 +/** + * @brief Accel 15 Int1 IO ctrl macros. + * @details Specified setting for INT1 IO ctrl macros + * of Accel 15 Click driver. + */ +#define ACCEL15_INT1_IO_CTRL_INPUT_EN 0x10 +#define ACCEL15_INT1_IO_CTRL_OUTPUT_EN 0x08 +#define ACCEL15_INT1_IO_CTRL_OD_EN 0x04 +#define ACCEL15_INT1_IO_CTRL_LVL_HIGH 0x02 +#define ACCEL15_INT1_IO_CTRL_EDGE_EN 0x01 + +/** + * @brief Accel 15 INT map data macros. + * @details Specified setting for INT map data macros + * of Accel 15 Click driver. + */ +#define ACCEL15_INT_MAP_DATA_INT2_DRDY 0x40 +#define ACCEL15_INT_MAP_DATA_INT2_FWM 0x20 +#define ACCEL15_INT_MAP_DATA_INT2_FFULL 0x10 +#define ACCEL15_INT_MAP_DATA_INT1_DRDY 0x04 +#define ACCEL15_INT_MAP_DATA_INT1_FWM 0x02 +#define ACCEL15_INT_MAP_DATA_INT1_FFULL 0x01 + +/** + * @brief Accel 15 Accel config macros. + * @details Specified setting for Accel config macros + * of Accel 15 Click driver. + */ +#define ACCEL15_ + /** * @brief Accel 15 power ctrl macros. * @details Specified setting for power ctrl macros @@ -214,7 +244,6 @@ extern "C"{ #define ACCEL15_ACCEL_EN 0x40 #define ACCEL15_ACCEL_DRDY 0x80 - /** * @brief Accel 15 Interface selection macro. * @details Specified setting for interface selection macro @@ -302,10 +331,6 @@ extern "C"{ * @details Specified setting for accel ODR * of Accel 15 Click driver. */ -#define ACCEL15_OUTPUT_DATA_RATE_0_78HZ 0x01 -#define ACCEL15_OUTPUT_DATA_RATE_1_56HZ 0x02 -#define ACCEL15_OUTPUT_DATA_RATE_3_12HZ 0x03 -#define ACCEL15_OUTPUT_DATA_RATE_6_25HZ 0x04 #define ACCEL15_OUTPUT_DATA_RATE_12_5HZ 0x05 #define ACCEL15_OUTPUT_DATA_RATE_25HZ 0x06 #define ACCEL15_OUTPUT_DATA_RATE_50HZ 0x07 @@ -334,10 +359,10 @@ extern "C"{ * @details Specified setting for accel range check * of Accel 15 Click driver. */ -#define ACCEL15_ACCEL_RANGE_2G 0 -#define ACCEL15_ACCEL_RANGE_4G 1 -#define ACCEL15_ACCEL_RANGE_8G 2 -#define ACCEL15_ACCEL_RANGE_16G 3 +#define ACCEL15_ACCEL_RANGE_16G 0 +#define ACCEL15_ACCEL_RANGE_8G 1 +#define ACCEL15_ACCEL_RANGE_4G 2 +#define ACCEL15_ACCEL_RANGE_2G 3 /** * @brief Accel 15 error status position and mask. @@ -546,8 +571,8 @@ extern "C"{ cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \ cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \ cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \ - cfg.i2 = MIKROBUS( mikrobus, MIKROBUS_AN ); \ - cfg.i1 = MIKROBUS( mikrobus, MIKROBUS_INT ) + cfg.in2 = MIKROBUS( mikrobus, MIKROBUS_AN ); \ + cfg.in1 = MIKROBUS( mikrobus, MIKROBUS_INT ) /*! @} */ // accel15_map /*! @} */ // accel15 @@ -558,8 +583,8 @@ extern "C"{ */ typedef enum { - ACCEL15_DRV_SEL_SPI, /**< SPI driver descriptor. */ - ACCEL15_DRV_SEL_I2C /**< I2C driver descriptor. */ + ACCEL15_DRV_SEL_SPI, /**< SPI driver descriptor. */ + ACCEL15_DRV_SEL_I2C /**< I2C driver descriptor. */ } accel15_drv_t; @@ -575,19 +600,18 @@ typedef err_t ( *accel15_master_io_t )( struct accel15_s*, uint8_t, uint8_t*, ui */ typedef struct accel15_s { + digital_in_t in2; /**< Interrupt output 2. */ + digital_in_t in1; /**< Interrupt output 1. */ - digital_in_t i2; /**< Interrupt output 2. */ - digital_in_t i1; /**< Interrupt output 1. */ - - i2c_master_t i2c; /**< I2C driver object. */ - spi_master_t spi; /**< SPI driver object. */ + i2c_master_t i2c; /**< I2C driver object. */ + spi_master_t spi; /**< SPI driver object. */ - uint8_t slave_address; /**< Device slave address (used for I2C driver). */ - pin_name_t chip_select; /**< Chip select pin descriptor (used for SPI driver). */ - accel15_drv_t drv_sel; /**< Master driver interface selector. */ + uint8_t slave_address; /**< Device slave address (used for I2C driver). */ + pin_name_t chip_select; /**< Chip select pin descriptor (used for SPI driver). */ + accel15_drv_t drv_sel; /**< Master driver interface selector. */ - accel15_master_io_t write_f; /**< Master write function. */ - accel15_master_io_t read_f; /**< Master read function. */ + accel15_master_io_t write_f; /**< Master write function. */ + accel15_master_io_t read_f; /**< Master read function. */ } accel15_t; @@ -603,17 +627,17 @@ typedef struct pin_name_t mosi; /**< Master output - slave input pin descriptor for SPI driver. */ pin_name_t sck; /**< Clock pin descriptor for SPI driver. */ pin_name_t cs; /**< Chip select pin descriptor for SPI driver. */ - pin_name_t i2; /**< Interrupt output 2. */ - pin_name_t i1; /**< Interrupt output 1. */ + pin_name_t in2; /**< Interrupt output 2. */ + pin_name_t in1; /**< Interrupt output 1. */ - uint32_t i2c_speed; /**< I2C serial speed. */ - uint8_t i2c_address; /**< I2C slave address. */ + uint32_t i2c_speed; /**< I2C serial speed. */ + uint8_t i2c_address; /**< I2C slave address. */ uint32_t spi_speed; /**< SPI serial speed. */ spi_master_mode_t spi_mode; /**< SPI master mode. */ spi_master_chip_select_polarity_t cs_polarity; /**< Chip select pin polarity. */ - accel15_drv_t drv_sel; /**< Master driver interface selector. */ + accel15_drv_t drv_sel; /**< Master driver interface selector. */ } accel15_cfg_t; @@ -628,6 +652,17 @@ typedef struct } accel15_axis_t; +/** + * @brief Accel 15 Click return value data. + * @details Predefined enum values for driver return values. + */ +typedef enum +{ + ACCEL15_OK = 0, + ACCEL15_ERROR = -1 + +} accel15_return_value_t; + /*! * @addtogroup accel15 Accel 15 Click Driver * @brief API for configuring and manipulating Accel 15 Click driver. @@ -683,11 +718,13 @@ err_t accel15_init ( accel15_t *ctx, accel15_cfg_t *cfg ); * click board. * @param[in] ctx : Click context object. * See #accel15_t object definition for detailed explanation. + * @return @li @c 0 - Success, + * @li @c -1 - Error. * * @note This function can consist any necessary configuration or setting to put * device into operating mode. */ -void accel15_default_cfg ( accel15_t *ctx ); +err_t accel15_default_cfg ( accel15_t *ctx ); /** * @brief Accel 15 data writing function. @@ -798,10 +835,6 @@ void accel15_enable_accel ( accel15_t *ctx ); * @param[in] ctx : Click context object. * See #accel15_t object definition for detailed explanation. * @param[in] acc_odr : - * @li @c 0x01 - odr_0p78, 25/32. - * @li @c 0x02 - odr_1p5, 25/16. - * @li @c 0x03 - odr_3p1, 25/8. - * @li @c 0x04 - odr_6p25, 25/4. * @li @c 0x05 - odr_12p5, 25/2. * @li @c 0x06 - odr_25, 25. * @li @c 0x07 - odr_50, 50. @@ -811,10 +844,10 @@ void accel15_enable_accel ( accel15_t *ctx ); * @li @c 0x0b - odr_800, 800. * @li @c 0x0c - odr_1k6, 1600. * @param[in] g_range : - * @li @c 0x00 - range_2g, +/-2g. - * @li @c 0x01 - range_4g, +/-4g. - * @li @c 0x02 - range_8g, +/-8g. - * @li @c 0x03 - range_16g, +/-16g. + * @li @c 0x00 - range_16g, +/-16g. + * @li @c 0x01 - range_8g, +/-8g. + * @li @c 0x02 - range_4g, +/-4g. + * @li @c 0x03 - range_2g, +/-2g. * @return Nothing. * * @note None. @@ -842,11 +875,12 @@ uint8_t accel15_get_internal_status ( accel15_t *ctx ); * @param[in] ctx : Click context object. * See #accel15_t object definition for detailed explanation. * @param[in] axis : An object that contains X , Y and Z axis data. - * @return Nothing. + * @return @li @c 0 - Success, + * @li @c -1 - Error. * * @note None. */ -void accel15_get_axis_data ( accel15_t *ctx, accel15_axis_t *axis ); +err_t accel15_get_axis_data ( accel15_t *ctx, accel15_axis_t *axis ); /** * @brief Accel 15 get Interrupt 1 function. diff --git a/clicks/accel15/lib_accel15/src/accel15.c b/clicks/accel15/lib_accel15/src/accel15.c new file mode 100644 index 0000000000..083f883cd5 --- /dev/null +++ b/clicks/accel15/lib_accel15/src/accel15.c @@ -0,0 +1,556 @@ +/**************************************************************************** +** Copyright (C) 2020 MikroElektronika d.o.o. +** Contact: https://www.mikroe.com/contact +** +** Permission is hereby granted, free of charge, to any person obtaining a copy +** of this software and associated documentation files (the "Software"), to deal +** in the Software without restriction, including without limitation the rights +** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +** copies of the Software, and to permit persons to whom the Software is +** furnished to do so, subject to the following conditions: +** The above copyright notice and this permission notice shall be +** included in all copies or substantial portions of the Software. +** +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +** USE OR OTHER DEALINGS IN THE SOFTWARE. +****************************************************************************/ + +/*! + * @file accel15.c + * @brief Accel 15 Click Driver. + */ + +#include "accel15.h" + +/** + * @brief Dummy data. + * @details Definition of dummy data. + */ +#define DUMMY 0x00 + +/** + * @brief Config file array. + * @details Global array that stores the configuration file of BMA490L. + */ +const uint8_t bma490l_config_file[ ACCEL15_RD_WR_MAX_LEN ] = +{ + 0xc8, 0x2e, 0x00, 0x2e, 0xc8, 0x2e, 0x00, 0x2e, 0xc8, 0x2e, 0x00, 0x2e, 0xc8, 0x2e, 0x00, 0x2e, + 0xc8, 0x2e, 0x00, 0x2e, 0xc8, 0x2e, 0x00, 0x2e, 0xc8, 0x2e, 0x00, 0x2e, 0x80, 0x2e, 0x58, 0x01, + 0x80, 0x2e, 0x74, 0x02, 0xb0, 0xf0, 0x10, 0x30, 0x21, 0x2e, 0x16, 0xf0, 0x80, 0x2e, 0xeb, 0x00, + 0x19, 0x50, 0x17, 0x52, 0x01, 0x42, 0x3b, 0x80, 0x41, 0x30, 0x01, 0x42, 0x3c, 0x80, 0x00, 0x2e, + 0x01, 0x40, 0x01, 0x42, 0x21, 0x2e, 0xff, 0xaf, 0xb8, 0x2e, 0x9b, 0x95, 0x80, 0x2e, 0x18, 0x00, + 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, + 0x80, 0x2e, 0x18, 0x00, 0xfd, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x2e, 0x55, 0xf0, 0xc0, 0x2e, 0x21, 0x2e, 0x55, 0xf0, 0x80, 0x2e, 0x18, 0x00, 0xfd, 0x2d, + 0xaa, 0x00, 0x05, 0x00, 0xaa, 0x00, 0x05, 0x00, 0x40, 0x48, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x98, 0x2e, 0x80, 0x00, 0x20, 0x26, 0x98, 0x2e, 0xef, 0x00, 0x10, 0x30, 0x21, 0x2e, 0x59, 0xf0, + 0x98, 0x2e, 0x38, 0x00, 0x98, 0x2e, 0x7f, 0x01, 0x98, 0x2e, 0x8e, 0x01, 0x00, 0x2e, 0x00, 0x2e, + 0xd0, 0x2e, 0x98, 0x2e, 0xce, 0x00, 0x01, 0x2e, 0x34, 0x00, 0x00, 0xb2, 0x0d, 0x2f, 0x00, 0x30, + 0x21, 0x2e, 0x34, 0x00, 0x01, 0x50, 0x98, 0x2e, 0x13, 0x01, 0x01, 0x50, 0x03, 0x52, 0x98, 0x2e, + 0x00, 0xb0, 0x01, 0x50, 0x05, 0x52, 0x98, 0x2e, 0x00, 0xb0, 0x98, 0x2e, 0x38, 0x00, 0xe6, 0x2d, + 0x13, 0x52, 0x40, 0x30, 0x42, 0x40, 0x90, 0x0a, 0x42, 0x42, 0x58, 0x84, 0x07, 0x52, 0xa1, 0x42, + 0x71, 0x3c, 0x09, 0x56, 0x83, 0x42, 0xa9, 0x84, 0x83, 0x32, 0x84, 0x40, 0x61, 0x08, 0x4b, 0x0a, + 0x81, 0x42, 0x82, 0x82, 0x02, 0x3f, 0x43, 0x40, 0x9a, 0x08, 0x52, 0x42, 0x40, 0x42, 0x7e, 0x80, + 0x61, 0x30, 0x01, 0x42, 0x10, 0x50, 0x01, 0x2e, 0x40, 0xf0, 0x1a, 0x90, 0xfb, 0x7f, 0x20, 0x2f, + 0x03, 0x30, 0x0d, 0x50, 0x34, 0x33, 0x06, 0x30, 0x11, 0x52, 0x0b, 0x54, 0x55, 0x32, 0x1d, 0x1a, + 0xe3, 0x22, 0x18, 0x1a, 0x0f, 0x58, 0xe3, 0x22, 0x04, 0x30, 0xd5, 0x40, 0xb5, 0x0d, 0xe1, 0xbe, + 0x6f, 0xbb, 0x80, 0x91, 0xa9, 0x0d, 0x01, 0x89, 0xb5, 0x23, 0x10, 0xa1, 0xf7, 0x2f, 0xda, 0x0e, + 0x34, 0x33, 0xeb, 0x2f, 0x01, 0x2e, 0x25, 0x00, 0x70, 0x1a, 0x00, 0x30, 0x21, 0x30, 0x02, 0x2c, + 0x08, 0x22, 0x30, 0x30, 0x00, 0xb2, 0x06, 0x2f, 0x21, 0x2e, 0x59, 0xf0, 0x98, 0x2e, 0x38, 0x00, + 0x00, 0x2e, 0x00, 0x2e, 0xd0, 0x2e, 0xfb, 0x6f, 0xf0, 0x5f, 0xb8, 0x2e, 0x1d, 0x50, 0x05, 0x2e, + 0x00, 0xf0, 0x17, 0x56, 0xd3, 0x0f, 0x01, 0x40, 0xf4, 0x33, 0xcc, 0x08, 0x0d, 0x2f, 0xf4, 0x30, + 0x94, 0x08, 0xb9, 0x88, 0x02, 0xa3, 0x04, 0x2f, 0x1b, 0x58, 0x4c, 0x0a, 0x87, 0xa2, 0x05, 0x2c, + 0xcb, 0x22, 0x17, 0x54, 0x4a, 0x0a, 0xf2, 0x3b, 0xca, 0x08, 0x3c, 0x80, 0x27, 0x2e, 0x59, 0xf0, + 0x01, 0x40, 0x01, 0x42, 0xb8, 0x2e, 0x1a, 0x24, 0x26, 0x00, 0x80, 0x2e, 0x58, 0x00, 0x00, 0x31, + 0xc0, 0x2e, 0x21, 0x2e, 0xba, 0xf0, 0x12, 0x30, 0x12, 0x42, 0x02, 0x30, 0x12, 0x42, 0x12, 0x42, + 0x12, 0x42, 0x02, 0x42, 0x03, 0x80, 0x41, 0x84, 0x11, 0x42, 0x02, 0x42, 0xb8, 0x2e, 0x44, 0x47, + 0x35, 0x00, 0x46, 0x00, 0x4f, 0x00, 0xaf, 0x00, 0xff, 0x00, 0xff, 0xb7, 0x00, 0x02, 0x00, 0xb0, + 0x05, 0x80, 0xb1, 0xf0, 0x88, 0x00, 0x80, 0x00, 0x5e, 0xf0, 0xc0, 0x00, 0x59, 0xf0, 0x89, 0xf0, + 0x38, 0x00, 0x40, 0x00, 0x42, 0x00, 0x60, 0x50, 0x03, 0x2e, 0x45, 0x00, 0xe0, 0x7f, 0xf1, 0x7f, + 0xdb, 0x7f, 0x30, 0x30, 0x15, 0x54, 0x0a, 0x1a, 0x28, 0x2f, 0x1a, 0x25, 0x7a, 0x82, 0x00, 0x30, + 0x43, 0x30, 0x32, 0x30, 0x05, 0x30, 0x04, 0x30, 0xf6, 0x6f, 0xf2, 0x09, 0xfc, 0x13, 0xc2, 0xab, + 0xb3, 0x09, 0xef, 0x23, 0x80, 0xb3, 0xe6, 0x6f, 0xb7, 0x01, 0x00, 0x2e, 0x8b, 0x41, 0x4b, 0x42, + 0x03, 0x2f, 0x46, 0x40, 0x86, 0x17, 0x81, 0x8d, 0x46, 0x42, 0x41, 0x8b, 0x23, 0xbd, 0xb3, 0xbd, + 0x03, 0x89, 0x41, 0x82, 0x07, 0x0c, 0x43, 0xa3, 0xe6, 0x2f, 0xe1, 0x6f, 0xa2, 0x6f, 0x52, 0x42, + 0x00, 0x2e, 0xb2, 0x6f, 0x52, 0x42, 0x00, 0x2e, 0xc2, 0x6f, 0x42, 0x42, 0x03, 0xb2, 0x06, 0x2f, + 0x01, 0x2e, 0x59, 0xf0, 0x01, 0x32, 0x01, 0x0a, 0x21, 0x2e, 0x59, 0xf0, 0x06, 0x2d, 0x01, 0x2e, + 0x59, 0xf0, 0xf1, 0x3d, 0x01, 0x08, 0x21, 0x2e, 0x59, 0xf0, 0xdb, 0x6f, 0xa0, 0x5f, 0xb8, 0x2e, + 0x60, 0x50, 0xc3, 0x7f, 0xd4, 0x7f, 0xe7, 0x7f, 0xf6, 0x7f, 0xb2, 0x7f, 0xa5, 0x7f, 0x36, 0x30, + 0x07, 0x2e, 0x01, 0xf0, 0xbe, 0xbd, 0xbe, 0xbb, 0x1f, 0x58, 0x77, 0x05, 0x01, 0x56, 0x21, 0x54, + 0x27, 0x41, 0x06, 0x41, 0xf8, 0xbf, 0xbe, 0x0b, 0xb5, 0x11, 0xd6, 0x42, 0x03, 0x89, 0x5a, 0x0e, + 0xf6, 0x2f, 0x12, 0x30, 0x25, 0x2e, 0x34, 0x00, 0x02, 0x31, 0x25, 0x2e, 0xb8, 0xf0, 0xd4, 0x6f, + 0xc3, 0x6f, 0xe7, 0x6f, 0xb2, 0x6f, 0xa5, 0x6f, 0xf6, 0x6f, 0xa0, 0x5f, 0xc8, 0x2e, 0x10, 0x50, + 0x23, 0x52, 0x03, 0x50, 0xfb, 0x7f, 0x98, 0x2e, 0xf3, 0x00, 0x03, 0x52, 0x45, 0x82, 0x10, 0x30, + 0x50, 0x42, 0x60, 0x30, 0xfb, 0x6f, 0xc0, 0x2e, 0x40, 0x42, 0xf0, 0x5f, 0x10, 0x50, 0x25, 0x52, + 0x05, 0x50, 0xfb, 0x7f, 0x98, 0x2e, 0xf3, 0x00, 0x05, 0x52, 0x45, 0x82, 0x00, 0x30, 0x50, 0x42, + 0x70, 0x30, 0xfb, 0x6f, 0xc0, 0x2e, 0x40, 0x42, 0xf0, 0x5f, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, + 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, + 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, + 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, + 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, + 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, + 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, + 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, + 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, + 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, + 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, + 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, + 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 0xfd, 0x2d, + 0x46, 0x86, 0x70, 0x50, 0xe5, 0x40, 0xc3, 0x88, 0x42, 0x84, 0x04, 0x41, 0xc3, 0x40, 0x06, 0x41, + 0x6d, 0xbb, 0xc2, 0x7f, 0xf5, 0x7f, 0x80, 0xb3, 0xe6, 0x7f, 0xd0, 0x7f, 0xb3, 0x7f, 0x12, 0x30, + 0x5e, 0x2f, 0x31, 0x25, 0x55, 0x40, 0x41, 0x91, 0xa1, 0x7f, 0x0f, 0x2f, 0x01, 0x30, 0xc1, 0x42, + 0x00, 0x2e, 0xc2, 0x6f, 0x13, 0x40, 0x93, 0x42, 0x00, 0x2e, 0x13, 0x40, 0x93, 0x42, 0x00, 0x2e, + 0x00, 0x40, 0x80, 0x42, 0xbd, 0x80, 0xc0, 0x2e, 0x01, 0x42, 0x90, 0x5f, 0xc7, 0x86, 0x01, 0x30, + 0xc5, 0x40, 0xfb, 0x86, 0x45, 0x41, 0x04, 0x41, 0x43, 0xbe, 0xc3, 0xbb, 0xd5, 0xbe, 0x55, 0xba, + 0x97, 0x7f, 0x05, 0x30, 0xd1, 0x15, 0xf7, 0x09, 0xc0, 0xb3, 0x09, 0x2f, 0x06, 0x40, 0xc7, 0x40, + 0xb7, 0x05, 0x07, 0x30, 0x80, 0xa9, 0xfe, 0x05, 0xb7, 0x23, 0x74, 0x0f, 0x55, 0x23, 0xe6, 0x6f, + 0x41, 0x82, 0x01, 0x80, 0xc1, 0x86, 0x43, 0xa2, 0xec, 0x2f, 0xb0, 0x6f, 0xa4, 0x6f, 0x28, 0x1a, + 0xd1, 0x6f, 0xc3, 0x6f, 0x02, 0x2f, 0x02, 0x30, 0x18, 0x2c, 0x02, 0x43, 0x05, 0x41, 0x6a, 0x29, + 0x96, 0x6f, 0x05, 0x43, 0x6e, 0x0e, 0x10, 0x2f, 0xf4, 0x6f, 0x00, 0xb3, 0x03, 0x2f, 0x3f, 0x89, + 0x94, 0x14, 0x25, 0x2e, 0x5e, 0xf0, 0x41, 0x25, 0x23, 0x25, 0x15, 0x41, 0x95, 0x42, 0x00, 0x2e, + 0x15, 0x41, 0x95, 0x42, 0x00, 0x2e, 0x04, 0x41, 0x84, 0x42, 0x00, 0x90, 0x09, 0x2f, 0x50, 0x40, + 0xd0, 0x42, 0x00, 0x2e, 0x50, 0x40, 0xd0, 0x42, 0x00, 0x2e, 0x40, 0x40, 0x02, 0x2c, 0xc0, 0x42, + 0x42, 0x42, 0x90, 0x5f, 0xb8, 0x2e, 0x00, 0x2e, 0x10, 0x24, 0x8a, 0x02, 0x11, 0x24, 0x00, 0x0c, + 0x12, 0x24, 0x80, 0x2e, 0x13, 0x24, 0x18, 0x00, 0x12, 0x42, 0x13, 0x42, 0x41, 0x1a, 0xfb, 0x2f, + 0x10, 0x24, 0x50, 0x39, 0x11, 0x24, 0x21, 0x2e, 0x21, 0x2e, 0x10, 0x00, 0x23, 0x2e, 0x11, 0x00, + 0x80, 0x2e, 0x10, 0x00, +}; + +// ---------------------------------------------- PRIVATE FUNCTION DECLARATIONS + +/** + * @brief Accel 15 configuration delay function. + * @details Configuration delay for 100 milliseconds. + * + * @note None. + */ + +static void accel15_config_delay ( void ); + +/** + * @brief Accel 15 I2C writing function. + * @details This function writes a desired number of data bytes starting from + * the selected register by using I2C serial interface. + * @param[in] ctx : Click context object. + * See #accel15_t object definition for detailed explanation. + * @param[in] reg : Start register address. + * @param[in] data_in : Data to be written. + * @param[in] len : Number of bytes to be written. + * @return @li @c 0 - Success, + * @li @c -1 - Error. + * + * See #err_t definition for detailed explanation. + * @note None. + */ +static err_t accel15_i2c_write ( accel15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len ); + +/** + * @brief Accel 15 I2C reading function. + * @details This function reads a desired number of data bytes starting from + * the selected register by using I2C serial interface. + * @param[in] ctx : Click context object. + * See #accel15_t object definition for detailed explanation. + * @param[in] reg : Start register address. + * @param[out] data_out : Output read data. + * @param[in] len : Number of bytes to be read. + * @return @li @c 0 - Success, + * @li @c -1 - Error. + * + * See #err_t definition for detailed explanation. + * @note None. + */ +static err_t accel15_i2c_read ( accel15_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len ); + +/** + * @brief Accel 15 SPI writing function. + * @details This function writes a desired number of data bytes starting from + * the selected register by using SPI serial interface. + * @param[in] ctx : Click context object. + * See #accel15_t object definition for detailed explanation. + * @param[in] reg : Start register address. + * @param[in] data_in : Data to be written. + * @param[in] len : Number of bytes to be written. + * @return @li @c 0 - Success, + * @li @c -1 - Error. + * + * See #err_t definition for detailed explanation. + * @note None. + */ +static err_t accel15_spi_write ( accel15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len ); + +/** + * @brief Accel 15 SPI reading function. + * @details This function reads a desired number of data bytes starting from + * the selected register by using SPI serial interface. + * @param[in] ctx : Click context object. + * See #accel15_t object definition for detailed explanation. + * @param[in] reg : Start register address. + * @param[out] data_out : Output read data. + * @param[in] len : Number of bytes to be read. + * @return @li @c 0 - Success, + * @li @c -1 - Error. + * + * See #err_t definition for detailed explanation. + * @note None. + */ +static err_t accel15_spi_read ( accel15_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len ); + +// ------------------------------------------------ PUBLIC FUNCTION DEFINITIONS + +void accel15_cfg_setup ( accel15_cfg_t *cfg ) +{ + cfg->scl = HAL_PIN_NC; + cfg->sda = HAL_PIN_NC; + cfg->sck = HAL_PIN_NC; + cfg->miso = HAL_PIN_NC; + cfg->mosi = HAL_PIN_NC; + cfg->cs = HAL_PIN_NC; + cfg->in2 = HAL_PIN_NC; + cfg->in1 = HAL_PIN_NC; + + cfg->i2c_speed = I2C_MASTER_SPEED_STANDARD; + cfg->i2c_address = ACCEL15_SET_DEV_ADDR_GND; + + cfg->spi_speed = 100000; + cfg->spi_mode = SPI_MASTER_MODE_0; + cfg->cs_polarity = SPI_MASTER_CHIP_SELECT_POLARITY_ACTIVE_LOW; + + cfg->drv_sel = ACCEL15_DRV_SEL_I2C; +} + +void accel15_drv_interface_selection ( accel15_cfg_t *cfg, accel15_drv_t drv_sel ) +{ + cfg->drv_sel = drv_sel; +} + +err_t accel15_init ( accel15_t *ctx, accel15_cfg_t *cfg ) +{ + ctx->drv_sel = cfg->drv_sel; + + if ( ACCEL15_DRV_SEL_I2C == ctx->drv_sel ) + { + i2c_master_config_t i2c_cfg; + + i2c_master_configure_default( &i2c_cfg ); + + i2c_cfg.scl = cfg->scl; + i2c_cfg.sda = cfg->sda; + + ctx->slave_address = cfg->i2c_address; + + if ( I2C_MASTER_ERROR == i2c_master_open( &ctx->i2c, &i2c_cfg ) ) + { + return I2C_MASTER_ERROR; + } + + if ( I2C_MASTER_ERROR == i2c_master_set_slave_address( &ctx->i2c, ctx->slave_address ) ) + { + return I2C_MASTER_ERROR; + } + + if ( I2C_MASTER_ERROR == i2c_master_set_speed( &ctx->i2c, cfg->i2c_speed ) ) + { + return I2C_MASTER_ERROR; + } + + ctx->read_f = accel15_i2c_read; + ctx->write_f = accel15_i2c_write; + } + else + { + spi_master_config_t spi_cfg; + + spi_master_configure_default( &spi_cfg ); + + spi_cfg.sck = cfg->sck; + spi_cfg.miso = cfg->miso; + spi_cfg.mosi = cfg->mosi; + + ctx->chip_select = cfg->cs; + + if ( SPI_MASTER_ERROR == spi_master_open( &ctx->spi, &spi_cfg ) ) + { + return SPI_MASTER_ERROR; + } + + if ( SPI_MASTER_ERROR == spi_master_set_default_write_data( &ctx->spi, DUMMY ) ) + { + return SPI_MASTER_ERROR; + } + + if ( SPI_MASTER_ERROR == spi_master_set_mode( &ctx->spi, cfg->spi_mode ) ) + { + return SPI_MASTER_ERROR; + } + + if ( SPI_MASTER_ERROR == spi_master_set_speed( &ctx->spi, cfg->spi_speed ) ) + { + return SPI_MASTER_ERROR; + } + + spi_master_set_chip_select_polarity( cfg->cs_polarity ); + spi_master_deselect_device( ctx->chip_select ); + + ctx->read_f = accel15_spi_read; + ctx->write_f = accel15_spi_write; + } + + digital_in_init( &ctx->in2, cfg->in2 ); + digital_in_init( &ctx->in1, cfg->in1 ); + + return ACCEL15_OK; +} + +err_t accel15_default_cfg ( accel15_t *ctx ) +{ + err_t error_flag = ACCEL15_OK; + uint8_t data_buf[ 128 ] = { 0 }; + uint16_t cnt = 0; + uint16_t len = 0; + uint8_t tx_buf[ 1 ] = { 0 }; + if ( ACCEL15_DRV_SEL_SPI == ctx->drv_sel ) + { + tx_buf[ 0 ] = ACCEL15_NV_DISABLE_I2C; + + error_flag |= accel15_generic_write( ctx, ACCEL15_REG_NV_CONFIG, tx_buf, 1 ); + accel15_config_delay( ); + } + + tx_buf[ 0 ] = ACCEL15_SOFT_RESET; + error_flag |= accel15_generic_write( ctx, ACCEL15_REG_CMD, tx_buf, 1 ); + accel15_config_delay( ); + + tx_buf[ 0 ] = ACCEL15_APS_OFF | ACCEL15_FSW_ON; + error_flag |= accel15_generic_write( ctx, ACCEL15_REG_POWER_CONF, tx_buf, 1 ); + accel15_config_delay( ); + + tx_buf[ 0 ] = ACCEL15_INIT_START; + error_flag |= accel15_generic_write( ctx, ACCEL15_REG_INIT_CTRL, tx_buf, 1 ); + accel15_config_delay( ); + + len = sizeof ( bma490l_config_file ); + while ( cnt < len ) + { + data_buf[ 0 ] = ( ( cnt / 2 ) & 0x0F ); + error_flag |= accel15_generic_write( ctx, ACCEL15_REG_RESERVED_REG_5B, data_buf, 1 ); + data_buf[ 0 ] = ( uint8_t ) ( ( cnt / 2 ) >> 4 ); + error_flag |= accel15_generic_write( ctx, ACCEL15_REG_RESERVED_REG_5C, data_buf, 1 ); + if ( ( len - cnt ) >= 128 ) + { + memcpy ( data_buf, &bma490l_config_file[ cnt ], 128 ); + error_flag |= accel15_generic_write( ctx, ACCEL15_REG_FEATURE_CONFIG, data_buf, 128 ); + } + else + { + memcpy ( data_buf, &bma490l_config_file[ cnt ], len - cnt ); + error_flag |= accel15_generic_write( ctx, ACCEL15_REG_FEATURE_CONFIG, data_buf, len - cnt ); + } + cnt += 128; + } + accel15_config_delay( ); + + tx_buf[ 0 ] = ACCEL15_INIT_STOP; + error_flag |= accel15_generic_write( ctx, ACCEL15_REG_INIT_CTRL, tx_buf, 1 ); + accel15_config_delay( ); + + tx_buf[ 0 ] = ACCEL15_INT1_IO_CTRL_OUTPUT_EN | ACCEL15_INT1_IO_CTRL_LVL_HIGH; + error_flag |= accel15_generic_write( ctx, ACCEL15_REG_INT1_IO_CTRL, tx_buf, 1 ); + accel15_config_delay( ); + + tx_buf[ 0 ] = ACCEL15_INT_MAP_DATA_INT1_DRDY; + error_flag |= accel15_generic_write( ctx, ACCEL15_REG_INT_MAP_DATA, tx_buf, 1 ); + accel15_config_delay( ); + + accel15_cfg_accel( ctx, ACCEL15_OUTPUT_DATA_RATE_12_5HZ, ACCEL15_ACCEL_RANGE_2G ); + accel15_config_delay( ); + + tx_buf[ 0 ] = ACCEL15_ACCEL_ON; + error_flag |= accel15_generic_write( ctx, ACCEL15_REG_POWER_CTRL, tx_buf, 1 ); + accel15_config_delay( ); + return error_flag; +} + +err_t accel15_generic_write ( accel15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len ) +{ + return ctx->write_f( ctx, reg, data_in, len ); +} + +err_t accel15_generic_read ( accel15_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len ) +{ + return ctx->read_f( ctx, reg, data_out, len ); +} + +void accel15_soft_reset ( accel15_t *ctx ) +{ + uint8_t tx_buf[ 1 ] = { 0 }; + + tx_buf[ 0 ] = ACCEL15_SOFT_RESET; + + accel15_generic_write( ctx, ACCEL15_REG_CMD, tx_buf, 1 ); +} + +err_t accel15_check_id ( accel15_t *ctx ) +{ + uint8_t id_val = 0; + err_t return_flag = ACCEL15_OK; + + return_flag |= accel15_generic_read( ctx, ACCEL15_REG_CHIP_ID, &id_val, 1 ); + + if ( ACCEL15_CHIP_ID != id_val ) + { + return_flag = ACCEL15_ERROR; + } + + return return_flag; +} + +uint8_t accel15_get_error ( accel15_t *ctx ) +{ + uint8_t error = 0; + + accel15_generic_read( ctx, ACCEL15_REG_ERROR, &error, 1 ); + + return error; +} + +uint8_t accel15_get_status ( accel15_t *ctx ) +{ + uint8_t status = 0; + + accel15_generic_read( ctx, ACCEL15_REG_STATUS, &status, 1 ); + + return status; +} + +void accel15_enable_accel ( accel15_t *ctx ) +{ + uint8_t buf[ 1 ] = { 0 }; + + accel15_generic_read( ctx, ACCEL15_REG_POWER_CTRL, buf, 1 ); + + buf[ 0 ] &= ( ~ACCEL15_X_AXIS_EN ); + buf[ 0 ] |= ACCEL15_X_AXIS_EN; + + accel15_generic_write( ctx, ACCEL15_REG_POWER_CTRL, buf, 1 ); +} + +void accel15_cfg_accel ( accel15_t *ctx, uint8_t acc_odr, uint8_t g_range ) +{ + uint8_t buf[ 1 ] = { 0 }; + + accel15_generic_read( ctx, ACCEL15_REG_ACCEL_CONFIG, buf, 1 ); + + buf[ 0 ] &= ( ~ACCEL15_ACCEL_ODR_MSK ); + buf[ 0 ] |= ( acc_odr & ACCEL15_ACCEL_ODR_MSK ); + + accel15_generic_write( ctx, ACCEL15_REG_ACCEL_CONFIG, buf, 1 ); + + accel15_generic_read( ctx, ACCEL15_REG_ACCEL_RANGE, buf, 1 ); + + buf[ 0 ] &= ( ~ACCEL15_ACCEL_RANGE_MSK ); + buf[ 0 ] |= ( g_range & ACCEL15_ACCEL_RANGE_MSK ); + + accel15_generic_write( ctx, ACCEL15_REG_ACCEL_RANGE, buf, 1 ); +} + +uint8_t accel15_get_internal_status ( accel15_t *ctx ) +{ + uint8_t int_status = 0; + + accel15_generic_read( ctx, ACCEL15_REG_INTERNAL_STAT, &int_status, 1 ); + + int_status &= ACCEL15_CONFIG_STREAM_MESSAGE_MSK; + + return int_status; +} + +err_t accel15_get_axis_data ( accel15_t *ctx, accel15_axis_t *axis ) +{ + uint8_t rx_buf[ 6 ] = { 0 }; + uint16_t tmp = 0; + + err_t error_flag = accel15_generic_read( ctx, ACCEL15_REG_DATA_8, rx_buf, 6 ); + + tmp = rx_buf[ 1 ]; + tmp <<= 8; + tmp |= rx_buf[ 0 ]; + axis->x = ( int16_t ) tmp; + + tmp = rx_buf[ 3 ]; + tmp <<= 8; + tmp |= rx_buf[ 2 ]; + axis->y = ( int16_t ) tmp; + + tmp = rx_buf[ 5 ]; + tmp <<= 8; + tmp |= rx_buf[ 4 ]; + axis->z = ( int16_t ) tmp; + + return error_flag; +} + +uint8_t accel15_get_int_1 ( accel15_t *ctx ) +{ + return digital_in_read( &ctx->in1 ); +} + +uint8_t accel15_get_int_2 ( accel15_t *ctx ) +{ + return digital_in_read( &ctx->in2 ); +} + +// ----------------------------------------------- PRIVATE FUNCTION DEFINITIONS + +static void accel15_config_delay ( void ) +{ + Delay_100ms( ); +} + +static err_t accel15_i2c_write ( accel15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len ) +{ + uint8_t tx_buf[ 256 ] = { 0 }; + tx_buf[ 0 ] = reg; + for ( uint8_t cnt = 0; cnt < len; cnt++ ) + { + tx_buf[ cnt + 1 ] = data_in[ cnt ]; + } + return i2c_master_write( &ctx->i2c, tx_buf, len + 1 ); +} + +static err_t accel15_i2c_read ( accel15_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len ) +{ + return i2c_master_write_then_read( &ctx->i2c, ®, 1, data_out, len ); +} + +static err_t accel15_spi_write ( accel15_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len ) +{ + uint8_t tx_buf[ 1 ] = { 0 }; + tx_buf[ 0 ] = reg; + tx_buf[ 0 ] |= ACCEL15_SPI_WRITE; + spi_master_select_device( ctx->chip_select ); + err_t error_flag = spi_master_write( &ctx->spi, tx_buf, 1 ); + error_flag |= spi_master_write( &ctx->spi, data_in, len ); + spi_master_deselect_device( ctx->chip_select ); + return error_flag; +} + +static err_t accel15_spi_read ( accel15_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len ) +{ + uint8_t tx_buf[ 2 ] = { 0 }; + tx_buf[ 0 ] = reg; + tx_buf[ 0 ] |= ACCEL15_SPI_READ; + tx_buf[ 1 ] = DUMMY; + spi_master_select_device( ctx->chip_select ); + err_t error_flag = spi_master_write_then_read( &ctx->spi, tx_buf, 2, data_out, len ); + spi_master_deselect_device( ctx->chip_select ); + return error_flag; +} + +// ------------------------------------------------------------------------ END diff --git a/clicks/accel15/memake.txt b/clicks/accel15/memake.txt deleted file mode 100644 index a3bf73c40c..0000000000 --- a/clicks/accel15/memake.txt +++ /dev/null @@ -1,8 +0,0 @@ -type: subdirs - -project: Accel15 - -subdirs: { - lib - example -} diff --git a/clicks/accel16/CHANGELOG.md b/clicks/accel16/CHANGELOG.md index fb1dd95ea8..086189320b 100644 --- a/clicks/accel16/CHANGELOG.md +++ b/clicks/accel16/CHANGELOG.md @@ -1,4 +1,4 @@ ## Changelog -### Version 2.0.0.1 +### Version 2.1.0.1 - Initial release diff --git a/clicks/accel16/CMakeLists.txt b/clicks/accel16/CMakeLists.txt new file mode 100644 index 0000000000..da9226645d --- /dev/null +++ b/clicks/accel16/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(example_accel16 LANGUAGES MikroC) +else() + project(example_accel16 LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_executable(example_accel16 + example/main.c + +) + + +############################ example_accel16 GENERATED CODE START ########################### +find_package(MikroC.Core REQUIRED) +target_link_libraries(example_accel16 PUBLIC MikroC.Core) +find_package(MikroSDK.Board REQUIRED) +target_link_libraries(example_accel16 PUBLIC MikroSDK.Board) +find_package(MikroSDK.Log REQUIRED) +target_link_libraries(example_accel16 PUBLIC MikroSDK.Log) +find_package(MikroSDK.Conversions REQUIRED) +target_link_libraries(example_accel16 PUBLIC MikroSDK.Conversions) +add_subdirectory(lib_accel16) +target_link_libraries(example_accel16 PUBLIC Click.Accel16) +############################ example_accel16 GENERATED CODE END ########################### diff --git a/clicks/accel16/README.md b/clicks/accel16/README.md index 935ed87010..ab5ec1c71d 100644 --- a/clicks/accel16/README.md +++ b/clicks/accel16/README.md @@ -83,8 +83,8 @@ in internal fifo buffer. > Initialization of communication modules(SPI, UART) and additional interrupt pins. Reads device ID's and revision. Then configures device to work in FIFO mode or to read data -from the registers, sets 2g resolution, 100Hz output data rate, -sets interrupt 1 active low, and powers on device. +from the registers, sets 2g resolution, 12.5Hz output data rate, +sets interrupt 1 active low, powers on device, and calibrates temperature. ```c @@ -120,8 +120,9 @@ void application_init ( void ) uint8_t temp_buf[ 4 ] = { 0 }; accel16_multiple_reg_read( &accel16, ACCEL16_REG_DEVID_AD, temp_buf, 4 ); - log_printf( &logger, " > ID: 0x%.2X\r\n > ID: 0x%.2X\r\n > ID: 0x%.2X\r\n > REV: 0x%.2X\r\n", - temp_buf[ 0 ], temp_buf[ 1 ], temp_buf[ 2 ], temp_buf[ 3 ] ); + log_printf( &logger, " > ID0: 0x%.2X\r\n > ID1: 0x%.2X\r\n > ID2: 0x%.2X\r\n > REV: 0x%.2X\r\n", + ( uint16_t ) temp_buf[ 0 ], ( uint16_t ) temp_buf[ 1 ], + ( uint16_t ) temp_buf[ 2 ], ( uint16_t ) temp_buf[ 3 ] ); if ( ACCEL16_ERROR == accel16_default_cfg ( &accel16 ) ) diff --git a/clicks/accel16/details.md b/clicks/accel16/details.md index 0f09b9b220..cd90ef4100 100644 --- a/clicks/accel16/details.md +++ b/clicks/accel16/details.md @@ -82,8 +82,8 @@ in internal fifo buffer. > Initialization of communication modules(SPI, UART) and additional interrupt pins. Reads device ID's and revision. Then configures device to work in FIFO mode or to read data -from the registers, sets 2g resolution, 100Hz output data rate, -sets interrupt 1 active low, and powers on device. +from the registers, sets 2g resolution, 12.5Hz output data rate, +sets interrupt 1 active low, powers on device, and calibrates temperature. ```c @@ -119,8 +119,9 @@ void application_init ( void ) uint8_t temp_buf[ 4 ] = { 0 }; accel16_multiple_reg_read( &accel16, ACCEL16_REG_DEVID_AD, temp_buf, 4 ); - log_printf( &logger, " > ID: 0x%.2X\r\n > ID: 0x%.2X\r\n > ID: 0x%.2X\r\n > REV: 0x%.2X\r\n", - temp_buf[ 0 ], temp_buf[ 1 ], temp_buf[ 2 ], temp_buf[ 3 ] ); + log_printf( &logger, " > ID0: 0x%.2X\r\n > ID1: 0x%.2X\r\n > ID2: 0x%.2X\r\n > REV: 0x%.2X\r\n", + ( uint16_t ) temp_buf[ 0 ], ( uint16_t ) temp_buf[ 1 ], + ( uint16_t ) temp_buf[ 2 ], ( uint16_t ) temp_buf[ 3 ] ); if ( ACCEL16_ERROR == accel16_default_cfg ( &accel16 ) ) diff --git a/clicks/accel16/doc/doxy/Doxyfile.doxy b/clicks/accel16/doc/doxy/Doxyfile.doxy index 1930d3010d..2e66ba2559 100644 --- a/clicks/accel16/doc/doxy/Doxyfile.doxy +++ b/clicks/accel16/doc/doxy/Doxyfile.doxy @@ -44,21 +44,21 @@ PROJECT_NUMBER = 2.0.0.0 # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = +PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = +PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = ../clicks/accel16/temp/Help/doc +OUTPUT_DIRECTORY = ../cmake/accel16/temp/Help/doc # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -162,7 +162,7 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -171,7 +171,7 @@ STRIP_FROM_PATH = # specify the list of include paths that are normally passed to the compiler # using the -I flag. -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't @@ -238,13 +238,13 @@ TAB_SIZE = 4 # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. -ALIASES = +ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. -TCL_SUBST = +TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For @@ -291,7 +291,7 @@ OPTIMIZE_OUTPUT_VHDL = NO # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. -EXTENSION_MAPPING = +EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable @@ -648,7 +648,7 @@ GENERATE_DEPRECATEDLIST= YES # sections, marked by \if ... \endif and \cond # ... \endcond blocks. -ENABLED_SECTIONS = +ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the @@ -690,7 +690,7 @@ SHOW_NAMESPACES = YES # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. -FILE_VERSION_FILTER = +FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated @@ -703,7 +703,7 @@ FILE_VERSION_FILTER = # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. -LAYOUT_FILE = +LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib @@ -713,7 +713,7 @@ LAYOUT_FILE = # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. -CITE_BIB_FILES = +CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages @@ -778,7 +778,7 @@ WARN_FORMAT = "$file:$line: $text" # messages should be written. If left blank the output is written to standard # error (stderr). -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files @@ -790,9 +790,9 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = ../clicks/accel16/example \ - ../clicks/accel16/lib/include \ - ../clicks/accel16/README.md +INPUT = ../cmake/accel16/example \ + ../cmake/accel16/lib_accel16/include \ + ../cmake/accel16/README.md # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -877,7 +877,7 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = +EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -893,7 +893,7 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the @@ -904,13 +904,13 @@ EXCLUDE_PATTERNS = # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* -EXCLUDE_SYMBOLS = +EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = ../clicks/accel16/example +EXAMPLE_PATH = ../cmake/accel16/example # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and @@ -930,7 +930,7 @@ EXAMPLE_RECURSIVE = YES # that contain images that are to be included in the documentation (see the # \image command). -IMAGE_PATH = +IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program @@ -951,7 +951,7 @@ IMAGE_PATH = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -INPUT_FILTER = +INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the @@ -964,7 +964,7 @@ INPUT_FILTER = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -FILTER_PATTERNS = +FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for @@ -979,14 +979,14 @@ FILTER_SOURCE_FILES = NO # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. -FILTER_SOURCE_PATTERNS = +FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = +USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing @@ -1091,7 +1091,7 @@ CLANG_ASSISTED_PARSING = NO # specified with INPUT and INCLUDE_PATH. # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. -CLANG_OPTIONS = +CLANG_OPTIONS = #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index @@ -1117,7 +1117,7 @@ COLS_IN_ALPHA_INDEX = 5 # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output @@ -1161,7 +1161,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = +HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard @@ -1171,7 +1171,7 @@ HTML_HEADER = # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = +HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of @@ -1183,7 +1183,7 @@ HTML_FOOTER = # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_STYLESHEET = +HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets @@ -1196,7 +1196,7 @@ HTML_STYLESHEET = # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = +HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note @@ -1206,7 +1206,7 @@ HTML_EXTRA_STYLESHEET = # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = +HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to @@ -1335,7 +1335,7 @@ GENERATE_HTMLHELP = NO # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_FILE = +CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, @@ -1343,7 +1343,7 @@ CHM_FILE = # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -HHC_LOCATION = +HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the master .chm file (NO). @@ -1356,7 +1356,7 @@ GENERATE_CHI = NO # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_INDEX_ENCODING = +CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it @@ -1387,7 +1387,7 @@ GENERATE_QHP = NO # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. -QCH_FILE = +QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace @@ -1412,7 +1412,7 @@ QHP_VIRTUAL_FOLDER = ./temp/Help/doc # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom @@ -1420,21 +1420,21 @@ QHP_CUST_FILTER_NAME = # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_ATTRS = +QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_SECT_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. -QHG_LOCATION = +QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To @@ -1567,7 +1567,7 @@ MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_EXTENSIONS = +MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site @@ -1575,7 +1575,7 @@ MATHJAX_EXTENSIONS = # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_CODEFILE = +MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and @@ -1635,7 +1635,7 @@ EXTERNAL_SEARCH = NO # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. -SEARCHENGINE_URL = +SEARCHENGINE_URL = # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed # search data is written to a file for indexing by an external tool. With the @@ -1651,7 +1651,7 @@ SEARCHDATA_FILE = searchdata.xml # projects and redirect the results back to the right project. # This tag requires that the tag SEARCHENGINE is set to YES. -EXTERNAL_SEARCH_ID = +EXTERNAL_SEARCH_ID = # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen # projects other than the one defined by this configuration file, but that are @@ -1661,7 +1661,7 @@ EXTERNAL_SEARCH_ID = # EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... # This tag requires that the tag SEARCHENGINE is set to YES. -EXTRA_SEARCH_MAPPINGS = +EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- # Configuration options related to the LaTeX output @@ -1725,7 +1725,7 @@ PAPER_TYPE = a4 # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. -EXTRA_PACKAGES = +EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for the # generated LaTeX document. The header should contain everything until the first @@ -1741,7 +1741,7 @@ EXTRA_PACKAGES = # to HTML_HEADER. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_HEADER = +LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the # generated LaTeX document. The footer should contain everything after the last @@ -1752,7 +1752,7 @@ LATEX_HEADER = # Note: Only use a user-defined footer if you know what you are doing! # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_FOOTER = +LATEX_FOOTER = # The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined # LaTeX style sheets that are included after the standard style sheets created @@ -1763,7 +1763,7 @@ LATEX_FOOTER = # list). # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_STYLESHEET = +LATEX_EXTRA_STYLESHEET = # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output @@ -1771,7 +1771,7 @@ LATEX_EXTRA_STYLESHEET = # markers available. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_FILES = +LATEX_EXTRA_FILES = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is # prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will @@ -1879,14 +1879,14 @@ RTF_HYPERLINKS = NO # default style sheet that doxygen normally uses. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_STYLESHEET_FILE = +RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is # similar to doxygen's config file. A template extensions file can be generated # using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_EXTENSIONS_FILE = +RTF_EXTENSIONS_FILE = # If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code # with syntax highlighting in the RTF output. @@ -1931,7 +1931,7 @@ MAN_EXTENSION = .3 # MAN_EXTENSION with the initial . removed. # This tag requires that the tag GENERATE_MAN is set to YES. -MAN_SUBDIR = +MAN_SUBDIR = # If the MAN_LINKS tag is set to YES and doxygen generates man output, then it # will generate one additional man file for each entity documented in the real @@ -2044,7 +2044,7 @@ PERLMOD_PRETTY = YES # overwrite each other's variables. # This tag requires that the tag GENERATE_PERLMOD is set to YES. -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor @@ -2085,7 +2085,7 @@ SEARCH_INCLUDES = YES # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = +INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the @@ -2093,7 +2093,7 @@ INCLUDE_PATH = # used. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -INCLUDE_FILE_PATTERNS = +INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that are # defined before the preprocessor is started (similar to the -D option of e.g. @@ -2103,7 +2103,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = +PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -2112,7 +2112,7 @@ PREDEFINED = # definition found in the source code. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will # remove all references to function-like macros that are alone on a line, have @@ -2141,13 +2141,13 @@ SKIP_FUNCTION_MACROS = YES # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. -TAGFILES = +TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create a # tag file that is based on the input files it reads. See section "Linking to # external documentation" for more information about the usage of tag files. -GENERATE_TAGFILE = +GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES, all external class will be listed in # the class index. If set to NO, only the inherited external classes will be @@ -2188,7 +2188,7 @@ CLASS_DIAGRAMS = YES # DIA_PATH tag allows you to specify the directory where the dia binary resides. # If left empty dia is assumed to be found in the default search path. -DIA_PATH = +DIA_PATH = # If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. @@ -2237,7 +2237,7 @@ DOT_FONTSIZE = 10 # the path where dot can find it using this tag. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTPATH = +DOT_FONTPATH = # If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for # each documented class showing the direct and indirect inheritance relations. @@ -2381,26 +2381,26 @@ INTERACTIVE_SVG = NO # found. If left blank, it is assumed the dot tool can be found in the path. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_PATH = +DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the \dotfile # command). # This tag requires that the tag HAVE_DOT is set to YES. -DOTFILE_DIRS = +DOTFILE_DIRS = # The MSCFILE_DIRS tag can be used to specify one or more directories that # contain msc files that are included in the documentation (see the \mscfile # command). -MSCFILE_DIRS = +MSCFILE_DIRS = # The DIAFILE_DIRS tag can be used to specify one or more directories that # contain dia files that are included in the documentation (see the \diafile # command). -DIAFILE_DIRS = +DIAFILE_DIRS = # When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the # path where java can find the plantuml.jar file. If left blank, it is assumed @@ -2408,17 +2408,17 @@ DIAFILE_DIRS = # generate a warning when it encounters a \startuml command in this case and # will not generate output for the diagram. -PLANTUML_JAR_PATH = +PLANTUML_JAR_PATH = # When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a # configuration file for plantuml. -PLANTUML_CFG_FILE = +PLANTUML_CFG_FILE = # When using plantuml, the specified paths are searched for files specified by # the !include statement in a plantuml block. -PLANTUML_INCLUDE_PATH = +PLANTUML_INCLUDE_PATH = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes diff --git a/clicks/accel16/doc/package/manifest.json b/clicks/accel16/doc/package/manifest.json index 95d87eabcb..6c8157006c 100644 --- a/clicks/accel16/doc/package/manifest.json +++ b/clicks/accel16/doc/package/manifest.json @@ -1,6 +1,6 @@ { - "architecture": "ARM|PIC|PIC32", - "category": "Motion", + "architecture": "ARM|PIC|PIC32|RISC-V|AVR", + "category": "Click Boards > Sensors > Motion", "changelog": "Resources/CHANGELOG.md", "contains": [ "libraries", @@ -8,8 +8,7 @@ "examples", "source_files" ], - "dependency_list": [ - ], + "dependency_list": [], "details": "Resources/DETAILS.md", "display_name": "Accel 16 click", "example_list": [ @@ -26,9 +25,11 @@ "name": "mikroe.click.accel16", "product_link": "https://www.mikroe.com/accel-16-click", "short_description": "Accel 16 Click is a compact add-on board that contains an acceleration sensor. This board features the ADXL363, a micropower three-sensor combination including acceleration and temperature from Analog Devices. This device combines a 3-axis MEMS accelerometer, a temperature sensor, and an analog-to-digital converter (ADC) input for synchronized conversions of external signals.", - "supported_compiler": "mikroC AI", + "supported_compiler": "mikroC AI|GCC", "type": "Library", - "_type":"mikroSDK Library", - "version": "2.0.0.1" + "_type": "mikroSDK Library", + "version": "2.1.0.1", + "cmake": true, + "alias": "Click.Accel16", + "subdir_name": "lib_accel16" } - diff --git a/clicks/accel16/example/CMakeLists.txt b/clicks/accel16/example/CMakeLists.txt new file mode 100644 index 0000000000..bd9e657bd7 --- /dev/null +++ b/clicks/accel16/example/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(example_accel16 LANGUAGES MikroC) +else() + project(example_accel16 LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_executable(example_accel16 + main.c + +) + + +############################ example_accel16 GENERATED CODE START ########################### +find_package(MikroC.Core REQUIRED) +target_link_libraries(example_accel16 PUBLIC MikroC.Core) +find_package(MikroSDK.Board REQUIRED) +target_link_libraries(example_accel16 PUBLIC MikroSDK.Board) +find_package(MikroSDK.Log REQUIRED) +target_link_libraries(example_accel16 PUBLIC MikroSDK.Log) +find_package(MikroSDK.Conversions REQUIRED) +target_link_libraries(example_accel16 PUBLIC MikroSDK.Conversions) +add_subdirectory(lib_accel16) +target_link_libraries(example_accel16 PUBLIC Click.Accel16) +############################ example_accel16 GENERATED CODE END ########################### diff --git a/clicks/accel16/example/main.c b/clicks/accel16/example/main.c index 5bc5c8592c..2e45758338 100644 --- a/clicks/accel16/example/main.c +++ b/clicks/accel16/example/main.c @@ -15,8 +15,8 @@ * Initialization of communication modules(SPI, UART) and * additional interrupt pins. Reads device ID's and revision. * Then configures device to work in FIFO mode or to read data - * from the registers, sets 2g resolution, 100Hz output data rate, - * sets interrupt 1 active low, and powers on device. + * from the registers, sets 2g resolution, 12.5Hz output data rate, + * sets interrupt 1 active low, powers on device, and calibrates temperature. * * ## Application Task * Depending of the application mode selects example. @@ -89,9 +89,9 @@ void application_init ( void ) uint8_t temp_buf[ 4 ] = { 0 }; accel16_multiple_reg_read( &accel16, ACCEL16_REG_DEVID_AD, temp_buf, 4 ); - log_printf( &logger, " > ID: 0x%.2X\r\n > ID: 0x%.2X\r\n > ID: 0x%.2X\r\n > REV: 0x%.2X\r\n", - temp_buf[ 0 ], temp_buf[ 1 ], temp_buf[ 2 ], temp_buf[ 3 ] ); - + log_printf( &logger, " > ID0: 0x%.2X\r\n > ID1: 0x%.2X\r\n > ID2: 0x%.2X\r\n > REV: 0x%.2X\r\n", + ( uint16_t ) temp_buf[ 0 ], ( uint16_t ) temp_buf[ 1 ], + ( uint16_t ) temp_buf[ 2 ], ( uint16_t ) temp_buf[ 3 ] ); if ( ACCEL16_ERROR == accel16_default_cfg ( &accel16 ) ) { @@ -114,7 +114,6 @@ void application_task ( void ) } log_printf( &logger, "********************************************************\r\n" ); - Delay_ms( 300 ); } void main ( void ) @@ -167,7 +166,9 @@ static void accel16_read_fifo_data ( void ) } case 0x3: { - float temperature = temp_data * 0.065; + float temperature = ACCEL16_ROOM_TEMPERATURE + + ( temp_data - ACCEL16_TEMPERATURE_BIAS ) * ACCEL16_TEMPERATURE_RES - + accel16.room_temp_offset;; log_printf( &logger, " > Temperature[degC]: %.2f\r\n", temperature ); break; } diff --git a/clicks/accel16/example/manifest.exm b/clicks/accel16/example/manifest.exm index 23470fb867..e8bff4deb6 100644 --- a/clicks/accel16/example/manifest.exm +++ b/clicks/accel16/example/manifest.exm @@ -2,7 +2,7 @@ "name": "Accel 16 Click", "description": "Accel 16 Click is a compact add-on board that contains an acceleration sensor. This board features the ADXL363, a micropower three-sensor combination including acceleration and temperature from Analog Devices. This device combines a 3-axis MEMS accelerometer, a temperature sensor, and an analog-to-digital converter (ADC) input for synchronized conversions of external signals.", "image" : "../../Resources/click_icon.png", - "toolchain": ["mikrocarm","mikrocpic","mikrocpic32"], + "toolchain": ["mikrocarm","mikrocpic","mikrocpic32","gcc-riscv","mikrocavr"], "hw" : ["click","ADXL363"], "category" : ["Motion"] } diff --git a/clicks/accel16/example/memake.txt b/clicks/accel16/example/memake.txt deleted file mode 100644 index 160c49d2c0..0000000000 --- a/clicks/accel16/example/memake.txt +++ /dev/null @@ -1,14 +0,0 @@ -type: executable -target: example_accel16 - -depends: { - MikroC.Core - MikroSDK.Board - MikroSDK.Log - MikroSDK.Conversions - Click.Accel16 -} - -sources: { - main.c -} diff --git a/clicks/accel16/lib/memake.txt b/clicks/accel16/lib/memake.txt deleted file mode 100644 index 594aaf119e..0000000000 --- a/clicks/accel16/lib/memake.txt +++ /dev/null @@ -1,49 +0,0 @@ -type: library -target: lib_accel16 - -#begin python -import re - -if ( re.match("(^PIC18F(.+)[KQ]4[23]$)|(^PIC32(.+)$)",MEMAKE_MCU_NAME) ): - sample_mode_reg_case = "SAMPLE_REG_CASE_1" -else: - sample_mode_reg_case = "SAMPLE_REG_CASE_2" -#end python - -defines: { - <[sample_mode_reg_case]> -} - -sources: { - src/accel16.c -} - -headers: { - include/accel16.h -} - -include: { - include -} - -install: { - src(include/accel16.h) dst(include/accel16.h) - src(include/spi_specifics.h) dst(include/spi_specifics.h) -} - -expInclude: { - include -} - -depends: { - MikroC.Core - MikroSDK.Driver -} - -others: { - ../README.md - ../DETAILS.md - ../CHANGELOG.md -} - -alias: Click.Accel16 diff --git a/clicks/accel16/lib_accel16/CMakeLists.txt b/clicks/accel16/lib_accel16/CMakeLists.txt new file mode 100644 index 0000000000..9c37d8164e --- /dev/null +++ b/clicks/accel16/lib_accel16/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(lib_accel16 LANGUAGES MikroC) +else() + project(lib_accel16 LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_library(lib_accel16 STATIC + src/accel16.c + include/accel16.h +) +add_library(Click.Accel16 ALIAS lib_accel16) + +if (${MCU_NAME} MATCHES "(^PIC18F(.+)[KQ]4[23]$)|(^PIC32(.+)$)") + set(sample_mode_reg_case "SAMPLE_REG_CASE_1") +else() + set(sample_mode_reg_case "SAMPLE_REG_CASE_2") +endif() + +target_compile_definitions(lib_accel16 PUBLIC ${sample_mode_reg_case}) + + +target_include_directories(lib_accel16 PUBLIC + include +) + +find_package(MikroC.Core REQUIRED) +target_link_libraries(lib_accel16 PUBLIC MikroC.Core) +find_package(MikroSDK.Driver REQUIRED) +target_link_libraries(lib_accel16 PUBLIC MikroSDK.Driver) diff --git a/clicks/accel16/lib_accel16/include/Click.Accel16 b/clicks/accel16/lib_accel16/include/Click.Accel16 new file mode 100644 index 0000000000..74247cb445 --- /dev/null +++ b/clicks/accel16/lib_accel16/include/Click.Accel16 @@ -0,0 +1 @@ +#include "accel16.h" diff --git a/clicks/accel16/lib/include/accel16.h b/clicks/accel16/lib_accel16/include/accel16.h similarity index 79% rename from clicks/accel16/lib/include/accel16.h rename to clicks/accel16/lib_accel16/include/accel16.h index 7e8001c13b..520edcc759 100644 --- a/clicks/accel16/lib/include/accel16.h +++ b/clicks/accel16/lib_accel16/include/accel16.h @@ -57,50 +57,50 @@ extern "C"{ * @brief Accel 16 control commands. * @details Specified commands for control of Accel 16 Click driver. */ -#define ACCEL16_CMD_WRITE_REG 0x0A -#define ACCEL16_CMD_READ_REG 0x0B -#define ACCEL16_CMD_READ_FIFO 0x0D +#define ACCEL16_CMD_WRITE_REG 0x0A +#define ACCEL16_CMD_READ_REG 0x0B +#define ACCEL16_CMD_READ_FIFO 0x0D /** * @brief Accel 16 description register. * @details Specified register for description of Accel 16 Click driver. */ -#define ACCEL16_REG_DEVID_AD 0x00 -#define ACCEL16_REG_DEVID_MST 0x01 -#define ACCEL16_REG_DEVID 0x02 -#define ACCEL16_REG_REVID 0x03 -#define ACCEL16_REG_XDATA 0x08 -#define ACCEL16_REG_YDATA 0x09 -#define ACCEL16_REG_ZDATA 0x0A -#define ACCEL16_REG_STATUS 0x0B -#define ACCEL16_REG_FIFO_ENTRIES_L 0x0C -#define ACCEL16_REG_FIFO_ENTRIES_H 0x0D -#define ACCEL16_REG_XDATA_L 0x0E -#define ACCEL16_REG_XDATA_H 0x0F -#define ACCEL16_REG_YDATA_L 0x10 -#define ACCEL16_REG_YDATA_H 0x11 -#define ACCEL16_REG_ZDATA_L 0x12 -#define ACCEL16_REG_ZDATA_H 0x13 -#define ACCEL16_REG_TEMP_L 0x14 -#define ACCEL16_REG_TEMP_H 0x15 -#define ACCEL16_REG_ADC_DATA_L 0x16 -#define ACCEL16_REG_ADC_DATA_H 0x17 -#define ACCEL16_REG_SOFT_RESET 0x1F -#define ACCEL16_REG_THRESH_ACT_L 0x20 -#define ACCEL16_REG_THRESH_ACT_H 0x21 -#define ACCEL16_REG_TIME_ACT 0x22 -#define ACCEL16_REG_THRESH_INACT_L 0x23 -#define ACCEL16_REG_THRESH_INACT_H 0x24 -#define ACCEL16_REG_TIME_INACT_L 0x25 -#define ACCEL16_REG_TIME_INACT_H 0x26 -#define ACCEL16_REG_ACT_INACT_CTL 0x27 -#define ACCEL16_REG_FIFO_CONTROL 0x28 -#define ACCEL16_REG_FIFO_SAMPLES 0x29 -#define ACCEL16_REG_INTMAP1 0x2A -#define ACCEL16_REG_INTMAP2 0x2B -#define ACCEL16_REG_FILTER_CTL 0x2C -#define ACCEL16_REG_POWER_CTL 0x2D -#define ACCEL16_REG_SELF_CTL 0x2E +#define ACCEL16_REG_DEVID_AD 0x00 +#define ACCEL16_REG_DEVID_MST 0x01 +#define ACCEL16_REG_DEVID 0x02 +#define ACCEL16_REG_REVID 0x03 +#define ACCEL16_REG_XDATA 0x08 +#define ACCEL16_REG_YDATA 0x09 +#define ACCEL16_REG_ZDATA 0x0A +#define ACCEL16_REG_STATUS 0x0B +#define ACCEL16_REG_FIFO_ENTRIES_L 0x0C +#define ACCEL16_REG_FIFO_ENTRIES_H 0x0D +#define ACCEL16_REG_XDATA_L 0x0E +#define ACCEL16_REG_XDATA_H 0x0F +#define ACCEL16_REG_YDATA_L 0x10 +#define ACCEL16_REG_YDATA_H 0x11 +#define ACCEL16_REG_ZDATA_L 0x12 +#define ACCEL16_REG_ZDATA_H 0x13 +#define ACCEL16_REG_TEMP_L 0x14 +#define ACCEL16_REG_TEMP_H 0x15 +#define ACCEL16_REG_ADC_DATA_L 0x16 +#define ACCEL16_REG_ADC_DATA_H 0x17 +#define ACCEL16_REG_SOFT_RESET 0x1F +#define ACCEL16_REG_THRESH_ACT_L 0x20 +#define ACCEL16_REG_THRESH_ACT_H 0x21 +#define ACCEL16_REG_TIME_ACT 0x22 +#define ACCEL16_REG_THRESH_INACT_L 0x23 +#define ACCEL16_REG_THRESH_INACT_H 0x24 +#define ACCEL16_REG_TIME_INACT_L 0x25 +#define ACCEL16_REG_TIME_INACT_H 0x26 +#define ACCEL16_REG_ACT_INACT_CTL 0x27 +#define ACCEL16_REG_FIFO_CONTROL 0x28 +#define ACCEL16_REG_FIFO_SAMPLES 0x29 +#define ACCEL16_REG_INTMAP1 0x2A +#define ACCEL16_REG_INTMAP2 0x2B +#define ACCEL16_REG_FILTER_CTL 0x2C +#define ACCEL16_REG_POWER_CTL 0x2D +#define ACCEL16_REG_SELF_CTL 0x2E /*! @} */ // accel16_reg @@ -118,8 +118,17 @@ extern "C"{ * @brief Accel 16 description setting. * @details Specified setting for description of Accel 16 Click driver. */ -#define ACCEL16_APPLICATION_FIFO 0xAA -#define ACCEL16_APPLICATION_REG 0xBB +#define ACCEL16_APPLICATION_FIFO 0xAA +#define ACCEL16_APPLICATION_REG 0xBB + +/** + * @brief Accel 16 temperature calculation values. + * @details Specified temperature calculation values of Accel 16 Click driver. + */ +#define ACCEL16_ROOM_TEMPERATURE 25.0 +#define ACCEL16_TEMPERATURE_BIAS 350 +#define ACCEL16_TEMPERATURE_RES 0.065 +#define ACCEL16_TEMPERATURE_CAL_SAMPLE_NUM 100 /** * @brief Data sample selection. @@ -129,8 +138,8 @@ extern "C"{ * Can be overwritten with @b accel16_init which will set * @b SET_SPI_DATA_SAMPLE_MIDDLE by default on the mapped mikrobus. */ -#define ACCEL16_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE -#define ACCEL16_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE +#define ACCEL16_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE +#define ACCEL16_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE /*! @} */ // accel16_set @@ -173,8 +182,9 @@ typedef struct spi_master_t spi; /**< SPI driver object. */ pin_name_t chip_select; /**< Chip select pin descriptor (used for SPI driver). */ - float resolution; - uint8_t application_type; + float resolution; /**< Accel range resolution. */ + float room_temp_offset; /**< Room temperature offset, calibrate using accel16_calibrate_temperature function. */ + uint8_t application_type; /**< FIFO or REG application type. */ } accel16_t; @@ -230,9 +240,9 @@ typedef enum */ typedef enum { - ACCEL16_2G = 1, - ACCEL16_4G = 2, - ACCEL16_8G = 4 + ACCEL16_2G = 0, + ACCEL16_4G = 1, + ACCEL16_8G = 2 } accel16_gain_t; @@ -440,6 +450,19 @@ err_t accel16_get_temperature ( accel16_t *ctx, float *temperature ); */ err_t accel16_get_adc ( accel16_t *ctx, float *v_adc ); +/** + * @brief Accel 16 calibrate temperature function. + * @details This function calibrates the temperature readings to the known room temperature in Celsius. + * @param[in] ctx : Click context object. + * See #accel16_t object definition for detailed explanation. + * @param[in] room_temperature : Known room temperature in Celsius. + * @return @li @c 0 - Success, + * @li @c -1 - Error. + * See #err_t definition for detailed explanation. + * @note None. + */ +err_t accel16_calibrate_temperature ( accel16_t *ctx, float room_temperature ); + #ifdef __cplusplus } #endif diff --git a/clicks/accel16/lib/include/spi_specifics.h b/clicks/accel16/lib_accel16/include/spi_specifics.h similarity index 100% rename from clicks/accel16/lib/include/spi_specifics.h rename to clicks/accel16/lib_accel16/include/spi_specifics.h diff --git a/clicks/accel16/lib/src/accel16.c b/clicks/accel16/lib_accel16/src/accel16.c similarity index 86% rename from clicks/accel16/lib/src/accel16.c rename to clicks/accel16/lib_accel16/src/accel16.c index 75f4f5c192..5a98544ffc 100644 --- a/clicks/accel16/lib/src/accel16.c +++ b/clicks/accel16/lib_accel16/src/accel16.c @@ -33,7 +33,6 @@ */ #define DUMMY 0x00 #define DEFAULT_RES 1000.0 -#define TEMPERATURE_RES 0.065 #define ADC_10PCT 0.33 #define ADC_VREF 2.64 #define ADC_RESOLUTION 4095.0 @@ -114,8 +113,12 @@ err_t accel16_default_cfg ( accel16_t *ctx ) error_flag |= accel16_single_reg_write( ctx, ACCEL16_REG_INTMAP1, 0x81 ); } - error_flag |= accel16_filter_configuration( ctx, ACCEL16_2G, ACCEL16_100HZ ); + error_flag |= accel16_filter_configuration( ctx, ACCEL16_2G, ACCEL16_12p5HZ ); error_flag |= accel16_single_reg_write( ctx, ACCEL16_REG_POWER_CTL, 0x8A ); + Delay_100ms ( ); + + ctx->room_temp_offset = 0; + error_flag |= accel16_calibrate_temperature ( ctx, ACCEL16_ROOM_TEMPERATURE ); return error_flag; } @@ -196,10 +199,10 @@ uint8_t accel16_get_interrupt_2 ( accel16_t *ctx ) err_t accel16_filter_configuration ( accel16_t *ctx, accel16_gain_t gain, accel16_output_rate_t odr ) { uint8_t default_setting = 0x10; - default_setting |= ( gain - 1 ) << 6; + default_setting |= ( gain << 6 ); default_setting |= odr; - ctx->resolution = DEFAULT_RES / ( float )gain; + ctx->resolution = DEFAULT_RES / ( 1 << gain ); return accel16_single_reg_write( ctx, ACCEL16_REG_FILTER_CTL, default_setting ); } @@ -210,13 +213,13 @@ err_t accel16_get_axes ( accel16_t *ctx, accel16_axes_t *axes ) int16_t temp_data = 0; err_t ret_val = accel16_multiple_reg_read( ctx, ACCEL16_REG_XDATA_L, &temp_buf[ 0 ], 6 ); - temp_data = ( ( int16_t )temp_buf[ 1 ] << 8 ) | temp_buf[ 0 ]; + temp_data = ( ( int16_t ) temp_buf[ 1 ] << 8 ) | temp_buf[ 0 ]; axes->x = temp_data / ctx->resolution; - temp_data = ( ( int16_t )temp_buf[ 3 ] << 8 ) | temp_buf[ 2 ]; + temp_data = ( ( int16_t ) temp_buf[ 3 ] << 8 ) | temp_buf[ 2 ]; axes->y = temp_data / ctx->resolution; - temp_data = ( ( int16_t )temp_buf[ 5 ] << 8 ) | temp_buf[ 4 ]; + temp_data = ( ( int16_t ) temp_buf[ 5 ] << 8 ) | temp_buf[ 4 ]; axes->z = temp_data / ctx->resolution; return ret_val; @@ -229,7 +232,9 @@ err_t accel16_get_temperature ( accel16_t *ctx, float *temperature ) err_t ret_val = accel16_multiple_reg_read( ctx, ACCEL16_REG_TEMP_L, &temp_buf[ 0 ], 2 ); temp_data = ( ( int16_t )temp_buf[ 1 ] << 8 ) | temp_buf[ 0 ]; - *temperature = ( float )temp_data * TEMPERATURE_RES; + *temperature = ACCEL16_ROOM_TEMPERATURE + + ( temp_data - ACCEL16_TEMPERATURE_BIAS ) * ACCEL16_TEMPERATURE_RES - + ctx->room_temp_offset; return ret_val; } @@ -247,4 +252,22 @@ err_t accel16_get_adc ( accel16_t *ctx, float *v_adc ) return ret_val; } +err_t accel16_calibrate_temperature ( accel16_t *ctx, float room_temperature ) +{ + err_t error_flag = ACCEL16_OK; + float temp_avg = 0; + float temp = 0; + uint8_t cnt = 0; + for ( cnt = 0; cnt < ACCEL16_TEMPERATURE_CAL_SAMPLE_NUM; cnt++ ) + { + // Wait for data ready indication + while ( accel16_get_interrupt_1( ctx ) ); + + error_flag |= accel16_get_temperature ( ctx, &temp ); + temp_avg += temp; + } + ctx->room_temp_offset = ( temp_avg / ACCEL16_TEMPERATURE_CAL_SAMPLE_NUM ) - room_temperature; + return error_flag; +} + // ------------------------------------------------------------------------- END diff --git a/clicks/accel16/memake.txt b/clicks/accel16/memake.txt deleted file mode 100644 index 515f183f80..0000000000 --- a/clicks/accel16/memake.txt +++ /dev/null @@ -1,10 +0,0 @@ -type: subdirs -project: Accel16 - -subdirs: { - lib - example -} - -depends: { -} diff --git a/clicks/accurrent/CHANGELOG.md b/clicks/accurrent/CHANGELOG.md index b586d72846..8ce49e7776 100644 --- a/clicks/accurrent/CHANGELOG.md +++ b/clicks/accurrent/CHANGELOG.md @@ -1,4 +1,4 @@ ## Changelog -### Version 2.0.0.7 +### Version 2.1.0.7 - Initial release diff --git a/clicks/accurrent/CMakeLists.txt b/clicks/accurrent/CMakeLists.txt new file mode 100644 index 0000000000..30ced22300 --- /dev/null +++ b/clicks/accurrent/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.21) +if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC") + project(example_accurrent LANGUAGES MikroC) +else() + project(example_accurrent LANGUAGES C ASM) +endif() + +if (NOT PROJECT_TYPE) + set(PROJECT_TYPE "mikrosdk" CACHE STRING "" FORCE) +endif() + +add_executable(example_accurrent + example/main.c + +) + + +############################ example_accurrent GENERATED CODE START ########################### +find_package(MikroC.Core REQUIRED) +target_link_libraries(example_accurrent PUBLIC MikroC.Core) +find_package(MikroSDK.Board REQUIRED) +target_link_libraries(example_accurrent PUBLIC MikroSDK.Board) +find_package(MikroSDK.Log REQUIRED) +target_link_libraries(example_accurrent PUBLIC MikroSDK.Log) +add_subdirectory(lib_accurrent) +target_link_libraries(example_accurrent PUBLIC Click.AcCurrent) +############################ example_accurrent GENERATED CODE END ########################### diff --git a/clicks/accurrent/DETAILS.md b/clicks/accurrent/DETAILS.md index e0b20ddb2d..db0481ab89 100644 --- a/clicks/accurrent/DETAILS.md +++ b/clicks/accurrent/DETAILS.md @@ -2,7 +2,7 @@ --- # AC Current click -AC Current click is a device that is able to measure the alternating current (AC) running through the conductor, using the so-called non-invasive current sensor. +AC Current click is a device that is able to measure the alternating current (AC) running through the conductor, using the so-called non-invasive current sensor. The non-invasive sensor works by utilizing the electromagnetic induction phenomenon, similar to a transformer. The primary coil does not exist though, the electromagnetic field is generated by the AC Current running through the cable which is measured. The core of the sensing probe is split, allowing it to clamp on the current conducting cable. Since the sensor does not influence the measurement circuitry in any way while being galvanically isolated at the same time, it is an ideal solution to measure current running through mains, or similar high voltage installations.

@@ -35,21 +35,27 @@ Package can be downloaded/installed directly form compilers IDE(recommended way) #### Standard key functions : -- Config Object Initialization function. -> void accurrent_cfg_setup ( accurrent_cfg_t *cfg ); +- `accurrent_cfg_setup` Config Object Initialization function. +```c +void accurrent_cfg_setup ( accurrent_cfg_t *cfg ); +``` -- Initialization function. -> ACCURRENT_RETVAL accurrent_init ( accurrent_t *ctx, accurrent_cfg_t *cfg ); - +- `accurrent_init` Initialization function. +```c +err_t accurrent_init ( accurrent_t *ctx, accurrent_cfg_t *cfg ); +``` #### Example key functions : -- Gets current value of AC Current in mA. -> float accurrent_get_ma ( accurrent_t *ctx ); +- `accurrent_get_a` Gets current value of AC Current in A. +```c +float accurrent_get_a ( accurrent_t *ctx ); +``` -- Gets current value of AC Current in A. -> float accurrent_get_a ( accurrent_t *ctx ); - +- `accurrent_get_ma` Gets current value of AC Current in mA. +```c +float accurrent_get_ma ( accurrent_t *ctx ); +``` ## Examples Description @@ -98,14 +104,14 @@ void application_init ( void ) void application_task ( void ) { - float ac_current; - + float ac_current = 0; ac_current = accurrent_get_ma( &accurrent ); log_printf( &logger, "Current value: %.3f mA\r\n", ac_current ); Delay_ms( 1000 ); } ``` + ## NOTE > An appropriate AC Current sensor needs to be connected to the click board. diff --git a/clicks/accurrent/README.md b/clicks/accurrent/README.md index cfb2bbaf31..e84de091ea 100644 --- a/clicks/accurrent/README.md +++ b/clicks/accurrent/README.md @@ -3,7 +3,7 @@ --- # AC Current click -AC Current click is a device that is able to measure the alternating current (AC) running through the conductor, using the so-called non-invasive current sensor. +AC Current click is a device that is able to measure the alternating current (AC) running through the conductor, using the so-called non-invasive current sensor. The non-invasive sensor works by utilizing the electromagnetic induction phenomenon, similar to a transformer. The primary coil does not exist though, the electromagnetic field is generated by the AC Current running through the cable which is measured. The core of the sensing probe is split, allowing it to clamp on the current conducting cable. Since the sensor does not influence the measurement circuitry in any way while being galvanically isolated at the same time, it is an ideal solution to measure current running through mains, or similar high voltage installations.

@@ -36,21 +36,27 @@ Package can be downloaded/installed directly form compilers IDE(recommended way) #### Standard key functions : -- Config Object Initialization function. -> void accurrent_cfg_setup ( accurrent_cfg_t *cfg ); +- `accurrent_cfg_setup` Config Object Initialization function. +```c +void accurrent_cfg_setup ( accurrent_cfg_t *cfg ); +``` -- Initialization function. -> ACCURRENT_RETVAL accurrent_init ( accurrent_t *ctx, accurrent_cfg_t *cfg ); - +- `accurrent_init` Initialization function. +```c +err_t accurrent_init ( accurrent_t *ctx, accurrent_cfg_t *cfg ); +``` #### Example key functions : -- Gets current value of AC Current in mA. -> float accurrent_get_ma ( accurrent_t *ctx ); +- `accurrent_get_a` Gets current value of AC Current in A. +```c +float accurrent_get_a ( accurrent_t *ctx ); +``` -- Gets current value of AC Current in A. -> float accurrent_get_a ( accurrent_t *ctx ); - +- `accurrent_get_ma` Gets current value of AC Current in mA. +```c +float accurrent_get_ma ( accurrent_t *ctx ); +``` ## Examples Description @@ -99,14 +105,14 @@ void application_init ( void ) void application_task ( void ) { - float ac_current; - + float ac_current = 0; ac_current = accurrent_get_ma( &accurrent ); log_printf( &logger, "Current value: %.3f mA\r\n", ac_current ); Delay_ms( 1000 ); } ``` + ## NOTE > An appropriate AC Current sensor needs to be connected to the click board. diff --git a/clicks/accurrent/doc/doxy/Doxyfile.doxy b/clicks/accurrent/doc/doxy/Doxyfile.doxy index 428a96b841..367b55905d 100644 --- a/clicks/accurrent/doc/doxy/Doxyfile.doxy +++ b/clicks/accurrent/doc/doxy/Doxyfile.doxy @@ -1,2500 +1,2496 @@ -# Doxyfile 1.8.13 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a double hash (##) is considered a comment and is placed in -# front of the TAG it is preceding. -# -# All text after a single hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists, items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (\" \"). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. -# The default value is: UTF-8. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by -# double-quotes, unless you are using Doxywizard) that should identify the -# project for which the documentation is generated. This name is used in the -# title of most generated pages and in a few other places. -# The default value is: My Project. - -PROJECT_NAME = accurrent - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. This -# could be handy for archiving the generated documentation or if some version -# control system is used. - -PROJECT_NUMBER = 2.0.0.0 - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer a -# quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = - -# With the PROJECT_LOGO tag one can specify a logo or an icon that is included -# in the documentation. The maximum height of the logo should not exceed 55 -# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy -# the logo to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path -# into which the generated documentation will be written. If a relative path is -# entered, it will be relative to the location where doxygen was started. If -# left blank the current directory will be used. - -OUTPUT_DIRECTORY = ../clicks/accurrent/temp/Help/doc - -# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this -# option can be useful when feeding doxygen a huge amount of source files, where -# putting all generated files in the same directory would otherwise causes -# performance problems for the file system. -# The default value is: NO. - -CREATE_SUBDIRS = NO - -# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII -# characters to appear in the names of generated files. If set to NO, non-ASCII -# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode -# U+3044. -# The default value is: NO. - -ALLOW_UNICODE_NAMES = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, -# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, -# Ukrainian and Vietnamese. -# The default value is: English. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member -# descriptions after the members that are listed in the file and class -# documentation (similar to Javadoc). Set to NO to disable this. -# The default value is: YES. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief -# description of a member or function before the detailed description -# -# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. -# The default value is: YES. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator that is -# used to form the text in various listings. Each string in this list, if found -# as the leading text of the brief description, will be stripped from the text -# and the result, after processing the whole list, is used as the annotated -# text. Otherwise, the brief description is used as-is. If left blank, the -# following values are used ($name is automatically replaced with the name of -# the entity):The $name class, The $name widget, The $name file, is, provides, -# specifies, contains, represents, a, an and the. - -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# doxygen will generate a detailed section even if there is only a brief -# description. -# The default value is: NO. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. -# The default value is: NO. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path -# before files name in the file list and in the header files. If set to NO the -# shortest path that makes the file name unique will be used -# The default value is: YES. - -FULL_PATH_NAMES = YES - -# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. -# Stripping is only done if one of the specified strings matches the left-hand -# part of the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the path to -# strip. -# -# Note that you can specify absolute paths here, but also relative paths, which -# will be relative from the directory where doxygen is started. -# This tag requires that the tag FULL_PATH_NAMES is set to YES. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the -# path mentioned in the documentation of a class, which tells the reader which -# header file to include in order to use a class. If left blank only the name of -# the header file containing the class definition is used. Otherwise one should -# specify the list of include paths that are normally passed to the compiler -# using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but -# less readable) file names. This can be useful is your file systems doesn't -# support long names like on DOS, Mac, or CD-ROM. -# The default value is: NO. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the -# first line (until the first dot) of a Javadoc-style comment as the brief -# description. If set to NO, the Javadoc-style will behave just like regular Qt- -# style comments (thus requiring an explicit @brief command for a brief -# description.) -# The default value is: NO. - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first -# line (until the first dot) of a Qt-style comment as the brief description. If -# set to NO, the Qt-style will behave just like regular Qt-style comments (thus -# requiring an explicit \brief command for a brief description.) -# The default value is: NO. - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a -# multi-line C++ special comment block (i.e. a block of //! or /// comments) as -# a brief description. This used to be the default behavior. The new default is -# to treat a multi-line C++ comment block as a detailed description. Set this -# tag to YES if you prefer the old behavior instead. -# -# Note that setting this tag to YES also means that rational rose comments are -# not recognized any more. -# The default value is: NO. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the -# documentation from any documented member that it re-implements. -# The default value is: YES. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new -# page for each member. If set to NO, the documentation of a member will be part -# of the file/class/namespace that contains it. -# The default value is: NO. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen -# uses this value to replace tabs by spaces in code fragments. -# Minimum value: 1, maximum value: 16, default value: 4. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that act as commands in -# the documentation. An alias has the form: -# name=value -# For example adding -# "sideeffect=@par Side Effects:\n" -# will allow you to put the command \sideeffect (or @sideeffect) in the -# documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. - -ALIASES = - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. For -# instance, some of the names that are used will be different. The list of all -# members will be omitted, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or -# Python sources only. Doxygen will then generate output that is more tailored -# for that language. For instance, namespaces will be presented as packages, -# qualified scopes will look different, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources. Doxygen will then generate output that is tailored for Fortran. -# The default value is: NO. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for VHDL. -# The default value is: NO. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: -# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: -# Fortran. In the later case the parser tries to guess whether the code is fixed -# or free formatted code, this is the default for Fortran type files), VHDL. For -# instance to make doxygen treat .inc files as Fortran files (default is PHP), -# and .f files as C (default is Fortran), use: inc=Fortran f=C. -# -# Note: For files without extension you can use no_extension as a placeholder. -# -# Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments -# according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you can -# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in -# case of backward compatibilities issues. -# The default value is: YES. - -MARKDOWN_SUPPORT = YES - -# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up -# to that level are automatically included in the table of contents, even if -# they do not have an id attribute. -# Note: This feature currently applies only to Markdown headings. -# Minimum value: 0, maximum value: 99, default value: 0. -# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. - -TOC_INCLUDE_HEADINGS = 0 - -# When enabled doxygen tries to link words that correspond to documented -# classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by putting a % sign in front of the word or -# globally by setting AUTOLINK_SUPPORT to NO. -# The default value is: YES. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should set this -# tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); -# versus func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. -# The default value is: NO. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. -# The default value is: NO. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen -# will parse them like normal C++ but will assume all classes use public instead -# of private inheritance when no explicit protection keyword is present. -# The default value is: NO. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate -# getter and setter methods for a property. Setting this option to YES will make -# doxygen to replace the get and set methods by a property in the documentation. -# This will only work if the methods are indeed getting or setting a simple -# type. If this is not the case, or you want to show the methods anyway, you -# should set this option to NO. -# The default value is: YES. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. -# The default value is: NO. - -DISTRIBUTE_GROUP_DOC = NO - -# If one adds a struct or class to a group and this option is enabled, then also -# any nested class or struct is added to the same group. By default this option -# is disabled and one has to add nested compounds explicitly via \ingroup. -# The default value is: NO. - -GROUP_NESTED_COMPOUNDS = NO - -# Set the SUBGROUPING tag to YES to allow class member groups of the same type -# (for instance a group of public functions) to be put as a subgroup of that -# type (e.g. under the Public Functions section). Set it to NO to prevent -# subgrouping. Alternatively, this can be done per class using the -# \nosubgrouping command. -# The default value is: YES. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions -# are shown inside the group in which they are included (e.g. using \ingroup) -# instead of on a separate page (for HTML and Man pages) or section (for LaTeX -# and RTF). -# -# Note that this feature does not work in combination with -# SEPARATE_MEMBER_PAGES. -# The default value is: NO. - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions -# with only public data fields or simple typedef fields will be shown inline in -# the documentation of the scope in which they are defined (i.e. file, -# namespace, or group documentation), provided this scope is documented. If set -# to NO, structs, classes, and unions are shown on a separate page (for HTML and -# Man pages) or section (for LaTeX and RTF). -# The default value is: NO. - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or -# enum is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically be -# useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. -# The default value is: NO. - -TYPEDEF_HIDES_STRUCT = NO - -# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This -# cache is used to resolve symbols given their name and scope. Since this can be -# an expensive process and often the same symbol appears multiple times in the -# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small -# doxygen will become slower. If the cache is too large, memory is wasted. The -# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range -# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 -# symbols. At the end of a run doxygen will report the cache usage and suggest -# the optimal cache size from a speed point of view. -# Minimum value: 0, maximum value: 9, default value: 0. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in -# documentation are documented, even if no documentation was available. Private -# class members and static file members will be hidden unless the -# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. -# Note: This will also disable the warnings about undocumented members that are -# normally produced when WARNINGS is set to YES. -# The default value is: NO. - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will -# be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal -# scope will be included in the documentation. -# The default value is: NO. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be -# included in the documentation. -# The default value is: NO. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO, -# only classes defined in header files are included. Does not have any effect -# for Java sources. -# The default value is: YES. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. If set to YES, local methods, -# which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO, only methods in the interface are -# included. -# The default value is: NO. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base name of -# the file that contains the anonymous namespace. By default anonymous namespace -# are hidden. -# The default value is: NO. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all -# undocumented members inside documented classes or files. If set to NO these -# members will be included in the various overviews, but no documentation -# section is generated. This option has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. If set -# to NO, these classes will be included in the various overviews. This option -# has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO, these declarations will be -# included in the documentation. -# The default value is: NO. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO, these -# blocks will be appended to the function's detailed documentation block. -# The default value is: NO. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation that is typed after a -# \internal command is included. If the tag is set to NO then the documentation -# will be excluded. Set it to YES to include the internal documentation. -# The default value is: NO. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES, upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. -# The default value is: system dependent. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES, the -# scope will be hidden. -# The default value is: NO. - -HIDE_SCOPE_NAMES = YES - -# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will -# append additional text to a page's title, such as Class Reference. If set to -# YES the compound reference will be hidden. -# The default value is: NO. - -HIDE_COMPOUND_REFERENCE= NO - -# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of -# the files that are included by a file in the documentation of that file. -# The default value is: YES. - -SHOW_INCLUDE_FILES = YES - -# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each -# grouped member an include statement to the documentation, telling the reader -# which file to include in order to use the member. -# The default value is: NO. - -SHOW_GROUPED_MEMB_INC = NO - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include -# files with double quotes in the documentation rather than with sharp brackets. -# The default value is: NO. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the -# documentation for inline members. -# The default value is: YES. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the -# (detailed) documentation of file and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. -# The default value is: YES. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief -# descriptions of file, namespace and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. Note that -# this will also influence the order of the classes in the class list. -# The default value is: NO. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the -# (brief and detailed) documentation of class members so that constructors and -# destructors are listed first. If set to NO the constructors will appear in the -# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. -# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief -# member documentation. -# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting -# detailed member documentation. -# The default value is: NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy -# of group names into alphabetical order. If set to NO the group names will -# appear in their defined order. -# The default value is: NO. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by -# fully-qualified names, including namespaces. If set to NO, the class list will -# be sorted only by class name, not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the alphabetical -# list. -# The default value is: NO. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper -# type resolution of all parameters of a function it will reject a match between -# the prototype and the implementation of a member function even if there is -# only one candidate or it is obvious which candidate to choose by doing a -# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still -# accept a match between prototype and implementation in such cases. -# The default value is: NO. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo -# list. This list is created by putting \todo commands in the documentation. -# The default value is: YES. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test -# list. This list is created by putting \test commands in the documentation. -# The default value is: YES. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug -# list. This list is created by putting \bug commands in the documentation. -# The default value is: YES. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) -# the deprecated list. This list is created by putting \deprecated commands in -# the documentation. -# The default value is: YES. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional documentation -# sections, marked by \if ... \endif and \cond -# ... \endcond blocks. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the -# initial value of a variable or macro / define can have for it to appear in the -# documentation. If the initializer consists of more lines than specified here -# it will be hidden. Use a value of 0 to hide initializers completely. The -# appearance of the value of individual variables and macros / defines can be -# controlled using \showinitializer or \hideinitializer command in the -# documentation regardless of this setting. -# Minimum value: 0, maximum value: 10000, default value: 30. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES, the -# list will mention the files that were used to generate the documentation. -# The default value is: YES. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This -# will remove the Files entry from the Quick Index and from the Folder Tree View -# (if specified). -# The default value is: YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces -# page. This will remove the Namespaces entry from the Quick Index and from the -# Folder Tree View (if specified). -# The default value is: YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command command input-file, where command is the value of the -# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided -# by doxygen. Whatever the program writes to standard output is used as the file -# version. For an example see the documentation. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. You can -# optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. -# -# Note that if you run doxygen from a directory containing a file called -# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE -# tag is left empty. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files containing -# the reference definitions. This must be a list of .bib files. The .bib -# extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. -# For LaTeX the style of the bibliography can be controlled using -# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. See also \cite for info how to create references. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# Configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated to -# standard output by doxygen. If QUIET is set to YES this implies that the -# messages are off. -# The default value is: NO. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES -# this implies that the warnings are on. -# -# Tip: Turn warnings on while writing the documentation. -# The default value is: YES. - -WARNINGS = YES - -# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate -# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag -# will automatically be disabled. -# The default value is: YES. - -WARN_IF_UNDOCUMENTED = YES - -# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some parameters -# in a documented function, or documenting parameters that don't exist or using -# markup commands wrongly. -# The default value is: YES. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that -# are documented, but have no documentation for their parameters or return -# value. If set to NO, doxygen will only warn about wrong or incomplete -# parameter documentation, but not about the absence of documentation. -# The default value is: NO. - -WARN_NO_PARAMDOC = NO - -# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when -# a warning is encountered. -# The default value is: NO. - -WARN_AS_ERROR = NO - -# The WARN_FORMAT tag determines the format of the warning messages that doxygen -# can produce. The string should contain the $file, $line, and $text tags, which -# will be replaced by the file and line number from which the warning originated -# and the warning text. Optionally the format may contain $version, which will -# be replaced by the version of the file (if it could be obtained via -# FILE_VERSION_FILTER) -# The default value is: $file:$line: $text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning and error -# messages should be written. If left blank the output is written to standard -# error (stderr). - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# Configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag is used to specify the files and/or directories that contain -# documented source files. You may enter file names like myfile.cpp or -# directories like /usr/src/myproject. Separate the files or directories with -# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING -# Note: If this tag is empty the current directory is searched. - -INPUT = ../clicks/accurrent/example \ - ../clicks/accurrent/lib/include \ - ../clicks/accurrent/README.md - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses -# libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of -# possible encodings. -# The default value is: UTF-8. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# read by doxygen. -# -# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, -# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, -# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, -# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, -# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. - -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.idl \ - *.ddl \ - *.odl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.cs \ - *.d \ - *.php \ - *.php4 \ - *.php5 \ - *.phtml \ - *.inc \ - *.m \ - *.markdown \ - *.md \ - *.mm \ - *.dox \ - *.py \ - *.pyw \ - *.f90 \ - *.f95 \ - *.f03 \ - *.f08 \ - *.f \ - *.for \ - *.tcl \ - *.vhd \ - *.vhdl \ - *.ucf \ - *.qsf \ - *.odl \ - .md - -# The RECURSIVE tag can be used to specify whether or not subdirectories should -# be searched for input files as well. -# The default value is: NO. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. -# The default value is: NO. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories use the pattern */test/* - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or directories -# that contain example code fragments that are included (see the \include -# command). - -EXAMPLE_PATH = ../clicks/accurrent/example - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank all -# files are included. - -EXAMPLE_PATTERNS = * - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude commands -# irrespective of the value of the RECURSIVE tag. -# The default value is: NO. - -EXAMPLE_RECURSIVE = YES - -# The IMAGE_PATH tag can be used to specify one or more files or directories -# that contain images that are to be included in the documentation (see the -# \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command: -# -# -# -# where is the value of the INPUT_FILTER tag, and is the -# name of an input file. Doxygen will then use the output that the filter -# program writes to standard output. If FILTER_PATTERNS is specified, this tag -# will be ignored. -# -# Note that the filter must not add or remove lines; it is applied before the -# code is scanned, but not when the output code is generated. If lines are added -# or removed, the anchors will not be placed correctly. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# properly processed by doxygen. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: pattern=filter -# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how -# filters are used. If the FILTER_PATTERNS tag is empty or if none of the -# patterns match the file name, INPUT_FILTER is applied. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# properly processed by doxygen. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will also be used to filter the input files that are used for -# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). -# The default value is: NO. - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and -# it is also possible to disable source filtering for a specific pattern using -# *.ext= (so without naming a filter). -# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. - -FILTER_SOURCE_PATTERNS = - -# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that -# is part of the input, its contents will be placed on the main page -# (index.html). This can be useful if you have a project on for instance GitHub -# and want to reuse the introduction page also for the doxygen output. - -USE_MDFILE_AS_MAINPAGE = - -#--------------------------------------------------------------------------- -# Configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will be -# generated. Documented entities will be cross-referenced with these sources. -# -# Note: To get rid of all source code in the generated output, make sure that -# also VERBATIM_HEADERS is set to NO. -# The default value is: NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body of functions, -# classes and enums directly into the documentation. -# The default value is: NO. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any -# special comment blocks from generated source code fragments. Normal C, C++ and -# Fortran comments will always remain visible. -# The default value is: YES. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. -# The default value is: NO. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES then for each documented function -# all documented entities called/used by that function will be listed. -# The default value is: NO. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES then the hyperlinks from functions in REFERENCES_RELATION and -# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will -# link to the documentation. -# The default value is: YES. - -REFERENCES_LINK_SOURCE = YES - -# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the -# source code will show a tooltip with additional information such as prototype, -# brief description and links to the definition and documentation. Since this -# will make the HTML file larger and loading of large files a bit slower, you -# can opt to disable this feature. -# The default value is: YES. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -SOURCE_TOOLTIPS = YES - -# If the USE_HTAGS tag is set to YES then the references to source code will -# point to the HTML generated by the htags(1) tool instead of doxygen built-in -# source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version -# 4.8.6 or higher. -# -# To use it do the following: -# - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file -# - Make sure the INPUT points to the root of the source tree -# - Run doxygen as normal -# -# Doxygen will invoke htags (and that will in turn invoke gtags), so these -# tools must be available from the command line (i.e. in the search path). -# -# The result: instead of the source browser generated by doxygen, the links to -# source code will now point to the output of htags. -# The default value is: NO. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a -# verbatim copy of the header file for each class for which an include is -# specified. Set to NO to disable this. -# See also: Section \class. -# The default value is: YES. - -VERBATIM_HEADERS = YES - -# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the -# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the -# cost of reduced performance. This can be particularly helpful with template -# rich C++ code for which doxygen's built-in parser lacks the necessary type -# information. -# Note: The availability of this option depends on whether or not doxygen was -# generated with the -Duse-libclang=ON option for CMake. -# The default value is: NO. - -CLANG_ASSISTED_PARSING = NO - -# If clang assisted parsing is enabled you can provide the compiler with command -# line options that you would normally use when invoking the compiler. Note that -# the include paths will already be set by doxygen for the files and directories -# specified with INPUT and INCLUDE_PATH. -# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. - -CLANG_OPTIONS = - -#--------------------------------------------------------------------------- -# Configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all -# compounds will be generated. Enable this if the project contains a lot of -# classes, structs, unions or interfaces. -# The default value is: YES. - -ALPHABETICAL_INDEX = YES - -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all classes will -# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag -# can be used to specify a prefix (or a list of prefixes) that should be ignored -# while generating the index headers. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output -# The default value is: YES. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each -# generated HTML page (for example: .htm, .php, .asp). -# The default value is: .html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a user-defined HTML header file for -# each generated HTML page. If the tag is left blank doxygen will generate a -# standard header. -# -# To get valid HTML the header file that includes any scripts and style sheets -# that doxygen needs, which is dependent on the configuration options used (e.g. -# the setting GENERATE_TREEVIEW). It is highly recommended to start with a -# default header using -# doxygen -w html new_header.html new_footer.html new_stylesheet.css -# YourConfigFile -# and then modify the file new_header.html. See also section "Doxygen usage" -# for information on how to generate the default header that doxygen normally -# uses. -# Note: The header is subject to change so you typically have to regenerate the -# default header when upgrading to a newer version of doxygen. For a description -# of the possible markers and block names see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each -# generated HTML page. If the tag is left blank doxygen will generate a standard -# footer. See HTML_HEADER for more information on how to generate a default -# footer and what special commands can be used inside the footer. See also -# section "Doxygen usage" for information on how to generate the default footer -# that doxygen normally uses. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style -# sheet that is used by each HTML page. It can be used to fine-tune the look of -# the HTML output. If left blank doxygen will generate a default style sheet. -# See also section "Doxygen usage" for information on how to generate the style -# sheet that doxygen normally uses. -# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as -# it is more robust and this tag (HTML_STYLESHEET) will in the future become -# obsolete. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined -# cascading style sheets that are included after the standard style sheets -# created by doxygen. Using this option one can overrule certain style aspects. -# This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefore more robust against future updates. -# Doxygen will copy the style sheet files to the output directory. -# Note: The order of the extra style sheet files is of importance (e.g. the last -# style sheet in the list overrules the setting of the previous ones in the -# list). For an example see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that the -# files will be copied as-is; there are no commands or markers available. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the style sheet and background images according to -# this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value -# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 -# purple, and 360 is red again. -# Minimum value: 0, maximum value: 359, default value: 220. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use grayscales only. A -# value of 255 will produce the most vivid colors. -# Minimum value: 0, maximum value: 255, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the -# luminance component of the colors in the HTML output. Values below 100 -# gradually make the output lighter, whereas values above 100 make the output -# darker. The value divided by 100 is the actual gamma applied, so 80 represents -# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not -# change the gamma. -# Minimum value: 40, maximum value: 240, default value: 80. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to YES can help to show when doxygen was last run and thus if the -# documentation is up to date. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_TIMESTAMP = NO - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries -# shown in the various tree structured indices initially; the user can expand -# and collapse entries dynamically later on. Doxygen will expand the tree to -# such a level that at most the specified number of entries are visible (unless -# a fully collapsed tree already exceeds this amount). So setting the number of -# entries 1 will produce a full collapsed tree by default. 0 is a special value -# representing an infinite number of entries and will result in a full expanded -# tree by default. -# Minimum value: 0, maximum value: 9999, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files will be -# generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://DEVELOPER_NAME.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in -# ~/Library/DEVELOPER_NAME/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://DEVELOPER_NAME.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_DOCSET = NO - -# This tag determines the name of the docset feed. A documentation feed provides -# an umbrella under which multiple documentation sets from a single provider -# (such as a company or product suite) can be grouped. -# The default value is: Doxygen generated docs. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_FEEDNAME = "MikroE Click boards" - -# This tag specifies a string that should uniquely identify the documentation -# set bundle. This should be a reverse domain-name style string, e.g. -# com.mycompany.MyDocSet. Doxygen will append .docset to the name. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_BUNDLE_ID = mikroe.com - -# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. -# The default value is: org.doxygen.Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_ID = mikroe.com - -# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. -# The default value is: Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_NAME = MikroElektronika - -# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three -# additional HTML index files: index.hhp, index.hhc, and index.hhk. The -# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. -# -# The HTML Help Workshop contains a compiler that can convert all HTML output -# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML -# files are now used as the Windows 98 help format, and will replace the old -# Windows help format (.hlp) on all Windows platforms in the future. Compressed -# HTML files also contain an index, a table of contents, and you can search for -# words in the documentation. The HTML workshop also contains a viewer for -# compressed HTML files. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_HTMLHELP = YES - -# The CHM_FILE tag can be used to specify the file name of the resulting .chm -# file. You can add a path in front of the file if the result should not be -# written to the html output directory. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_FILE = - -# The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler (hhc.exe). If non-empty, -# doxygen will try to run the HTML help compiler on the generated index.hhp. -# The file has to be specified with full path. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -HHC_LOCATION = - -# The GENERATE_CHI flag controls if a separate .chi index file is generated -# (YES) or that it should be included in the master .chm file (NO). -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -GENERATE_CHI = NO - -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) -# and project file content. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_INDEX_ENCODING = - -# The BINARY_TOC flag controls whether a binary table of contents is generated -# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it -# enables the Previous and Next buttons. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members to -# the table of contents of the HTML help documentation and to the tree view. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that -# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help -# (.qch) of the generated HTML documentation. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify -# the file name of the resulting .qch file. The path specified is relative to -# the HTML output folder. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help -# Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt -# Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). -# The default value is: doc. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_VIRTUAL_FOLDER = ./temp/Help/doc - -# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom -# filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_SECT_FILTER_ATTRS = - -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be -# generated, together with the HTML files, they form an Eclipse help plugin. To -# install this plugin and make it available under the help contents menu in -# Eclipse, the contents of the directory containing the HTML and XML files needs -# to be copied into the plugins directory of eclipse. The name of the directory -# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. -# After copying Eclipse needs to be restarted before the help appears. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the Eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have this -# name. Each documentation set should have its own identifier. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# If you want full control over the layout of the generated HTML pages it might -# be necessary to disable the index and replace it with your own. The -# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top -# of each HTML page. A value of NO enables the index and the value YES disables -# it. Since the tabs in the index contain the same information as the navigation -# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. If the tag -# value is set to YES, a side panel will be generated containing a tree-like -# index structure (just like the one that is generated for HTML Help). For this -# to work a browser that supports JavaScript, DHTML, CSS and frames is required -# (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can -# further fine-tune the look of the index. As an example, the default style -# sheet generated by doxygen has an example that shows how to put an image at -# the root of the tree instead of the PROJECT_NAME. Since the tree basically has -# the same information as the tab index, you could consider setting -# DISABLE_INDEX to YES when enabling this option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_TREEVIEW = NO - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that -# doxygen will group on one line in the generated HTML documentation. -# -# Note that a value of 0 will completely suppress the enum values from appearing -# in the overview section. -# Minimum value: 0, maximum value: 20, default value: 4. -# This tag requires that the tag GENERATE_HTML is set to YES. - -ENUM_VALUES_PER_LINE = 4 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used -# to set the initial width (in pixels) of the frame in which the tree is shown. -# Minimum value: 0, maximum value: 1500, default value: 250. -# This tag requires that the tag GENERATE_HTML is set to YES. - -TREEVIEW_WIDTH = 250 - -# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to -# external symbols imported via tag files in a separate window. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of LaTeX formulas included as images in -# the HTML documentation. When you change the font size after a successful -# doxygen run you need to manually remove any form_*.png images from the HTML -# output directory to force them to be regenerated. -# Minimum value: 8, maximum value: 50, default value: 10. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX -# installed or if you want to formulas look prettier in the HTML output. When -# enabled you may also need to install MathJax separately and configure the path -# to it using the MATHJAX_RELPATH option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -USE_MATHJAX = NO - -# When MathJax is enabled you can set the default output format to be used for -# the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. -# Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. -# The default value is: HTML-CSS. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_FORMAT = HTML-CSS - -# When MathJax is enabled you need to specify the location relative to the HTML -# output directory using the MATHJAX_RELPATH option. The destination directory -# should contain the MathJax.js script. For instance, if the mathjax directory -# is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax -# Content Delivery Network so you can quickly see the result without installing -# MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest - -# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax -# extension names that should be enabled during MathJax rendering. For example -# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_EXTENSIONS = - -# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces -# of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an -# example see the documentation. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_CODEFILE = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box for -# the HTML output. The underlying search engine uses javascript and DHTML and -# should work on any modern browser. Note that when using HTML help -# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) -# there is already a search function so this one should typically be disabled. -# For large projects the javascript based search engine can be slow, then -# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to -# search using the keyboard; to jump to the search box use + S -# (what the is depends on the OS and browser, but it is typically -# , /

+ +

+ +[click Product page](https://www.mikroe.com/aws-iot-click) + +--- + + +#### Click library + +- **Author** : Stefan Filipovic +- **Date** : Mar 2023. +- **Type** : UART type + + +# Software Support + +We provide a library for the AWS IoT Click +as well as a demo application (example), developed using MikroElektronika +[compilers](https://www.mikroe.com/necto-studio). +The demo can run on all the main MikroElektronika [development boards](https://www.mikroe.com/development-boards). + +Package can be downloaded/installed directly from *NECTO Studio Package Manager*(recommended way), downloaded from our [LibStock™](https://libstock.mikroe.com) or found on [Mikroe github account](https://github.com/MikroElektronika/mikrosdk_click_v2/tree/master/clicks). + +## Library Description + +> This library contains API for AWS IoT Click driver. + +#### Standard key functions : + +- `awsiot_cfg_setup` Config Object Initialization function. +```c +void awsiot_cfg_setup ( awsiot_cfg_t *cfg ); +``` + +- `awsiot_init` Initialization function. +```c +err_t awsiot_init ( awsiot_t *ctx, awsiot_cfg_t *cfg ); +``` + +#### Example key functions : + +- `awsiot_reset_device` This function resets device by toggling the RST pin state. +```c +void awsiot_reset_device ( awsiot_t *ctx ); +``` + +- `awsiot_send_cmd` This function send command string by using UART serial interface. +```c +void awsiot_send_cmd ( awsiot_t *ctx, uint8_t *cmd ); +``` + +## Example Description + +> This example demonstrates the use of AWS IoT click board by bridging the USB UART +to mikroBUS UART which allows the click board to establish a connection with +the AWS IoT over the Quick Connect demo application without an AWS account. + +**The demo application is composed of two sections :** + +### Application Init + +> Initializes the driver, resets the click board to factory default settings, reads +and displays the vendor model and thing name on the USB UART, sets the WiFi credentials, +and attempts to connect to the AWS Cloud. If the initial attempt fails and the error +message "Failed to access network" or "Failed to login AWS (MQTT) broker" appears, +check the WiFi credentials and try running the example again. + +```c + +void application_init ( void ) +{ + log_cfg_t log_cfg; /**< Logger config object. */ + awsiot_cfg_t awsiot_cfg; /**< Click config object. */ + + /** + * Logger initialization. + * Default baud rate: 115200 + * Default log level: LOG_LEVEL_DEBUG + * @note If USB_UART_RX and USB_UART_TX + * are defined as HAL_PIN_NC, you will + * need to define them manually for log to work. + * See @b LOG_MAP_USB_UART macro definition for detailed explanation. + */ + LOG_MAP_USB_UART( log_cfg ); + log_init( &logger, &log_cfg ); + log_info( &logger, " Application Init " ); + + // Click initialization. + awsiot_cfg_setup( &awsiot_cfg ); + AWSIOT_MAP_MIKROBUS( awsiot_cfg, MIKROBUS_1 ); + if ( UART_ERROR == awsiot_init( &awsiot, &awsiot_cfg ) ) + { + log_error( &logger, " Communication init." ); + for ( ; ; ); + } + + log_printf( &logger, "Reset device\r\n\n" ); + awsiot_reset_device ( &awsiot ); + Delay_ms ( 2000 ); + log_printf( &logger, "Factory reset\r\n" ); + strcpy ( app_buf, AWSIOT_CMD_FACTORY_RESET ); + awsiot_send_cmd ( &awsiot, app_buf ); + awsiot_read_response ( &awsiot ); + Delay_ms ( 2000 ); + + log_printf( &logger, "Vendor model\r\n" ); + strcpy ( app_buf, AWSIOT_CMD_CONF_CHECK ); + strcat ( app_buf, AWSIOT_CMD_SEPARATOR ); + strcat ( app_buf, AWSIOT_CONF_KEY_ABOUT ); + awsiot_send_cmd ( &awsiot, app_buf ); + awsiot_read_response ( &awsiot ); + + log_printf( &logger, "Thing name\r\n" ); + strcpy ( app_buf, AWSIOT_CMD_CONF_CHECK ); + strcat ( app_buf, AWSIOT_CMD_SEPARATOR ); + strcat ( app_buf, AWSIOT_CONF_KEY_THING_NAME ); + awsiot_send_cmd ( &awsiot, app_buf ); + awsiot_read_response ( &awsiot ); + + log_printf( &logger, "WiFi SSID\r\n" ); + strcpy ( app_buf, AWSIOT_CMD_CONF ); + strcat ( app_buf, AWSIOT_CMD_SEPARATOR ); + strcat ( app_buf, AWSIOT_CONF_KEY_SSID ); + strcat ( app_buf, AWSIOT_CMD_SIGN_EQUAL ); + strcat ( app_buf, WIFI_SSID ); + awsiot_send_cmd ( &awsiot, app_buf ); + awsiot_read_response ( &awsiot ); + + log_printf( &logger, "WiFi Password\r\n" ); + strcpy ( app_buf, AWSIOT_CMD_CONF ); + strcat ( app_buf, AWSIOT_CMD_SEPARATOR ); + strcat ( app_buf, AWSIOT_CONF_KEY_PASSPHRASE ); + strcat ( app_buf, AWSIOT_CMD_SIGN_EQUAL ); + strcat ( app_buf, WIFI_PASS ); + awsiot_send_cmd ( &awsiot, app_buf ); + awsiot_read_response ( &awsiot ); + + log_printf( &logger, "Try to connect\r\n" ); + strcpy ( app_buf, AWSIOT_CMD_CONNECT ); + awsiot_send_cmd ( &awsiot, app_buf ); + awsiot_read_response ( &awsiot ); + + log_info( &logger, " Application Task " ); + + log_printf( &logger, "Now close the UART terminal and switch to the QuickConnect app\r\n" ); + Delay_ms ( 1000 ); + + uart_set_blocking( &logger.uart, false ); +} + +``` + +### Application Task + +> All data received from the USB UART will be forwarded to mikroBUS UART, and vice versa. +At this point you should disconnect from the UART terminal and run the Quick Connect demo application. + +```c +void application_task ( void ) +{ + app_buf_len = uart_read( &logger.uart, app_buf, PROCESS_BUFFER_SIZE ); + if ( app_buf_len > 0 ) + { + uart_write ( &awsiot.uart, app_buf, app_buf_len ); + awsiot_clear_app_buf( ); + } + app_buf_len = uart_read( &awsiot.uart, app_buf, PROCESS_BUFFER_SIZE ); + if ( app_buf_len > 0 ) + { + uart_write ( &logger.uart, app_buf, app_buf_len ); + awsiot_clear_app_buf( ); + } +} +``` + +## Note + +> To run the demo, follow the below steps: +> 1. If you opened a terminal application in the previous step, be sure to > disconnect that application from the serial port. +> 2. Download the Quick Connect executable: +> - [Mac](https://quickconnectexpresslinkutility.s3.us-west-2.amazonaws.com/QuickConnect_v1.9_macos.x64.tar.gz) +> - [Windows](https://quickconnectexpresslinkutility.s3.us-west-2.amazonaws.com/QuickConnect_v1.9_windows.x64.zip) +> - [Linux](https://quickconnectexpresslinkutility.s3.us-west-2.amazonaws.com/QuickConnect_v1.9_linux.x64.tar.gz) +> 3. Unzip the package, and follow the steps from the README file. +> +> The demo will connect to AWS IoT and give you an URL that you can use to visualize data +flowing from the device to the cloud using AT+SEND commands. The demo will run for up +to two minutes, and afterwards, you will be able to type AT+SEND commands yourself and +see the data coming in on the visualizer. + +The full application code, and ready to use projects can be installed directly from *NECTO Studio Package Manager*(recommended way), downloaded from our [LibStock™](https://libstock.mikroe.com) or found on [Mikroe github account](https://github.com/MikroElektronika/mikrosdk_click_v2/tree/master/clicks). + +**Other Mikroe Libraries used in the example:** + +- MikroSDK.Board +- MikroSDK.Log +- Click.AWSIoT + +**Additional notes and informations** + +Depending on the development board you are using, you may need +[USB UART click](https://www.mikroe.com/usb-uart-click), +[USB UART 2 Click](https://www.mikroe.com/usb-uart-2-click) or +[RS232 Click](https://www.mikroe.com/rs232-click) to connect to your PC, for +development systems with no UART to USB interface available on the board. UART +terminal is available in all MikroElektronika +[compilers](https://shop.mikroe.com/compilers). + +--- diff --git a/clicks/awsiot/changelog.md b/clicks/awsiot/changelog.md new file mode 100644 index 0000000000..ca09ef759f --- /dev/null +++ b/clicks/awsiot/changelog.md @@ -0,0 +1,4 @@ +## Changelog + +### Version 2.1.0.4 + - Initial release diff --git a/clicks/awsiot/details.md b/clicks/awsiot/details.md new file mode 100644 index 0000000000..082e334f7f --- /dev/null +++ b/clicks/awsiot/details.md @@ -0,0 +1,217 @@ + +--- +# AWS IoT click + +> AWS IoT Click is a compact add-on board that allows users to easily connected to AWS IoT services and securely interact with cloud applications and other devices. This board features the ESP32-C3-MINI-1-N4-A, a small 2.4GHz WiFi (802.11 b/g/n) and Bluetooth® 5 module from Espressif Systems that use ESP32C3 series of SoC RISCV single-core microprocessor (ESP32-C3FN4) with 4MB flash in a single chip package. The module uses UART communication alongside several other features like standalone possibility via USB interface, firmware boot, JTAG for debugging, and others. + +

+ +

+ +[click Product page](https://www.mikroe.com/aws-iot-click) + +--- + + +#### Click library + +- **Author** : Stefan Filipovic +- **Date** : Mar 2023. +- **Type** : UART type + + +# Software Support + +We provide a library for the AWS IoT Click +as well as a demo application (example), developed using MikroElektronika +[compilers](https://www.mikroe.com/necto-studio). +The demo can run on all the main MikroElektronika [development boards](https://www.mikroe.com/development-boards). + +Package can be downloaded/installed directly from *NECTO Studio Package Manager*(recommended way), downloaded from our [LibStock™](https://libstock.mikroe.com) or found on [Mikroe github account](https://github.com/MikroElektronika/mikrosdk_click_v2/tree/master/clicks). + +## Library Description + +> This library contains API for AWS IoT Click driver. + +#### Standard key functions : + +- `awsiot_cfg_setup` Config Object Initialization function. +```c +void awsiot_cfg_setup ( awsiot_cfg_t *cfg ); +``` + +- `awsiot_init` Initialization function. +```c +err_t awsiot_init ( awsiot_t *ctx, awsiot_cfg_t *cfg ); +``` + +#### Example key functions : + +- `awsiot_reset_device` This function resets device by toggling the RST pin state. +```c +void awsiot_reset_device ( awsiot_t *ctx ); +``` + +- `awsiot_send_cmd` This function send command string by using UART serial interface. +```c +void awsiot_send_cmd ( awsiot_t *ctx, uint8_t *cmd ); +``` + +## Example Description + +> This example demonstrates the use of AWS IoT click board by bridging the USB UART +to mikroBUS UART which allows the click board to establish a connection with +the AWS IoT over the Quick Connect demo application without an AWS account. + +**The demo application is composed of two sections :** + +### Application Init + +> Initializes the driver, resets the click board to factory default settings, reads +and displays the vendor model and thing name on the USB UART, sets the WiFi credentials, +and attempts to connect to the AWS Cloud. If the initial attempt fails and the error +message "Failed to access network" or "Failed to login AWS (MQTT) broker" appears, +check the WiFi credentials and try running the example again. + +```c + +void application_init ( void ) +{ + log_cfg_t log_cfg; /**< Logger config object. */ + awsiot_cfg_t awsiot_cfg; /**< Click config object. */ + + /** + * Logger initialization. + * Default baud rate: 115200 + * Default log level: LOG_LEVEL_DEBUG + * @note If USB_UART_RX and USB_UART_TX + * are defined as HAL_PIN_NC, you will + * need to define them manually for log to work. + * See @b LOG_MAP_USB_UART macro definition for detailed explanation. + */ + LOG_MAP_USB_UART( log_cfg ); + log_init( &logger, &log_cfg ); + log_info( &logger, " Application Init " ); + + // Click initialization. + awsiot_cfg_setup( &awsiot_cfg ); + AWSIOT_MAP_MIKROBUS( awsiot_cfg, MIKROBUS_1 ); + if ( UART_ERROR == awsiot_init( &awsiot, &awsiot_cfg ) ) + { + log_error( &logger, " Communication init." ); + for ( ; ; ); + } + + log_printf( &logger, "Reset device\r\n\n" ); + awsiot_reset_device ( &awsiot ); + Delay_ms ( 2000 ); + log_printf( &logger, "Factory reset\r\n" ); + strcpy ( app_buf, AWSIOT_CMD_FACTORY_RESET ); + awsiot_send_cmd ( &awsiot, app_buf ); + awsiot_read_response ( &awsiot ); + Delay_ms ( 2000 ); + + log_printf( &logger, "Vendor model\r\n" ); + strcpy ( app_buf, AWSIOT_CMD_CONF_CHECK ); + strcat ( app_buf, AWSIOT_CMD_SEPARATOR ); + strcat ( app_buf, AWSIOT_CONF_KEY_ABOUT ); + awsiot_send_cmd ( &awsiot, app_buf ); + awsiot_read_response ( &awsiot ); + + log_printf( &logger, "Thing name\r\n" ); + strcpy ( app_buf, AWSIOT_CMD_CONF_CHECK ); + strcat ( app_buf, AWSIOT_CMD_SEPARATOR ); + strcat ( app_buf, AWSIOT_CONF_KEY_THING_NAME ); + awsiot_send_cmd ( &awsiot, app_buf ); + awsiot_read_response ( &awsiot ); + + log_printf( &logger, "WiFi SSID\r\n" ); + strcpy ( app_buf, AWSIOT_CMD_CONF ); + strcat ( app_buf, AWSIOT_CMD_SEPARATOR ); + strcat ( app_buf, AWSIOT_CONF_KEY_SSID ); + strcat ( app_buf, AWSIOT_CMD_SIGN_EQUAL ); + strcat ( app_buf, WIFI_SSID ); + awsiot_send_cmd ( &awsiot, app_buf ); + awsiot_read_response ( &awsiot ); + + log_printf( &logger, "WiFi Password\r\n" ); + strcpy ( app_buf, AWSIOT_CMD_CONF ); + strcat ( app_buf, AWSIOT_CMD_SEPARATOR ); + strcat ( app_buf, AWSIOT_CONF_KEY_PASSPHRASE ); + strcat ( app_buf, AWSIOT_CMD_SIGN_EQUAL ); + strcat ( app_buf, WIFI_PASS ); + awsiot_send_cmd ( &awsiot, app_buf ); + awsiot_read_response ( &awsiot ); + + log_printf( &logger, "Try to connect\r\n" ); + strcpy ( app_buf, AWSIOT_CMD_CONNECT ); + awsiot_send_cmd ( &awsiot, app_buf ); + awsiot_read_response ( &awsiot ); + + log_info( &logger, " Application Task " ); + + log_printf( &logger, "Now close the UART terminal and switch to the QuickConnect app\r\n" ); + Delay_ms ( 1000 ); + + uart_set_blocking( &logger.uart, false ); +} + +``` + +### Application Task + +> All data received from the USB UART will be forwarded to mikroBUS UART, and vice versa. +At this point you should disconnect from the UART terminal and run the Quick Connect demo application. + +```c +void application_task ( void ) +{ + app_buf_len = uart_read( &logger.uart, app_buf, PROCESS_BUFFER_SIZE ); + if ( app_buf_len > 0 ) + { + uart_write ( &awsiot.uart, app_buf, app_buf_len ); + awsiot_clear_app_buf( ); + } + app_buf_len = uart_read( &awsiot.uart, app_buf, PROCESS_BUFFER_SIZE ); + if ( app_buf_len > 0 ) + { + uart_write ( &logger.uart, app_buf, app_buf_len ); + awsiot_clear_app_buf( ); + } +} +``` + +## Note + +> To run the demo, follow the below steps: +> 1. If you opened a terminal application in the previous step, be sure to > disconnect that application from the serial port. +> 2. Download the Quick Connect executable: +> - [Mac](https://quickconnectexpresslinkutility.s3.us-west-2.amazonaws.com/QuickConnect_v1.9_macos.x64.tar.gz) +> - [Windows](https://quickconnectexpresslinkutility.s3.us-west-2.amazonaws.com/QuickConnect_v1.9_windows.x64.zip) +> - [Linux](https://quickconnectexpresslinkutility.s3.us-west-2.amazonaws.com/QuickConnect_v1.9_linux.x64.tar.gz) +> 3. Unzip the package, and follow the steps from the README file. +> +> The demo will connect to AWS IoT and give you an URL that you can use to visualize data +flowing from the device to the cloud using AT+SEND commands. The demo will run for up +to two minutes, and afterwards, you will be able to type AT+SEND commands yourself and +see the data coming in on the visualizer. + +The full application code, and ready to use projects can be installed directly from *NECTO Studio Package Manager*(recommended way), downloaded from our [LibStock™](https://libstock.mikroe.com) or found on [Mikroe github account](https://github.com/MikroElektronika/mikrosdk_click_v2/tree/master/clicks). + +**Other Mikroe Libraries used in the example:** + +- MikroSDK.Board +- MikroSDK.Log +- Click.AWSIoT + +**Additional notes and informations** + +Depending on the development board you are using, you may need +[USB UART click](https://www.mikroe.com/usb-uart-click), +[USB UART 2 Click](https://www.mikroe.com/usb-uart-2-click) or +[RS232 Click](https://www.mikroe.com/rs232-click) to connect to your PC, for +development systems with no UART to USB interface available on the board. UART +terminal is available in all MikroElektronika +[compilers](https://shop.mikroe.com/compilers). + +--- diff --git a/clicks/awsiot/doc/doxy/Doxyfile.doxy b/clicks/awsiot/doc/doxy/Doxyfile.doxy new file mode 100644 index 0000000000..50abf664fe --- /dev/null +++ b/clicks/awsiot/doc/doxy/Doxyfile.doxy @@ -0,0 +1,2481 @@ +# Doxyfile 1.8.13 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = awsiot + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = 2.1.0.0 + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = ../cmake/awsiot/temp/Help/doc + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 0. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 0 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO, these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = YES + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = ../cmake/awsiot/example \ + ../cmake/awsiot/lib_awsiot/include \ + ../cmake/awsiot/README.md + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.idl \ + *.ddl \ + *.odl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.cs \ + *.d \ + *.php \ + *.php4 \ + *.php5 \ + *.phtml \ + *.inc \ + *.m \ + *.markdown \ + *.md \ + *.mm \ + *.dox \ + *.py \ + *.pyw \ + *.f90 \ + *.f95 \ + *.f03 \ + *.f08 \ + *.f \ + *.for \ + *.tcl \ + *.vhd \ + *.vhdl \ + *.ucf \ + *.qsf \ + *.odl \ + .md + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = ../cmake/awsiot/example + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = YES + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse-libclang=ON option for CMake. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://DEVELOPER_NAME.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/DEVELOPER_NAME/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://DEVELOPER_NAME.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Mikroe Click boards" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = mikroe.com + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = mikroe.com + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = MikroElektronika + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = ./temp/Help/doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /