mirror of https://github.com/ARMmbed/mbed-os.git
Simplified M0/M4 binary merging functionality. Now, M0 binary image to be used has to be explicitely named in a json file (can be ovverriden in mbed_app.json).
Exporter hooks removed completely. Cleanup and improvements to the comments, including removal of the redundant doxygen comments. Code run through astyle. Additionally: - changes to drivers/Timer.cpp reverted - ipcpipe_transport.* files removed as they are not used for now, - fixed condition in stdio_init.cpp to perform serial initialization only when STDIO is enabled, - added missing resurce manager call in PWM initialization, - us_ticker initialization changed to use pre-reserved clock divider (to avoid resource manager call). Changed reporting level from info to debug in PSOC6.py. Added missing includes for function declarations in startup files. Fixed (removed) garbadge text in psoc6_utils.c Precompiled binaries updated for recent changes in psoc6_utils.c and moved to a separate folder; README and LICENSE files added.pull/8491/head
parent
9b1db83eaa
commit
7d322dcd41
|
@ -23,13 +23,11 @@ namespace mbed {
|
|||
|
||||
Timer::Timer() : _running(), _start(), _time(), _ticker_data(get_us_ticker_data()), _lock_deepsleep(true)
|
||||
{
|
||||
(void)ticker_read_us(_ticker_data); // Make sure h/w timer is initialized in non-critical context.
|
||||
reset();
|
||||
}
|
||||
|
||||
Timer::Timer(const ticker_data_t *data) : _running(), _start(), _time(), _ticker_data(data), _lock_deepsleep(true)
|
||||
{
|
||||
(void)ticker_read_us(_ticker_data); // Make sure h/w timer is initialized in non-critical context.
|
||||
reset();
|
||||
#if DEVICE_LPTICKER
|
||||
_lock_deepsleep = (data != get_lp_ticker_data());
|
||||
|
|
|
@ -96,7 +96,7 @@ typedef enum {
|
|||
|
||||
typedef enum {
|
||||
ADC_0 = (int)SAR_BASE,
|
||||
}ADCName;
|
||||
} ADCName;
|
||||
|
||||
typedef enum {
|
||||
DAC_0 = (int)CTDAC0_BASE,
|
||||
|
|
|
@ -21,21 +21,18 @@
|
|||
#include "cy_ipc_config.h"
|
||||
#include "ipc/cy_ipc_pipe.h"
|
||||
|
||||
#undef RPC_GEN
|
||||
#define RPC_GEN RPC_GEN_IMPLEMENTATION
|
||||
|
||||
#include "rpc_defs.h"
|
||||
#include "rpc_api.h"
|
||||
|
||||
#undef RPC_GEN
|
||||
#define RPC_GEN RPC_GEN_INITIALIZATION
|
||||
|
||||
|
||||
void ipcrpc_init(void)
|
||||
{
|
||||
uint32_t rpc_counter = 0;
|
||||
|
||||
#include "rpc_defs.h"
|
||||
#define RPC_GEN RPC_GEN_INITIALIZATION
|
||||
#include "rpc_api.h"
|
||||
#undef RPC_GEN
|
||||
}
|
||||
|
||||
/* [] END OF FILE */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
#include "device.h"
|
||||
#include "system_psoc63.h"
|
||||
#include "cy_device_headers.h"
|
||||
#include "ipc_rpc.h"
|
||||
#include "psoc6_utils.h"
|
||||
|
||||
#if defined(CY_DEVICE_PSOC6ABLE2)
|
||||
#if !defined(CY_PSOC6ABLE2_REV_0A_SUPPORT_DISABLE)
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
Copyright (c) 2017-2018 Future Electronics.
|
||||
Copyright (c) 2007-2018 Cypress Semiconductor.
|
||||
|
||||
Permissive Binary License
|
||||
|
||||
Version 1.0, September 2015
|
||||
|
||||
Redistribution. Redistribution and use in binary form, without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
1) Redistributions must reproduce the above copyright notice and the
|
||||
following disclaimer in the documentation and/or other materials
|
||||
provided with the distribution.
|
||||
|
||||
2) Unless to the extent explicitly permitted by law, no reverse
|
||||
engineering, decompilation, or disassembly of this software is
|
||||
permitted.
|
||||
|
||||
3) Redistribution as part of a software development kit must include the
|
||||
accompanying file named "DEPENDENCIES" and any dependencies listed in
|
||||
that file.
|
||||
|
||||
4) Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
Limited patent license. The copyright holders (and contributors) grant a
|
||||
worldwide, non-exclusive, no-charge, royalty-free patent license to
|
||||
make, have made, use, offer to sell, sell, import, and otherwise
|
||||
transfer this software, where such license applies only to those patent
|
||||
claims licensable by the copyright holders (and contributors) that are
|
||||
necessarily infringed by this software. This patent license shall not
|
||||
apply to any combinations that include this software. No hardware is
|
||||
licensed hereunder.
|
||||
|
||||
If you institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the software
|
||||
itself infringes your patent(s), then your rights granted under this
|
||||
license shall terminate as of the date such litigation is filed.
|
||||
|
||||
DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
||||
CONTRIBUTORS "AS IS." ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
|
||||
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@ -0,0 +1,15 @@
|
|||
README for pre-compiled PSoC 6 Cortex M0+ core images
|
||||
=====================================================
|
||||
|
||||
This folder contains precompiled program images for the CM0+ core of the PSoC 6(63xx) MCU suitable for use with MBed OS applications running on CM4 core. Two images are available:
|
||||
* `psoc63_m0_default_1.01.hex`
|
||||
|
||||
This image contains basic code, that brings up the chip, starts CM4 core and puts CM0+ core into a deep sleep. It is suitable for use with all Mbed applications except those intendif to use BLE feature.
|
||||
|
||||
* `psoc63_m0_ble_controller_1.01.hex`
|
||||
|
||||
This image brings up the chip, starts CM4 core and runs BLE HCI controller for the build-in BLE device. This image is suitable for use with Mbed BLE applications.
|
||||
|
||||
The images are 'bare metal' code prepared with Cypress PSoC Creator IDE and are toolchain agnostic, i.e. can be used with CM4 Mbed applications build with any supported toolchain.
|
||||
|
||||
**These images were prepared by Future Electronics and are made available under the conditions of Permissive Binary Licence, see file LICENSE.txt**
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,150 @@
|
|||
:020000041000EA
|
||||
:4000000000000108310100100D00000095010010000000000000000000000000000000000000000000000000000000009101001000000000000000009101001091010010DC
|
||||
:4000400091010010F10700109101001091010010910100109101001091010010910100109101001091010010910100109101001091010010910100109101001091010010FA
|
||||
:400080009101001091010010910100109101001091010010910100109101001091010010910100109101001091010010910100109101001091010010910100109101001020
|
||||
:4000C00010B5064C2378002B07D1054B002B02D0044800E000BF0123237010BD4804000800000000541F0010084B10B5002B03D00749084800E000BF07480368002B00D1AD
|
||||
:4001000010BD064B002BFBD09847F9E7000000004C040008541F001044010008000000007047EFF3108072B6704780F310887047FFF7F6FF72B6104C104DAC4209DA2168D4
|
||||
:400140006268A368043B02DBC858D050FAE70C34F3E70B490B4A0020521A02DD043A8850FCDC094809490860BFF34F8F00F0ECF800F01EF8FEE70000581F0010701F0010D1
|
||||
:4001800048040008380700080000000808ED00E0FEE7FEE700B504207146084202D0EFF3098001E0EFF30880043001F08DFAFEE710B500F0A5F962B6064B5B689B0301D517
|
||||
:4001C00001F044FA044800F02FF9002001F090F9FBE7C0460000264000000810F8B5E023504C9B00E2580F231340D022990092000919885807224C4D0240032A05D0042A73
|
||||
:4002000005D0002A0FD0494811E028680FE0C022920089581F220A40112A01D0132A04D18020000203E0424801E0FA20C001002B27D1B223B1210322DB00C900E65863588A
|
||||
:4002400067581B0F3F0F1340174205D0354F7958090F0A40012A01D1F20701D4032B3AD1B023344ADB00E658A158E758C904C90C01F050FDB603F901B60BC90F7043013158
|
||||
:4002800027E0012B27D1C823C0210322DB00C900E658635867583F0F174205D0214F7958090F0A40012A01D1F20703D49B009B0F032B10D1C0227F23D200A758A1583B40BD
|
||||
:4002C0001F27A658090A3940584301F023FD310C394001F01FFDE0239B00E3589B069B0FD840154B68601C691969240A090E013101F010FDE1B2A860013101F00BFD0F4BBF
|
||||
:40030000E860286104000E49C01801F003FDFA210C4B28758900E01801F0FCFCA861C003E861F8BD00002640C000000800366E0100127A0084050000000021403F420F00AC
|
||||
:4003400040420F00E7030000B021E02010B530241F4BC9005A588000520052085A501A58A2431A50802252045A501A491A4A80209950A021043289019950FF21174AC005FA
|
||||
:40038000995081315A5892009208024380205A505A580006024301205A505A5882435A5000F054FAFFF71AFF00F02AFA00F032FA00F0B8FEB0235B055A78002A02D05B7855
|
||||
:4003C000212B03D10022064BDA605A6010BDC0460000264001000200840500008C050000E0002340024BD86F032318407047C0460400214010B5FFF794FE074A074BD16F79
|
||||
:400400000B4007490B43D367102306490A681A42FCD0FFF78AFE10BD04002140FCFF00000100FA058800214070B50F4C0600FFF778FEE36F0500DB439B0701D1FFF7DAFF3F
|
||||
:40044000B0230A4A9B00D650E26F094B09491340094A1343E36710230A681A42FCD02800FFF763FE70BDC0460400214000002140FCFF0000880021400300FA0510B5040063
|
||||
:40048000007B00F0F3F8606010BD10B50400007B216900F0B5F8606010BD10B5037B0169180000F0CDF810BD10B50400C06800F009F9606010BD10B5C06800F017F910BDF0
|
||||
:4004C00010B50400C06800F023F9606010BD10B5C06800F037F910BD10B504000C23C05E00F056F8606010BD10B50C23C05E00F06FF810BD10B5C06800F036F910BD0000A8
|
||||
:4005000010B500221849042000F0A4FC01221749042000F09FFC02221549042000F09AFC03221449042000F095FC04221249100000F090FC05221149042000F08BFC0622E9
|
||||
:400540000F49042000F086FC07220E49042000F081FC08220C49042000F07CFC09220B49042000F077FC10BD7D0400108B0400109B040010A9040010B7040010C104001062
|
||||
:40058000CF040010D9040010E9040010F504001070B507260512EDB206400D2D11D801F0F8F80A4901224B5D1C003441144003D1B24013434B5501E00124644201F0EDF8D2
|
||||
:4005C00001E001246442200070BDC0466404000870B50412E4B20D2C0FD80725054001F0D8F8064901220B5D1E002E41164202D0AA4093430B5501F0D0F870BD6404000862
|
||||
:40060000F8B50C00050001F0C4F80C2301225D431300A3401A00094E71198F683A4008D13B43AD598B60631C4B60AB4202D94A6000E0FF2401F0B1F82000F8BDE0000008BD
|
||||
:4006400070B50C00050001F0A4F801210C23A1406B43054AD3189A680A4201D08A439A6001F09BF870BDC046E0000008F0B50C2485B0019001F08DF8019B114D5C432B192A
|
||||
:400680005B68029003932E1971680198FFF7B8FF0700FF280DD173682A59934201D9002373602A1953680399994202D001335360E9E7029801F071F8380005B0F0BDC04648
|
||||
:4006C000E000000810B5040007280AD801F061F8054B0E331A5D002A01D101321A5501F05CF80120404210BD6404000810B5040007280AD801F04DF8044B0E331A5D012AE1
|
||||
:4007000001D100221A5501F048F810BD6404000870B505001F280ED801F03BF8084B30335C5D002C02D101225A5501E00124644201F033F801E001246442200070BDC04666
|
||||
:40074000E000000810B504001F280AD801F021F8044B30331A5D012A01D100221A5501F01CF810BDE000000870B5B024C025144B144A15496405ED00E35CA25C615C665D18
|
||||
:400780003F251F242A400C4024039201224311002B407F2219430B003240520413430B4A1C0A110050310B701B0C8B7000234C7011005031595CC1540133062BF8D170BDDB
|
||||
:4007C000040600000506000003060000E000000810B50248583000F051FB10BDFC04000810B50248B03000F049FB10BDFC04000810B5024800F042FB10BDC046FC0400083C
|
||||
:4008000010B5034A80216032042000F001FA10BDFC05000870B500F0BCFF0500094800F08BFA094C200000F0B9FA2000343000F0B5FA2000683000F0B1FA280000F0ADFFA1
|
||||
:4008400070BDC046FC040008881E0010F0B5962191B0002000F050FF00F026FF002801D100F014FF012000F09FFDE821724C734B626C89011A400A436264626C0193120A04
|
||||
:40088000D2B23A2A04D1636C6D4A13400B4363643422002103A801F0D2FA03AA0021694800F06EFC3422002103A801F0C8FA03AA0121644800F064FC082204262368624DA7
|
||||
:4008C000134323602369334207D1002D04D0012000F0D2FE013DF5E701E0002D00D1FEE7A02603220127594CF600A35903AD93433B43A351D2195649280001F097FA280088
|
||||
:4009000000F0FAFF534901980B68534A03400B608021136949041B021B0A0B4313611369019902200B401361E0230F219B00E2588A433A43E250E25821318A438021E250C6
|
||||
:40094000E25809060A43E250002100F0D3FA0021032000F0CFFA0021042000F0CBFA0321002000F0C7FA0321380000F0C3FA384B0522191D280001F059FA2900380000F03F
|
||||
:40098000DBFA002800D0FEE73449380000F026FB002800D0FEE7324B324AE1580A403A43E250E158304A0A408021E250E25809060A43E250A2592D4B1340A351A2592C4BF3
|
||||
:4009C00013408022920113438022A351A35912021343A351184B1A68264B1340164A136000F0DEFEC0235B00E3583B4204D1224AA3585B005B08A3506421002000F07CFEEF
|
||||
:400A000024220021280001F01AFA29000D4800F031FC2A000E4B0C3313CB13C213CB13C213CB13C22900154800F024FC144A154B1A6011B0F0BDC04600002740FF00FFFF06
|
||||
:400A4000FFC5FFDF0000324020A1070000002640241F001090002140000021401027000004050000FEFCFFFFFFFF00FFFFF0FFFFFF8FFFFFFFFCFFFF0C0500000003324062
|
||||
:400A800001001180000E1F41030010B5FF24800882009B1ADB009C409940E243214007282DD8174B01F02CF904090E13181D2227186A02401143196221E0586A0240114332
|
||||
:400AC00059621CE0986A02401143996217E0D86A02401143D96212E0186B0240114319630DE0586B02401143596308E0986B02401143996303E0D86B02401143D96310BDD7
|
||||
:400B000000002140064B10309A68064B9A4203D183009858995002E0034B8000C058704700ED00E00000000800000010F7B5051E01913DD00023C05E002802DBA978FFF735
|
||||
:400B4000A3FF6A680023E85E9201002812DB1A4B81088900C918FF2303271C00C0250740FF00BC401A40BA40AD004E59A64332434A5113E003250F2381B20B402940A9404B
|
||||
:400B8000FC352F002A408F408A40083B9B080B4C9B001B19DE69BE433243DA61074B00259A68074B9A4204D10199FFF7ABFF00E0044D2800FEBDC04600E100E000ED00E070
|
||||
:400BC00000000008010056000369002B03DA89B24160002000E001487047C04601008A000368002B01DB034803E089B2C26081600020704701008A000369002B03DAC368D6
|
||||
:400C000000200B6000E001487047C04601008A0070B5040010000F2C2BD8002A07D1002927D1154B6401E418144B1C6022E000291FD01F260E401CD1104D0F4B6401E418D0
|
||||
:400C40006960AA60CA0831002C6001F0F8F831002000FFF7B9FF31002A1D2868FFF7C0FF011E04D12868FFF7AFFF011E02D0044900E00449080070BD00002340EC06000850
|
||||
:400C800001018A0003018A00194BF7B51A680193D76804003B680E00834223D90025A94202D100F076FD0500019B18680368002B01DB104C10E063095A01A41A0122A24090
|
||||
:400CC00079689B00CB18196811420DD00024914319600021FFF778FF002E07D1280000F05CFD03E0044C01E0044CF2E72000FEBDEC0600080301880004018A0002018800B6
|
||||
:400D00000A4B1B68DA68136883420DD9430999005B01C31A0120984052688B581840431E9841034BC01800E002487047EC0600080001880004018A00024B1A68002A00D14A
|
||||
:400D400018607047F8060008F0B52C246043104C1E0024681F0A2018FF2426403C400D4F06607601F61906610B4E1B0C44606401A4191E04836033434461A3600023059D5D
|
||||
:400D8000C261016283619D4201D02B888381F0BDF80600080000234000102340F0B5038985B002AD2B800368066A1933AB704368476A0095826AC16A040003930369C068A1
|
||||
:400DC000FFF7C2FF00213B000A0000913000FFF7BBFF216B2800FFF7A9FE0023EA5E002A05DB1F231A401E3B9340024A136005B0F0BDC04600E100E0F7B52C25124C6843E9
|
||||
:400E0000276801933C182669002E08D04D4379198869002805D13568002D02DA03E00B4811E00B480FE06768012425004B689D4013882D041D431560F2608C61BC40019B65
|
||||
:400E4000A4B24B62B460FEBDF806000804028A0007028A002C235843064B1B681818C369934204D9036A9200D150002000E002487047C046F80600080A028A0073B500269A
|
||||
:400E800042690400D56801962B0CB3421CD01B040069136013680369B34215DA01A9FFF7ABFEB0420CD10198E26903681E0C0378934205D2226A9B009B58002B00D0984725
|
||||
:400EC00031002069FFF780FEADB2002D0ED063691D6000251B68636AAB4202D09847656203E0A36A002B00D09847A56163691B6873BD0000042819D804290FD94B1EFF3B13
|
||||
:400F0000132B13D81F231940094B8000C018C02304229B00C1504033C25005E00723D0301940034B8000C150002000E0014870470000264001004A00F0B5012819D1C02275
|
||||
:400F4000224BD2009A58002A0CDB8A78901E0E280FD84C78601E11280BD8C8780D7800282FD101E01A4830E07026152D01D9AE4201D2184829E00E79022E14D0F82124020C
|
||||
:400F80004901F8270C4021007F2412047F033A4011432C4021438024C022C006240520400143D2009950C020C0248005360706403200E4001D590849002029400A431A51C4
|
||||
:400FC00003E03826122DD4D9D1E7F0BD0000264003004A0001004A00FFFFFFCFF8B50D00012819D1C02180240D4BC9005A582406C826224307001C005A50F600A3593B42B7
|
||||
:4010000006D1002D0AD0012000F036FB013DF5E70020002D03D101E0024800E00248F8BD0000264001004A0002004A001E4A0300904238D010D840282ED005D8002831D0B5
|
||||
:4010400010282DD119482EE0802827D08021100049008B4227D023E0154A904214D008D8A022120690421DD0124AA020934211D016E0114A904209D0104A904208D0104AB1
|
||||
:4010800090420DD10F480EE0A42003E00E480AE00E4808E0C00306E00D4804E00D4802E00D4800E0002070470600520001005000010000F0090000A0040000F0050000F0C5
|
||||
:4010C000030000F00100520002005200030052000200500005005200FF0052000B4B10B51B69002B10DB0A4B0A4C1868FFF79EFF0121094B094A995099580029FCD10649AC
|
||||
:4011000009590029F8D100E0054810BD00002340FC0600088C040000000025400C0400000200500010B5022202490020FFF792FE10BDC046450200080F4B30B5C0180F4B30
|
||||
:40114000C009C01800011F23032909D81D00C9008D4013408B400468AC432343036009E01D000439C9008D4013408B404468AC432343436030BDC0460000CEBF0010030457
|
||||
:40118000F7B504000E00150000286ED0002A6CD0012312688B40002A01D1436000E08360B30001930F231900B0008140A26A8A4369680B4083401343A3622A7A31002000BA
|
||||
:4011C000FFF7BAFF0320710088400322636A83431800EB6813408B400343636201231F00B7400097FF43BC462F6962461F40B740A0691031104038436F69A0611F40B740A9
|
||||
:40120000E06A10403843E062A86903221840B0400600E869276B10408A408840009930430A4397436A6A384356000222206304201640AA6A616B92000240286A3243034017
|
||||
:401240001A43EB6AD80018230340FF2013432A6B019D520102401343FE2292002A40934081430B436363002000E00148FEBDC04601005A0000281BD0002919D00D4B0E4AD2
|
||||
:40128000C318DB099B180A681B010260CA6882620A69C2624A6902638A6842624A6882618A694263CA6900201A600A6A5A6000E0024870470000CEBF0010030401005A0069
|
||||
:4012C00010B50F2402200649064BCA58A2430243CA50F02212028B58A34303438B5010BD0000214004F0000010B50F2403200649064BCA58A2430243CA50F02212028B5872
|
||||
:40130000A34303438B5010BD0000214004F000000449054A054B88580340C020C00103438B5070470000214004F00000FF8FFFFF0449054A054B885803408020C001034365
|
||||
:401340008B5070470000214004F00000FF8FFFFF031E03D1084B5869C00F0CE00020012B09D1054918008A69920F1A4201D18869C00F01231840704700002640072370B540
|
||||
:40138000084CA2691A4090420BD0A5699D4303402B43A361002904D0904202D9C82000F06BF970BD00002640F7B5060000F0F1F9B022E8211F27244D244C01902B595205B1
|
||||
:4013C000C900525C3B409B1A5A1E9341B34236D0002E13D180211E4A490493690B439361FFF76EFF0B222B59BB4313432B51FFF78FFFB023E8225B05D2000CE00B222B5945
|
||||
:401400000920BB4313432B5100F036F9FFF790FFB022104B5205D35C2959DAB21F23994313400B432B51012E09D1092000F024F9FFF75AFF064A084B91690B409361019810
|
||||
:4014400000F0ABF9F7BDC046000026401CFF000000F0254041070000FFFFFFFEF0B5060085B00D00204F042901D001291AD100207C68002C35D01D4B984232D02379B3428C
|
||||
:401480000ED1A368002B01D02B4209D1E36801A85A689B6842608360057023689847BC606469E6E7BC68022902D1002C00D024690020002C15D00D4B984212D02379B342AB
|
||||
:4014C0000DD1A368002B01D02B4208D1E36801A85A689B68426083600570236898472469E7E705B0F0BDC0460C070008FF004200F7B5484C06002368002B0AD100F049F97C
|
||||
:4015000023680700002B10D004210120FFF7A6FF0BE001210800FFF7A1FF0028EED002210120FFF79BFF3C4C72E03C4D2B680195DB061AD5F2223A4BD2019A58E260F022BA
|
||||
:40154000D2019A582261374A9A586261364A9A58A261364A9A58E261354A9A582262354A9A586262344A9B58A362B02252055378002B02D05378212B03D1300000F07CFCAF
|
||||
:401580001DE02E4B2E492F4859588C46E821C900515CC9B20091196809020AD41F2165460D402900009DA94203D0274952581A5002E00023214A1350300000F055FC019B2F
|
||||
:4015C0001B68DB0619D5F0222169154BD20199506169144A9950A169134A9950E169134A9950216A124A9950616A124A9950A16A114A9950E168E8329950380000F0CDF888
|
||||
:4016000023680024A34203D008210120FFF726FF2000FEBD0C070008FF004200E00001400000344004780000087800000C7800001078000014780000187800000000264088
|
||||
:401640001CFF0000307F00001018000010B5E82400F09FF8064B07495A68A4010A4022435A605A68114059605B6800F096F810BD00002640FF00FC0F10B5034B1B78584324
|
||||
:4016800000F07EF810BDC046D400000880220020034B12069A649B6C834200DA0148704700002740030046008022054B120198585B68DBB2002B02D08023DB0218437047C5
|
||||
:4016C00000002640FEE7000002680A4B10B51A6042685A6082689A60C268DA6002691A6142695A6182699A61C269DA61FFF7EAFF10BDC04628040008F0B51922002800D19E
|
||||
:401700004B32E82403258A429241194E640033595242AB43134333513359164F3B403351154B5C68AC4322435A605A6817405F60002808D00023102913D921338B429B4167
|
||||
:401740005B4201330DE003001D290AD901233A2907D9DB18572904D976338B4240410422131A0F21054A1068884303431360F0BD00002140FFFCFFFFFC002140000025403A
|
||||
:401780000230800803D001300238FCD1C046C0467047EFF3108072B6704780F310887047094B042803D11A68104318600BE0C02200069204104090220449920088500421A6
|
||||
:4017C0001A688A431A60704710E000E000002140F8B58023FA250C0001271B0218430D4E0004F061AD00326C0A4B01203A4205D1002D0CD0013DFFF73FFFF4E7002D06D001
|
||||
:401800001A6C10431864DB6A0020238000E00248F8BDC04600003C400400160070B5FA2401260D4B000418400C4D0143E961A4002B6C0A4A0120334205D1002C0AD0013C8D
|
||||
:40184000FFF71AFFF4E7002C04D0136C18431064002000E0024870BD0000FF7F00003C400400160030B524259DB02A00002101A800F0E5FA154B164C0493164B2A00002162
|
||||
:401880000AA808930993069400F0D9FA124B2A000D93124B00211193114B13A812930F9400F0CDFA0F4B01A916930F4B0F481A931894FFF7DFFC0AA90D48FFF7DBFC13A96A
|
||||
:4018C0000C48FFF7D7FC1DB030BDC046666666660000FFFF1C1C1C1C66E6EE661C1A1A1A1A1A000066E666661A1A001C000132408001324000023240F0B585B000900028F3
|
||||
:4019000000D147E1BE4F7B689B0301D5FFF79EFE0122BC4BBC4C1D001959114204D0BB495B58134200D037E1FFF79CFFB84AB94BEA508022009BD2021B781343B64AAB5016
|
||||
:40194000B64AB74BEA50B74B5A6801231A4200D024E1B54A116F08220A4008D1B34BB44918681300884202D900F0D4F9431E2A68002B03D0AF485B03034300E0AE4B13439B
|
||||
:401980002B607B699F499E4E01275B000DD539000320FFF7F3FC73699B0F3B420AD08022B369D2051343B36104E00320A34A8B5803438B502B5940200193019AA04BA14E7D
|
||||
:4019C00013432B51FFF758FE0123AA598D4F1A4208D1BB514020FFF74FFE03234020BB51FFF74AFEFA27019A974B984E1A4016430192FF002E51964A964BD3581022134257
|
||||
:401A000007D1002F00D1CBE00120013FFFF734FEF1E7002F00D1C3E008218F4A0120AB580B43AB50FFF794FC002802D18B4E019B1E438B4B1E4001231E432E511E00894C2E
|
||||
:401A4000724BEB58334207D1002C00D1A8E00120013CFFF711FEF3E7002C00D1A0E00B27C02181484901FFF7D9FE041E05D102AB991D7D48FFF7ACFE0400013F002F00D1E3
|
||||
:401A800096E0002C25D1C02202AB9E1D338852019342E5D131007548FFF79AFE041E18D180233288DB001A4200D083E00B27019380216E48C900FFF7B1FE041E04D13100AA
|
||||
:401AC0006A48FFF785FE0400013F002F70D0002C68D0B0256D056B78002B44D06B78212B41D0634FEB5B002B3DD0002C00D0FEE002AB9E1D31005F48FFF76AFE041E00D061
|
||||
:401B0000F5E0C021E85B3488084060398C434008594920430140F020EA5BC000EB5BD201024011439B05554A9B0F1140DB02194350483180FFF772FE041E00D0D7E03100F2
|
||||
:401B40004F48FFF745FE041E00D0D0E0C022EB5B31889B069B0F9B019143194348483180FFF75CFE0400002C00D0C0E0009B454859781D78444B49001943FFF74FFE041EA3
|
||||
:401B800004D142494248FFF749FE04006801FFF773FDACE03F4CAAE03F4CA8E03F4CA6E03F4CA4E03388019A934200D080E701E03B4C8EE731003B48FFF70AFE041E00D074
|
||||
:401BC00087E732883F2310009843009B36499F78DB78012F0ED10222012B04D89FB2D21B92B2019201E0170001947022104330802E4A66E0002B5BD0019401275BE0C04668
|
||||
:401C00000000264000003C40A0F00100B4F0010006000001A4F00100A8F0010001000100ACF00100FC003C4000F03D40C800000800093D00041A0080040A0080C4F00100DC
|
||||
:401C400030000300B0F00100EFFFFEFF20000200000032401040000068F0010028000200FFFFFBFFF07E0E00021E0000031E000016180000071E00007FF8FFFFFFE7FFFFDD
|
||||
:401C8000061E0000081E000001100000376800000F1E000001001600030016000200160004001600091E0000C00000080048E80101201F0001907F2082436F3802433280A8
|
||||
:401CC0000C4ADA400A6031880B4839433180FFF7A5FD009B0400DB78DF1B03231F40019B9B001F43054BBFB23780EF50F1E6200005B0F0BD0024F400091E000064F001008B
|
||||
:401D000002B4714649084900095C49008E4402BC7047C046002243088B4274D303098B425FD3030A8B4244D3030B8B4228D3030C8B420DD3FF22090212BA030C8B4202D3E9
|
||||
:401D40001212090265D0030B8B4219D300E0090AC30B8B4201D3CB03C01A5241830B8B4201D38B03C01A5241430B8B4201D34B03C01A5241030B8B4201D30B03C01A52419D
|
||||
:401D8000C30A8B4201D3CB02C01A5241830A8B4201D38B02C01A5241430A8B4201D34B02C01A5241030A8B4201D30B02C01A5241CDD2C3098B4201D3CB01C01A52418309B2
|
||||
:401DC0008B4201D38B01C01A524143098B4201D34B01C01A524103098B4201D30B01C01A5241C3088B4201D3CB00C01A524183088B4201D38B00C01A524143088B4201D3C9
|
||||
:401E00004B00C01A5241411A00D20146524110467047FFE701B5002000F006F802BDC0460029F7D076E770477047C046002310B59A4203D0CC5CC4540133F9E710BD0300EB
|
||||
:401E40008218934202D019700133FAE770470000F8B5C046F8BC08BC9E467047F8B5C046F8BC08BC9E46704701B40248844601BC604700BF3503000801B40248844601BC8E
|
||||
:401E8000604700BF7102000803000000010000000100000000000000050360000400000001000000000000000100000006046000080000006C060008F107001008000000D2
|
||||
:401EC000010000000200000002000000080800030900000001000000000000000300000009090003080000008C060008D10700100A0000000100000004000000040000000B
|
||||
:401F00000A0A000C0B0000000100000000000000050000000B0B000C10000000AC060008E1070010192001021901020000000000000000000000000000000000000000BA7A
|
||||
:401F40000000000000000000000000000000000000001D1D000000000000001000000008C0000000781F0010C00000086803000048040008F002000000127A0000127A0017
|
||||
:401F800000093D0000093D0000093D0004000000A00F00000000D0070700000002000000030000000F000000000000000000000003000000000000000000000000000000A7
|
||||
:401FC0000000000000000000030000000000000000000000000000000000000000000000000000000000000019000050A000000002FF0000E9000010C1000010000000000A
|
||||
:40200000F7B50D00019000F04BF9060003281FD12D4B1B69002B19DB002000F021F92B4FB84213D000232A4A1900012000F048F9041E0BD1002000F013F9264BB84203D00B
|
||||
:402040009C4203D00134F5E79C4201D1224D39E000F01EF9214A04000121214800F028F900282DD1019B002B16D1ADB2ED0001D11C4D18E03E221C4B06211A601B4A1C4BCD
|
||||
:402080001A60A3221B4BD20099501B4A9D50995899580029FCDAEBE7114A1369002BFCDB00F0E6F80500032E03D0200000F010F908E00121002000F0E3F80028F9D1F4E730
|
||||
:4020C000054DF0E72800FEBDC00023400101880038010008F049020005005200FC0600080000234001005000040126401E1F000008012640000026401C05000010B5437878
|
||||
:40210000FF2B0DD100F0C4F8064BDB685A68012311681943116011681942FCD100F0D8F810BDC0468000234070B52B490A682A4B002AFBDA0221DA680A43DA60DA68D2078E
|
||||
:402140001BD5264D264CD9682A69266889B2360A36060E43FF21120209040A4032439026DA6029691F4A360111403143296121680A40324322602A692268002204241A491B
|
||||
:402180005A605A680A6922430A61012801D030BF00E020BF1A68104D002AFBDAEA68D20712D5FF240D4E0F4A3069E9682402090A1040214001430A4831610668E9683240C4
|
||||
:4021C000090C0C40224302600221DA688A43DA6000225A6070BDC046E00023400000214090002140FF00FFFF00ED00E00421134A13690B431361012801D030BF00E020BF75
|
||||
:402200000F4A1368002BFCDA0E4B19691A00002910D10D490D4B196006210D4B19600D4B383119600C4B0631196019680029FCDA0A4B13610022024B5A60704700ED00E074
|
||||
:40224000E0002340FC0025401E1F00000801264018052640040126401C052640AAAAAAAA01B40248844601BC604700BF010D001001B40248844601BC604700BFDD100010FE
|
||||
:4022800001B40248844601BC604700BF890C001001B40248844601BC604700BF9317001001B40248844601BC604700BFE503001001B40248844601BC604700BFE10B00101B
|
||||
:4022C00001B40248844601BC604700BFF90D001001B40248844601BC604700BF9B17001000000000000000000000000000000000000000000000000000000000000000002E
|
||||
:40230000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009D
|
||||
:40234000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005D
|
||||
:40238000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001D
|
||||
:4023C00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000DD
|
||||
:0200000490303A
|
||||
:02000000121CD0
|
||||
:0200000490501A
|
||||
:0C0000000005E20721002101E212331C80
|
||||
:00000001FF
|
File diff suppressed because it is too large
Load Diff
|
@ -1,198 +0,0 @@
|
|||
:020000041000EA
|
||||
:4000000000000108310100100D00000095010010000000000000000000000000000000000000000000000000000000009101001000000000000000009101001091010010DC
|
||||
:400040009101001095090010910100109101001091010010910100109101001091010010910100109101001091010010910100109101001091010010910100109101001054
|
||||
:400080009101001091010010910100109101001091010010910100109101001091010010910100109101001091010010910100109101001091010010910100109101001020
|
||||
:4000C00010B5064C2378002B07D1054B002B02D0044800E000BF0123237010BD8C04000800000000C82A0010084B10B5002B03D00749084800E000BF07480368002B00D1EA
|
||||
:4001000010BD064B002BFBD09847F9E70000000090040008C82A001024010008000000007047EFF3108072B6704780F310887047FFF7F6FF72B6104C104DAC4209DA216831
|
||||
:400140006268A368043B02DBC858D050FAE70C34F3E70B490B4A0020521A02DD043A8850FCDC094809490860BFF34F8F00F00EF900F01EF8FEE70000CC2A0010E42A0010B0
|
||||
:400180008C0400089C0700080000000808ED00E0FEE7FEE700B504207146084202D0EFF3098001E0EFF30880043001F0DFFEFEE710B500F0CBF962B6064B5B689B0301D5F3
|
||||
:4001C00001F084FE044800F055F9002001F0F6FDFBE7C046000026400000081070B56249E0239B00CB580F2213401A00D0329200525807210A40032A05D0042A06D0002A89
|
||||
:4002000012D15A4814E05A4A106811E01A00C0329200554952581F210A40112A06D0132A04D0FA20C00103E0524801E080200002002B36D14C4BB222D2009A5801211140F7
|
||||
:40024000B125ED005A59120F032422405B591B0F1C4207D0444C63591B0F03242340012B02D102E0012300E00023002B01D0002901D1032A4BD13C4BB022D2009D58AD0333
|
||||
:40028000AD0B3D495958C904C90C9C58240E01231C40013402F0BCF96843210002F0B8F935E0012B33D1304BC822D2009A5801251540C024E4001A59120F03210A401B5995
|
||||
:4002C0001B0F194207D028490B591B0F03210B40012B02D102E0012300E00023002B01D0002D01D1032A12D11F4DC022D200AB587F210B40A958090A1F263140AC58240C15
|
||||
:400300003440584302F084F9210002F081F9E0239B00154AD3581B0903221340D840144C6060164B1D692D0AFC32154001351969090E013102F06CF9A060290002F068F941
|
||||
:400340000500E06020610E4BC0180E4902F060F920750D4BE818FA21890002F059F9A061C003E06170BDC0460000264000127A00C000000800366E0184050000000021408E
|
||||
:400380003F420F0040420F00E703000010B5234BB021C9005A58520052085A50E02080001A583024A2431A50802252045A501C491C4A9950A021890104329950FF211A4A84
|
||||
:4003C000995081315A58920092088020C00502435A505A588020000602435A505A58012082435A5000F0E0FBFFF7F8FE00F0DAFA00F0E2FA01F050F9B0235B055B78002BF5
|
||||
:4004000004D0B0235B055B78DBB200E02123212B03D1064B0022DA605A6010BD0000264001000200840500008C050000E00023408023024AD358032018407047000021406A
|
||||
:4004400010B5FFF76EFE084980228C58074B2340074C23438B508823034AD358DB06FAD5FFF763FE10BDC04600002140FCFF00000100FA0570B50500FFF753FE0400FFF771
|
||||
:40048000D7FF032801D1FFF7DBFF0A4AB0239B00D55080215058084B03400848034353508823044AD358DB06FAD52000FFF73DFE70BDC04600002140FCFF00000300FA05E4
|
||||
:4004C00010B50400007B00F057F9606010BDC04610B50400007B216900F0DCF8606010BD10B50169007B00F00FF910BD10B50400C06800F09BF9606010BDC04610B5C06862
|
||||
:4005000000F0AAF910BDC04610B50400C06800F0BDF9606010BDC04610B5C06800F0D2F910BDC04610B504000C23C05E00F056F8606010BD10B50C23C05E00F07BF810BD8D
|
||||
:4005400010B5C06800F0E2F910BDC04610B500221849042000F0D4FE01221749042000F0CFFE02221549042000F0CAFE03221449042000F0C5FE04221249042000F0C0FE54
|
||||
:4005800005221149042000F0BBFE06220F49042000F0B6FE07220E49042000F0B1FE08220C49042000F0ACFE09220B49042000F0A7FE10BDC1040010D1040010E104001071
|
||||
:4005C000ED040010FD040010090500101905001025050010350500104105001070B50412FF231C40F83B184005000D2C15D8072813D801F026FD0D4B1A5D13002B41DB07F6
|
||||
:4006000006D40123AB401343084A1355002401E00124644201F019FD05E03421044801F077FC01246442200070BDC046A8040008A827001070B50412FF231C40F83B18400B
|
||||
:4006400005000D2C15D8072816D801F0FAFC0F4B1B5D1A002A41D20706D50122AA4093430A4A1355002401E00124644201F0EDFC04E00124644201E001246442002C03D09D
|
||||
:400680004A21034801F044FC70BDC046A8040008A8270010F8B504000D00032803D96921174801F035FC63001B199A00154BD358AB4203D26A21124801F02AFC01F0C1FC95
|
||||
:4006C0006200121993000F4AD3189A680123AB40134210D10B4F61000E19B600B446BE191343B3606A1C72606146CB599A4203D90022726000E0FF2501F0A7FC2800F8BD39
|
||||
:40070000A8270010E000000870B504000D00032803D98221164801F0FBFB63001B199A00144BD358AB4203D28321114801F0F0FB01F087FC6200121993000E4AD3189A689E
|
||||
:400740000123AB401A4208D061000C19A100094C61189A438A60002401E00124644201F074FC002C03D08F21014801F0D1FB70BDA8270010E0000008F0B583B005000400BF
|
||||
:40078000032803D99921274801F0C2FB01F059FC019025496B00581982008A1850685B199A005358984203D39D211E4801F0B0FB6A00521993001C4AD3185F681FE01A4953
|
||||
:4007C0006300181982008A1850681B199A005358984205D9620012199300CB1800225A60620012199300104AD3185B689F4212D0610009198A000C498A1801335360620041
|
||||
:4008000012199300084AD31859682800FFF742FF0600FF28D3D0019801F017FC300003B0F0BDC046A8270010E000000810B5040007280CD801F005FC064B1B191B7C002BBE
|
||||
:4008400003D1044B1C190123237401F0FEFB0120404210BDA804000810B5040007280CD801F0EFFB074B1B191B7C012B03D1054B1C190023237401F0E8FBD021024801F044
|
||||
:4008800047FB10BDA8040008A827001010B504001F2811D801F0D5FB094B1B191B7E002B05D1074B1C1901232376002401E00124644201F0CAFB01E001246442200010BD57
|
||||
:4008C000A804000810B504001F2811D801F0B9FB0C4B1B191B7E012B05D10A4B1C1900232376002401E00124644201F0AEFB01E001246442002C03D0F521034801F008FBD0
|
||||
:4009000010BDC046A8040008A827001010B5B0214905144BCB5C3F221340134C0C5D224092011A43114BCC5C1F2323401B031343C022D200895C7F220A40520413430C4AF6
|
||||
:4009400030215354190A303251701B0C9370002305E0074AD2183021525CC2540133052BF7DD10BD040600000506000003060000E000000810B50248583000F0E1FC10BD7B
|
||||
:400980006005000810B50248B03000F0D9FC10BD6005000810B5024800F0D2FC10BDC0466005000810B5034A60328021042000F0B7FA10BD6006000870B501F042FB050032
|
||||
:4009C000094800F06DFB094C200000F0D3FB2000343000F0CFFB2000683000F0CBFB280001F033FB70BDC04660050008B8270010FEE7C046014A024B1A6070470100118053
|
||||
:400A0000000E1F4170B582B0584A116808230B431360574C03E0012001F06EFA013C534B1B695B0701D4002CF5D1002C01D1514B00E00023002B02D00520FFF7D9FF4E4C3B
|
||||
:400A4000A022D200A35803218B4301263343A3504A4D04222900684601F066FE684601F0D1FC474A9020135846490B40135013691B021B0A802040040343136113691940F6
|
||||
:400A80001161E0239B00E2580F218A431643E650E25821318A43E250E258802109060A43E2500021022000F0ADFC0021032000F0A9FC0021042000F0A5FC0321002000F0AD
|
||||
:400AC000A1FC0321012000F09DFC291D0522684601F02AFE6946012000F0BCFC002802D00320FFF785FF2849012000F025FD002802D00320FFF77CFF1F4C244BE158244A95
|
||||
:400B00000A4001252A43E250E158224A0A40E250E258802109060A43E250043BE1581E4A0A40E250E1581D4A0A40802189010A43E250E258802109020A43E2500B4A1168F9
|
||||
:400B4000174B0B401360002001F082FAC0235B00E3581D4204D1134AA3585B005B08A3506421002001F01AFA02B070BD0000274020A1070002004A0000002640542800101C
|
||||
:400B800000002140FF00FFFF1027000004050000FEFCFFFFFFFF00FFFFF0FFFFFF8FFFFFFFFCFFFF0C05000030B58FB09621002001F0F4F901F0CAF9002801D101F0B6F9F8
|
||||
:400BC000012001F033F8244A516C244B0B40E82189010B435364536C1B0AFF2213403A2B07D11D4A516C1E4B0B40E82189010B43536401AC34220021200001F09EFD194D00
|
||||
:400C000022000021280000F051FD34220021200001F093FD22000121280000F047FDFFF7F1FE24220021200001F087FD2100280000F0A6FE22000C4B0C3323CB23C223CB1C
|
||||
:400C400023C223CB23C22100084800F099FEFFF7D1FE0FB030BDC04600002740FF00FFFFFFC5FFDF00003240542800100003324010B583089A00801AC000FF228240D44396
|
||||
:400C800081400A40072B32D89B001949CB589F46184B196A0C4022431A6228E0154B596A0C4022435A6222E0124B996A0C4022439A621CE00F4BD96A0C402243DA6216E0B2
|
||||
:400CC0000C4B196B0C4022431A6310E0094B596B0C4022435A630AE0064B996B0C4022439A6304E0034BD96B0C402243DA6310BD842800100000214083089A00801AC100BA
|
||||
:400D0000FF228A40072B2BD89B001748C3589F46164B186A1040C84023E0144B586A1040C8401EE0114B986A1040C84019E00F4BD86A1040C84014E00C4B186B1040C8401B
|
||||
:400D40000FE00A4B586B1040C8400AE0074B986B1040C84005E0054BD86B1040C84000E00020C0B27047C046A42800100000214070B504000D000B4B9A680B4B9A420BD1A5
|
||||
:400D8000002903D1FC21094801F0C2F81034064BA400E058E55003E01034A400044BE05870BDC04600ED00E000000008C428001000000010F0B583B0041E019150D04368BA
|
||||
:400DC000032B03D93621294801F0A2F80023E05E002802DBA178FFF74BFF0023E25E6368002A12DB9008224EC0308000875903210A40D200FF25290091408F4399012B0045
|
||||
:400E00000B4093403B43835117E092B20F21114008398908063189001648844661444E6803200240D200FF2738009040864398013B000340934033434B600E4B9A680E4B84
|
||||
:400E40009A420FD1019B002B03D14521074801F05FF80023E05E0199FFF78AFF002002E0064800E0002003B0F0BDC046C428001000E100E000ED00E0000000080100560005
|
||||
:400E800070B504000D000369002B0ADA0B0C03D00549064801F03CF82D042D0C6560002000E0034870BDC046A70200000829001001008A0070B505000C000368002B01DA0D
|
||||
:400EC000002300E0084B002B0BD1EA60230C03D00649074801F01CF82404240CAC60002000E0014870BDC04601008A008E0200000829001070B505000C1E03D1992106483A
|
||||
:400F000001F006F82B69002B03DAEB682360002000E0024870BDC0464829001001008A00F8B504000E0015000F283FD8002A10D100290ED10F2804D99E21FF31214800F036
|
||||
:400F4000E7FF6401204B9C466444204B1C60002037E0002D2CD0002E2CD0F3062CD10F2C04D99E21FF31174800F0D2FF6401164B9C466444154F3C607E60BD60F20800213D
|
||||
:400F8000280001F0DAFB00212000FFF779FF3A0001CA0021FFF78EFF00280FD10B4B18680021FFF76DFF00280AD10AE0084808E0074806E0064804E0054802E0054800E0A2
|
||||
:400FC0000448F8BD88290010000023405007000803018A0001018A00F0B583B00D001C4B1B68DC68236883422DD947097B01C01A012383401E00002903D101F022F80190A6
|
||||
:4010000001E000230193124B18680368002B01DA002300E00F4B002B0ED16368BF00DF193B68334203D0B3433B60002400E00A4C0021FFF725FF00E0084C002D04D1019801
|
||||
:4010400001F003F800E0064C200003B0F0BDC0465007000801008A00020188000301880004018A000A4B1B68DA68136883420BD943095901401A0121814052689B009B58D3
|
||||
:401080000B4203D0034802E0034800E003487047500700080101880004018A0000018800034B1B68002B01D1014B18607047C0465C070008F0B5474680B404000F009046AC
|
||||
:4010C0001E00072803D9B421254800F021FF254B1B682C2060431C18FF22150035402560330A13406360330CA3600F2D04D99E21FF311D4800F00CFF6B011C4A94466344DF
|
||||
:40110000236165680F2D04D9DC214900164800F0FFFE6D01164B9C4665446561A668330C04D0EB214900104800F0F2FE330C04D0D821FF310C4800F0EBFE3604330C1E43A3
|
||||
:40114000AE604346E36127620023A361069B002B02D000229B5EA38104BC9046F0BDC046C82900105C070008882900100000234000102340F0B58FB0041E03D150212E48FA
|
||||
:4011800000F0C6FE6368032B03D952212A4800F0BFFEE36A002B03D15621274800F0B8FEE368072B03D95721234800F0B1FE236A072B03D95821204800F0AAFE236B002B94
|
||||
:4011C00003D159211C4800F0A3FE07AA1300210061C961C321C921C302AD290023001433C1CBC1C141CB41C10821535E0CAE3380079B1933B370089B0D930B9B0A980096D4
|
||||
:40120000A26AE16AFFF756FF2B69E868002200920021FFF74FFF216B3000FFF7CBFD0023F25E002A05DB1F231A401E3B9340034A13600FB0F0BDC046C829001000E100E05C
|
||||
:40124000F8B505000F0016001C00002A03D1FC21244800F05DFE072D03D9FD21214800F057FE072F03D9FE211E4800F051FE1E4B1B682C212800484318187943591801228B
|
||||
:4012800013004D68AB401B044568AA4015000269002A20D08F69002F1FD11268002A01DA002200E0114A002A19D132681204120C134333600369DE6001238B614C62046998
|
||||
:4012C0002B0C03D00A490B4800F022FE2A04120CA260002004E0084802E0084800E00748F8BDC046C82900105C07000801008A008E0200008829001004028A0007028A0005
|
||||
:4013000070B505000C001600072804D96021FF31084800F0FDFD084B1B682C2068431818C369B34204D9036AB6009C51002000E0024870BDC82900105C0700080A028A00E6
|
||||
:4013400070B582B0040000230193002804D1D92149002B4800F0DCFD2369002B04D1B421FF31274800F0D4FD6369002B04D1DA214900234800F0CCFD236A002B04D1B62186
|
||||
:40138000FF311F4800F0C4FD6269D5682B0C1FD01B041360136820690369002B18DA01A9FFF7A8FD00280ED1019803681E0CFF221340E269934207D29B00226AD358002B34
|
||||
:4013C00002D0984700E0002631002069FFF758FD2D042D0C0FD063691D601B68636A002B03D098470023636203E0A36A002B00D098470023A36163691B6802B070BDC04665
|
||||
:40140000C829001004281DD8042904D94B1EFF3B9BB2132B18D8FF290CD91F2319400B4A0300C0339B009950D03080000423835000200AE007231940D0308000034BC15005
|
||||
:40144000002002E0024800E0014870470000264001004A0070B50300012823D102008032FF32920030481258002A1DDB8A78023AD2B20E2A1AD84A78002A19D0122A19D8E1
|
||||
:401480000A78C878002801D0132400E01624944212D8002801D0382000E0702090420DD300200CE021480AE0214808E01F4806E01E4804E01D4802E01C4800E01B48002890
|
||||
:4014C00030D1013B0A79022A1ED00A787F2616404A781202F8246401224032438E783604F8256D0334002C4022431600CA78D20680252D052A401400320022431C008134A8
|
||||
:40150000FF34A400084D6251074D8133FF339B005C59084A14400A791207C02189050A4022435A5170BDC0460000264001004A0003004A00FFFFFFCF70B50C0001281CD1F3
|
||||
:40154000451E104A8030FF3080008358802109060B43835003E0012000F0CEFC013C2B009133FF339B00074A9B58DB0701D4002CF1D1002C03D1044802E0044800E0002089
|
||||
:4015800070BDC0460000264002004A0001004A00214B984230D00ED8402831D004D800281FD010282AD031E080282BD080235B00984229D02AE0194B984229D007D8A023D9
|
||||
:4015C0001B0698420DD0164B984212D01EE0154B98420AD0144B984209D0144B984215D101E0002016E0124814E0124812E0124810E0A020C0030DE007480BE00F4809E0EE
|
||||
:401600000F4807E00F4805E0034803E00E4801E0A420C0037047C04606005200010000F0090000A0040000F0050000F0030000F0010052000200520003005200010050006C
|
||||
:401640000200500005005200FF00520010B50C4B1B69002B11DB0B4B1868FFF799FF0121094B0A4AD150084B084AD358002BFAD1074BD358002BF6D100E0064810BDC04634
|
||||
:4016800000002340600700080C040000000025408C0400000200500010B5022202490020FFF72EFE10BDC0466D010008F8B506000D001400002800D142E1002A00D141E135
|
||||
:4016C000072903D93921A04800F022FC2368012B03D93A219C4800F01BFC0F2362689A4303D03B21984800F013FC237A1F22934303D03C21944800F00BFCE368032B03D9C2
|
||||
:401700003D21914800F004FC2369012B03D93E218D4800F0FDFB6369012B03D93F218A4800F0F6FBA369012B03D94021864800F0EFFBE369032B03D94121834800F0E8FB78
|
||||
:40174000236A012B03D942217F4800F0E1FB636A012B03D943217C4800F0DAFBA36A012B03D94421784800F0D3FBE36A032B03D94521754800F0CCFB236B072B03D94621F0
|
||||
:40178000714800F0C5FB2768072D03D96F49704800F0BEFB012F04D9BA2189006C4800F0B7FB002F03D10123AB40736002E00123AB40B3606768072D04D9E421890064483E
|
||||
:4017C00000F0A6FB0F233A009A4303D06149604800F09EFBAA00B36A0F210800904083430F4097401F43B762277A072D03D95A49574800F08DFB1F233A009A4303D05749F4
|
||||
:40180000534800F085FB564BF318DB09554A944663441B01032D0BD81A68E8001F2181408A4311001F223A4082400A431A600BE0291F5A68C9001F208840824310001F2256
|
||||
:401840003A408A4002435A60E768082D03D946493F4800F05DFB032F03D944493C4800F057FB6A00736A03210800904083430F4097401F4377622769082D03D93C493448FA
|
||||
:4018800000F046FB012F04D9CA21C900304800F03FFBB36901221100A9408B431740AF401F43B7616769072D03D93249284800F02FFB012F03D93049254800F029FBF26A86
|
||||
:4018C00001231900A9408C468A431F40AF401743F7626F00103703210800B84062461043326B8243A0691840A8400243E0690140B9400A433263706BFF2294469043276ABE
|
||||
:401900001F40636A5A00022313403B43A26A9100042739400B431F00E36AD900182319403B000B43226B520161460A401343AD00FE2292001540AB4003437363002002E056
|
||||
:401940000E4800E00D48F8BD082A0010E7020000482A00109103000045020000460200000000CEBF00100304D4060000D50600004F060000D2030000D303000001005A00A3
|
||||
:4019800070B505000C00002848D0002948D0FF230A689A4303D08D21224800F0B9FAFF2322699A4303D08E211E4800F0B1FAA3685B0D03D08F211B4800F0AAFA63685B0A47
|
||||
:4019C00003D09021174800F0A3FAE3695B0F03D09121144800F09CFA236A5B0F03D09221104800F095FA104BEB18DB090F4A944663441B0122682A60E268AA622269EA628D
|
||||
:401A000062692A63A2686A626268AA61A2696A63E2691A60226A5A60002002E0044800E0034870BD082A00100000CEBF0010030401005A00034A9369802149040B43936160
|
||||
:401A40007047C04600F02540024A9169024B0B409361704700F02540FFFFFFFE0D4BF222D2019A580260F022D2019A5842600A4A9A588260094A9A58C260094A9A58026138
|
||||
:401A8000084A9A584261084A9A588261074A9B58C36170470000344004780000087800000C7800001078000014780000187800000D4BF022D201416899500C4A816899506A
|
||||
:401AC0000B4AC16899500B4A016999500A4A416999500A4A81699950094AC16999500168E83299507047C0460000344004780000087800000C780000107800001478000032
|
||||
:401B00001878000010B5074A074813580F24A34302210B43135004381358A3431943115010BDC0460000214004F0000010B5074A074813580F24A34303210B4313500438EC
|
||||
:401B40001358A3431943115010BDC0460000214004F000000449054A8858054B0340C020C00103438B5070470000214004F00000FF8FFFFF0449054A8858054B0340802017
|
||||
:401B8000C00103438B5070470000214004F00000FF8FFFFF10B50400012803D90D490E4800F0B6F9002C03D10C4B5869C00F00E00020012C0CD1094B9B695B0005D4074BC3
|
||||
:401BC0009B69002B03DA012002E0012000E0002010BDC04641060000882A00100000264070B504000D00072803D90D490D4800F08FF90D4B9B690722134021009C420DD05B
|
||||
:401C0000094882690726B243344014438461002D04D0994202D9C82000F06EF970BDC046A1060000882A00100000264070B50500012803D92A492B4800F06AF900F001FA4B
|
||||
:401C40000400294B294AD3581F221340E822D200B02149058A5CD31A5A1E9341DBB29D4239D0002D14D1FFF7E5FEFFF74BFF1F481D4943581F229343143A13434350FFF754
|
||||
:401C800069FFE823DB00B0225205D35CDAB211E01648154943581F229343143A13434350092000F029F9FFF765FF114BB0225205D35CDAB20D4E0C4831581F2399431340DE
|
||||
:401CC0000B433350012D06D1092000F015F9FFF72DFFFFF7B9FE200000F0B7F970BDC046ED060000882A00101CFF0000000026404107000070B584B005000E00042803D933
|
||||
:401D000029492A4800F004F9731EDBB2012B07D9042E05D0082E03D02549244800F0F8F8042E01D0012E1DD1224B5C68002013E023799D420FD1A368002B01D01E420AD1DD
|
||||
:401D4000E36801A85A6842609B688360067023689847184B9C606469002C23D0164B9842E6D11FE0134B9C68022E02D1002C00D02469002011E023799D420DD1A368002B7B
|
||||
:401D800001D01E4208D1E36801A85A6842609B6883600670236898472469002C02D0064B9842E8D104B070BD24080000882A00102508000070070008FF00420070B50500A6
|
||||
:401DC000012804D9F221FF31384800F0A1F8384B1B68002B05D001210120FFF78BFF040000E00024002C59D100F02BF90600304B1B68002B03D004210120FFF77BFFE0239B
|
||||
:401E00002C4AD358DB0603D529480C30FFF726FEB0235B055B78002B04D0B0235B055B78DBB200E02123212B03D1280000F0B4FC1FE02149214BCB581F221340E822D20075
|
||||
:401E4000B0204005825CD31A5A1E9341DBB20A68120207D4012B05D1194BC158194B164AD15003E00021174B134AD150280000F08BFCE0230F4AD358DB0603D50C480C3091
|
||||
:401E8000FFF716FE300000F0E0F8094B1B68002B09D008210120FFF72DFF04E002210120FFF728FF084C200070BDC046882A00107007000800000140000026401CFF0000EA
|
||||
:401EC00010180000307F0000FF00420010B500F0B8F8074B5A6807490A40E824A40122435A605A68114059605B6800F0AEF810BD00002640FF00FC0F10B5034B1B78584344
|
||||
:401F000000F096F810BDC046D400000801BEFEE770B50D00044C18220100200000F015FCA5610020FFF7F2FF50040008054B802212069A649B6C002B01DB002000E0024829
|
||||
:401F40007047C0460000274003004600054B8022120198585B68FF221A4202D08023DB021843704700002640FEE7C04610B50A4B0268DA6142681A6282685A62C2689A6259
|
||||
:401F80000269DA6242691A6382695A63C2699A63FFF7EAFF10BDC04650040008F0B5002801D0192200E064228A42924152421C4BE8256D005C590327BC433A4014435C51C5
|
||||
:401FC0005C59184E34405C51D03D5C59BC4322435A515A5916405E51002805D010290DD921290DD8012014E01D290BD93A290BD957290BD978290BD803200AE0002008E04E
|
||||
:40200000022006E0002004E0012002E0022000E00420054A13680F218B4303431360F0BD00002140FFFCFFFF00002540000000000230800803D001300238FCD1C046C046AD
|
||||
:402040007047EFF3108072B6704780F310887047042805D1094A116804230B4313600CE00006C0239B04184090239B00044AD050024A136804218B431360704710E000E0A4
|
||||
:402080000000214070B50D000F4B184300040F4BD861FA24A40003E0013C0120FFF72CFF0A4B1B6CDB0701D4002CF5D1002C08D0064B196C01220A431A64DB6A2B800020C0
|
||||
:4020C00000E0034870BDC0460080FFFF00003C400400160010B500040E4B184001430E4BD961FA24A40003E0013C0120FFF704FF094B1B6CDB0701D4002CF5D1002C06D09B
|
||||
:40210000054A116C01230B431364002000E0034810BDC0460000FF7F00003C4004001600F0B583B006000A24C02149017548FFF7D1FF002804D16B46991D7248FFF7A2FF49
|
||||
:40214000002C01D0013C00E06F48002805D16B46DA88C0235B019A42E6D1002825D16B46991D6A48FFF78EFF00281ED16B4606331B885B0519D40A248021C9006348FFF7C7
|
||||
:40218000A9FF002804D16B46991D6048FFF77AFF002C01D0013C00E05B48002805D16B46DA888023DB009A42E6D1002804D16B46991D5748FFF766FF002844D16B46063398
|
||||
:4021C0001B883F229343B278012A15D1F178012904D88FB20222D21B95B201E000250227402213439BB2302213436A46D380494BCB40494A136013E0F178002904D18FB2A3
|
||||
:402200000122D21B95B201E00025012740229343102213436A46D380404BCB403E4A13606B469C1DD9883943D9803948FFF752FFF378DB1B03221340AA0092B2134323809D
|
||||
:40224000374A38498B50B0235B055B78002B04D0B0235B055B78DBB200E02123212B4FD0314BB0225205D35A9BB2002B48D0002804D16B46991D2D48FFF704FF002824D109
|
||||
:402280006B469A1DDB8860218B4318001380B0256D05254C2B5B60310B405B08034324490B401380295BC901F020C00001400B43204919401180285BC0239B000340DB002C
|
||||
:4022C000194311801948FFF705FF002804D16B46991D1948FFF7D6FE002811D16B469A1DD988C023994311800F4BB0204005C05A302303409B00194311800F48FFF7EAFE08
|
||||
:4023000003B0F0BD021E000004001600031E0000091E00000048E801C00000080024F40064F0010000003C4016180000071E00007FF8FFFFFFE7FFFF061E000070B50C00D8
|
||||
:402340004000084901430848FFF7C4FE051E04D106490748FFF7BEFE05006001FFF7CCFD280070BD01100000081E0000376800000F1E000010B59CB02422002113A800F098
|
||||
:40238000DCF9154B1693154C1894154B1A931B93242200210AA800F0D0F9124B0D930F94114B1193114B12932422002101A800F0C4F90F4B049306940E4B089313A90E48B6
|
||||
:4023C000FFF7DEFA0AA90D48FFF7DAFA01A90C48FFF7D6FA1CB010BD666666660000FFFF1C1C1C1C66E6EE661C1A1A1A1A1A000066E666661A1A001C0001324080013240CE
|
||||
:4024000000023240F8B5051E00D1C1E0644B5B689B0301D5FFF75AFD624B634AD358DB0704D5624BD358DB0700D5B3E0FFF7A2FF5D4B5F495F4A99502A788021C9020A437D
|
||||
:402440005D495A505D495E4A9950802252009B58DB0700D5A0E05B4B1B6F1B0709D45A4B18685A4B984206D9190000F0D1F8013802E0012000E000204B4B1B68002803D0E3
|
||||
:402480004003534A104300E052481843464B1860434B5B695B000ED501210320FFF7A0FB3F4B5B695B000CD53D4A93698021C9050B43936105E03C49474A885803230343A0
|
||||
:4024C0008B50394C374AA658444B3343A3504020FFF712FD424BE358DB070BD42700404C01233B514020FFF707FD03233B514020FFF702FD3B4B1E403B4B1E43294B2A4AA0
|
||||
:40250000D650FA24E40003E0013C0120FFF7F4FC364B374AD358DB0601D4002CF4D1002C01D0002400E0334C002C23D11E49324A8858082303438B500120FFF72BFB002864
|
||||
:4025400001D108231E432D4B1E4001231E43154B154AD6502A4E03E0013E0120FFF7CCFC124B114AD358DB0701D4002EF4D1002E00D1204C002C03D12800FFF7D1FD04005C
|
||||
:40258000002C0AD168782978FFF7D8FE040004E01C4C02E01C4C00E01C4C2000F8BDC04600002640A0F0010000003C40B4F0010006000001A4F00100A8F0010001000100BB
|
||||
:4025C000ACF0010000F03D40C800000800093D00041A0080040A0080C4F0010030000300B0F00100EFFFFEFF2000020010400000000032400400160068F00100FFFFFBFFCC
|
||||
:40260000F07E0E00010016000300160002001600002243088B4274D303098B425FD3030A8B4244D3030B8B4228D3030C8B420DD3FF22090212BA030C8B4202D312120902EF
|
||||
:4026400065D0030B8B4219D300E0090AC30B8B4201D3CB03C01A5241830B8B4201D38B03C01A5241430B8B4201D34B03C01A5241030B8B4201D30B03C01A5241C30A8B4229
|
||||
:4026800001D3CB02C01A5241830A8B4201D38B02C01A5241430A8B4201D34B02C01A5241030A8B4201D30B02C01A5241CDD2C3098B4201D3CB01C01A524183098B4201D3A2
|
||||
:4026C0008B01C01A524143098B4201D34B01C01A524103098B4201D30B01C01A5241C3088B4201D3CB00C01A524183088B4201D38B00C01A524143088B4201D34B00C01A3C
|
||||
:402700005241411A00D20146524110467047FFE701B5002000F006F802BDC0460029F7D076E770477047C046002310B59A4203D0CC5CC4540133F9E710BD03008218934298
|
||||
:4027400002D019700133FAE77047030030B5002A0DD00C7801335D1E013A2C700131002CF5D19A189A4202D01C700133FAE730BDF8B5C046F8BC08BC9E467047F8B5C046AE
|
||||
:40278000F8BC08BC9E46704701B40248844601BC604700BF4D03000801B40248844601BC604700BF7902000870736F63365F7574696C732E63000000030000000100000043
|
||||
:4027C000010000000000000005036000040000000100000000000000010000000604600008000000D00600089509001008000000010000000200000002000000080800034C
|
||||
:40280000090000000100000000000000030000000909000308000000F0060008750900100A0000000100000004000000040000000A0A000C0B0000000100000000000000A3
|
||||
:40284000050000000B0B000C100000001007000885090010192001021901020000000000000000000000000000000000000000BA0000000000000000000000000000000052
|
||||
:4028800000001D1D900C00109C0C0010A80C0010B40C0010C00C0010CC0C0010D80C0010E40C0010100D00101A0D0010240D00102E0D0010380D0010420D00104C0D001021
|
||||
:4028C000560D001047656E6572617465645F536F757263655C50536F43365C70646C5C647269766572735C7065726970686572616C5C737973696E745C63795F737973693B
|
||||
:402900006E742E630000000047656E6572617465645F536F757263655C50536F43365C70646C5C647269766572735C7065726970686572616C5C6970635C63795F697063F4
|
||||
:402940005F6472762E68000047656E6572617465645F536F757263655C50536F43365C70646C5C647269766572735C7065726970686572616C5C6970635C63795F697063E6
|
||||
:402980005F6472762E63000047656E6572617465645F536F757263655C50536F43365C70646C5C647269766572732F7065726970686572616C2F6970632F63795F69706332
|
||||
:4029C0005F6472762E68000047656E6572617465645F536F757263655C50536F43365C70646C5C647269766572735C7065726970686572616C5C6970635C63795F69706366
|
||||
:402A00005F706970652E630047656E6572617465645F536F757263655C50536F43365C70646C5C647269766572735C7065726970686572616C5C6770696F5C63795F6770BA
|
||||
:402A4000696F2E630000000047656E6572617465645F536F757263655C50536F43365C70646C5C647269766572735C7065726970686572616C5C6770696F5C63795F6770AF
|
||||
:402A8000696F2E680000000047656E6572617465645F536F757263655C50536F43365C70646C5C647269766572735C7065726970686572616C5C737973706D5C63795F7341
|
||||
:402AC0007973706D2E630000000000000000001000000008C0000000EC2A0010C0000008900300008C0400081003000000127A0000127A0000093D0000093D0000093D008E
|
||||
:402B000004000000A00F00000000D0070700000000000000000000000F00000000000000000000000300000000000000000000000000000000000000000000001900005089
|
||||
:402B4000A000000002FF0000E9000010C1000010000000000004400B12D03E22094B1A60094A0A4B1A600A4B0621A322D2009950084A98509B58074B054AD358002BFADA75
|
||||
:402B80007047C046040126401E1F000008012640000026401C05000010B54378FF2B0DD100F064F9064BDB685A68116801230B4313601368DB07FCD400F028F910BDC04620
|
||||
:402BC00080002340F0B583B006000F0000F046F90500032824D12B4B1B69002B22DB002000F034F9284B98421ED00023274A0021012000F01BF9002803D0254C17E00134A5
|
||||
:402C000000E00024002000F021F91F4B984202D0204B9C42F3D91F4B9C4207D91C4C06E0002404E01A4C02E0194C00E00024002C24D100F01BF90190174A0121174800F084
|
||||
:402C4000DDF800280ED1002E04D13800FFF782FF134C08E0114B1B69002BFBDB00F0DEF8040000E00A4C032D05D10121002000F0E5F80028F9D1019800F0C8F8200003B07B
|
||||
:402C8000F0BDC046C0002340010188001801000805005200EF49020060070008000023400100500070B5304B1B68002BFBDA2E4BD96802220A43DA60DB68DB071FD52A4EC6
|
||||
:402CC000F2681204150C294B1A69120A1204FF2424042240110090241A59120A12060A432A43F2601969224A114090252D012943196119590A402A431A511A691B591A4BFD
|
||||
:402D000000225A605B681B4A116904230B431361012801D030BF00E020BF134B1B68002BFBDA114BDB68DB0715D510480269104B1A4014000C4DEA68120C1202FF210902A4
|
||||
:402D40000A4022430261902142581340EA68120E120213434350044BDA6802218A43DA6000225A6070BDC046E000234000002140FF00FFFF00ED00E0164A116904230B43AD
|
||||
:402D80001361012801D030BF00E020BF124B1B68002BFBDA86235B00104AD358002B14D10F4A104B1A6006220F4B1A6038320F4B1A6006320E4B1A600D4B1B68002BFBDA30
|
||||
:402DC0000C4986235B00054AD1500022024B5A607047C04600ED00E0E0002340000025401E1F00000801264018052640040126401C052640AAAAAAAA0000000001B40248E7
|
||||
:402E0000844601BC604700BFB50E001001B40248844601BC604700BF4B20001001B40248844601BC604700BF4D16001001B40248844601BC604700BF4112001001B40248BE
|
||||
:402E4000844601BC604700BFD90F001001B40248844601BC604700BF6510001001B40248844601BC604700BF3104001001B40248844601BC604700BF43200010000000006C
|
||||
:402E80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012
|
||||
:402EC00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000D2
|
||||
:402F00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000091
|
||||
:402F40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000051
|
||||
:402F80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011
|
||||
:402FC00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000D1
|
||||
:0200000490303A
|
||||
:02000000CE5ED2
|
||||
:0200000490501A
|
||||
:0C0000000005E20721002101E215EF5E7F
|
||||
:00000001FF
|
|
@ -30,22 +30,22 @@ using namespace rtos;
|
|||
static SingletonPtr<Mutex> msg_mutex;
|
||||
static SingletonPtr<Semaphore> msg_semaphore;
|
||||
|
||||
|
||||
#define RPC_GEN RPC_GEN_INTERFACE_IDS
|
||||
|
||||
#include "rpc_defs.h"
|
||||
#include "rpc_api.h"
|
||||
|
||||
#undef RPC_GEN
|
||||
|
||||
extern "C" {
|
||||
|
||||
// This function uses a "C" linkage as it is a callback called from Cypress library
|
||||
// which is C-only.
|
||||
extern "C" void ipcrpc_release(void);
|
||||
void ipcrpc_release(void)
|
||||
{
|
||||
// Just signal on semaphore that we are done with a call.
|
||||
msg_semaphore->release();
|
||||
}
|
||||
|
||||
|
||||
// Encapsulate call arguments and send a message over IPC pipe to the
|
||||
// other core for execution.
|
||||
uint32_t ipcrpc_call(uint32_t call_id, uint32_t args_num, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -82,43 +82,26 @@ uint32_t ipcrpc_call(uint32_t call_id, uint32_t args_num, ...)
|
|||
return message.result;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
||||
void ipcrpc_init(void)
|
||||
{
|
||||
uint32_t rpc_counter = 0;
|
||||
#define RPC_GEN RPC_GEN_INTERFACE_IDS_INIT
|
||||
|
||||
void ipcrpc_init(void)
|
||||
{
|
||||
uint32_t rpc_counter = 0;
|
||||
|
||||
#include "rpc_defs.h"
|
||||
#include "rpc_api.h"
|
||||
}
|
||||
|
||||
#undef RPC_GEN
|
||||
}
|
||||
|
||||
|
||||
#define RPC_GEN RPC_GEN_INTERFACE
|
||||
|
||||
#include "rpc_defs.h"
|
||||
#include "rpc_api.h"
|
||||
|
||||
/////////
|
||||
|
||||
#undef RPC_GEN
|
||||
|
||||
|
||||
#define RPC_GEN RPC_GEN_IMPLEMENTATION
|
||||
|
||||
#include "rpc_defs.h"
|
||||
#include "rpc_api.h"
|
||||
|
||||
#undef RPC_GEN
|
||||
|
||||
#define RPC_GEN RPC_GEN_INITIALIZATION
|
||||
|
||||
void ipcrpc_init2(void)
|
||||
{
|
||||
uint32_t rpc_counter = 0;
|
||||
#include "rpc_defs.h"
|
||||
#include "rpc_api.h"
|
||||
}
|
||||
|
||||
} /* extern "C" */
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "system_psoc63.h"
|
||||
#include "cy_device_headers.h"
|
||||
#include "ipc_rpc.h"
|
||||
#include "psoc6_utils.h"
|
||||
|
||||
#if defined(CY_DEVICE_PSOC6ABLE2) && !defined(CY_IPC_DEFAULT_CFG_DISABLE)
|
||||
#include "ipc/cy_ipc_drv.h"
|
||||
|
|
|
@ -30,32 +30,45 @@
|
|||
|
||||
#define IPCRPC_MAX_ARGUMENTS 8
|
||||
|
||||
/* IPC Pipe message data structure */
|
||||
typedef struct
|
||||
{
|
||||
uint32_t client_id;
|
||||
uint32_t result;
|
||||
uint32_t args_num;
|
||||
uint32_t args[IPCRPC_MAX_ARGUMENTS];
|
||||
/** IPC RPC message data structure
|
||||
* Used to pass RPC call arguments to M0 core for execution
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t client_id; ///< Client ID of the RPC client
|
||||
uint32_t result; ///< Function execution result returned from callee to caller
|
||||
uint32_t args_num; ///< Number of arguments to RPC function call
|
||||
uint32_t args[IPCRPC_MAX_ARGUMENTS]; ///< Arguments of RPC function call
|
||||
} IpcRpcMessage;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
volatile uint8_t busy_flag;
|
||||
IpcRpcMessage message;
|
||||
/** IPC RPC message buffer
|
||||
* Used to hold and transfer RPC message
|
||||
*/
|
||||
typedef struct {
|
||||
volatile uint8_t busy_flag; ///< Indicates whether the RPC call using this buffer is in progress
|
||||
IpcRpcMessage message; ///< RPC message associated with a call
|
||||
} IpcRpcBuffer;
|
||||
|
||||
|
||||
|
||||
/** Function handling the RPC call
|
||||
* It packs its arguments into the RPC message buffer, initializes transfer
|
||||
* and waits for completion.
|
||||
*
|
||||
* @param call_id unique identifier of the RPC API function to be executed
|
||||
* @param args_num number of call arguments
|
||||
* @param ... call arguments
|
||||
*
|
||||
* @return call result (as returned by executed function)
|
||||
*/
|
||||
uint32_t ipcrpc_call(uint32_t call_id, uint32_t args_num, ...);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** Initialization function for RPC mechanism.
|
||||
* Generated automatically during wrapper generation; needs to be called from startup code.
|
||||
*/
|
||||
void ipcrpc_init(void);
|
||||
uint32_t ipcrpc_call(uint32_t call_id, uint32_t args_num, ...);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -155,8 +155,7 @@ static void ClockInit(void)
|
|||
|
||||
/* Enable all source clocks */
|
||||
status = Cy_SysClk_WcoEnable(500000u);
|
||||
if (CY_RET_SUCCESS != status)
|
||||
{
|
||||
if (CY_RET_SUCCESS != status) {
|
||||
CyClockStartupError(CYCLOCKSTART_WCO_ERROR);
|
||||
}
|
||||
Cy_SysClk_ClkLfSetSource(CY_SYSCLK_CLKLF_IN_WCO);
|
||||
|
@ -185,9 +184,9 @@ static void ClockInit(void)
|
|||
|
||||
/* Configure Path Clocks */
|
||||
/* PLL path is used to clock HF domain from BLE ECO */
|
||||
Cy_SysClk_ClkPathSetSource(2, CY_SYSCLK_CLKPATH_IN_IMO);
|
||||
Cy_SysClk_ClkPathSetSource(3, CY_SYSCLK_CLKPATH_IN_IMO);
|
||||
Cy_SysClk_ClkPathSetSource(4, CY_SYSCLK_CLKPATH_IN_IMO);
|
||||
Cy_SysClk_ClkPathSetSource(2, CY_SYSCLK_CLKPATH_IN_IMO);
|
||||
Cy_SysClk_ClkPathSetSource(3, CY_SYSCLK_CLKPATH_IN_IMO);
|
||||
Cy_SysClk_ClkPathSetSource(4, CY_SYSCLK_CLKPATH_IN_IMO);
|
||||
#if FEATURE_BLE
|
||||
Cy_SysClk_ClkPathSetSource(0, CY_SYSCLK_CLKPATH_IN_ALTHF);
|
||||
Cy_SysClk_ClkPathSetSource(1, CY_SYSCLK_CLKPATH_IN_ALTHF);
|
||||
|
@ -295,8 +294,8 @@ void Cy_SystemInit(void)
|
|||
Cy_SysLib_ResetBackupDomain();
|
||||
}
|
||||
|
||||
/* Power Mode */
|
||||
Cy_SysPm_LdoSetVoltage(CY_SYSPM_LDO_VOLTAGE_1_1V);
|
||||
/* Power Mode */
|
||||
Cy_SysPm_LdoSetVoltage(CY_SYSPM_LDO_VOLTAGE_1_1V);
|
||||
|
||||
/* PMIC Control */
|
||||
Cy_SysPm_UnlockPmic();
|
||||
|
|
|
@ -17,15 +17,14 @@
|
|||
|
||||
#include "mbed.h"
|
||||
|
||||
/*
|
||||
* This makes sure, stdio serial is initialized on M4 core at the very beging
|
||||
* and outside of any critical context, so printf is usable anyware, including
|
||||
* interrupt and fault handlers.
|
||||
* Hardware devices cannot be initialized in the interrupt or critical section context
|
||||
* on PSoC 6 M4 core.
|
||||
*/
|
||||
/*
|
||||
* This makes sure, stdio serial is initialized on M4 core at the very beginning
|
||||
* and outside of any critical context, so printf is usable anywhere, including
|
||||
* interrupt and fault handlers.
|
||||
* Hardware devices cannot be initialized in the interrupt or critical section context
|
||||
* on PSoC 6 M4 core.
|
||||
*/
|
||||
|
||||
#ifndef TARGET_MCU_PSOC6_M0
|
||||
#if DEVICE_STDIO_MESSAGES && !defined(TARGET_MCU_PSOC6_M0)
|
||||
Serial _stdio_uart_object(STDIO_UART_TX, STDIO_UART_RX);
|
||||
#endif
|
||||
|
|
@ -46,19 +46,19 @@ const uint32_t SAR_BASE_CLOCK_HZ = 18000000; // 18 MHz or less
|
|||
*/
|
||||
static cy_stc_sar_config_t sar_config = {
|
||||
.ctrl = CY_SAR_VREF_SEL_VDDA_DIV_2 |
|
||||
CY_SAR_NEG_SEL_VREF |
|
||||
CY_SAR_CTRL_COMP_DLY_12 |
|
||||
CY_SAR_COMP_PWR_50 |
|
||||
CY_SAR_SARSEQ_SWITCH_DISABLE, /**< Control register */
|
||||
CY_SAR_NEG_SEL_VREF |
|
||||
CY_SAR_CTRL_COMP_DLY_12 |
|
||||
CY_SAR_COMP_PWR_50 |
|
||||
CY_SAR_SARSEQ_SWITCH_DISABLE, /**< Control register */
|
||||
.sampleCtrl = CY_SAR_RIGHT_ALIGN |
|
||||
CY_SAR_SINGLE_ENDED_UNSIGNED |
|
||||
CY_SAR_AVG_CNT_16 |
|
||||
CY_SAR_AVG_MODE_SEQUENTIAL_FIXED |
|
||||
CY_SAR_TRIGGER_MODE_FW_ONLY, /**< Sample control register */
|
||||
CY_SAR_SINGLE_ENDED_UNSIGNED |
|
||||
CY_SAR_AVG_CNT_16 |
|
||||
CY_SAR_AVG_MODE_SEQUENTIAL_FIXED |
|
||||
CY_SAR_TRIGGER_MODE_FW_ONLY, /**< Sample control register */
|
||||
.sampleTime01 = (4uL << CY_SAR_SAMPLE_TIME0_SHIFT) |
|
||||
(4uL << CY_SAR_SAMPLE_TIME1_SHIFT), /**< Sample time in ADC clocks for ST0 and ST1 */
|
||||
(4uL << CY_SAR_SAMPLE_TIME1_SHIFT), /**< Sample time in ADC clocks for ST0 and ST1 */
|
||||
.sampleTime23 = (4uL << CY_SAR_SAMPLE_TIME2_SHIFT) |
|
||||
(4uL << CY_SAR_SAMPLE_TIME3_SHIFT), /**< Sample time in ADC clocks for ST2 and ST3 */
|
||||
(4uL << CY_SAR_SAMPLE_TIME3_SHIFT), /**< Sample time in ADC clocks for ST2 and ST3 */
|
||||
.rangeThres = 0, /**< Range detect threshold register for all channels (unused)*/
|
||||
.rangeCond = 0, /**< Range detect mode for all channels (unused)*/
|
||||
.chanEn = 0, /**< Enable bits for the channels */
|
||||
|
@ -115,13 +115,6 @@ static void sar_init(analogin_t *obj)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/** Initialize the analogin peripheral
|
||||
*
|
||||
* Configures the pin used by analogin.
|
||||
* @param obj The analogin object to initialize
|
||||
* @param pin The analogin pin name
|
||||
*/
|
||||
void analogin_init(analogin_t *obj, PinName pin)
|
||||
{
|
||||
uint32_t sar = 0;
|
||||
|
@ -150,12 +143,6 @@ void analogin_init(analogin_t *obj, PinName pin)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/** Read the input voltage, represented as a float in the range [0.0, 1.0]
|
||||
*
|
||||
* @param obj The analogin object
|
||||
* @return A floating value representing the current input voltage
|
||||
*/
|
||||
float analogin_read(analogin_t *obj)
|
||||
{
|
||||
uint16_t result = analogin_read_u16(obj);
|
||||
|
@ -163,12 +150,6 @@ float analogin_read(analogin_t *obj)
|
|||
return (float)result * (1.0 / ADC_MAX_VALUE);
|
||||
}
|
||||
|
||||
|
||||
/** Read the value from analogin pin, represented as an unsigned 16bit value
|
||||
*
|
||||
* @param obj The analogin object
|
||||
* @return An unsigned 16bit value representing the current input voltage
|
||||
*/
|
||||
uint16_t analogin_read_u16(analogin_t *obj)
|
||||
{
|
||||
uint32_t result = 0;
|
||||
|
|
|
@ -80,12 +80,6 @@ static void ctdac_init(dac_t *obj)
|
|||
}
|
||||
|
||||
|
||||
/** Initialize the analogout peripheral
|
||||
*
|
||||
* Configures the pin used by analogout.
|
||||
* @param obj The analogout object to initialize
|
||||
* @param pin The analogout pin name
|
||||
*/
|
||||
void analogout_init(dac_t *obj, PinName pin)
|
||||
{
|
||||
uint32_t dac = 0;
|
||||
|
@ -94,7 +88,6 @@ void analogout_init(dac_t *obj, PinName pin)
|
|||
MBED_ASSERT(obj);
|
||||
MBED_ASSERT(pin != (PinName)NC);
|
||||
|
||||
|
||||
dac = pinmap_peripheral(pin, PinMap_DAC);
|
||||
if (dac != (uint32_t)NC) {
|
||||
if (cy_reserve_io_pin(pin)) {
|
||||
|
@ -113,21 +106,11 @@ void analogout_init(dac_t *obj, PinName pin)
|
|||
}
|
||||
}
|
||||
|
||||
/** Release the analogout object
|
||||
*
|
||||
* Note: This is not currently used in the mbed-drivers
|
||||
* @param obj The analogout object
|
||||
*/
|
||||
void analogout_free(dac_t *obj)
|
||||
{
|
||||
|
||||
// Not supported yet.
|
||||
}
|
||||
|
||||
/** Set the output voltage, specified as a percentage (float)
|
||||
*
|
||||
* @param obj The analogout object
|
||||
* @param value The floating-point output voltage to be set
|
||||
*/
|
||||
void analogout_write(dac_t *obj, float value)
|
||||
{
|
||||
uint32_t val = 0;
|
||||
|
@ -140,11 +123,6 @@ void analogout_write(dac_t *obj, float value)
|
|||
Cy_CTDAC_SetValueBuffered(obj->base, val);
|
||||
}
|
||||
|
||||
/** Set the output voltage, specified as unsigned 16-bit
|
||||
*
|
||||
* @param obj The analogout object
|
||||
* @param value The unsigned 16-bit output voltage to be set
|
||||
*/
|
||||
void analogout_write_u16(dac_t *obj, uint16_t value)
|
||||
{
|
||||
uint32_t val = 0;
|
||||
|
@ -154,22 +132,11 @@ void analogout_write_u16(dac_t *obj, uint16_t value)
|
|||
Cy_CTDAC_SetValueBuffered(obj->base, val);
|
||||
}
|
||||
|
||||
/** Read the current voltage value on the pin
|
||||
*
|
||||
* @param obj The analogout object
|
||||
* @return A floating-point value representing the current voltage on the pin,
|
||||
* measured as a percentage
|
||||
*/
|
||||
float analogout_read(dac_t *obj)
|
||||
{
|
||||
return (float)analogout_read_u16(obj) / 0xffff;
|
||||
}
|
||||
|
||||
/** Read the current voltage value on the pin, as a normalized unsigned 16bit value
|
||||
*
|
||||
* @param obj The analogout object
|
||||
* @return An unsigned 16-bit value representing the current voltage on the pin
|
||||
*/
|
||||
uint16_t analogout_read_u16(dac_t *obj)
|
||||
{
|
||||
uint16_t value = (obj->base->CTDAC_VAL_NXT >> CTDAC_CTDAC_VAL_NXT_VALUE_Pos) & CTDAC_CTDAC_VAL_NXT_VALUE_Msk;
|
||||
|
@ -179,7 +146,5 @@ uint16_t analogout_read_u16(dac_t *obj)
|
|||
return value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif // DEVICE_ANALOGIN
|
||||
|
||||
|
|
|
@ -57,22 +57,22 @@ void gpio_init(gpio_t *obj, PinName pin)
|
|||
if (pin == NC) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
MBED_ASSERT(CY_PIN(obj->pin) < 8); // PSoC6 architecture supports 8 pins per port.
|
||||
|
||||
/*
|
||||
* Perform i/o reservation only if this is called outside of critical section/interrupt context.
|
||||
* This is a workaround for mbed_die() implementation, which configures LED1 inside critical section.
|
||||
* Normally user is advised to perform all of the i/o configuration at the program beginning,
|
||||
* or elswere in the running thread context. when we decct that we are in the wrong context here,
|
||||
* we assume it's explicitely called from mbed_die() or other fault handling, so eventual forcing
|
||||
* of the pin mode is deliberate and should not cause more problems.
|
||||
*/
|
||||
if (!(IsIrqMode() || IsIrqMasked())) {
|
||||
if (cy_reserve_io_pin(pin)) {
|
||||
error("GPIO pin reservation conflict.");
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Perform i/o reservation only if this is called outside of critical section/interrupt context.
|
||||
* This is a workaround for mbed_die() implementation, which configures LED1 inside critical section.
|
||||
* Normally user is advised to perform all of the i/o configuration at the program beginning,
|
||||
* or elsewhere in the running thread context. when we detect that we are in the wrong context here,
|
||||
* we assume it's explicitly called from mbed_die() or other fault handling, so eventual forcing
|
||||
* of the pin mode is deliberate and should not cause more problems.
|
||||
*/
|
||||
if (!(IsIrqMode() || IsIrqMasked())) {
|
||||
if (cy_reserve_io_pin(pin)) {
|
||||
error("GPIO pin reservation conflict.");
|
||||
}
|
||||
}
|
||||
obj->port = Cy_GPIO_PortToAddr(CY_PORT(obj->pin));
|
||||
|
||||
const uint32_t outputVal = 0;
|
||||
|
|
|
@ -189,20 +189,9 @@ static int gpio_irq_setup_channel(gpio_irq_t *obj)
|
|||
NVIC_EnableIRQ(irqn);
|
||||
}
|
||||
|
||||
// TODO: Should we enable individual pin interrupt here?
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/** Initialize the GPIO IRQ pin
|
||||
*
|
||||
* @param obj The GPIO object to initialize
|
||||
* @param pin The GPIO pin name
|
||||
* @param handler The handler to be attached to GPIO IRQ
|
||||
* @param id The object ID (id != 0, 0 is reserved)
|
||||
* @return -1 if pin is NC, 0 otherwise
|
||||
*/
|
||||
int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32_t id)
|
||||
{
|
||||
if (pin != NC) {
|
||||
|
@ -221,10 +210,6 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32
|
|||
}
|
||||
}
|
||||
|
||||
/** Release the GPIO IRQ PIN
|
||||
*
|
||||
* @param obj The gpio object
|
||||
*/
|
||||
void gpio_irq_free(gpio_irq_t *obj)
|
||||
{
|
||||
gpio_irq_disable(obj);
|
||||
|
@ -238,12 +223,6 @@ void gpio_irq_free(gpio_irq_t *obj)
|
|||
NVIC_EnableIRQ(irq_port_usage[obj->port_id].irqn);
|
||||
}
|
||||
|
||||
/** Enable/disable pin IRQ event
|
||||
*
|
||||
* @param obj The GPIO object(IRQn_Type)
|
||||
* @param event The GPIO IRQ event
|
||||
* @param enable The enable flag
|
||||
*/
|
||||
void gpio_irq_set(gpio_irq_t *obj, gpio_irq_event event, uint32_t enable)
|
||||
{
|
||||
if (enable) {
|
||||
|
@ -291,21 +270,11 @@ void gpio_irq_set(gpio_irq_t *obj, gpio_irq_event event, uint32_t enable)
|
|||
}
|
||||
}
|
||||
|
||||
/** Enable GPIO IRQ
|
||||
*
|
||||
* This is target dependent, as it might enable the entire port or just a pin
|
||||
* @param obj The GPIO object
|
||||
*/
|
||||
void gpio_irq_enable(gpio_irq_t *obj)
|
||||
{
|
||||
Cy_GPIO_SetInterruptMask(obj->port, obj->pin, 1);
|
||||
}
|
||||
|
||||
/** Disable GPIO IRQ
|
||||
*
|
||||
* This is target dependent, as it might disable the entire port or just a pin
|
||||
* @param obj The GPIO object
|
||||
*/
|
||||
void gpio_irq_disable(gpio_irq_t *obj)
|
||||
{
|
||||
Cy_GPIO_SetInterruptMask(obj->port, obj->pin, 0);
|
||||
|
|
|
@ -159,7 +159,8 @@ static int allocate_divider(I2cDividerType divider)
|
|||
return (p_div->div_num == CY_INVALID_DIVIDER)? -1 : 0;
|
||||
}
|
||||
|
||||
/** Select one of the 3 dividers used depending on the required frequency.
|
||||
/*
|
||||
* Select one of the 3 dividers used depending on the required frequency.
|
||||
*/
|
||||
static I2cDividerType select_divider(uint32_t frequency)
|
||||
{
|
||||
|
@ -178,7 +179,8 @@ static I2cDividerType select_divider(uint32_t frequency)
|
|||
}
|
||||
}
|
||||
|
||||
/** Initializes i2c clock for the required speed
|
||||
/*
|
||||
* Initializes i2c clock for the required speed
|
||||
*/
|
||||
static cy_en_sysclk_status_t i2c_init_clock(i2c_obj_t *obj, uint32_t speed)
|
||||
{
|
||||
|
@ -210,7 +212,7 @@ static cy_en_sysclk_status_t i2c_init_clock(i2c_obj_t *obj, uint32_t speed)
|
|||
return (obj->actual_speed != 0)? CY_SYSCLK_SUCCESS : CY_SYSCLK_BAD_PARAM;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Initializes i/o pins for i2c sda/scl.
|
||||
*/
|
||||
static void i2c_init_pins(i2c_obj_t *obj)
|
||||
|
@ -222,7 +224,7 @@ static void i2c_init_pins(i2c_obj_t *obj)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
/*
|
||||
* Initializes and enables I2C/SCB.
|
||||
*/
|
||||
static void i2c_init_peripheral(i2c_obj_t *obj)
|
||||
|
@ -235,10 +237,11 @@ static void i2c_init_peripheral(i2c_obj_t *obj)
|
|||
Cy_SCB_I2C_Enable(obj->base);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Coverts PDL status into Mbed status.
|
||||
*/
|
||||
static int i2c_convert_status(cy_en_scb_i2c_status_t status) {
|
||||
static int i2c_convert_status(cy_en_scb_i2c_status_t status)
|
||||
{
|
||||
switch (status) {
|
||||
case CY_SCB_I2C_MASTER_NOT_READY:
|
||||
case CY_SCB_I2C_MASTER_MANUAL_ARB_LOST:
|
||||
|
@ -256,9 +259,9 @@ static void i2c_init_peripheral(i2c_obj_t *obj)
|
|||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Callback function to handle into and out of deep sleep state transitions.
|
||||
*/
|
||||
#if DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
|
||||
|
@ -273,13 +276,6 @@ static cy_en_syspm_status_t i2c_pm_callback(cy_stc_syspm_callback_params_t *call
|
|||
#endif // DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
|
||||
|
||||
|
||||
/** Initialize the I2C peripheral. It sets the default parameters for I2C
|
||||
* peripheral, and configures its specified pins.
|
||||
*
|
||||
* @param obj The I2C object
|
||||
* @param sda The sda pin
|
||||
* @param scl The scl pin
|
||||
*/
|
||||
void i2c_init(i2c_t *obj_in, PinName sda, PinName scl)
|
||||
{
|
||||
i2c_obj_t *obj = OBJ_P(obj_in);
|
||||
|
@ -305,26 +301,21 @@ void i2c_init(i2c_t *obj_in, PinName sda, PinName scl)
|
|||
i2c_init_pins(obj);
|
||||
i2c_init_peripheral(obj);
|
||||
#if DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
|
||||
obj->pm_callback_handler.callback = i2c_pm_callback;
|
||||
obj->pm_callback_handler.type = CY_SYSPM_DEEPSLEEP;
|
||||
obj->pm_callback_handler.skipMode = 0;
|
||||
obj->pm_callback_handler.callbackParams = &obj->pm_callback_params;
|
||||
obj->pm_callback_params.base = obj->base;
|
||||
obj->pm_callback_params.context = obj;
|
||||
if (!Cy_SysPm_RegisterCallback(&obj->pm_callback_handler)) {
|
||||
error("PM callback registration failed!");
|
||||
}
|
||||
obj->pm_callback_handler.callback = i2c_pm_callback;
|
||||
obj->pm_callback_handler.type = CY_SYSPM_DEEPSLEEP;
|
||||
obj->pm_callback_handler.skipMode = 0;
|
||||
obj->pm_callback_handler.callbackParams = &obj->pm_callback_params;
|
||||
obj->pm_callback_params.base = obj->base;
|
||||
obj->pm_callback_params.context = obj;
|
||||
if (!Cy_SysPm_RegisterCallback(&obj->pm_callback_handler)) {
|
||||
error("PM callback registration failed!");
|
||||
}
|
||||
#endif // DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
|
||||
} else {
|
||||
error("I2C pinout mismatch. Requested pins Rx and Tx can't be used for the same I2C communication.");
|
||||
}
|
||||
}
|
||||
|
||||
/** Configure the I2C frequency
|
||||
*
|
||||
* @param obj The I2C object
|
||||
* @param hz Frequency in Hz
|
||||
*/
|
||||
void i2c_frequency(i2c_t *obj_in, int hz)
|
||||
{
|
||||
i2c_obj_t *obj = OBJ_P(obj_in);
|
||||
|
@ -333,35 +324,18 @@ void i2c_frequency(i2c_t *obj_in, int hz)
|
|||
Cy_SCB_I2C_Enable(obj->base);
|
||||
}
|
||||
|
||||
/** Send START command
|
||||
*
|
||||
* This function is a dummy operation on PSoC
|
||||
*/
|
||||
int i2c_start(i2c_t *obj_in)
|
||||
{
|
||||
// Unsupported, start condition is sent automatically.
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** Send STOP command
|
||||
*
|
||||
* @param obj The I2C object
|
||||
*/
|
||||
int i2c_stop(i2c_t *obj_in)
|
||||
{
|
||||
i2c_obj_t *obj = OBJ_P(obj_in);
|
||||
// Cy_SCB_I2C_MasterSendStop(obj->base, obj->timeout, &obj->context);
|
||||
// Unsupported, stop condition is sent automatically.
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** Blocking reading data
|
||||
*
|
||||
* @param obj The I2C object
|
||||
* @param address 7-bit address (last bit is 1)
|
||||
* @param data The buffer for receiving
|
||||
* @param length Number of bytes to read
|
||||
* @param stop Stop to be generated after the transfer is done
|
||||
* @return Number of read bytes
|
||||
*/
|
||||
int i2c_read(i2c_t *obj_in, int address, char *data, int length, int stop)
|
||||
{
|
||||
cy_en_scb_i2c_status_t status = CY_SCB_I2C_SUCCESS;
|
||||
|
@ -400,17 +374,6 @@ int i2c_read(i2c_t *obj_in, int address, char *data, int length, int stop)
|
|||
return byte_count;
|
||||
}
|
||||
|
||||
/** Blocking sending data
|
||||
*
|
||||
* @param obj The I2C object
|
||||
* @param address 7-bit address (last bit is 0)
|
||||
* @param data The buffer for sending
|
||||
* @param length Number of bytes to write
|
||||
* @param stop Stop to be generated after the transfer is done
|
||||
* @return
|
||||
* zero or non-zero - Number of written bytes
|
||||
* negative - I2C_ERROR_XXX status
|
||||
*/
|
||||
int i2c_write(i2c_t *obj_in, int address, const char *data, int length, int stop)
|
||||
{
|
||||
cy_en_scb_i2c_status_t status = CY_SCB_I2C_SUCCESS;
|
||||
|
@ -445,21 +408,11 @@ int i2c_write(i2c_t *obj_in, int address, const char *data, int length, int stop
|
|||
return byte_count;
|
||||
}
|
||||
|
||||
/** Reset I2C peripheral. TODO: The action here. Most of the implementation sends stop()
|
||||
*
|
||||
* @param obj The I2C object
|
||||
*/
|
||||
void i2c_reset(i2c_t *obj_in)
|
||||
{
|
||||
i2c_stop(obj_in);
|
||||
}
|
||||
|
||||
/** Read one byte
|
||||
*
|
||||
* @param obj The I2C object
|
||||
* @param last Acknowledge
|
||||
* @return The read byte
|
||||
*/
|
||||
int i2c_byte_read(i2c_t *obj_in, int last)
|
||||
{
|
||||
i2c_obj_t *obj = OBJ_P(obj_in);
|
||||
|
@ -474,12 +427,6 @@ int i2c_byte_read(i2c_t *obj_in, int last)
|
|||
}
|
||||
}
|
||||
|
||||
/** Write one byte
|
||||
*
|
||||
* @param obj The I2C object
|
||||
* @param data Byte to be written
|
||||
* @return 0 if NAK was received, 1 if ACK was received, 2 for timeout.
|
||||
*/
|
||||
int i2c_byte_write(i2c_t *obj_in, int data)
|
||||
{
|
||||
i2c_obj_t *obj = OBJ_P(obj_in);
|
||||
|
@ -498,84 +445,8 @@ int i2c_byte_write(i2c_t *obj_in, int data)
|
|||
}
|
||||
}
|
||||
|
||||
#if DEVICE_I2CSLAVE
|
||||
|
||||
/** Configure I2C as slave or master.
|
||||
* @param obj The I2C object
|
||||
* @return non-zero if a value is available
|
||||
*/
|
||||
void i2c_slave_mode(i2c_t *obj_in, int enable_slave)
|
||||
{
|
||||
i2c_obj_t *obj = OBJ_P(obj_in);
|
||||
|
||||
}
|
||||
|
||||
/** Check to see if the I2C slave has been addressed.
|
||||
* @param obj The I2C object
|
||||
* @return The status - 1 - read addresses, 2 - write to all slaves,
|
||||
* 3 write addressed, 0 - the slave has not been addressed
|
||||
*/
|
||||
int i2c_slave_receive(i2c_t *obj_in)
|
||||
{
|
||||
i2c_obj_t *obj = OBJ_P(obj_in);
|
||||
|
||||
}
|
||||
|
||||
/** Configure I2C as slave or master.
|
||||
* @param obj The I2C object
|
||||
* @return non-zero if a value is available
|
||||
*/
|
||||
int i2c_slave_read(i2c_t *obj_in, char *data, int length)
|
||||
{
|
||||
i2c_obj_t *obj = OBJ_P(obj_in);
|
||||
|
||||
}
|
||||
|
||||
/** Configure I2C as slave or master.
|
||||
* @param obj The I2C object
|
||||
* @return non-zero if a value is available
|
||||
*/
|
||||
int i2c_slave_write(i2c_t *obj_in, const char *data, int length)
|
||||
{
|
||||
i2c_obj_t *obj = OBJ_P(obj_in);
|
||||
|
||||
}
|
||||
|
||||
/** Configure I2C address.
|
||||
* @param obj The I2C object
|
||||
* @param idx Currently not used
|
||||
* @param address The address to be set
|
||||
* @param mask Currently not used
|
||||
*/
|
||||
void i2c_slave_address(i2c_t *obj_in, int idx, uint32_t address, uint32_t mask)
|
||||
{
|
||||
i2c_obj_t *obj = OBJ_P(obj_in);
|
||||
obj->slave_addr = (uint8_t)address >> 1;
|
||||
Cy_SCB_I2C_SlaveSetAddress(obj->base, obj->slave_addr);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if DEVICE_I2C_ASYNCH
|
||||
|
||||
/**
|
||||
* \defgroup hal_AsynchI2C Asynchronous I2C Hardware Abstraction Layer
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** Start I2C asynchronous transfer
|
||||
*
|
||||
* @param obj The I2C object
|
||||
* @param tx The transmit buffer
|
||||
* @param tx_length The number of bytes to transmit
|
||||
* @param rx The receive buffer
|
||||
* @param rx_length The number of bytes to receive
|
||||
* @param address The address to be set - 7bit or 9bit
|
||||
* @param stop If true, stop will be generated after the transfer is done
|
||||
* @param handler The I2C IRQ handler to be set
|
||||
* @param hint DMA hint usage
|
||||
*/
|
||||
void i2c_transfer_asynch(i2c_t *obj_in,
|
||||
const void *tx,
|
||||
size_t tx_length,
|
||||
|
@ -625,16 +496,11 @@ void i2c_transfer_asynch(i2c_t *obj_in,
|
|||
}
|
||||
}
|
||||
|
||||
/** The asynchronous IRQ handler
|
||||
*
|
||||
* @param obj The I2C object which holds the transfer information
|
||||
* @return Event flags if a transfer termination condition was met, otherwise return 0.
|
||||
*/
|
||||
uint32_t i2c_irq_handler_asynch(i2c_t *obj_in)
|
||||
{
|
||||
i2c_obj_t *obj = OBJ_P(obj_in);
|
||||
uint32_t event = 0;
|
||||
// Process actual interrupt.
|
||||
// Process actual interrupt.
|
||||
Cy_SCB_I2C_Interrupt(obj->base, &obj->context);
|
||||
if (obj->context.state == CY_SCB_I2C_MASTER_CMPLT) {
|
||||
if (obj->context.masterStatus & CY_SCB_I2C_MASTER_ERR) {
|
||||
|
@ -648,8 +514,8 @@ uint32_t i2c_irq_handler_asynch(i2c_t *obj_in)
|
|||
} else {
|
||||
// Check if a read phase is pending after write.
|
||||
if (obj->pending == PENDING_TX_RX) {
|
||||
obj->pending = PENDING_RX;
|
||||
Cy_SCB_I2C_MasterRead(obj->base, &obj->rx_config, &obj->context);
|
||||
obj->pending = PENDING_RX;
|
||||
Cy_SCB_I2C_MasterRead(obj->base, &obj->rx_config, &obj->context);
|
||||
} else {
|
||||
event = I2C_EVENT_TRANSFER_COMPLETE;
|
||||
}
|
||||
|
@ -661,22 +527,12 @@ uint32_t i2c_irq_handler_asynch(i2c_t *obj_in)
|
|||
return event & obj->events;
|
||||
}
|
||||
|
||||
/** Attempts to determine if the I2C peripheral is already in use
|
||||
*
|
||||
* @param obj The I2C object
|
||||
* @return Non-zero if the I2C module is active or zero if it is not
|
||||
*/
|
||||
uint8_t i2c_active(i2c_t *obj_in)
|
||||
{
|
||||
i2c_obj_t *obj = OBJ_P(obj_in);
|
||||
return (obj->pending != PENDING_NONE);
|
||||
}
|
||||
|
||||
/** Abort asynchronous transfer
|
||||
*
|
||||
* This function does not perform any check - that should happen in upper layers.
|
||||
* @param obj The I2C object
|
||||
*/
|
||||
void i2c_abort_asynch(i2c_t *obj_in)
|
||||
{
|
||||
i2c_obj_t *obj = OBJ_P(obj_in);
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#include "ipcpipe_transport.h"
|
||||
#include "cy_ipc_config.h"
|
||||
#include "ipc/cy_ipc_pipe.h"
|
||||
#include "syspm/cy_syspm.h"
|
||||
//#include "syspm/cy_syspm.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -34,12 +34,21 @@ static uint32_t num_registered_clients = 0;
|
|||
IpcPipeTxCompleteHandler *ipcpipe_xfer_complete_cb[CY_IPC_USRPIPE_CLIENT_CNT] = {NULL};
|
||||
|
||||
|
||||
/** Buffer release callback function
|
||||
* Just releases currently transmitted buffer upon tx completion.
|
||||
* Used in the case the currently transmitted buffer was not the last one
|
||||
* in the queue, i.e. event doesn't complete the whole transmission.
|
||||
*/
|
||||
void ipcpipe_buffer_release(void)
|
||||
{
|
||||
IPCPIPE_ASSERT(ipcpipe_buffer[ipcpipe_transfer_buffer].busy_flag == 1);
|
||||
ipcpipe_buffer[ipcpipe_transfer_buffer].busy_flag = 0;
|
||||
}
|
||||
|
||||
/** Buffer release callback function
|
||||
* Releases currently transmitted buffer upon tx completion
|
||||
* and calls associated tx complete event handler.
|
||||
*/
|
||||
void ipcpipe_buffer_release_callback(void)
|
||||
{
|
||||
uint32_t client_id = ipcpipe_buffer[ipcpipe_transfer_buffer].message.client_id;
|
||||
|
@ -55,7 +64,9 @@ void ipcpipe_buffer_release_callback(void)
|
|||
}
|
||||
}
|
||||
|
||||
/** Sets current buffer available for transmission.
|
||||
/** Locks a buffer making it available for transmission.
|
||||
*
|
||||
* @param current_buffer index of the buffer to be locked
|
||||
*/
|
||||
void ipcpipe_transfer_lock_buffer(uint32_t current_buffer)
|
||||
{
|
||||
|
@ -70,13 +81,18 @@ void ipcpipe_transfer_lock_buffer(uint32_t current_buffer)
|
|||
ipcpipe_transfer_buffer = current_buffer;
|
||||
}
|
||||
|
||||
/** Find index of the next available buffer
|
||||
* This is a blocking call, it blocks until the buffer becomes available
|
||||
* if there is no free buffer at the moment.
|
||||
*
|
||||
* @return index of the buffer
|
||||
*/
|
||||
uint32_t ipcpipe_buffer_aquire(void)
|
||||
{
|
||||
uint32_t buffer_index;
|
||||
/* check that we have a buffer available */
|
||||
while (ipcpipe_buffer[ipcpipe_current_buffer].busy_flag) {
|
||||
/* just wait here */
|
||||
Cy_SysPm_Sleep(CY_SYSPM_WAIT_FOR_INTERRUPT);
|
||||
}
|
||||
|
||||
buffer_index = ipcpipe_current_buffer;
|
||||
|
@ -122,7 +138,7 @@ void ipcpipe_write_data(uint32_t client_id, uint8_t *header, uint32_t header_len
|
|||
&buffer->message,
|
||||
avail? ipcpipe_buffer_release : ipcpipe_buffer_release_callback);
|
||||
if (status == CY_IPC_PIPE_ERROR_SEND_BUSY) {
|
||||
Cy_SysPm_Sleep(CY_SYSPM_WAIT_FOR_INTERRUPT);
|
||||
/* busy wait */
|
||||
}
|
||||
} while (status != CY_IPC_PIPE_SUCCESS);
|
||||
}
|
||||
|
|
|
@ -35,35 +35,68 @@
|
|||
/* Client IDs */
|
||||
#define IPCPIPE_CLIENT_H4 0
|
||||
|
||||
/* IPC Pipe message data structure */
|
||||
typedef struct
|
||||
{
|
||||
uint32_t client_id;
|
||||
uint32_t header_length;
|
||||
uint32_t data_length;
|
||||
uint8_t header[IPCPIPE_MAX_HEADER_LENGTH];
|
||||
uint8_t data[IPCPIPE_MAX_DATA_LENGTH];
|
||||
/** IPC Pipe message data structure
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t client_id; ///< ID of the client using this API
|
||||
uint32_t header_length; ///< length of the message header in bytes
|
||||
uint32_t data_length; ///< length of the message data field
|
||||
uint8_t header[IPCPIPE_MAX_HEADER_LENGTH]; ///< message header
|
||||
uint8_t data[IPCPIPE_MAX_DATA_LENGTH]; ///< message data
|
||||
} IpcPipeMessage;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
volatile uint8_t busy_flag;
|
||||
IpcPipeMessage message;
|
||||
/** IPC Pipe message buffer
|
||||
* Used to transfer a message to other MCU
|
||||
*/
|
||||
typedef struct {
|
||||
volatile uint8_t busy_flag; ///< indicates whether the transfer is in progress
|
||||
IpcPipeMessage message; ///< the message itself
|
||||
} IpcPipeBuffer;
|
||||
|
||||
|
||||
/** Type of rx (buffer received) event handler function
|
||||
*/
|
||||
typedef void (IpcPipeRxHandler)(uint32_t *message_ptr);
|
||||
|
||||
/** Type of tx complete (buffer sent out) event handler function
|
||||
*/
|
||||
typedef void (IpcPipeTxCompleteHandler)(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** Send a data block over IPC pipe
|
||||
*
|
||||
* @param client_id ID of the client using this service
|
||||
* @param header pointer to the message header to be sent
|
||||
* @param header_length length of the header
|
||||
* @param data pointer to the message data to be sent
|
||||
* @param data_length length of the data
|
||||
*/
|
||||
void ipcpipe_write_data(uint32_t client_id, uint8_t* header, uint32_t header_length, uint8_t *data, uint32_t data_length);
|
||||
|
||||
/** Initialize and start IPC pipe transport service
|
||||
*
|
||||
* @param client_id ID of the client using this service
|
||||
* @param rx_handler receive event handler
|
||||
* @param tx_handler transmit complete event handler
|
||||
*/
|
||||
void ipcpipe_transport_start(uint32_t client_id, IpcPipeRxHandler *rx_handler, IpcPipeTxCompleteHandler *tx_handler);
|
||||
|
||||
/** Stop IPC pipe transport service
|
||||
*
|
||||
* @param client_id ID of the client using this service
|
||||
*/
|
||||
void ipcpipe_transport_stop(uint32_t client_id);
|
||||
|
||||
|
||||
/** Enable IPC pipe transport service
|
||||
*/
|
||||
void ipcpipe_transport_enable(void);
|
||||
|
||||
/** Disable IPC pipe transport service
|
||||
*/
|
||||
void ipcpipe_transport_disable(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -72,9 +72,6 @@ static cy_stc_sysint_t lpt_sysint_config = {
|
|||
};
|
||||
|
||||
|
||||
/** Initialize the low power ticker
|
||||
*
|
||||
*/
|
||||
void lp_ticker_init(void)
|
||||
{
|
||||
lp_ticker_disable_interrupt();
|
||||
|
@ -101,9 +98,6 @@ void lp_ticker_init(void)
|
|||
lpt_init_done = true;
|
||||
}
|
||||
|
||||
/** Deinitialize the lower power ticker
|
||||
*
|
||||
*/
|
||||
void lp_ticker_free(void)
|
||||
{
|
||||
NVIC_DisableIRQ(lpt_sysint_config.intrSrc);
|
||||
|
@ -115,19 +109,11 @@ void lp_ticker_free(void)
|
|||
lpt_init_done = 0;
|
||||
}
|
||||
|
||||
/** Read the current counter
|
||||
*
|
||||
* @return The current timer's counter value in microseconds
|
||||
*/
|
||||
uint32_t lp_ticker_read(void)
|
||||
{
|
||||
return Cy_MCWDT_GetCount(LPT_MCWDT_UNIT, CY_MCWDT_COUNTER0);
|
||||
}
|
||||
|
||||
/** Set interrupt for specified timestamp
|
||||
*
|
||||
* @param timestamp The time in microseconds to be set
|
||||
*/
|
||||
void lp_ticker_set_interrupt(timestamp_t timestamp)
|
||||
{
|
||||
uint16_t delay;
|
||||
|
@ -153,17 +139,11 @@ void lp_ticker_set_interrupt(timestamp_t timestamp)
|
|||
Cy_MCWDT_SetInterruptMask(LPT_MCWDT_UNIT, CY_MCWDT_CTR0);
|
||||
}
|
||||
|
||||
/** Disable low power ticker interrupt
|
||||
*
|
||||
*/
|
||||
void lp_ticker_disable_interrupt(void)
|
||||
{
|
||||
Cy_MCWDT_SetInterruptMask(LPT_MCWDT_UNIT, 0);
|
||||
}
|
||||
|
||||
/** Clear the low power ticker interrupt
|
||||
*
|
||||
*/
|
||||
void lp_ticker_clear_interrupt(void)
|
||||
{
|
||||
Cy_MCWDT_ClearInterrupt(LPT_MCWDT_UNIT, CY_MCWDT_CTR0);
|
||||
|
|
|
@ -52,13 +52,6 @@ static void port_init_pins(port_t *obj)
|
|||
}
|
||||
}
|
||||
|
||||
/** Initilize the port
|
||||
*
|
||||
* @param obj The port object to initialize
|
||||
* @param port The port name
|
||||
* @param mask The bitmask to identify which bits in the port should be included (0 - ignore)
|
||||
* @param dir The port direction
|
||||
*/
|
||||
void port_init(port_t *obj, PortName port, int mask, PinDirection dir)
|
||||
{
|
||||
uint32_t pin;
|
||||
|
@ -80,11 +73,6 @@ void port_init(port_t *obj, PortName port, int mask, PinDirection dir)
|
|||
port_init_pins(obj);
|
||||
}
|
||||
|
||||
/** Set the input port mode
|
||||
*
|
||||
* @param obj The port object
|
||||
* @param mode THe port mode to be set
|
||||
*/
|
||||
void port_mode(port_t *obj, PinMode mode)
|
||||
{
|
||||
MBED_ASSERT(obj);
|
||||
|
@ -94,11 +82,6 @@ void port_mode(port_t *obj, PinMode mode)
|
|||
port_init_pins(obj);
|
||||
}
|
||||
|
||||
/** Set port direction (in/out)
|
||||
*
|
||||
* @param obj The port object
|
||||
* @param dir The port direction to be set
|
||||
*/
|
||||
void port_dir(port_t *obj, PinDirection dir)
|
||||
{
|
||||
MBED_ASSERT(obj);
|
||||
|
@ -108,11 +91,6 @@ void port_dir(port_t *obj, PinDirection dir)
|
|||
port_init_pins(obj);
|
||||
}
|
||||
|
||||
/** Write value to the port
|
||||
*
|
||||
* @param obj The port object
|
||||
* @param value The value to be set
|
||||
*/
|
||||
void port_write(port_t *obj, int value)
|
||||
{
|
||||
MBED_ASSERT(obj);
|
||||
|
@ -133,11 +111,6 @@ void port_write(port_t *obj, int value)
|
|||
}
|
||||
}
|
||||
|
||||
/** Read the current value on the port
|
||||
*
|
||||
* @param obj The port object
|
||||
* @return An integer with each bit corresponding to an associated port pin setting
|
||||
*/
|
||||
int port_read(port_t *obj)
|
||||
{
|
||||
return obj->port->IN & obj->mask;
|
||||
|
|
|
@ -113,6 +113,7 @@ do { \
|
|||
|
||||
#define DEFAULT_PORT_RES 0
|
||||
#define DEFAULT_DIVIDER_RES 0
|
||||
#define DEFAULT_DIVIDER8_RES 0
|
||||
#define DEFAULT_SCM_RES 0
|
||||
#define DEFAULT_TCPWM_RES 0
|
||||
#endif // defined(TARGET_MCU_PSOC6_M0)
|
||||
|
@ -123,8 +124,9 @@ do { \
|
|||
|
||||
#define DEFAULT_PORT_RES 0
|
||||
#define DEFAULT_DIVIDER_RES 0
|
||||
#define DEFAULT_DIVIDER8_RES 0x3 // dividers 0 & 1 are reserved for us_ticker
|
||||
#define DEFAULT_SCM_RES 0
|
||||
#define DEFAULT_TCPWM_RES 0
|
||||
#define DEFAULT_TCPWM_RES 0x3 // 32b counters 0 & 1 are reserved for us_ticker
|
||||
|
||||
#endif // PSOC6_DYNSRM_DISABLE
|
||||
|
||||
|
@ -137,7 +139,7 @@ typedef struct {
|
|||
} divider_alloc_t;
|
||||
|
||||
static divider_alloc_t divider_allocations[CY_NUM_DIVIDER_TYPES] = {
|
||||
{ PERI_DIV_8_NR - 1, 0, DEFAULT_DIVIDER_RES }, // CY_SYSCLK_DIV_8_BIT
|
||||
{ PERI_DIV_8_NR - 1, 2, DEFAULT_DIVIDER8_RES }, // CY_SYSCLK_DIV_8_BIT
|
||||
{ PERI_DIV_16_NR - 1, 0, DEFAULT_DIVIDER_RES }, // CY_SYSCLK_DIV_16_BIT
|
||||
{ PERI_DIV_16_5_NR - 1, 0, DEFAULT_DIVIDER_RES }, // CY_SYSCLK_DIV_16_5_BIT
|
||||
{ PERI_DIV_24_5_NR - 1, 0, DEFAULT_DIVIDER_RES } // CY_SYSCLK_DIV_24_5_BIT
|
||||
|
@ -250,8 +252,8 @@ uint32_t cy_clk_allocate_divider(cy_en_divider_types_t div_type)
|
|||
|
||||
|
||||
for ( uint32_t first_index = p_alloc->current_index;
|
||||
CY_INVALID_DIVIDER == (divider = cy_clk_reserve_divider(div_type, p_alloc->current_index));
|
||||
++p_alloc->current_index) {
|
||||
CY_INVALID_DIVIDER == (divider = cy_clk_reserve_divider(div_type, p_alloc->current_index));
|
||||
++p_alloc->current_index) {
|
||||
if (p_alloc->current_index > p_alloc->max_index) {
|
||||
p_alloc->current_index = 0;
|
||||
}
|
||||
|
@ -355,7 +357,8 @@ IRQn_Type cy_m0_nvic_allocate_channel(uint32_t channel_id)
|
|||
if (irq_channels[chn] == 0) {
|
||||
irq_channels[chn] = channel_id;
|
||||
alloc = NvicMux0_IRQn + chn;
|
||||
break; irq_channels[chn] = channel_id;
|
||||
break;
|
||||
irq_channels[chn] = channel_id;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -436,18 +439,18 @@ void cy_get_bd_mac_address(uint8_t *buffer)
|
|||
void cy_srm_initialize(void)
|
||||
{
|
||||
#if PSOC6_DYNSRM_DISABLE
|
||||
#ifdef M0_ASSIGNED_PORTS
|
||||
SRM_INIT_RESOURCE(uint8_t, port_reservations,, M0_ASSIGNED_PORTS);
|
||||
#endif
|
||||
#ifdef M0_ASSIGNED_DIVIDERS
|
||||
SRM_INIT_RESOURCE(uint32_t, divider_allocations, .reservations, M0_ASSIGNED_DIVIDERS);
|
||||
#endif
|
||||
#ifdef M0_ASSIGNED_SCBS
|
||||
SRM_INIT_RESOURCE(uint8_t, scb_reservations,, M0_ASSIGNED_SCBS);
|
||||
#endif
|
||||
#ifdef M0_ASSIGNED_TCPWMS
|
||||
SRM_INIT_RESOURCE(uint8_t, tcpwm_reservations,, M0_ASSIGNED_TCPWMS);
|
||||
#endif
|
||||
#ifdef M0_ASSIGNED_PORTS
|
||||
SRM_INIT_RESOURCE(uint8_t, port_reservations,, M0_ASSIGNED_PORTS);
|
||||
#endif
|
||||
#ifdef M0_ASSIGNED_DIVIDERS
|
||||
SRM_INIT_RESOURCE(uint32_t, divider_allocations, .reservations, M0_ASSIGNED_DIVIDERS);
|
||||
#endif
|
||||
#ifdef M0_ASSIGNED_SCBS
|
||||
SRM_INIT_RESOURCE(uint8_t, scb_reservations,, M0_ASSIGNED_SCBS);
|
||||
#endif
|
||||
#ifdef M0_ASSIGNED_TCPWMS
|
||||
SRM_INIT_RESOURCE(uint8_t, tcpwm_reservations,, M0_ASSIGNED_TCPWMS);
|
||||
#endif
|
||||
#endif // PSOC6_DYNSRM_DISABLE
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,6 @@ static void Cy_TCPWM_PWM_SetPrescaler(TCPWM_Type *base, uint32_t cntNum, uint32
|
|||
base->CNT[cntNum].CTRL = _CLR_SET_FLD32U(base->CNT[cntNum].CTRL, TCPWM_CNT_CTRL_GENERIC, prescaler);
|
||||
}
|
||||
|
||||
|
||||
static void pwm_start_32b(pwmout_t *obj, uint32_t new_period, uint32_t new_width)
|
||||
{
|
||||
obj->period = new_period;
|
||||
|
@ -75,7 +74,6 @@ static void pwm_start_32b(pwmout_t *obj, uint32_t new_period, uint32_t new_width
|
|||
Cy_TCPWM_TriggerStart(obj->base, 1UL << obj->counter_id);
|
||||
}
|
||||
|
||||
|
||||
static void pwm_start_16b(pwmout_t *obj, uint32_t period, uint32_t width)
|
||||
{
|
||||
uint32_t prescaler = 0;
|
||||
|
@ -104,24 +102,23 @@ static void pwm_start_16b(pwmout_t *obj, uint32_t period, uint32_t width)
|
|||
Cy_TCPWM_TriggerStart(obj->base, 1UL << obj->counter_id);
|
||||
}
|
||||
|
||||
|
||||
static void pwm_start(pwmout_t *obj, uint32_t new_period, uint32_t new_pulse_width)
|
||||
{
|
||||
obj->period = new_period;
|
||||
obj->pulse_width = new_pulse_width;
|
||||
Cy_TCPWM_PWM_Disable(obj->base, obj->counter_id);
|
||||
if (new_period > 0) {
|
||||
if (obj->base == TCPWM0) {
|
||||
pwm_start_32b(obj, new_period, new_pulse_width);
|
||||
} else {
|
||||
pwm_start_16b(obj, new_period, new_pulse_width);
|
||||
}
|
||||
if (obj->base == TCPWM0) {
|
||||
pwm_start_32b(obj, new_period, new_pulse_width);
|
||||
} else {
|
||||
pwm_start_16b(obj, new_period, new_pulse_width);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** Callback handler to restart the timer after deep sleep.
|
||||
*
|
||||
/*
|
||||
* Callback handler to restart the timer after deep sleep.
|
||||
*/
|
||||
#if DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
|
||||
static cy_en_syspm_status_t pwm_pm_callback(cy_stc_syspm_callback_params_t *callback_params)
|
||||
|
@ -129,21 +126,21 @@ static cy_en_syspm_status_t pwm_pm_callback(cy_stc_syspm_callback_params_t *call
|
|||
pwmout_t *obj = (pwmout_t *)callback_params->context;
|
||||
|
||||
switch (callback_params->mode) {
|
||||
case CY_SYSPM_BEFORE_TRANSITION:
|
||||
/* Disable timer before transition */
|
||||
Cy_TCPWM_PWM_Disable(obj->base, obj->counter_id);
|
||||
break;
|
||||
case CY_SYSPM_BEFORE_TRANSITION:
|
||||
/* Disable timer before transition */
|
||||
Cy_TCPWM_PWM_Disable(obj->base, obj->counter_id);
|
||||
break;
|
||||
|
||||
case CY_SYSPM_AFTER_TRANSITION:
|
||||
/* Enable the timer to operate */
|
||||
if (obj->period > 0) {
|
||||
Cy_TCPWM_PWM_Enable(obj->base, obj->counter_id);
|
||||
Cy_TCPWM_TriggerStart(obj->base, 1UL << obj->counter_id);
|
||||
}
|
||||
break;
|
||||
case CY_SYSPM_AFTER_TRANSITION:
|
||||
/* Enable the timer to operate */
|
||||
if (obj->period > 0) {
|
||||
Cy_TCPWM_PWM_Enable(obj->base, obj->counter_id);
|
||||
Cy_TCPWM_TriggerStart(obj->base, 1UL << obj->counter_id);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return CY_SYSPM_SUCCESS;
|
||||
|
@ -151,15 +148,11 @@ static cy_en_syspm_status_t pwm_pm_callback(cy_stc_syspm_callback_params_t *call
|
|||
#endif // DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
|
||||
|
||||
|
||||
/** Initialize the pwm out peripheral and configure the pin
|
||||
*
|
||||
* @param obj The pwmout object to initialize
|
||||
* @param pin The pwmout pin to initialize
|
||||
*/
|
||||
void pwmout_init(pwmout_t *obj, PinName pin)
|
||||
{
|
||||
uint32_t pwm_cnt = 0;
|
||||
uint32_t pwm_function = 0;
|
||||
uint32_t abs_cnt_num = 0;
|
||||
|
||||
MBED_ASSERT(obj);
|
||||
MBED_ASSERT(pin != (PinName)NC);
|
||||
|
@ -185,9 +178,14 @@ void pwmout_init(pwmout_t *obj, PinName pin)
|
|||
obj->pin = pin;
|
||||
if (obj->base == TCPWM0) {
|
||||
obj->counter_id = ((PWMName)pwm_cnt - PWM_32b_0) / (PWM_32b_1 - PWM_32b_0);
|
||||
abs_cnt_num = obj->counter_id;
|
||||
} else {
|
||||
// TCPWM1 is used.
|
||||
obj->counter_id = ((PWMName)pwm_cnt - PWM_16b_0) / (PWM_16b_1 - PWM_16b_0);
|
||||
abs_cnt_num = obj->counter_id + 8;
|
||||
}
|
||||
if (cy_reserve_tcpwm(abs_cnt_num)) {
|
||||
error("PWMOUT Timer/Counter reservation conflict.");
|
||||
}
|
||||
|
||||
// Configure clock.
|
||||
|
@ -201,15 +199,15 @@ void pwmout_init(pwmout_t *obj, PinName pin)
|
|||
obj->pulse_width = 0;
|
||||
obj->prescaler = 0;
|
||||
#if DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
|
||||
obj->pm_callback_handler.callback = pwm_pm_callback;
|
||||
obj->pm_callback_handler.type = CY_SYSPM_DEEPSLEEP;
|
||||
obj->pm_callback_handler.skipMode = CY_SYSPM_SKIP_CHECK_READY | CY_SYSPM_SKIP_CHECK_FAIL;
|
||||
obj->pm_callback_handler.callbackParams = &obj->pm_callback_params;
|
||||
obj->pm_callback_params.base = obj->base;
|
||||
obj->pm_callback_params.context = obj;
|
||||
if (!Cy_SysPm_RegisterCallback(&obj->pm_callback_handler)) {
|
||||
error("PM callback registration failed!");
|
||||
}
|
||||
obj->pm_callback_handler.callback = pwm_pm_callback;
|
||||
obj->pm_callback_handler.type = CY_SYSPM_DEEPSLEEP;
|
||||
obj->pm_callback_handler.skipMode = CY_SYSPM_SKIP_CHECK_READY | CY_SYSPM_SKIP_CHECK_FAIL;
|
||||
obj->pm_callback_handler.callbackParams = &obj->pm_callback_params;
|
||||
obj->pm_callback_params.base = obj->base;
|
||||
obj->pm_callback_params.context = obj;
|
||||
if (!Cy_SysPm_RegisterCallback(&obj->pm_callback_handler)) {
|
||||
error("PM callback registration failed!");
|
||||
}
|
||||
#endif // DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
|
||||
|
||||
} else {
|
||||
|
@ -217,21 +215,11 @@ void pwmout_init(pwmout_t *obj, PinName pin)
|
|||
}
|
||||
}
|
||||
|
||||
/** Deinitialize the pwmout object
|
||||
*
|
||||
* @param obj The pwmout object
|
||||
*/
|
||||
void pwmout_free(pwmout_t *obj)
|
||||
{
|
||||
// TODO: Not implemented yet.
|
||||
}
|
||||
|
||||
/** Set the output duty-cycle in range <0.0f, 1.0f>
|
||||
*
|
||||
* Value 0.0f represents 0 percentage, 1.0f represents 100 percent.
|
||||
* @param obj The pwmout object
|
||||
* @param percent The floating-point percentage number
|
||||
*/
|
||||
void pwmout_write(pwmout_t *obj, float percent)
|
||||
{
|
||||
uint32_t pulse_width;
|
||||
|
@ -246,11 +234,6 @@ void pwmout_write(pwmout_t *obj, float percent)
|
|||
pwm_start(obj, obj->period, pulse_width);
|
||||
}
|
||||
|
||||
/** Read the current float-point output duty-cycle
|
||||
*
|
||||
* @param obj The pwmout object
|
||||
* @return A floating-point output duty-cycle
|
||||
*/
|
||||
float pwmout_read(pwmout_t *obj)
|
||||
{
|
||||
MBED_ASSERT(obj);
|
||||
|
@ -258,12 +241,6 @@ float pwmout_read(pwmout_t *obj)
|
|||
return (float)(obj->pulse_width) / obj->period;
|
||||
}
|
||||
|
||||
/** Set the PWM period specified in seconds, keeping the duty cycle the same
|
||||
*
|
||||
* Periods smaller than microseconds (the lowest resolution) are set to zero.
|
||||
* @param obj The pwmout object
|
||||
* @param seconds The floating-point seconds period
|
||||
*/
|
||||
void pwmout_period(pwmout_t *obj, float seconds)
|
||||
{
|
||||
uint32_t period;
|
||||
|
@ -279,11 +256,6 @@ void pwmout_period(pwmout_t *obj, float seconds)
|
|||
pwm_start(obj, period, pulse_width);
|
||||
}
|
||||
|
||||
/** Set the PWM period specified in miliseconds, keeping the duty cycle the same
|
||||
*
|
||||
* @param obj The pwmout object
|
||||
* @param ms The milisecond period
|
||||
*/
|
||||
void pwmout_period_ms(pwmout_t *obj, int ms)
|
||||
{
|
||||
uint32_t period;
|
||||
|
@ -299,11 +271,6 @@ void pwmout_period_ms(pwmout_t *obj, int ms)
|
|||
pwm_start(obj, period, pulse_width);
|
||||
}
|
||||
|
||||
/** Set the PWM period specified in microseconds, keeping the duty cycle the same
|
||||
*
|
||||
* @param obj The pwmout object
|
||||
* @param us The microsecond period
|
||||
*/
|
||||
void pwmout_period_us(pwmout_t *obj, int us)
|
||||
{
|
||||
uint32_t pulse_width;
|
||||
|
@ -317,11 +284,6 @@ void pwmout_period_us(pwmout_t *obj, int us)
|
|||
pwm_start(obj, us, pulse_width);
|
||||
}
|
||||
|
||||
/** Set the PWM pulsewidth specified in seconds, keeping the period the same.
|
||||
*
|
||||
* @param obj The pwmout object
|
||||
* @param seconds The floating-point pulsewidth in seconds
|
||||
*/
|
||||
void pwmout_pulsewidth(pwmout_t *obj, float seconds)
|
||||
{
|
||||
uint32_t pulse_width;
|
||||
|
@ -335,11 +297,6 @@ void pwmout_pulsewidth(pwmout_t *obj, float seconds)
|
|||
pwm_start(obj, obj->period, pulse_width);
|
||||
}
|
||||
|
||||
/** Set the PWM pulsewidth specified in miliseconds, keeping the period the same.
|
||||
*
|
||||
* @param obj The pwmout object
|
||||
* @param ms The floating-point pulsewidth in miliseconds
|
||||
*/
|
||||
void pwmout_pulsewidth_ms(pwmout_t *obj, int ms)
|
||||
{
|
||||
uint32_t pulse_width;
|
||||
|
@ -353,11 +310,6 @@ void pwmout_pulsewidth_ms(pwmout_t *obj, int ms)
|
|||
pwm_start(obj, obj->period, pulse_width);
|
||||
}
|
||||
|
||||
/** Set the PWM pulsewidth specified in microseconds, keeping the period the same.
|
||||
*
|
||||
* @param obj The pwmout object
|
||||
* @param us The floating-point pulsewidth in microseconds
|
||||
*/
|
||||
void pwmout_pulsewidth_us(pwmout_t *obj, int us)
|
||||
{
|
||||
MBED_ASSERT(obj);
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/** This file contains declarations of all the functions executed on CM0+ core
|
||||
/* This file contains declarations of all the functions executed on CM0+ core
|
||||
* that need to be callable from CM4 core via internal RPC mechanism.
|
||||
*
|
||||
* Functions are declared using RPC_FUNCTION( _type_, _name_, _args_) macro,
|
||||
|
|
|
@ -18,8 +18,40 @@
|
|||
#ifndef RPC_DEFS_H
|
||||
#define RPC_DEFS_H
|
||||
|
||||
/*
|
||||
* This file defines set of helper macros used in implementation of the RPC
|
||||
* (Remote Procedure Call) mechanism to allow M4 core (caller) to call functions
|
||||
* that will execute on M0 core (callee), mainly used for shared hardware resource
|
||||
* management.
|
||||
* The RPC mechanism is build around PSoC6 IPC messaging interface.
|
||||
* When a function has to be called remotely, its ID as well as arguments
|
||||
* are packed into the message buffer and send out to M0 core.
|
||||
* M0 core receives the message, unpacks arguments from the buffer and calls
|
||||
* the proper function depending on the ID provided in the message. Then it puts
|
||||
* the function result back into the buffer and releases the message back to
|
||||
* M4 core.
|
||||
* Additional assumptions:
|
||||
* - message buffers reside in the M4 core address space,
|
||||
* - M0 core has read/write access at least to the message buffers and to other
|
||||
* data referenced when function arguments are pointers.
|
||||
*
|
||||
* The helper macros are used to automatically generate proper function wrappers for
|
||||
* required APIs.
|
||||
* All remotely callable functions have to be declared in the rpc_api.h header using
|
||||
* a set of macros (see description in the rpc_api.h for details).
|
||||
* Wrapper generation will process in a few phases, controlled by the value of
|
||||
* RPC_GEN macro. Each generation phase is invoked as follows:
|
||||
*
|
||||
* #define RPC_GEN <phase>
|
||||
* #include "rpc_api.h"
|
||||
* #undef RPC_GEN
|
||||
*
|
||||
* Macros declaring RPC APIs in the rpc_api.h will be expanded to various C code, depending
|
||||
* on the generation phase. See description of the generation phases below.
|
||||
*/
|
||||
|
||||
|
||||
/* Macros, that simply return it's n-th argument */
|
||||
#define _GET_10TH_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9, N, ...) N
|
||||
#define _GET_9TH_ARG(_1, _2, _3, _4, _5, _6, _7, _8, N, ...) N
|
||||
#define _GET_8TH_ARG(_1, _2, _3, _4, _5, _6, _7, N, ...) N
|
||||
|
@ -31,15 +63,21 @@
|
|||
#define _GET_2ND_ARG(_1, N, ...) N
|
||||
#define _GET_1ST_ARG(N, ...) N
|
||||
|
||||
// Count how many args are in a variadic macro. We now use GCC/Clang's extension to
|
||||
// handle the case where ... expands to nothing. We must add a placeholder arg before
|
||||
// ##__VA_ARGS__ (its value is totally irrelevant, but it's necessary to preserve
|
||||
// the shifting offset we want). In addition, we must add 0 as a valid value to be in
|
||||
// the N position.
|
||||
/* Count how many args are in a variadic macro. We now use GCC/Clang's extension to
|
||||
* handle the case where ... expands to nothing. We must add a placeholder arg before
|
||||
* ##__VA_ARGS__ (its value is totally irrelevant, but it's necessary to preserve
|
||||
* the shifting offset we want). In addition, we must add 0 as a valid value to be in
|
||||
* the N position.
|
||||
* Good for 0 to 9 arguments.
|
||||
*/
|
||||
#define COUNT_VARARGS(...) _GET_10TH_ARG(__VA_ARGS__, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)
|
||||
|
||||
#define _GET_OVERRIDE(_1, _2, _3, _4, _5, NAME, ...) NAME
|
||||
|
||||
/* Non-variadic macros generating (RPC) function call arguments (on a callee MCU).
|
||||
* Macro arguments are argument types for the function to be called,
|
||||
* actual argument values are taken from RPC message buffer.
|
||||
* Variants for functions using 0 - 5 arguments.
|
||||
*/
|
||||
#define _RPC_CALL_0() ()
|
||||
#define _RPC_CALL_1(_t1) ((_t1)(message->args[0]))
|
||||
#define _RPC_CALL_2(_t1, _t2) ((_t1)(message->args[0]), (_t2)(message->args[1]))
|
||||
|
@ -47,6 +85,11 @@
|
|||
#define _RPC_CALL_4(_t1, _t2, _t3, _t4) ((_t1)(message->args[0]), (_t2)(message->args[1]), (_t3)(message->args[2]), (_t4)(message->args[3]))
|
||||
#define _RPC_CALL_5(_t1, _t2, _t3, _t4, _t5) ((_t1)(message->args[0]), (_t2)(message->args[1]), (_t4)(message->args[3]), (_t5)(message->args[4]), (_t2)(message->args[1]))
|
||||
|
||||
/* Non-variadic macros generating (RPC) function argument declaration (on a caller MCU).
|
||||
* Macro arguments are argument types for the function to be called.
|
||||
* Expands to predefined argument names (arg1, arg2 and so on).
|
||||
* Variants for functions using 0 - 5 arguments.
|
||||
*/
|
||||
#define _RPC_DECL_ARGS_0()
|
||||
#define _RPC_DECL_ARGS_1(_t1) _t1 arg1
|
||||
#define _RPC_DECL_ARGS_2(_t1, _t2) _t1 arg1, _t2 arg2
|
||||
|
@ -54,6 +97,11 @@
|
|||
#define _RPC_DECL_ARGS_4(_t1, _t2, _t3, _t4) _t1 arg1, _t2 arg2, _t3 arg3, _t4 arg4
|
||||
#define _RPC_DECL_ARGS_5(_t1, _t2, _t3, _t4, _t5) _t1 arg1, _t2 arg2, _t3 arg3, _t4 arg4, _t5 arg5
|
||||
|
||||
/* Non-variadic macros generating (RPC) function arguments (on a caller MCU).
|
||||
* Macro arguments are argument types for the function to be called.
|
||||
* Expands to predefined argument names (arg1, arg2 and so on).
|
||||
* Variants for functions using 0 - 5 arguments.
|
||||
*/
|
||||
#define _RPC_ARGS_0()
|
||||
#define _RPC_ARGS_1(_t1) , arg1
|
||||
#define _RPC_ARGS_2(_t1, _t2) , arg1, arg2
|
||||
|
@ -62,14 +110,27 @@
|
|||
#define _RPC_ARGS_5(_t1, _t2, _t3, _t4, _t5) , arg1, arg2, arg3, arg4, arg5
|
||||
|
||||
|
||||
/* Variadic macro generating (RPC) function argument declaration (on a caller MCU).
|
||||
* Macro arguments are argument types for the function to be called;
|
||||
* expands to the non-variadic variant for the proper number of arguments.
|
||||
*/
|
||||
#define RPC_DECL_ARGS(...) \
|
||||
_GET_OVERRIDE(__VA_ARGS__, _RPC_DECL_ARGS_5, _RPC_DECL_ARGS_4, _RPC_DECL_ARGS_3, _RPC_DECL_ARGS_2, _RPC_DECL_ARGS_1, _RPC_DECL_ARGS_0)(__VA_ARGS__)
|
||||
_GET_6TH_ARG(__VA_ARGS__, _RPC_DECL_ARGS_5, _RPC_DECL_ARGS_4, _RPC_DECL_ARGS_3, _RPC_DECL_ARGS_2, _RPC_DECL_ARGS_1, _RPC_DECL_ARGS_0)(__VA_ARGS__)
|
||||
|
||||
|
||||
/* Variadic macro generating (RPC) function arguments (on a caller MCU).
|
||||
* Macro arguments are argument types for the function to be called;
|
||||
* expands to the non-variadic variant for the proper number of arguments.
|
||||
*/
|
||||
#define RPC_LIST_ARGS(...) \
|
||||
_GET_OVERRIDE(__VA_ARGS__, _RPC_ARGS_5, _RPC_ARGS_4, _RPC_ARGS_3, _RPC_ARGS_2, _RPC_ARGS_1, _RPC_ARGS_0)(__VA_ARGS__)
|
||||
_GET_6TH_ARG(__VA_ARGS__, _RPC_ARGS_5, _RPC_ARGS_4, _RPC_ARGS_3, _RPC_ARGS_2, _RPC_ARGS_1, _RPC_ARGS_0)(__VA_ARGS__)
|
||||
|
||||
/* Variadic macro generating (RPC) function call arguments (on a callee MCU).
|
||||
* Macro arguments are argument types for the function to be called;
|
||||
* expands to the non-variadic variant for the proper number of arguments.
|
||||
*/
|
||||
#define RPC_CALL_ARGS(...) \
|
||||
_GET_OVERRIDE(__VA_ARGS__, _RPC_CALL_5, _RPC_CALL_4, _RPC_CALL_3, _RPC_CALL_2, _RPC_CALL_1, _RPC_CALL_0)(__VA_ARGS__)
|
||||
_GET_6TH_ARG(__VA_ARGS__, _RPC_CALL_5, _RPC_CALL_4, _RPC_CALL_3, _RPC_CALL_2, _RPC_CALL_1, _RPC_CALL_0)(__VA_ARGS__)
|
||||
|
||||
|
||||
#define _RPC_VOID(arg)
|
||||
|
@ -80,11 +141,54 @@
|
|||
#define ARGS(...) __VA_ARGS__
|
||||
#define RPC_FUNCTION(...) RPC_FUNCTION_(__VA_ARGS__)
|
||||
|
||||
/*
|
||||
* Wrapper generation phases.
|
||||
* ========================================================================================
|
||||
* Generation of the RPC wrappers consists of a few phases, both on caller and callee MCUs.
|
||||
* Each phase is invoked through re-definition of RPC_GEN macro (holding current phase id)
|
||||
* and then inclusion of the rpc_api.h header, which also includes this file. The phases
|
||||
* (and their applicability) are in sequence:
|
||||
*
|
||||
* RPC_GEN_INTERFACE_IDS (caller, callee)
|
||||
* This will generate a set of variable declarations with names RPC_ID_<api name>,
|
||||
* where <api_name> is a name of the RPCed function. Variables will be initialized
|
||||
* in the next phase with unique integer values to be use in RPC messages to identify
|
||||
* function to be called.
|
||||
*
|
||||
* RPC_GEN_INTERFACE_IDS_INIT (caller, callee)
|
||||
* This will generate initialization code for the ID variables (assigning unique identifiers).
|
||||
* The assumption is that the generation is invoked inside a function containing
|
||||
* a local variable caller rpc_counter and initialized to 0. Example:
|
||||
*
|
||||
* void ipcrpc_init2(void)
|
||||
* {
|
||||
* uint32_t rpc_counter = 0;
|
||||
* #define RPC_GEN RPC_GEN_INTERFACE_IDS_INIT
|
||||
* #include "rpc_api.h"
|
||||
* #undef RPC_GEN
|
||||
* }
|
||||
*
|
||||
* RPC_GEN_INTERFACE (caller only)
|
||||
* This will generate a set of functions with the defined API that will internally call
|
||||
* RPC pipe message sending variadic function ipcrpc_call(...).
|
||||
*
|
||||
* RPC_GEN_IMPLEMENTATION (callee only)
|
||||
* This will generate a set of functions named RPC_<api_name> which internally will decode
|
||||
* an RPC message and will then call appropriate API function.
|
||||
*
|
||||
* RPC_GEN_IMPL_INITIALIZATION (callee only)
|
||||
* This will generate an initialization code on a target(calee) core that will register
|
||||
* interface functions generated in the previous step as RPC message receivers.
|
||||
* This phase has to be invoked within a function with the same assumptions as for
|
||||
* RPC_GEN_INTERFACE_IDS_INIT
|
||||
*/
|
||||
|
||||
#define RPC_GEN_INTERFACE_IDS 1
|
||||
#define RPC_GEN_INTERFACE_IDS_INIT 2
|
||||
#define RPC_GEN_INTERFACE 3
|
||||
#define RPC_GEN_IMPLEMENTATION 4
|
||||
#define RPC_GEN_IMPL_INIT 5
|
||||
#define RPC_GEN_INITIALIZATION 5
|
||||
|
||||
|
||||
#endif // RPC_DEFS_H
|
||||
|
||||
|
@ -92,24 +196,18 @@
|
|||
#define __RPC_DEFS_H_BODY_START__
|
||||
|
||||
#if RPC_GEN == RPC_GEN_INTERFACE_IDS
|
||||
/** Generating interface IDs.
|
||||
* This will generate a set of variable named RPC_ID_<api name> with unique integer IDs.
|
||||
*/
|
||||
/* Generating interface IDs. */
|
||||
#undef RPC_FUNCTION_
|
||||
#define RPC_FUNCTION_(T, _type_, _name_, ...) static uint32_t RPC_ID_##_name_ = 0;
|
||||
|
||||
#elif RPC_GEN == RPC_GEN_INTERFACE_IDS_INIT
|
||||
/** Initialization of interface IDs.
|
||||
* This will generate a set of variable named RPC_ID_<api name> with unique integer IDs.
|
||||
*/
|
||||
/* Initialization of interface IDs. */
|
||||
#undef RPC_FUNCTION_
|
||||
#define RPC_FUNCTION_(T, _type_, _name_, ...)\
|
||||
RPC_ID_##_name_ = rpc_counter++;
|
||||
|
||||
#elif RPC_GEN == RPC_GEN_INTERFACE
|
||||
/** Generating interface functions on caller core.
|
||||
* This will generate a set of functions with the defined API that will internally call RPC pipe.
|
||||
*/
|
||||
/* Generating interface functions on caller core. */
|
||||
#undef RPC_FUNCTION_
|
||||
#define RPC_FUNCTION_(T, _type_, _name_, ... )\
|
||||
_type_ _name_(RPC_DECL_ARGS(__VA_ARGS__)) {\
|
||||
|
@ -117,10 +215,7 @@ _type_ _name_(RPC_DECL_ARGS(__VA_ARGS__)) {\
|
|||
}
|
||||
|
||||
#elif RPC_GEN == RPC_GEN_IMPLEMENTATION
|
||||
/** Generating implementation interface on a target (calee) core.
|
||||
* This will generate a set of functions named RPC_<api_name> which internally will decode
|
||||
* RPC message and will then call appropriate API function.
|
||||
*/
|
||||
/* Generating implementation interface on a target (calee) core. */
|
||||
#undef RPC_FUNCTION_
|
||||
#define RPC_FUNCTION_( T, _type_, _name_, ...)\
|
||||
void RPC_##_name_(uint32_t *msg_ptr) {\
|
||||
|
@ -129,9 +224,7 @@ void RPC_##_name_(uint32_t *msg_ptr) {\
|
|||
}
|
||||
|
||||
#elif RPC_GEN == RPC_GEN_INITIALIZATION
|
||||
/** This will generate an initialization code on target(calee) core that will register
|
||||
* interface functions generated in the previous step as RPC message receivers.
|
||||
*/
|
||||
/* This will generate an initialization code on target(calee) core. */
|
||||
#undef RPC_FUNCTION_
|
||||
#define RPC_FUNCTION_( T, _type_, _name_, ...)\
|
||||
Cy_IPC_Pipe_RegisterCallback(CY_IPC_EP_RPCPIPE_ADDR, RPC_##_name_, rpc_counter++);
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
* and Cypress h/w supports only 2000 - 2099 years range,
|
||||
* two backup registers are used to flag century correction.
|
||||
*/
|
||||
#define BR_LAST_YEAR_READ 14
|
||||
#define BR_CENTURY_CORRECTION 15
|
||||
#define BR_LAST_YEAR_READ 14
|
||||
#define BR_CENTURY_CORRECTION 15
|
||||
|
||||
static int enabled = 0;
|
||||
|
||||
|
@ -56,9 +56,6 @@ static uint32_t rtc_write_convert_year(uint32_t long_year)
|
|||
return short_year;
|
||||
}
|
||||
|
||||
/** Initialize the RTC peripheral
|
||||
*
|
||||
*/
|
||||
void rtc_init(void)
|
||||
{
|
||||
static cy_stc_rtc_config_t init_val = {
|
||||
|
@ -80,12 +77,12 @@ void rtc_init(void)
|
|||
// Verify RTC time consistency.
|
||||
Cy_RTC_GetDateAndTime(&cy_time);
|
||||
if ( CY_RTC_IS_SEC_VALID(cy_time.sec) &&
|
||||
CY_RTC_IS_MIN_VALID(cy_time.min) &&
|
||||
CY_RTC_IS_HOUR_VALID(cy_time.hour) &&
|
||||
CY_RTC_IS_DOW_VALID(cy_time.dayOfWeek) &&
|
||||
CY_RTC_IS_MONTH_VALID(cy_time.month) &&
|
||||
CY_RTC_IS_YEAR_SHORT_VALID(cy_time.year) &&
|
||||
(cy_time.hrFormat == CY_RTC_24_HOURS)) {
|
||||
CY_RTC_IS_MIN_VALID(cy_time.min) &&
|
||||
CY_RTC_IS_HOUR_VALID(cy_time.hour) &&
|
||||
CY_RTC_IS_DOW_VALID(cy_time.dayOfWeek) &&
|
||||
CY_RTC_IS_MONTH_VALID(cy_time.month) &&
|
||||
CY_RTC_IS_YEAR_SHORT_VALID(cy_time.year) &&
|
||||
(cy_time.hrFormat == CY_RTC_24_HOURS)) {
|
||||
enabled = 1;
|
||||
} else {
|
||||
// reinitialize
|
||||
|
@ -97,32 +94,16 @@ void rtc_init(void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/** Deinitialize RTC
|
||||
*
|
||||
* TODO: The function is not used by rtc api in mbed-drivers.
|
||||
*/
|
||||
void rtc_free(void)
|
||||
{
|
||||
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
|
||||
/** Get the RTC enable status
|
||||
*
|
||||
* @retval 0 disabled
|
||||
* @retval 1 enabled
|
||||
*/
|
||||
int rtc_isenabled(void)
|
||||
{
|
||||
return enabled;
|
||||
}
|
||||
|
||||
|
||||
/** Get the current time from the RTC peripheral
|
||||
*
|
||||
* @return The current time
|
||||
*/
|
||||
time_t rtc_read(void)
|
||||
{
|
||||
cy_stc_rtc_config_t cy_time;
|
||||
|
@ -149,10 +130,6 @@ time_t rtc_read(void)
|
|||
return timestamp;
|
||||
}
|
||||
|
||||
/** Set the current time to the RTC peripheral
|
||||
*
|
||||
* @param t The current time to be set
|
||||
*/
|
||||
void rtc_write(time_t t)
|
||||
{
|
||||
cy_en_rtc_status_t status;
|
||||
|
|
|
@ -230,7 +230,7 @@ static int serial_irq_setup_channel(serial_obj_t *obj)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Calculates fractional divider value.
|
||||
*/
|
||||
static uint32_t divider_value(uint32_t frequency, uint32_t frac_bits)
|
||||
|
@ -292,7 +292,7 @@ static cy_en_sysclk_status_t serial_init_clock(serial_obj_t *obj, uint32_t baudr
|
|||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Initializes i/o pins for UART tx/rx.
|
||||
*/
|
||||
static void serial_init_pins(serial_obj_t *obj)
|
||||
|
@ -306,7 +306,7 @@ static void serial_init_pins(serial_obj_t *obj)
|
|||
pin_function(obj->pin_rx, rx_function);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Initializes i/o pins for UART flow control.
|
||||
*/
|
||||
static void serial_init_flow_pins(serial_obj_t *obj)
|
||||
|
@ -329,7 +329,7 @@ static void serial_init_flow_pins(serial_obj_t *obj)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
/*
|
||||
* Initializes and enables UART/SCB.
|
||||
*/
|
||||
static void serial_init_peripheral(serial_obj_t *obj)
|
||||
|
@ -353,23 +353,23 @@ static cy_en_syspm_status_t serial_pm_callback(cy_stc_syspm_callback_params_t *p
|
|||
|
||||
switch (params->mode) {
|
||||
case CY_SYSPM_CHECK_READY:
|
||||
/* If all data elements are transmitted from the TX FIFO and
|
||||
* shifter and the RX FIFO is empty: the UART is ready to enter
|
||||
* Deep Sleep mode.
|
||||
*/
|
||||
if (Cy_SCB_UART_IsTxComplete(obj->base)) {
|
||||
if (0UL == Cy_SCB_UART_GetNumInRxFifo(obj->base)) {
|
||||
/* Disable the UART. The transmitter stops driving the
|
||||
* lines and the receiver stops receiving data until
|
||||
* the UART is enabled.
|
||||
* This happens when the device failed to enter Deep
|
||||
* Sleep or it is awaken from Deep Sleep mode.
|
||||
*/
|
||||
Cy_SCB_UART_Disable(obj->base, NULL);
|
||||
status = CY_SYSPM_SUCCESS;
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* If all data elements are transmitted from the TX FIFO and
|
||||
* shifter and the RX FIFO is empty: the UART is ready to enter
|
||||
* Deep Sleep mode.
|
||||
*/
|
||||
if (Cy_SCB_UART_IsTxComplete(obj->base)) {
|
||||
if (0UL == Cy_SCB_UART_GetNumInRxFifo(obj->base)) {
|
||||
/* Disable the UART. The transmitter stops driving the
|
||||
* lines and the receiver stops receiving data until
|
||||
* the UART is enabled.
|
||||
* This happens when the device failed to enter Deep
|
||||
* Sleep or it is awaken from Deep Sleep mode.
|
||||
*/
|
||||
Cy_SCB_UART_Disable(obj->base, NULL);
|
||||
status = CY_SYSPM_SUCCESS;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case CY_SYSPM_CHECK_FAIL:
|
||||
|
@ -401,8 +401,8 @@ void serial_init(serial_t *obj_in, PinName tx, PinName rx)
|
|||
bool is_stdio = (tx == CY_STDIO_UART_TX) || (rx == CY_STDIO_UART_RX);
|
||||
|
||||
if (is_stdio && stdio_uart_inited) {
|
||||
memcpy(obj_in, &stdio_uart, sizeof(serial_t));
|
||||
return;
|
||||
memcpy(obj_in, &stdio_uart, sizeof(serial_t));
|
||||
return;
|
||||
}
|
||||
{
|
||||
uint32_t uart = pinmap_peripheral(tx, PinMap_UART_TX);
|
||||
|
@ -498,7 +498,6 @@ void serial_format(serial_t *obj_in, int data_bits, SerialParity parity, int sto
|
|||
serial_init_peripheral(obj);
|
||||
}
|
||||
|
||||
|
||||
void serial_putc(serial_t *obj_in, int c)
|
||||
{
|
||||
serial_obj_t *obj = OBJ_P(obj_in);
|
||||
|
@ -529,10 +528,6 @@ int serial_writable(serial_t *obj_in)
|
|||
return Cy_SCB_GetNumInTxFifo(obj->base) != Cy_SCB_GetFifoSize(obj->base);
|
||||
}
|
||||
|
||||
/** Clear the serial peripheral
|
||||
*
|
||||
* @param obj The serial object
|
||||
*/
|
||||
void serial_clear(serial_t *obj_in)
|
||||
{
|
||||
serial_obj_t *obj = OBJ_P(obj_in);
|
||||
|
@ -543,10 +538,6 @@ void serial_clear(serial_t *obj_in)
|
|||
serial_init_peripheral(obj);
|
||||
}
|
||||
|
||||
/** Set the break
|
||||
*
|
||||
* @param obj The serial object
|
||||
*/
|
||||
void serial_break_set(serial_t *obj_in)
|
||||
{
|
||||
serial_obj_t *obj = OBJ_P(obj_in);
|
||||
|
@ -559,10 +550,6 @@ void serial_break_set(serial_t *obj_in)
|
|||
Cy_GPIO_Write(port_tx, CY_PIN(obj->pin_tx), 0);
|
||||
}
|
||||
|
||||
/** Clear the break
|
||||
*
|
||||
* @param obj The serial object
|
||||
*/
|
||||
void serial_break_clear(serial_t *obj_in)
|
||||
{
|
||||
serial_obj_t *obj = OBJ_P(obj_in);
|
||||
|
@ -573,14 +560,6 @@ void serial_break_clear(serial_t *obj_in)
|
|||
Cy_GPIO_Pin_FastInit(port_tx, CY_PIN(obj->pin_tx), CY_GPIO_DM_STRONG_IN_OFF, 0, CY_PIN_HSIOM(tx_function));
|
||||
}
|
||||
|
||||
/** Configure the serial for the flow control. It sets flow control in the hardware
|
||||
* if a serial peripheral supports it, otherwise software emulation is used.
|
||||
*
|
||||
* @param obj The serial object
|
||||
* @param type The type of the flow control. Look at the available FlowControl types.
|
||||
* @param rxflow The TX pin name
|
||||
* @param txflow The RX pin name
|
||||
*/
|
||||
void serial_set_flow_control(serial_t *obj_in, FlowControl type, PinName rxflow, PinName txflow)
|
||||
{
|
||||
serial_obj_t *obj = OBJ_P(obj_in);
|
||||
|
@ -659,19 +638,6 @@ static void serial_finish_rx_asynch(serial_obj_t *obj)
|
|||
obj->rx_pending = false;
|
||||
}
|
||||
|
||||
|
||||
/** Begin asynchronous TX transfer. The used buffer is specified in the serial object,
|
||||
* tx_buff
|
||||
*
|
||||
* @param obj The serial object
|
||||
* @param tx The transmit buffer
|
||||
* @param tx_length The number of bytes to transmit
|
||||
* @param tx_width Deprecated argument
|
||||
* @param handler The serial handler
|
||||
* @param event The logical OR of events to be registered
|
||||
* @param hint A suggestion for how to use DMA with this transfer
|
||||
* @return Returns number of data transfered, otherwise returns 0
|
||||
*/
|
||||
int serial_tx_asynch(serial_t *obj_in, const void *tx, size_t tx_length, uint8_t tx_width, uint32_t handler, uint32_t event, DMAUsage hint)
|
||||
{
|
||||
serial_obj_t *obj = OBJ_P(obj_in);
|
||||
|
@ -711,19 +677,6 @@ int serial_tx_asynch(serial_t *obj_in, const void *tx, size_t tx_length, uint8_t
|
|||
return tx_length;
|
||||
}
|
||||
|
||||
/** Begin asynchronous RX transfer (enable interrupt for data collecting)
|
||||
* The used buffer is specified in the serial object - rx_buff
|
||||
*
|
||||
* @param obj The serial object
|
||||
* @param rx The receive buffer
|
||||
* @param rx_length The number of bytes to receive
|
||||
* @param rx_width Deprecated argument
|
||||
* @param handler The serial handler
|
||||
* @param event The logical OR of events to be registered
|
||||
* @param handler The serial handler
|
||||
* @param char_match A character in range 0-254 to be matched
|
||||
* @param hint A suggestion for how to use DMA with this transfer
|
||||
*/
|
||||
void serial_rx_asynch(serial_t *obj_in, void *rx, size_t rx_length, uint8_t rx_width, uint32_t handler, uint32_t event, uint8_t char_match, DMAUsage hint)
|
||||
{
|
||||
serial_obj_t *obj = OBJ_P(obj_in);
|
||||
|
@ -750,31 +703,16 @@ void serial_rx_asynch(serial_t *obj_in, void *rx, size_t rx_length, uint8_t rx_w
|
|||
Cy_SCB_SetRxInterruptMask(obj->base, CY_SCB_UART_RX_INTR_MASK & ~CY_SCB_RX_INTR_UART_BREAK_DETECT);
|
||||
}
|
||||
|
||||
/** Attempts to determine if the serial peripheral is already in use for TX
|
||||
*
|
||||
* @param obj The serial object
|
||||
* @return Non-zero if the RX transaction is ongoing, 0 otherwise
|
||||
*/
|
||||
uint8_t serial_tx_active(serial_t *obj)
|
||||
{
|
||||
return obj->serial.tx_pending;
|
||||
}
|
||||
|
||||
/** Attempts to determine if the serial peripheral is already in use for RX
|
||||
*
|
||||
* @param obj The serial object
|
||||
* @return Non-zero if the RX transaction is ongoing, 0 otherwise
|
||||
*/
|
||||
uint8_t serial_rx_active(serial_t *obj)
|
||||
{
|
||||
return obj->serial.rx_pending;
|
||||
}
|
||||
|
||||
/** The asynchronous TX and RX handler.
|
||||
*
|
||||
* @param obj The serial object
|
||||
* @return Returns event flags if an RX transfer termination condition was met; otherwise returns 0
|
||||
*/
|
||||
int serial_irq_handler_asynch(serial_t *obj_in)
|
||||
{
|
||||
uint32_t cur_events = 0;
|
||||
|
@ -793,7 +731,7 @@ int serial_irq_handler_asynch(serial_t *obj_in)
|
|||
uint8_t *ptr = obj_in->tx_buff.buffer;
|
||||
ptr += obj_in->tx_buff.pos;
|
||||
while ((obj_in->tx_buff.pos < obj_in->tx_buff.length) &&
|
||||
Cy_SCB_UART_Put(obj->base, *ptr)) {
|
||||
Cy_SCB_UART_Put(obj->base, *ptr)) {
|
||||
++ptr;
|
||||
++(obj_in->tx_buff.pos);
|
||||
}
|
||||
|
@ -861,11 +799,6 @@ int serial_irq_handler_asynch(serial_t *obj_in)
|
|||
return cur_events;
|
||||
}
|
||||
|
||||
/** Abort the ongoing TX transaction. It disables the enabled interrupt for TX and
|
||||
* flushes the TX hardware buffer if TX FIFO is used
|
||||
*
|
||||
* @param obj The serial object
|
||||
*/
|
||||
void serial_tx_abort_asynch(serial_t *obj_in)
|
||||
{
|
||||
serial_obj_t *obj = OBJ_P(obj_in);
|
||||
|
@ -874,11 +807,6 @@ void serial_tx_abort_asynch(serial_t *obj_in)
|
|||
Cy_SCB_UART_ClearTxFifo(obj->base);
|
||||
}
|
||||
|
||||
/** Abort the ongoing RX transaction. It disables the enabled interrupt for RX and
|
||||
* flushes the RX hardware buffer if RX FIFO is used
|
||||
*
|
||||
* @param obj The serial object
|
||||
*/
|
||||
void serial_rx_abort_asynch(serial_t *obj_in)
|
||||
{
|
||||
serial_obj_t *obj = OBJ_P(obj_in);
|
||||
|
|
|
@ -21,42 +21,15 @@
|
|||
|
||||
#ifdef DEVICE_SLEEP
|
||||
|
||||
/** Send the microcontroller to sleep
|
||||
*
|
||||
* The processor is setup ready for sleep, and sent to sleep using __WFI(). In this mode, the
|
||||
* system clock to the core is stopped until a reset or an interrupt occurs. This eliminates
|
||||
* dynamic power used by the processor, memory systems and buses. The processor, peripheral and
|
||||
* memory state are maintained, and the peripherals continue to work and can generate interrupts.
|
||||
*
|
||||
* The processor can be woken up by any internal peripheral interrupt or external pin interrupt.
|
||||
*
|
||||
* @note
|
||||
* The mbed interface semihosting is disconnected as part of going to sleep, and can not be restored.
|
||||
* Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be
|
||||
* able to access the LocalFileSystem
|
||||
*/
|
||||
void hal_sleep(void)
|
||||
{
|
||||
Cy_SysPm_Sleep(CY_SYSPM_WAIT_FOR_INTERRUPT);
|
||||
}
|
||||
|
||||
/** Send the microcontroller to deep sleep
|
||||
*
|
||||
* This processor is setup ready for deep sleep, and sent to sleep using __WFI(). This mode
|
||||
* has the same sleep features as sleep plus it powers down peripherals and clocks. All state
|
||||
* is still maintained.
|
||||
*
|
||||
* The processor can only be woken up by an external interrupt on a pin or a watchdog timer.
|
||||
*
|
||||
* @note
|
||||
* The mbed interface semihosting is disconnected as part of going to sleep, and can not be restored.
|
||||
* Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be
|
||||
* able to access the LocalFileSystem
|
||||
*/
|
||||
void hal_deepsleep(void)
|
||||
{
|
||||
#if DEVICE_LPTICKER
|
||||
if(CY_SYSPM_SUCCESS == Cy_SysPm_DeepSleep(CY_SYSPM_WAIT_FOR_INTERRUPT)) {
|
||||
if(CY_SYSPM_SUCCESS == Cy_SysPm_DeepSleep(CY_SYSPM_WAIT_FOR_INTERRUPT)) {
|
||||
// Have to make sure PLL clock is restored before continuing.
|
||||
// FLL clock is not used in basic configuration.
|
||||
while(!Cy_SysClk_PllLocked(1)) {
|
||||
|
|
|
@ -131,7 +131,8 @@ static int allocate_divider(spi_obj_t *obj)
|
|||
}
|
||||
|
||||
|
||||
/** Initializes spi clock for the required speed
|
||||
/*
|
||||
* Initializes spi clock for the required speed
|
||||
*/
|
||||
static cy_en_sysclk_status_t spi_init_clock(spi_obj_t *obj, uint32_t frequency)
|
||||
{
|
||||
|
@ -164,15 +165,15 @@ static cy_en_sysclk_status_t spi_init_clock(spi_obj_t *obj, uint32_t frequency)
|
|||
return CY_SYSCLK_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Initializes i/o pins for spi.
|
||||
*/
|
||||
static void spi_init_pins(spi_obj_t *obj)
|
||||
{
|
||||
if (cy_reserve_io_pin(obj->pin_sclk) ||
|
||||
cy_reserve_io_pin(obj->pin_mosi) ||
|
||||
cy_reserve_io_pin(obj->pin_miso) ||
|
||||
cy_reserve_io_pin(obj->pin_ssel)) {
|
||||
cy_reserve_io_pin(obj->pin_mosi) ||
|
||||
cy_reserve_io_pin(obj->pin_miso) ||
|
||||
cy_reserve_io_pin(obj->pin_ssel)) {
|
||||
error("SPI pin reservation conflict.");
|
||||
}
|
||||
pin_function(obj->pin_sclk, pinmap_function(obj->pin_sclk, PinMap_SPI_SCLK));
|
||||
|
@ -188,7 +189,7 @@ static void spi_init_pins(spi_obj_t *obj)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Initializes and enables SPI/SCB.
|
||||
*/
|
||||
static void spi_init_peripheral(spi_obj_t *obj)
|
||||
|
@ -203,7 +204,7 @@ static void spi_init_peripheral(spi_obj_t *obj)
|
|||
}
|
||||
|
||||
|
||||
/** Callback function to handle into and out of deep sleep state transitions.
|
||||
/* Callback function to handle into and out of deep sleep state transitions.
|
||||
*
|
||||
*/
|
||||
#if DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
|
||||
|
@ -218,15 +219,6 @@ static cy_en_syspm_status_t spi_pm_callback(cy_stc_syspm_callback_params_t *call
|
|||
#endif // DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
|
||||
|
||||
|
||||
/** Initialize the SPI peripheral. It sets the default parameters for SPI
|
||||
* peripheral, and configures its specified pins.
|
||||
*
|
||||
* @param obj The SPI object
|
||||
* @param mosi The mosi pin
|
||||
* @param miso The miso pin
|
||||
* @param sclk The sclk pin
|
||||
* @param ssel The ssel pin
|
||||
*/
|
||||
void spi_init(spi_t *obj_in, PinName mosi, PinName miso, PinName sclk, PinName ssel)
|
||||
{
|
||||
spi_obj_t *obj = OBJ_P(obj_in);
|
||||
|
@ -273,30 +265,21 @@ void spi_init(spi_t *obj_in, PinName mosi, PinName miso, PinName sclk, PinName s
|
|||
spi_init_pins(obj);
|
||||
spi_init_peripheral(obj);
|
||||
#if DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
|
||||
obj->pm_callback_handler.callback = spi_pm_callback;
|
||||
obj->pm_callback_handler.type = CY_SYSPM_DEEPSLEEP;
|
||||
obj->pm_callback_handler.skipMode = 0;
|
||||
obj->pm_callback_handler.callbackParams = &obj->pm_callback_params;
|
||||
obj->pm_callback_params.base = obj->base;
|
||||
obj->pm_callback_params.context = obj;
|
||||
if (!Cy_SysPm_RegisterCallback(&obj->pm_callback_handler)) {
|
||||
error("PM callback registration failed!");
|
||||
}
|
||||
obj->pm_callback_handler.callback = spi_pm_callback;
|
||||
obj->pm_callback_handler.type = CY_SYSPM_DEEPSLEEP;
|
||||
obj->pm_callback_handler.skipMode = 0;
|
||||
obj->pm_callback_handler.callbackParams = &obj->pm_callback_params;
|
||||
obj->pm_callback_params.base = obj->base;
|
||||
obj->pm_callback_params.context = obj;
|
||||
if (!Cy_SysPm_RegisterCallback(&obj->pm_callback_handler)) {
|
||||
error("PM callback registration failed!");
|
||||
}
|
||||
#endif // DEVICE_SLEEP && DEVICE_LOWPOWERTIMER
|
||||
} else {
|
||||
error("Serial pinout mismatch. Requested pins Rx and Tx can't be used for the same Serial communication.");
|
||||
}
|
||||
}
|
||||
|
||||
/** Configure the SPI format
|
||||
*
|
||||
* Set the number of bits per frame, configure clock polarity and phase, shift order and master/slave mode.
|
||||
* The default bit order is MSB.
|
||||
* @param[in,out] obj The SPI object to configure
|
||||
* @param[in] bits The number of bits per frame
|
||||
* @param[in] mode The SPI mode (clock polarity, phase, and shift direction)
|
||||
* @param[in] slave Zero for master mode or non-zero for slave mode
|
||||
*/
|
||||
void spi_format(spi_t *obj_in, int bits, int mode, int slave)
|
||||
{
|
||||
spi_obj_t *obj = OBJ_P(obj_in);
|
||||
|
@ -312,11 +295,6 @@ void spi_format(spi_t *obj_in, int bits, int mode, int slave)
|
|||
spi_init_peripheral(obj);
|
||||
}
|
||||
|
||||
/** Configure the SPI frequency
|
||||
*
|
||||
* @param obj The SPI object
|
||||
* @param hz Frequency in Hz
|
||||
*/
|
||||
void spi_frequency(spi_t *obj_in, int hz)
|
||||
{
|
||||
spi_obj_t *obj = OBJ_P(obj_in);
|
||||
|
@ -325,14 +303,6 @@ void spi_frequency(spi_t *obj_in, int hz)
|
|||
Cy_SCB_SPI_Enable(obj->base);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** Write a byte out in master mode and receive a value
|
||||
*
|
||||
* @param[in] obj The SPI peripheral to use for sending
|
||||
* @param[in] value The value to send
|
||||
* @return Returns the value received during send
|
||||
*/
|
||||
int spi_master_write(spi_t *obj_in, int value)
|
||||
{
|
||||
spi_obj_t *obj = OBJ_P(obj_in);
|
||||
|
@ -351,22 +321,6 @@ int spi_master_write(spi_t *obj_in, int value)
|
|||
}
|
||||
}
|
||||
|
||||
/** Write a block out in master mode and receive a value
|
||||
*
|
||||
* The total number of bytes sent and recieved will be the maximum of
|
||||
* tx_length and rx_length. The bytes written will be padded with the
|
||||
* value 0xff.
|
||||
*
|
||||
* @param[in] obj The SPI peripheral to use for sending
|
||||
* @param[in] tx_buffer Pointer to the byte-array of data to write to the device
|
||||
* @param[in] tx_length Number of bytes to write, may be zero
|
||||
* @param[in] rx_buffer Pointer to the byte-array of data to read from the device
|
||||
* @param[in] rx_length Number of bytes to read, may be zero
|
||||
* @param[in] write_fill Default data transmitted while performing a read
|
||||
* @returns
|
||||
* The number of bytes written and read from the device. This is
|
||||
* maximum of tx_length and rx_length.
|
||||
*/
|
||||
int spi_master_block_write(spi_t *obj_in, const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length, char write_fill)
|
||||
{
|
||||
spi_obj_t *obj = OBJ_P(obj_in);
|
||||
|
@ -422,12 +376,8 @@ int spi_master_block_write(spi_t *obj_in, const char *tx_buffer, int tx_length,
|
|||
return trans_length;
|
||||
}
|
||||
|
||||
/** Check if a value is available to read
|
||||
*
|
||||
* @param[in] obj The SPI peripheral to check
|
||||
* @return non-zero if a value is available
|
||||
*/
|
||||
int spi_slave_receive(spi_t *obj_in) {
|
||||
int spi_slave_receive(spi_t *obj_in)
|
||||
{
|
||||
spi_obj_t *obj = OBJ_P(obj_in);
|
||||
if (obj->ms_mode == CY_SCB_SPI_SLAVE) {
|
||||
return Cy_SCB_SPI_GetNumInRxFifo(obj->base);
|
||||
|
@ -436,12 +386,6 @@ int spi_slave_receive(spi_t *obj_in) {
|
|||
}
|
||||
}
|
||||
|
||||
/** Get a received value out of the SPI receive buffer in slave mode
|
||||
*
|
||||
* Blocks until a value is available
|
||||
* @param[in] obj The SPI peripheral to read
|
||||
* @return The value received
|
||||
*/
|
||||
int spi_slave_read(spi_t *obj_in)
|
||||
{
|
||||
spi_obj_t *obj = OBJ_P(obj_in);
|
||||
|
@ -456,12 +400,6 @@ int spi_slave_read(spi_t *obj_in)
|
|||
}
|
||||
}
|
||||
|
||||
/** Write a value to the SPI peripheral in slave mode
|
||||
*
|
||||
* Blocks until the SPI peripheral can be written to
|
||||
* @param[in] obj The SPI peripheral to write
|
||||
* @param[in] value The value to write
|
||||
*/
|
||||
void spi_slave_write(spi_t *obj_in, int value)
|
||||
{
|
||||
spi_obj_t *obj = OBJ_P(obj_in);
|
||||
|
@ -474,44 +412,18 @@ void spi_slave_write(spi_t *obj_in, int value)
|
|||
}
|
||||
}
|
||||
|
||||
/** Checks if the specified SPI peripheral is in use
|
||||
*
|
||||
* @param[in] obj The SPI peripheral to check
|
||||
* @return non-zero if the peripheral is currently transmitting
|
||||
*/
|
||||
int spi_busy(spi_t *obj) {
|
||||
int spi_busy(spi_t *obj)
|
||||
{
|
||||
return !Cy_SCB_SPI_IsTxComplete(OBJ_P(obj)->base);
|
||||
}
|
||||
|
||||
/** Get the module number
|
||||
*
|
||||
* @param[in] obj The SPI peripheral to check
|
||||
* @return The module number
|
||||
*/
|
||||
uint8_t spi_get_module(spi_t *obj_in) {
|
||||
uint8_t spi_get_module(spi_t *obj_in)
|
||||
{
|
||||
return (uint8_t) OBJ_P(obj_in)->spi_id;
|
||||
}
|
||||
|
||||
|
||||
#if DEVICE_SPI_ASYNCH
|
||||
|
||||
/**
|
||||
* \defgroup hal_AsynchSPI Asynchronous SPI Hardware Abstraction Layer
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** Begin the SPI transfer. Buffer pointers and lengths are specified in tx_buff and rx_buff
|
||||
*
|
||||
* @param[in] obj The SPI object that holds the transfer information
|
||||
* @param[in] tx The transmit buffer
|
||||
* @param[in] tx_length The number of bytes to transmit
|
||||
* @param[in] rx The receive buffer
|
||||
* @param[in] rx_length The number of bytes to receive
|
||||
* @param[in] bit_width The bit width of buffer words
|
||||
* @param[in] event The logical OR of events to be registered
|
||||
* @param[in] handler SPI interrupt handler
|
||||
* @param[in] hint A suggestion for how to use DMA with this transfer
|
||||
*/
|
||||
void spi_master_transfer(spi_t *obj_in,
|
||||
const void *tx,
|
||||
size_t tx_length,
|
||||
|
@ -548,8 +460,8 @@ void spi_master_transfer(spi_t *obj_in,
|
|||
obj->pending = PENDING_TX_RX;
|
||||
obj->rx_buffer = NULL;
|
||||
obj->tx_buffer = (bit_width == 8)?
|
||||
(void*)(((uint8_t*)tx) + rx_length) :
|
||||
(void*)(((uint16_t*)tx) + rx_length);
|
||||
(void*)(((uint8_t*)tx) + rx_length) :
|
||||
(void*)(((uint16_t*)tx) + rx_length);
|
||||
obj->tx_buffer_size = tx_length - rx_length;
|
||||
Cy_SCB_SPI_Transfer(obj->base, (void*)tx, rx, rx_length, &obj->context);
|
||||
} else {
|
||||
|
@ -564,8 +476,8 @@ void spi_master_transfer(spi_t *obj_in,
|
|||
// I) write + read, II) read only
|
||||
obj->pending = PENDING_TX_RX;
|
||||
obj->rx_buffer = (bit_width == 8)?
|
||||
(void*)(((uint8_t*)rx) + tx_length) :
|
||||
(void*)(((uint16_t*)rx) + tx_length);
|
||||
(void*)(((uint8_t*)rx) + tx_length) :
|
||||
(void*)(((uint16_t*)rx) + tx_length);
|
||||
obj->rx_buffer_size = rx_length - tx_length;
|
||||
obj->tx_buffer = NULL;
|
||||
Cy_SCB_SPI_Transfer(obj->base, (void*)tx, rx, tx_length, &obj->context);
|
||||
|
@ -579,24 +491,19 @@ void spi_master_transfer(spi_t *obj_in,
|
|||
} else {
|
||||
// Rx and Tx of the same size
|
||||
// I) write + read.
|
||||
obj->pending = PENDING_TX_RX;
|
||||
obj->rx_buffer = NULL;
|
||||
obj->tx_buffer = NULL;
|
||||
Cy_SCB_SPI_Transfer(obj->base, (void*)tx, rx, tx_length, &obj->context);
|
||||
obj->pending = PENDING_TX_RX;
|
||||
obj->rx_buffer = NULL;
|
||||
obj->tx_buffer = NULL;
|
||||
Cy_SCB_SPI_Transfer(obj->base, (void*)tx, rx, tx_length, &obj->context);
|
||||
}
|
||||
}
|
||||
|
||||
/** The asynchronous IRQ handler
|
||||
*
|
||||
* @param obj The SPI object which holds the transfer information
|
||||
* @return Event flags if a transfer termination condition was met, otherwise return 0.
|
||||
*/
|
||||
uint32_t spi_irq_handler_asynch(spi_t *obj_in)
|
||||
{
|
||||
spi_obj_t *obj = OBJ_P(obj_in);
|
||||
uint32_t event = 0;
|
||||
void *buf;
|
||||
// Process actual interrupt.
|
||||
// Process actual interrupt.
|
||||
Cy_SCB_SPI_Interrupt(obj->base, &obj->context);
|
||||
if (obj->context.status & CY_SCB_SPI_TRANSFER_OVERFLOW) {
|
||||
event = SPI_EVENT_RX_OVERFLOW;
|
||||
|
@ -623,22 +530,12 @@ uint32_t spi_irq_handler_asynch(spi_t *obj_in)
|
|||
return event & obj->events;
|
||||
}
|
||||
|
||||
/** Attempts to determine if the SPI peripheral is already in use
|
||||
*
|
||||
* @param obj The SPI object
|
||||
* @return Non-zero if the SPI module is active or zero if it is not
|
||||
*/
|
||||
uint8_t spi_active(spi_t *obj_in)
|
||||
{
|
||||
spi_obj_t *obj = OBJ_P(obj_in);
|
||||
return (obj->pending != PENDING_NONE);
|
||||
}
|
||||
|
||||
/** Abort asynchronous transfer
|
||||
*
|
||||
* This function does not perform any check - that should happen in upper layers.
|
||||
* @param obj The SPI object
|
||||
*/
|
||||
void spi_abort_asynch(spi_t *obj_in)
|
||||
{
|
||||
spi_obj_t *obj = OBJ_P(obj_in);
|
||||
|
|
|
@ -35,8 +35,7 @@
|
|||
static uint32_t trng_initialized = 0;
|
||||
|
||||
/** The Crypto configuration structure. */
|
||||
static const cy_stc_crypto_config_t crypto_config =
|
||||
{
|
||||
static const cy_stc_crypto_config_t crypto_config = {
|
||||
/* .ipcChannel */ CY_IPC_CHAN_CRYPTO,
|
||||
/* .acquireNotifierChannel */ CY_CRYPTO_IPC_INTR_NOTIFY_NUM,
|
||||
/* .releaseNotifierChannel */ CY_CRYPTO_IPC_INTR_RELEASE_NUM,
|
||||
|
@ -84,10 +83,6 @@ static cy_stc_crypto_server_context_t crypto_server_context;
|
|||
static cy_stc_crypto_context_t crypto_scratch;
|
||||
static cy_stc_crypto_context_trng_t trng_context;
|
||||
|
||||
/** Initialize the TRNG peripheral
|
||||
*
|
||||
* @param obj The TRNG object
|
||||
*/
|
||||
void trng_init(trng_t *obj)
|
||||
{
|
||||
(void) obj;
|
||||
|
@ -112,10 +107,6 @@ void trng_init(trng_t *obj)
|
|||
|
||||
}
|
||||
|
||||
/** Deinitialize the TRNG peripheral
|
||||
*
|
||||
* @param obj The TRNG object
|
||||
*/
|
||||
void trng_free(trng_t *obj)
|
||||
{
|
||||
(void) obj;
|
||||
|
@ -130,15 +121,6 @@ void trng_free(trng_t *obj)
|
|||
trng_initialized = 0;
|
||||
}
|
||||
|
||||
|
||||
/** Get random data from TRNG peripheral
|
||||
*
|
||||
* @param obj The TRNG object
|
||||
* @param output The pointer to an output array
|
||||
* @param length The size of output data, to avoid buffer overwrite
|
||||
* @param output_length The length of generated data
|
||||
* @return 0 success, -1 fail
|
||||
*/
|
||||
int trng_get_bytes(trng_t *obj, uint8_t *output, size_t length, size_t *output_length)
|
||||
{
|
||||
uint8_t random_val[4];
|
||||
|
|
|
@ -37,19 +37,21 @@
|
|||
|
||||
#if defined(TARGET_MCU_PSOC6_M0)
|
||||
|
||||
#define TICKER_COUNTER_UNIT TCPWM0
|
||||
#define TICKER_COUNTER_NUM 0
|
||||
#define TICKER_COUNTER_INTERRUPT_SOURCE tcpwm_0_interrupts_0_IRQn
|
||||
#define TICKER_COUNTER_NVIC_IRQN CY_M0_CORE_IRQ_CHANNEL_US_TICKER
|
||||
#define TICKER_COUNTER_INTERRUPT_PRIORITY 3
|
||||
#define TICKER_COUNTER_UNIT TCPWM0
|
||||
#define TICKER_COUNTER_NUM 0
|
||||
#define TICKER_COUNTER_INTERRUPT_SOURCE tcpwm_0_interrupts_0_IRQn
|
||||
#define TICKER_COUNTER_NVIC_IRQN CY_M0_CORE_IRQ_CHANNEL_US_TICKER
|
||||
#define TICKER_COUNTER_INTERRUPT_PRIORITY 3
|
||||
#define TICKER_CLOCK_DIVIDER_NUM 0
|
||||
|
||||
#elif defined(TARGET_MCU_PSOC6_M4)
|
||||
|
||||
#define TICKER_COUNTER_UNIT TCPWM0
|
||||
#define TICKER_COUNTER_NUM 1
|
||||
#define TICKER_COUNTER_INTERRUPT_SOURCE tcpwm_0_interrupts_1_IRQn
|
||||
#define TICKER_COUNTER_NVIC_IRQN TICKER_COUNTER_INTERRUPT_SOURCE
|
||||
#define TICKER_COUNTER_INTERRUPT_PRIORITY 6
|
||||
#define TICKER_COUNTER_UNIT TCPWM0
|
||||
#define TICKER_COUNTER_NUM 1
|
||||
#define TICKER_COUNTER_INTERRUPT_SOURCE tcpwm_0_interrupts_1_IRQn
|
||||
#define TICKER_COUNTER_NVIC_IRQN TICKER_COUNTER_INTERRUPT_SOURCE
|
||||
#define TICKER_COUNTER_INTERRUPT_PRIORITY 6
|
||||
#define TICKER_CLOCK_DIVIDER_NUM 1
|
||||
|
||||
#else
|
||||
#error "Unknown MCU type."
|
||||
|
@ -70,7 +72,6 @@ static const cy_stc_sysint_t us_ticker_sysint_cfg = {
|
|||
};
|
||||
|
||||
static int us_ticker_inited = 0;
|
||||
static uint32_t us_ticker_divider_num = CY_INVALID_DIVIDER;
|
||||
|
||||
static const cy_stc_tcpwm_counter_config_t cy_counter_config = {
|
||||
.period = 0xFFFFFFFFUL,
|
||||
|
@ -99,8 +100,8 @@ static cy_stc_syspm_callback_t ticker_pm_callback_handler = {
|
|||
};
|
||||
|
||||
|
||||
/** Callback handler to restart the timer after deep sleep.
|
||||
*
|
||||
/*
|
||||
* Callback handler to restart the timer after deep sleep.
|
||||
*/
|
||||
static cy_en_syspm_status_t ticker_pm_callback(cy_stc_syspm_callback_params_t *params)
|
||||
{
|
||||
|
@ -111,8 +112,8 @@ static cy_en_syspm_status_t ticker_pm_callback(cy_stc_syspm_callback_params_t *p
|
|||
return CY_SYSPM_SUCCESS;
|
||||
}
|
||||
|
||||
/** Interrupt handler.
|
||||
*
|
||||
/*
|
||||
* Interrupt handler.
|
||||
*/
|
||||
static void local_irq_handler(void)
|
||||
{
|
||||
|
@ -132,16 +133,10 @@ void us_ticker_init(void)
|
|||
|
||||
us_ticker_inited = 1;
|
||||
|
||||
/*
|
||||
* Configure the clock
|
||||
*/
|
||||
us_ticker_divider_num = cy_clk_allocate_divider(CY_SYSCLK_DIV_8_BIT);
|
||||
|
||||
// us_ticker 1 MHz from PCLK 50 MHz
|
||||
|
||||
Cy_SysClk_PeriphAssignDivider(PCLK_TCPWM0_CLOCKS0 + TICKER_COUNTER_NUM, CY_SYSCLK_DIV_8_BIT, us_ticker_divider_num);
|
||||
Cy_SysClk_PeriphSetDivider(CY_SYSCLK_DIV_8_BIT, us_ticker_divider_num, (CY_CLK_PERICLK_FREQ_HZ / 1000000UL) - 1);
|
||||
Cy_SysClk_PeriphEnableDivider(CY_SYSCLK_DIV_8_BIT, us_ticker_divider_num);
|
||||
// Configure the clock, us_ticker 1 MHz from PCLK 50 MHz
|
||||
Cy_SysClk_PeriphAssignDivider(PCLK_TCPWM0_CLOCKS0 + TICKER_COUNTER_NUM, CY_SYSCLK_DIV_8_BIT, TICKER_CLOCK_DIVIDER_NUM);
|
||||
Cy_SysClk_PeriphSetDivider(CY_SYSCLK_DIV_8_BIT, TICKER_CLOCK_DIVIDER_NUM, (CY_CLK_PERICLK_FREQ_HZ / 1000000UL) - 1);
|
||||
Cy_SysClk_PeriphEnableDivider(CY_SYSCLK_DIV_8_BIT, TICKER_CLOCK_DIVIDER_NUM);
|
||||
|
||||
/*
|
||||
Configure the counter
|
||||
|
@ -168,8 +163,6 @@ void us_ticker_free(void)
|
|||
us_ticker_disable_interrupt();
|
||||
Cy_TCPWM_Counter_Disable(TICKER_COUNTER_UNIT, TICKER_COUNTER_NUM);
|
||||
Cy_SysPm_UnregisterCallback(&ticker_pm_callback_handler);
|
||||
cy_clk_free_divider(CY_SYSCLK_DIV_8_BIT, us_ticker_divider_num);
|
||||
us_ticker_divider_num = CY_INVALID_DIVIDER;
|
||||
#if defined (TARGET_MCU_PSOC6_M0)
|
||||
cy_m0_nvic_release_channel(TICKER_COUNTER_NVIC_IRQN, CY_US_TICKER_IRQN_ID);
|
||||
#endif //
|
||||
|
|
|
@ -24,8 +24,6 @@ from os import makedirs, walk
|
|||
import copy
|
||||
from shutil import rmtree, copyfile
|
||||
import zipfile
|
||||
import inspect
|
||||
from inspect import getmro
|
||||
|
||||
from ..resources import Resources, FileType, FileRef
|
||||
from ..config import ALLOWED_FEATURES
|
||||
|
@ -131,62 +129,6 @@ def mcu_ide_matrix(verbose_html=False):
|
|||
return result
|
||||
|
||||
|
||||
def get_target_exporter(target, toolchain):
|
||||
"""Locate target-specyfic exporter function.
|
||||
Positional Arguments:
|
||||
target - the target object for inspection
|
||||
toolchain - the toolchain object for inspection
|
||||
"""
|
||||
# If there's no hook, simply return
|
||||
target_obj = toolchain.config.target
|
||||
try:
|
||||
hook_data = target_obj.post_binary_hook
|
||||
except AttributeError:
|
||||
return None
|
||||
# A hook was found. The hook's name is in the format
|
||||
# "classname.functionname"
|
||||
temp = hook_data["export_function"].split(".")
|
||||
if len(temp) != 2:
|
||||
raise HookError(
|
||||
("Invalid format for hook '%s' in target '%s'"
|
||||
% (hook_data["export_function"], target_obj.name)) +
|
||||
" (must be 'class_name.function_name')")
|
||||
class_name, function_name = temp
|
||||
# "class_name" must refer to a class in tools/targets module, so check if the
|
||||
# class exists
|
||||
from .. import targets
|
||||
from targets import HookError
|
||||
mdata = dict([(m[0], m[1]) for m in
|
||||
inspect.getmembers(sys.modules[targets.__name__])])
|
||||
|
||||
if class_name not in mdata or \
|
||||
not inspect.isclass(mdata[class_name]):
|
||||
print (mdata)
|
||||
raise HookError(
|
||||
("Class '%s' required by '%s' in target '%s'"
|
||||
% (class_name, hook_data["export_function"], target_obj.name)) +
|
||||
" not found in targets.py")
|
||||
# "function_name" must refer to a static function inside class
|
||||
# "class_name"
|
||||
cls = mdata[class_name]
|
||||
if (not hasattr(cls, function_name)) or \
|
||||
(not inspect.isfunction(getattr(cls, function_name))):
|
||||
raise HookError(
|
||||
("Static function '%s' " % function_name) +
|
||||
("required by '%s' " % hook_data["export_function"]) +
|
||||
("in target '%s' " % target_obj.name) +
|
||||
("not found in class '%s'" % class_name))
|
||||
# Check if the hook specification also has toolchain restrictions
|
||||
toolchain_restrictions = set(hook_data.get("toolchains", []))
|
||||
toolchain_labels = set(c.__name__ for c in getmro(toolchain.__class__))
|
||||
if toolchain_restrictions and \
|
||||
not toolchain_labels.intersection(toolchain_restrictions):
|
||||
return None
|
||||
# Finally, get the requested function
|
||||
print("Found function '%s' in class '%s'."% (function_name, class_name))
|
||||
return getattr(cls, function_name)
|
||||
|
||||
|
||||
def get_exporter_toolchain(ide):
|
||||
""" Return the exporter class and the toolchain string as a tuple
|
||||
|
||||
|
@ -216,9 +158,6 @@ def generate_project_files(resources, export_path, target, name, toolchain, ide,
|
|||
exporter_cls, _ = get_exporter_toolchain(ide)
|
||||
exporter = exporter_cls(target, export_path, name, toolchain,
|
||||
extra_symbols=macros, resources=resources)
|
||||
# Locate target-specyfic exporter if specified.
|
||||
exporter.TARGET_EXPORTER = get_target_exporter(target, toolchain)
|
||||
|
||||
exporter.generate()
|
||||
files = exporter.generated_files
|
||||
return files, exporter
|
||||
|
|
|
@ -53,7 +53,7 @@ class Exporter(object):
|
|||
TARGETS = set()
|
||||
TOOLCHAIN = None
|
||||
CLEAN_FILES = ("GettingStarted.html",)
|
||||
TARGET_EXPORTER = None
|
||||
|
||||
|
||||
def __init__(self, target, export_dir, project_name, toolchain,
|
||||
extra_symbols=None, resources=None):
|
||||
|
|
|
@ -146,12 +146,6 @@ class Makefile(Exporter):
|
|||
new_asm_flags.append(flag)
|
||||
ctx['asm_flags'] = new_asm_flags
|
||||
|
||||
# If there is a target-specific exporter function, call it now.
|
||||
if self.TARGET_EXPORTER:
|
||||
print ("Calling target exporter...")
|
||||
self.TARGET_EXPORTER(self, ctx)
|
||||
|
||||
# Generate makefiles.
|
||||
for templatefile in \
|
||||
['makefile/%s_%s.tmpl' % (self.TEMPLATE,
|
||||
self.target.lower())] + \
|
||||
|
@ -161,7 +155,6 @@ class Makefile(Exporter):
|
|||
['makefile/%s.tmpl' % self.TEMPLATE]:
|
||||
try:
|
||||
self.gen_file(templatefile, ctx, 'Makefile')
|
||||
print("Generated Makefile from %s"%templatefile)
|
||||
break
|
||||
except TemplateNotFound:
|
||||
pass
|
||||
|
|
|
@ -19,19 +19,14 @@ import platform
|
|||
import subprocess
|
||||
import errno
|
||||
from array import array
|
||||
from struct import (pack, unpack)
|
||||
from distutils.spawn import find_executable
|
||||
from shutil import copyfile
|
||||
from intelhex import IntelHex
|
||||
from intelhex.compat import asbytes
|
||||
|
||||
from ..config import ConfigException
|
||||
|
||||
|
||||
class HookError(Exception):
|
||||
def __init__(self, msg):
|
||||
self.msg = msg
|
||||
def __str__(self):
|
||||
return self.msg
|
||||
from ..targets import HookError
|
||||
|
||||
|
||||
# Patch Cypress hex file:
|
||||
|
@ -44,28 +39,20 @@ def patch(message_func, ihex, hexf, align=256):
|
|||
for start, end in ihex.segments():
|
||||
if start >= 0x090000000:
|
||||
continue
|
||||
segment = ihex.tobinarray(start = start, end = end)
|
||||
segment = ihex.tobinarray(start, end)
|
||||
checksum += sum(segment)
|
||||
|
||||
lowchecksum = checksum & 0x0FFFF
|
||||
message_func("Calculated checksum for %s is 0x%04x" % (hexf, checksum))
|
||||
message_func("Calculated checksum for %s is 0x%04x" % (hexf, lowchecksum))
|
||||
|
||||
# update checksum
|
||||
checksum_bytes = array('B', asbytes('\0'*2))
|
||||
checksum_bytes[0] = lowchecksum >> 8
|
||||
checksum_bytes[1] = lowchecksum & 0xFF
|
||||
ihex.frombytes(checksum_bytes, offset=0x90300000)
|
||||
checksum_str = pack('>H', lowchecksum)
|
||||
ihex.frombytes(array('B', checksum_str), offset=0x90300000)
|
||||
|
||||
# update metadata
|
||||
sig_bytes = ihex.tobinarray(start=0x90500002, size=4)
|
||||
signature = (sig_bytes[0] << 24) | (sig_bytes[1] << 16) | (sig_bytes[2] << 8) | sig_bytes[3]
|
||||
sigcheck = checksum + signature
|
||||
sigcheck_bytes = array('B', asbytes('\0'*4))
|
||||
sigcheck_bytes[0] = (sigcheck >> 24) & 0xff
|
||||
sigcheck_bytes[1] = (sigcheck >> 16) & 0xff
|
||||
sigcheck_bytes[2] = (sigcheck >> 8) & 0xff
|
||||
sigcheck_bytes[3] = sigcheck & 0xFF
|
||||
ihex.frombytes(sigcheck_bytes, offset=0x90500008)
|
||||
signature = unpack('>L', ihex.tobinstr(start=0x90500002, size=4))[0]
|
||||
sigcheck = pack('>L', (checksum + signature) & 0x0FFFF)
|
||||
ihex.frombytes(array('B',sigcheck), offset=0x90500008)
|
||||
|
||||
# align flash segments
|
||||
align_mask = align - 1
|
||||
|
@ -106,59 +93,20 @@ def complete_func(message_func, elf0, hexf0, hexf1=None, dest=None):
|
|||
patch(message_func, ihex, hexf0)
|
||||
ihex.write_hex_file(dest if dest else hexf0, write_start_addr=False, byte_count=64)
|
||||
|
||||
def check_matching_features(image_features, target_features):
|
||||
for feature in image_features:
|
||||
if not (feature in target_features):
|
||||
return False
|
||||
return True
|
||||
|
||||
# Find Cortex M0 boot image proper for the application image.
|
||||
def find_cm0_images(toolchain, resources, elf, hexf):
|
||||
# Scan to find the actual paths of m0 image
|
||||
# First check if user-compiled image exists.
|
||||
params, _ = toolchain.config.get_config_data()
|
||||
dual_core_enabled = params['target.sub-target-build-enable'].value
|
||||
if dual_core_enabled:
|
||||
if "BLE" in toolchain.target.features:
|
||||
raise ConfigException("Feature 'BLE' not compatible with dual core configuration.")
|
||||
m0target = toolchain.target.sub_target
|
||||
m4target = toolchain.target.name
|
||||
m0hexf = hexf.replace(m4target, m0target)
|
||||
if not os.path.isfile(m0hexf):
|
||||
raise ConfigException("Matching M0 core hex image not found.")
|
||||
else:
|
||||
# Try default image.
|
||||
m0hexf = None
|
||||
m0_images = toolchain.target.M0_CORE_IMAGE
|
||||
# convert into a list if needed
|
||||
if not isinstance(m0_images, list):
|
||||
m0_images = [m0_images]
|
||||
|
||||
# find an image with matching features
|
||||
try:
|
||||
target_features = toolchain.target.features
|
||||
except AttributeError:
|
||||
target_features = []
|
||||
pass
|
||||
|
||||
for image in m0_images:
|
||||
features = image['features']
|
||||
if check_matching_features(image['features'], target_features):
|
||||
for hexf in resources.hex_files:
|
||||
if hexf.find(image['name']) != -1:
|
||||
m0hexf = hexf
|
||||
break
|
||||
if m0hexf:
|
||||
break
|
||||
# Find Cortex M0 image.
|
||||
def find_cm0_image(toolchain, resources, elf, hexf):
|
||||
# Locate user-specified image
|
||||
from tools.resources import FileType
|
||||
hex_files = resources.get_file_paths(FileType.HEX)
|
||||
m0hexf = next((f for f in hex_files if os.path.basename(f) == toolchain.target.m0_core_img), None)
|
||||
|
||||
if m0hexf:
|
||||
toolchain.notify.info("M0 core image file found %s." % os.path.basename(m0hexf))
|
||||
toolchain.notify.debug("M0 core image file found %s." % os.path.basename(m0hexf))
|
||||
else:
|
||||
toolchain.notify.debug("M0 core hex image file not found. Aborting.")
|
||||
raise ConfigException("Matching M0 core hex image not found.")
|
||||
toolchain.notify.debug("M0 core hex image file %s not found. Aborting." % toolchain.target.m0_core_img)
|
||||
raise ConfigException("Required M0 core hex image not found.")
|
||||
|
||||
m0elf = m0hexf.replace(".hex", ".elf")
|
||||
return m0elf, m0hexf
|
||||
return m0hexf
|
||||
|
||||
|
||||
def complete(toolchain, elf0, hexf0, hexf1=None):
|
||||
|
|
|
@ -564,23 +564,12 @@ class PSOC6Code:
|
|||
from tools.targets.PSOC6 import complete as psoc6_complete
|
||||
if hasattr(t_self.target, "sub_target"):
|
||||
# Completing main image involves merging M0 image.
|
||||
from tools.targets.PSOC6 import find_cm0_images
|
||||
_, m0hexf = find_cm0_images(t_self, resources, elf, binf)
|
||||
from tools.targets.PSOC6 import find_cm0_image
|
||||
m0hexf = find_cm0_image(t_self, resources, elf, binf)
|
||||
psoc6_complete(t_self, elf, binf, m0hexf)
|
||||
else:
|
||||
psoc6_complete(t_self, elf, binf)
|
||||
|
||||
@staticmethod
|
||||
def export_function(exporter, ctx):
|
||||
if exporter.NAME in ['Make-GCC-ARM', 'Eclipse-GCC-ARM']:
|
||||
from tools.targets.PSOC6 import find_cm0_images
|
||||
elf = ctx['name']+'.elf'
|
||||
hexf = ctx['name']+'.hex'
|
||||
_, m0_hexf = find_cm0_images(exporter.toolchain, exporter.resources, elf, hexf)
|
||||
print ("Adding hex image: %s"% m0_hexf)
|
||||
ctx['hex_files'] = [m0_hexf]
|
||||
|
||||
|
||||
################################################################################
|
||||
|
||||
# Instantiate all public targets
|
||||
|
|
Loading…
Reference in New Issue