Compare commits

...

3 Commits

Author SHA1 Message Date
946bd8e5a0
FT23 Firmware beginnings 2023-04-07 00:18:34 +02:00
6202a467b1
Add DBC 2023-04-06 23:15:27 +02:00
0a2fcb6d48
Update divider and use straight header on backside for SWD 2023-04-06 20:33:25 +02:00
25 changed files with 36324 additions and 324 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,489 @@
VERSION ""
NS_ :
NS_DESC_
CM_
BA_DEF_
BA_
VAL_
CAT_DEF_
CAT_
FILTER
BA_DEF_DEF_
EV_DATA_
ENVVAR_DATA_
SGTYPE_
SGTYPE_VAL_
BA_DEF_SGTYPE_
BA_SGTYPE_
SIG_TYPE_REF_
VAL_TABLE_
SIG_GROUP_
SIG_VALTYPE_
SIGTYPE_VALTYPE_
BO_TX_BU_
BA_DEF_REL_
BA_REL_
BA_DEF_DEF_REL_
BU_SG_REL_
BU_EV_REL_
BU_BO_REL_
SG_MUL_VAL_
BS_:
BU_: SSU TTS_4 TTS_3 TTS_2 TTS_1 Shunt AMS ABX SDCL PDU PDMV XSens STW EPSC
BO_ 1026 STW_Param_Set: 5 STW
SG_ STW_Param_Value : 15|32@0- (1,0) [0|0] "" Vector__XXX
SG_ STW_Param_Type : 0|8@1+ (1,0) [0|0] "" Vector__XXX
BO_ 19 New_Message_68: 8 Vector__XXX
SG_ New_Signal_243 : 16|8@1+ (1,0) [0|0] "" Vector__XXX
BO_ 18 New_Message_67: 8 Vector__XXX
SG_ New_Signal_242 : 23|8@1+ (1,0) [0|0] "" Vector__XXX
BO_ 14 New_Message_66: 8 Vector__XXX
SG_ New_Signal_242 : 24|8@1+ (1,0) [0|0] "" Vector__XXX
BO_ 13 New_Message_65: 8 Vector__XXX
SG_ New_Signal_241 : 32|8@1+ (1,0) [0|0] "" Vector__XXX
BO_ 12 New_Message_64: 8 Vector__XXX
SG_ New_Signal_240 : 40|8@1+ (1,0) [0|0] "" Vector__XXX
BO_ 8 New_Message_63: 8 Vector__XXX
SG_ New_Signal_239 : 16|8@1+ (1,0) [0|0] "" Vector__XXX
BO_ 4 New_Message_62: 8 Vector__XXX
SG_ New_Signal_238 : 48|8@1+ (1,0) [0|0] "" Vector__XXX
BO_ 3 New_Message_61: 8 Vector__XXX
SG_ New_Signal_237 : 16|8@1+ (1,0) [0|0] "" Vector__XXX
BO_ 0 New_Message_60: 8 Vector__XXX
SG_ New_Signal_236 : 48|8@1+ (1,0) [0|0] "" Vector__XXX
BO_ 1280 SSU_Message: 8 SSU
SG_ SSU_Message : 0|64@1+ (1,0) [0|1.84467e+19] "" ABX
BO_ 1805 TTS_4_Message_2: 8 TTS_4
SG_ TTS_4_Message_2 : 0|64@1+ (1,0) [0|1.84467e+19] "" Vector__XXX
BO_ 1804 TTS_4_Message_1: 8 TTS_4
SG_ TTS_4_Message_1 : 0|64@1+ (1,0) [0|1.84467e+19] "" Vector__XXX
BO_ 1801 TTS_3_Message_2: 8 TTS_3
SG_ TTS_3_Message_2 : 0|64@1+ (1,0) [0|1.84467e+19] "" Vector__XXX
BO_ 1800 TTS_3_Message_1: 8 TTS_3
SG_ TTS_3_Message_1 : 0|64@1+ (1,0) [0|1.84467e+19] "" Vector__XXX
BO_ 1797 TTS_2_Message_2: 8 TTS_2
SG_ TTS_2_Message_2 : 0|64@1+ (1,0) [0|1.84467e+19] "" Vector__XXX
BO_ 1796 TTS_2_Message_1: 8 TTS_2
SG_ TTS_2_Message_1 : 0|64@1+ (1,0) [0|1.84467e+19] "" Vector__XXX
BO_ 1793 TTS_1_Message_2: 8 TTS_1
SG_ TTS_1_Message_2 : 0|64@1+ (1,0) [0|1.84467e+19] "" ABX
BO_ 1792 TTS_1_Message_1: 8 TTS_1
SG_ TTS_1_Message_1 : 0|64@1+ (1,0) [0|1.84467e+19] "" ABX
BO_ 1268 AMS_Log: 3 AMS
SG_ AMS_Log_voltage7 m1 : 8|8@1+ (0.0196078,0) [0|5] "V" ABX
SG_ AMS_Log_voltage0 m0 : 8|8@1+ (0.0196078,0) [0|5] "V" ABX
SG_ AMS_Log_slave_ID : 4|4@1+ (1,0) [0|15] "" ABX
SG_ AMS_Log_frame M : 0|4@1+ (1,0) [0|15] "" ABX
BO_ 10 AMS_Status: 6 AMS
SG_ AMS_State : 0|7@1+ (1,0) [0|1] "" ABX
SG_ SDC_Closed : 7|1@1+ (1,0) [0|1] "" ABX
SG_ SOC : 8|8@1+ (0.392157,0) [0|100] "%" ABX
SG_ Min_cell_volt : 23|16@0+ (7.62951e-05,0) [0|5] "V" ABX
SG_ Max_cell_temp : 39|16@0+ (0.0625,0) [0|4095.94] "°C" ABX
BO_ 9 AMS_Panic: 8 AMS
SG_ AMS_Error_arg : 8|56@1+ (1,0) [0|7.20576e+16] "" ABX
SG_ AMS_Error : 0|8@1+ (1,0) [0|255] "" ABX
BO_ 11 AMS_In: 1 ABX
SG_ TS_activate : 0|1@1+ (1,0) [0|1] "" AMS
SG_ Lap_Number : 2|6@1+ (1,0) [0|64] "Laps" AMS
BO_ 1313 Shunt_Current: 6 Shunt
SG_ Shunt_Current : 23|32@0- (0.001,0) [-2e+06|2e+06] "A" AMS
BO_ 1314 Shunt_Voltage1: 6 Shunt
SG_ Shunt_Voltage1 : 23|32@0- (0.001,0) [-2e+06|2e+06] "V" AMS
BO_ 1315 Shunt_Voltage2: 6 Shunt
SG_ Shunt_Voltage2 : 23|32@0- (0.001,0) [-2e+06|2e+06] "V" AMS
BO_ 1316 Shunt_Voltage3: 6 Shunt
SG_ Shunt_Voltage3 : 23|32@0- (0.001,0) [-2e+06|2e+06] "V" AMS
BO_ 1317 Shunt_Temperature: 6 Shunt
SG_ Shunt_Temperature : 23|32@0+ (0.1,0) [0|1000] "°C" ABX
BO_ 16 SDCL_tx: 4 SDCL
SG_ as_mission : 11|3@1+ (1,0) [0|7] "" Vector__XXX
SG_ latch_init_open : 8|1@1+ (1,0) [0|1] "" ABX
SG_ heartbeat_ok : 4|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ sdc_state_1 : 1|1@1+ (1,0) [0|1] "" ABX
SG_ asms_state : 0|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ sdcl_sdc_in : 7|1@1+ (1,0) [0|1] "" ABX
SG_ sdcl_sdc_ready : 5|1@1+ (1,0) [0|1] "" ABX
SG_ ts_start_muxed : 6|1@1+ (1,0) [0|1] "" ABX
SG_ sdc_state_2 : 2|1@1+ (1,0) [0|1] "" ABX
SG_ sdc_state_3 : 3|1@1+ (1,0) [0|1] "" ABX
SG_ latch_closed : 9|1@1+ (1,0) [0|1] "" ABX
SG_ latch_reopened : 10|1@1+ (1,0) [0|1] "" ABX
BO_ 15 SDCL_rx: 3 ABX
SG_ as_mission : 4|3@1+ (1,0) [0|7] "" Vector__XXX
SG_ asb_error : 2|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ as_driving_mode : 3|1@1+ (1,0) [0|1] "" SDCL
SG_ as_close_sdc : 0|1@1+ (1,0) [0|1] "" SDCL
SG_ sdcl_heartbeat : 1|1@1+ (1,0) [0|1] "" SDCL
BO_ 200 PDU_Command: 6 ABX
SG_ PDU_servo_rx : 6|1@0+ (1,0) [0|1] "" PDU
SG_ PDU_misc_rx : 5|1@0+ (1,0) [0|1] "" PDU
SG_ PDU_alwayson_rx : 4|1@0+ (1,0) [0|1] "" PDU
SG_ PDU_shutdown_circuit_rx : 3|1@0+ (1,0) [0|1] "" PDU
SG_ PDU_ebs_valve_2_rx : 2|1@0+ (1,0) [0|1] "" PDU
SG_ PDU_mode_valve_2_rx : 1|1@0+ (1,0) [0|1] "" PDU
SG_ PDU_inverter_rx : 0|1@0+ (1,0) [0|1] "" PDU
SG_ PDU_mode_valve_1_rx : 15|1@0+ (1,0) [0|1] "" PDU
SG_ PDU_steering_rx : 14|1@0+ (1,0) [0|1] "" PDU
SG_ PDU_ebs_valve_1_rx : 13|1@0+ (1,0) [0|1] "" PDU
SG_ PDU_service_brake_rx : 12|1@0+ (1,0) [0|1] "" PDU
SG_ PDU_sensorbox_rx : 11|1@0+ (1,0) [0|1] "" PDU
SG_ PDU_PWM_fans_rx : 23|8@0+ (1,0) [0|255] "" PDU
SG_ PDU_PWM_aggregat_rx : 31|8@0+ (1,0) [0|255] "" PDU
SG_ PDU_PWM_pump_rx : 39|8@0+ (1,0) [0|255] "" PDU
SG_ PDU_checksum_rx : 47|8@0+ (1,0) [0|255] "" PDU
BO_ 201 PDU_Response: 6 PDU
SG_ PDU_servo_tx : 6|1@0+ (1,0) [0|1] "" ABX
SG_ PDU_misc_tx : 5|1@0+ (1,0) [0|1] "" ABX
SG_ PDU_alwayson_tx : 4|1@0+ (1,0) [0|1] "" ABX
SG_ PDU_shutdown_circuit_tx : 3|1@0+ (1,0) [0|1] "" ABX
SG_ PDU_evs_valve_2_tx : 2|1@0+ (1,0) [0|1] "" ABX
SG_ PDU_mode_valve_2_tx : 1|1@0+ (1,0) [0|1] "" ABX
SG_ PDU_inverter_tx : 0|1@0+ (1,0) [0|1] "" ABX
SG_ PDU_mode_valve_1_tx : 15|1@0+ (1,0) [0|1] "" ABX
SG_ PDU_steering_tx : 14|1@0+ (1,0) [0|1] "" ABX
SG_ PDU_ebs_valve_1_tx : 13|1@0+ (1,0) [0|1] "" ABX
SG_ PDU_service_brake_tx : 12|1@0+ (1,0) [0|1] "" ABX
SG_ PDU_sensorbox_tx : 11|1@0+ (1,0) [0|1] "" ABX
SG_ PDU_PWM_fans_tx : 23|8@0+ (1,0) [0|255] "" ABX
SG_ PDU_PWM_aggregat : 31|8@0+ (1,0) [0|255] "" ABX
SG_ PDU_PWM_pump : 39|8@0+ (1,0) [0|255] "" ABX
SG_ PDU_checksum_tx : 47|8@0+ (1,0) [0|255] "" ABX
BO_ 514 TxPDO: 6 ABX
SG_ pdm_output2_shortcircuit : 21|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ pdm_output1_shortcircuit : 20|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ pdm_output2_cablebreak : 19|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ pdm_output1_cablebreak : 18|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ pdm_output2_controllerrange : 17|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ pdm_output1_controllerrange : 16|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ pdm_temperature_shutdown : 13|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ pdm_temperature_warning : 12|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ pdm_analoginput_currentoverload : 11|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ pdm_analoginput_shortcircuit : 10|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ pdm_analoginput_cablebreak : 9|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ pdm_analoginput_middleposition : 8|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ pdm_canbus_statewarning : 5|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ pdm_canbus_startupmissing : 4|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ pdm_canbus_timeout : 3|1@1+ (1,0) [0|1] "" Vector__XXX
SG_ pdm_powersupply_greater_32v : 2|1@1+ (1,0) [0|1] "" ABX
SG_ pdm_powersupply_less_8v : 1|1@1+ (1,0) [0|1] "" ABX
SG_ PDM_analoginput : 32|16@1+ (1,0) [0|65535] "%." ABX
BO_ 1 Error: 1 XSens
BO_ 2 Warning: 1 XSens
SG_ WarningCode : 7|8@0+ (1,0) [0|0] "" ABX
BO_ 5 SampleTime: 4 XSens
SG_ Timestamp : 7|32@0+ (1,0) [0|0] "us" ABX
BO_ 6 GroupCounter: 2 XSens
SG_ Counter : 7|16@0+ (1,0) [0|0] "" ABX
BO_ 17 StatusWord: 4 XSens
SG_ SelfTestOk : 24|1@1+ (1,0) [0|1] "" ABX
SG_ OrientationValid : 25|1@1+ (1,0) [0|1] "" ABX
SG_ GpsValid : 26|1@1+ (1,0) [0|1] "" ABX
SG_ NoRotation : 28|2@0+ (1,0) [0|3] "" ABX
SG_ RepresentativeMotion : 29|1@1+ (1,0) [0|1] "" ABX
SG_ ExternalClockSynced : 30|1@1+ (1,0) [0|1] "" ABX
SG_ ClipAccX : 16|1@1+ (1,0) [0|1] "" ABX
SG_ ClipAccY : 17|1@1+ (1,0) [0|1] "" ABX
SG_ ClipAccZ : 18|1@1+ (1,0) [0|1] "" ABX
SG_ ClipGyrX : 19|1@1+ (1,0) [0|1] "" ABX
SG_ ClipGyrY : 20|1@1+ (1,0) [0|1] "" ABX
SG_ ClipGyrZ : 21|1@1+ (1,0) [0|1] "" ABX
SG_ ClipMagX : 22|1@1+ (1,0) [0|1] "" ABX
SG_ ClipMagY : 23|1@1+ (1,0) [0|1] "" ABX
SG_ ClipMagZ : 8|1@1+ (1,0) [0|1] "" ABX
SG_ Retransmitted : 10|1@1+ (1,0) [0|1] "" ABX
SG_ ClippingDetected : 11|1@1+ (1,0) [0|1] "" ABX
SG_ Interpolated : 12|1@1+ (1,0) [0|1] "" ABX
SG_ SyncIn : 13|1@1+ (1,0) [0|1] "" ABX
SG_ SyncOut : 14|1@1+ (1,0) [0|1] "" ABX
SG_ FilterMode : 1|3@0+ (1,0) [0|1] "" ABX
SG_ HaveGnssTimePulse : 2|1@1+ (1,0) [0|1] "" ABX
SG_ RtkStatus : 4|2@0+ (1,0) [0|1] "" ABX
BO_ 33 Quaternion: 8 XSens
SG_ Q1 : 7|16@0- (3.05176e-05,0) [-1|1] "" ABX
SG_ Q2 : 23|16@0- (3.05176e-05,0) [-1|1] "" ABX
SG_ Q3 : 39|16@0- (3.05176e-05,0) [-1|1] "" ABX
SG_ Q4 : 55|16@0- (3.05176e-05,0) [-1|1] "" ABX
BO_ 49 DeltaV: 7 XSens
SG_ X : 7|16@0- (7.62939e-06,0) [-0.25|0.25] "m/s" ABX
SG_ Y : 23|16@0- (7.62939e-06,0) [-0.25|0.25] "m/s" ABX
SG_ Z : 39|16@0- (7.62939e-06,0) [-0.25|0.25] "m/s" ABX
SG_ Exponent : 55|8@0+ (1,0) [0|0] "" ABX
BO_ 50 RateOfTurn: 6 XSens
SG_ gyrX : 7|16@0- (0.00195313,0) [-35|35] "rad/s" ABX
SG_ gyrY : 23|16@0- (0.00195313,0) [-35|35] "rad/s" ABX
SG_ gyrZ : 39|16@0- (0.00195313,0) [-35|35] "rad/s" ABX
BO_ 51 DeltaQ: 8 XSens
SG_ DeltaQ1 : 7|16@0- (3.05185e-05,0) [-1|1] "m/s²" ABX
SG_ DeltaQ2 : 23|16@0- (3.05185e-05,0) [-1|1] "m/s²" ABX
SG_ DeltaQ3 : 39|16@0- (3.05185e-05,0) [-1|1] "m/s²" ABX
SG_ DeltaQ4 : 55|16@0- (3.05185e-05,0) [-1|1] "m/s²" ABX
BO_ 52 Acceleration: 6 XSens
SG_ accX : 7|16@0- (0.00390625,0) [-100|100] "m/s²" ABX
SG_ accY : 23|16@0- (0.00390625,0) [-100|100] "m/s²" ABX
SG_ accZ : 39|16@0- (0.00390625,0) [-100|100] "m/s²" ABX
BO_ 53 FreeAcceleration: 6 XSens
SG_ FreeAccX : 7|16@0- (0.00390625,0) [-100|100] "m/s²" ABX
SG_ FreeAccY : 23|16@0- (0.00390625,0) [-100|100] "m/s²" ABX
SG_ FreeAccZ : 39|16@0- (0.00390625,0) [-100|100] "m/s²" ABX
BO_ 97 RateOfTurnHR: 6 XSens
SG_ HrGyrX : 7|16@0- (0.00195313,0) [-35|35] "rad/s" ABX
SG_ HrGyrY : 23|16@0- (0.00195313,0) [-35|35] "rad/s" ABX
SG_ HrGyrZ : 39|16@0- (0.00195313,0) [-35|35] "rad/s" ABX
BO_ 98 AccelerationHR: 6 XSens
SG_ HrAccX : 7|16@0- (0.00390625,0) [-100|100] "m/s²" ABX
SG_ HrAccY : 23|16@0- (0.00390625,0) [-100|100] "m/s²" ABX
SG_ HrAccZ : 39|16@0- (0.00390625,0) [-100|100] "m/s²" ABX
BO_ 65 MagneticField: 6 XSens
SG_ magX : 7|16@0- (0.000976563,0) [-32|32] "a.u." ABX
SG_ magY : 23|16@0- (0.000976563,0) [-32|32] "a.u" ABX
SG_ magZ : 39|16@0- (0.000976563,0) [-32|32] "a.u" ABX
BO_ 81 Temperature: 2 XSens
SG_ Temperature : 7|16@0- (0.00390625,0) [-40|85] "degC" ABX
BO_ 82 BarometricPressure: 4 XSens
SG_ Pressure : 7|32@0- (3.05176e-05,0) [30000|125000] "Pa" ABX
BO_ 7 UTC: 8 XSens
SG_ year : 7|8@0+ (1,0) [0|0] "Y" ABX
SG_ month : 15|8@0+ (1,0) [1|12] "M" ABX
SG_ day : 23|8@0+ (1,0) [1|31] "D" ABX
SG_ hour : 31|8@0+ (1,0) [0|24] "h" ABX
SG_ minute : 39|8@0+ (1,0) [0|60] "m" ABX
SG_ second : 47|8@0+ (1,0) [0|60] "s" ABX
SG_ tenthms : 55|16@0+ (1,0) [0|0] "ms/10" ABX
BO_ 34 EulerAngles: 6 XSens
SG_ roll : 7|16@0- (0.0078125,0) [-180|180] "deg" ABX
SG_ pitch : 23|16@0- (0.0078125,0) [-90|90] "deg" ABX
SG_ yaw : 39|16@0- (0.0078125,0) [-180|180] "deg" ABX
BO_ 113 LongLat: 8 XSens
SG_ latitude : 7|32@0- (5.96046e-08,0) [-90|90] "deg" ABX
SG_ longitude : 39|32@0- (1.19209e-07,0) [-180|180] "deg" ABX
BO_ 114 AltitudeEllipsoid: 4 XSens
SG_ altEllipsoid : 7|32@0+ (3.05176e-05,0) [0|50000] "m" ABX
BO_ 115 PositionEcef_X: 4 XSens
SG_ PositionEcef_X : 7|32@0- (0.00390625,0) [-6.5e+06|6.5e+06] "m" ABX
BO_ 116 PositionEcef_Y: 4 XSens
SG_ PositionEcef_Y : 7|32@0- (0.00390625,0) [-6.5e+06|6.5e+06] "m" ABX
BO_ 117 PositionEcef_Z: 4 XSens
SG_ PositionEcef_Z : 7|32@0- (0.00390625,0) [-6.5e+06|6.5e+06] "m" ABX
BO_ 118 Velocity: 6 XSens
SG_ velX : 7|16@0- (0.015625,0) [-500|500] "m/s" ABX
SG_ velY : 23|16@0- (0.015625,0) [-500|500] "m/s" ABX
SG_ velZ : 39|16@0- (0.015625,0) [-500|500] "m/s" ABX
BO_ 1040 AS_Mission_fb: 1 ABX
SG_ Mission_selection : 0|3@1+ (1,0) [1|7] "" STW
BO_ 1024 STW_mission_selected: 1 STW
SG_ Mission_selection : 0|3@1+ (1,0) [1|7] "" ABX
BO_ 801 EPSC_out: 8 EPSC
SG_ EPSC_measured_steering_angle : 7|16@0- (7.20721e-05,0) [-13875|13875] "part of full steering" ABX
SG_ EPSC_measured_rpm : 39|12@0- (0.1,0) [-204.8|204.7] "rpm" ABX
SG_ EPSC_measured_current : 23|8@0+ (0.1,0) [0|25.5] "A" ABX
SG_ EPSC_measured_voltage : 31|8@0+ (0.1,0) [0|20] "V" ABX
SG_ EPSC_measured_temperature : 43|10@0+ (0.1,0) [0|102.3] "°C" ABX
SG_ EPSC_measured_internal_temp : 49|10@0+ (0.1,0) [0|102.3] "°C" ABX
BO_ 291 EPSC_Steering_In: 2 ABX
SG_ EPSC_desired_steering_angle : 7|16@0- (0.0001,0) [-10000|10000] "" EPSC
BO_ 1041 STW_control: 1 ABX
SG_ STW_debugMode : 0|1@1+ (1,0) [0|1] "" STW
BO_ 1025 STW_buttons: 1 STW
SG_ STW_button_left : 0|1@1+ (1,0) [0|1] "" ABX
SG_ STW_button_right : 1|1@1+ (1,0) [0|1] "" ABX
SG_ STW_button_R2D : 2|1@1+ (1,0) [0|1] "" ABX
SG_ STW_button_Enter : 3|1@1+ (1,0) [0|1] "" ABX
BO_ 1042 STW_status: 6 ABX
SG_ InvL_ready : 8|1@1+ (1,0) [0|0] "" STW
SG_ iniChk_state : 24|8@1+ (1,0) [0|255] "" STW
SG_ InvR_ready : 9|1@1+ (1,0) [0|0] "" STW
SG_ AS_state : 0|3@1+ (1,0) [0|5] "" Vector__XXX
SG_ SDC_BFL : 10|1@1+ (1,0) [0|0] "" STW
SG_ SDC_BRL : 11|1@1+ (1,0) [0|0] "" STW
SG_ SDC_ACC : 12|1@1+ (1,0) [0|0] "" STW
SG_ SDC_HVB : 13|1@1+ (1,0) [0|0] "" STW
SG_ Lap_Count : 16|6@1+ (1,0) [0|64] "" STW
SG_ ERR_SDC : 32|1@1+ (1,0) [0|1] "" STW
SG_ ERR_AMS : 33|1@1+ (1,0) [0|1] "" STW
SG_ ERR_InvL : 43|1@1+ (1,0) [0|1] "" STW
SG_ ERR_InvR : 44|1@1+ (1,0) [0|1] "" STW
SG_ ERR_IniChk : 35|1@1+ (1,0) [0|1] "" STW
SG_ ERR_ConMon : 36|1@1+ (1,0) [0|1] "" STW
SG_ ERR_SCS : 37|1@1+ (1,0) [0|1] "" STW
SG_ ERR_sBSPD : 38|1@1+ (1,0) [0|1] "" STW
SG_ ERR_APPSp : 39|1@1+ (1,0) [0|1] "" STW
SG_ ERR_AS : 40|1@1+ (1,0) [0|1] "" STW
SG_ ERR_ROS : 41|1@1+ (1,0) [0|1] "" STW
SG_ ERR_RES : 42|1@1+ (1,0) [0|1] "" STW
SG_ ERR_PDU : 34|1@1+ (1,0) [0|1] "" STW
SG_ R2D_Progress : 4|4@1+ (1,0) [0|15] "" STW
BO_ 202 PDU_Current_1: 8 PDU
SG_ PDU_alwayson_curr : 7|16@0+ (1,0) [0|65535] "" ABX
SG_ PDU_misc_curr : 23|16@0+ (1,0) [0|65535] "" ABX
SG_ PDU_inverter_curr : 39|16@0+ (1,0) [0|65535] "" ABX
SG_ PDU_shutdown_circuit_curr : 55|16@0+ (1,0) [0|65535] "" ABX
BO_ 203 PDU_Current_2: 8 PDU
SG_ PDU_fans_curr : 7|16@0+ (1,0) [0|65535] "" ABX
SG_ PDU_pump_curr : 23|16@0+ (1,0) [0|65535] "" ABX
SG_ PDU_aggregat_curr : 39|16@0+ (1,0) [0|65535] "" ABX
SG_ PDU_steering_curr : 55|16@0+ (1,0) [0|65535] "" ABX
BO_ 204 PDU_Current_3: 8 PDU
SG_ PDU_ebs_valve_1_curr : 7|16@0+ (1,0) [0|65535] "" ABX
SG_ PDU_ebs_valve_2_curr : 23|16@0+ (1,0) [0|65535] "" ABX
SG_ PDU_mode_valve_1_curr : 39|16@0+ (1,0) [0|65535] "" ABX
SG_ PDU_mode_valve_2_curr : 55|16@0+ (1,0) [0|65535] "" ABX
BO_ 205 PDU_Current_4: 8 PDU
SG_ PDU_sensorbox_curr : 7|16@0+ (1,0) [0|65535] "" ABX
SG_ PDU_service_brake_curr : 23|16@0+ (1,0) [0|65535] "" ABX
SG_ PDU_servos_curr : 39|16@0+ (1,0) [0|65535] "" ABX
SG_ PDU_shutdown_circuit_curr : 55|16@0+ (1,0) [0|65535] "" ABX
BO_ 292 EPSC_Config_In: 7 ABX
SG_ EPSC_Ki_curr m1 : 55|8@0+ (0.1,0) [0|25.6] "" Vector__XXX
SG_ EPSC_Kp_curr m1 : 47|8@0+ (0.1,0) [0|25.6] "" Vector__XXX
SG_ EPSC_Ki_rpm m1 : 39|8@0+ (0.1,0) [0|25.6] "" Vector__XXX
SG_ EPSC_Kp_rpm m1 : 31|8@0+ (0.1,0) [0|25.6] "" Vector__XXX
SG_ EPSC_Ki_pos m1 : 23|8@0+ (0.1,0) [0|25.6] "" Vector__XXX
SG_ EPSC_Kp_pos m1 : 15|8@0+ (0.1,0) [0|25.6] "" Vector__XXX
SG_ EPSC_should_calibrate : 7|1@0- (1,0) [0|1] "" Vector__XXX
SG_ EPSC_should_change_mode M : 6|1@0+ (1,0) [0|1] "" Vector__XXX
SG_ EPSC_mode m1 : 5|1@0+ (1,0) [0|1] "" Vector__XXX
SG_ EPSC_flag3 : 4|1@0+ (1,0) [0|1] "" Vector__XXX
SG_ EPSC_flag4 : 3|1@0+ (1,0) [0|1] "" Vector__XXX
SG_ EPSC_flag5 : 2|1@0+ (1,0) [0|1] "" Vector__XXX
SG_ EPSC_flag6 : 1|1@0+ (1,0) [0|1] "" Vector__XXX
SG_ EPSC_flag7 : 0|1@0+ (1,0) [0|1] "" Vector__XXX
CM_ BU_ XSens "Generic Xsens Motion Sensor";
CM_ SG_ 1280 SSU_Message "TBD";
CM_ SG_ 1804 TTS_4_Message_1 "TBD";
CM_ SG_ 1801 TTS_3_Message_2 "TBD";
CM_ SG_ 1800 TTS_3_Message_1 "TBD";
CM_ SG_ 1797 TTS_2_Message_2 "TBD";
CM_ SG_ 1796 TTS_2_Message_1 "TBD";
CM_ SG_ 1793 TTS_1_Message_2 "TBD";
CM_ SG_ 1792 TTS_1_Message_1 "TBD";
CM_ SG_ 17 SelfTestOk "Set when the self test result was ok";
CM_ SG_ 17 OrientationValid "Set when the computed orientation is valid. The orientation may be invalid during startup or when the XSens data is clipping during violent (for the device) motion";
CM_ SG_ 17 GpsValid "Set when the device has a GPS receiver and the receiver says that there is a GPS position fix.";
CM_ SG_ 17 RepresentativeMotion "Indicates if the In-Run Compass Calibration is doing the representative motion analysis";
CM_ SG_ 17 ExternalClockSynced "Indicates whether the internal clock is synced with an external clock (Either GNNS or custom provided clock sync)";
CM_ SG_ 17 ClipAccX "Indicates if there was clipping on the X-axis of the accelerometer";
CM_ SG_ 17 ClipAccY "Indicates if there was clipping on the Y-axis of the accelerometer";
CM_ SG_ 17 ClipAccZ "Indicates if there was clipping on the Z-axis of the accelerometer";
CM_ SG_ 17 ClipGyrX "Indicates if there was clipping on the X-axis of the gyroscope";
CM_ SG_ 17 ClipGyrY "Indicates if there was clipping on the Y-axis of the gyroscope";
CM_ SG_ 17 ClipGyrZ "Indicates if there was clipping on the Z-axis of the gyroscope";
CM_ SG_ 17 ClipMagX "Indicates if there was clipping on the X-axis of the magnetometer";
CM_ SG_ 17 ClipMagY "Indicates if there was clipping on the Y-axis of the magnetometer";
CM_ SG_ 17 ClipMagZ "Indicates if there was clipping on the Z-axis of the magnetometer";
CM_ SG_ 17 Retransmitted "When set Indicates the sample was received as a retransmission";
CM_ SG_ 17 ClippingDetected "When set Indicates clipping has occurred";
CM_ SG_ 17 Interpolated "When set Indicates the sample is an interpolation between other samples";
CM_ SG_ 17 SyncIn "When set indicates a sync-in event has been triggered";
CM_ SG_ 17 SyncOut "When set Indicates a sync-out event has been generated";
CM_ SG_ 17 FilterMode "Mask for the 3 bit filter mode field";
CM_ SG_ 17 HaveGnssTimePulse "Indicates that the 1PPS GNSS time pulse is present";
CM_ SG_ 17 RtkStatus "Mask for 2 bit RTK status field";
CM_ BO_ 7 "UTC Time in the following format YYMMDDhhmmss plus tenth of a milli second";
CM_ SG_ 801 EPSC_measured_steering_angle "+-13875 equals to +-1.0, so the factor is 1/13875";
BA_DEF_ BO_ "GenMsgBackgroundColor" STRING ;
BA_DEF_ BO_ "GenMsgForegroundColor" STRING ;
BA_DEF_DEF_ "GenMsgBackgroundColor" "#ffffff";
BA_DEF_DEF_ "GenMsgForegroundColor" "#000000";
VAL_ 1026 STW_Param_Type 0 "BrakeBalance" 1 "TractionControl1" 2 "TractionControl2" 3 "TorqueMap" 4 "Test1" 5 "Test2" 6 "Test3" 7 "Test4";
VAL_ 10 AMS_State 0 "No Description" 1 "TS_ACTIVE" 2 "TS_PRECHARGE" 3 "TS_DISCHARGE" 4 "TS_ERROR";
VAL_ 17 SelfTestOk 0 "false" 1 "true";
VAL_ 17 OrientationValid 0 "false" 1 "true";
VAL_ 17 GpsValid 0 "false" 1 "true";
VAL_ 17 NoRotation 1 "Aborted" 2 "SamplesRejected" 3 "RunningNormally";
VAL_ 17 RepresentativeMotion 0 "false" 1 "true";
VAL_ 17 ExternalClockSynced 0 "false" 1 "true";
VAL_ 17 ClipAccX 0 "false" 1 "true";
VAL_ 17 ClipAccY 0 "false" 1 "true";
VAL_ 17 ClipAccZ 0 "false" 1 "true";
VAL_ 17 ClipGyrX 0 "false" 1 "true";
VAL_ 17 ClipGyrY 0 "false" 1 "true";
VAL_ 17 ClipGyrZ 0 "false" 1 "true";
VAL_ 17 ClipMagX 0 "false" 1 "true";
VAL_ 17 ClipMagY 0 "false" 1 "true";
VAL_ 17 ClipMagZ 0 "false" 1 "true";
VAL_ 17 Retransmitted 0 "false" 1 "true";
VAL_ 17 ClippingDetected 0 "false" 1 "true";
VAL_ 17 Interpolated 0 "false" 1 "true";
VAL_ 17 SyncIn 0 "false" 1 "true";
VAL_ 17 SyncOut 0 "false" 1 "true";
VAL_ 17 FilterMode 0 "false" 1 "true";
VAL_ 17 HaveGnssTimePulse 0 "false" 1 "true";
VAL_ 17 RtkStatus 0 "No RTK" 1 "RTK floating" 2 "RTK fixed";
VAL_ 1040 Mission_selection 1 "MissionSelection_acceleration" 2 "MissionSelection_skidpad" 3 "MissionSelection_trackdrive" 4 "MissionSelection_braketest" 5 "MissionSelection_inspection" 6 "MissionSelection_autocross" 7 "MissionSelection_manual";
VAL_ 1024 Mission_selection 1 "MissionSelection_acceleration" 2 "MissionSelection_skidpad" 3 "MissionSelection_trackdrive" 4 "MissionSelection_braketest" 5 "MissionSelection_inspection" 6 "MissionSelection_autocross" 7 "MissionSelection_manual";
VAL_ 1042 iniChk_state 0 "Start" 1 "WD_Check" 2 "WD_OK" 3 "ASB_Check_1" 4 "ASB_Check_2" 5 "Wait_TS" 6 "EBS_Check_A" 7 "EBS_Check_B" 8 "Done" 9 "Error";
VAL_ 1042 AS_state 0 "AS_Off" 1 "AS_Manual" 2 "AS_Ready" 3 "AS_Driving" 4 "AS_Finished" 5 "AS_Emergency";
VAL_ 1042 R2D_Progress 0 "R2D_None" 1 "R2D_TSMS" 2 "R2D_TSActive" 3 "R2D_Resetting_Nodes" 4 "R2D_Resetting_Comms" 5 "R2D_Waiting_Init" 6 "R2D_Init_Stage1" 7 "R2D_Init_Stage2" 15 "R2D_Init_Success";

View File

@ -57,18 +57,48 @@ void Error_Handler(void);
/* USER CODE END EFP */
/* Private defines -----------------------------------------------------------*/
#define SDC_is_ready_Pin GPIO_PIN_1
#define SDC_is_ready_GPIO_Port GPIOA
#define AS_close_SDC_Pin GPIO_PIN_3
#define AS_close_SDC_GPIO_Port GPIOA
#define AS_driving_mode_Pin GPIO_PIN_4
#define AS_driving_mode_GPIO_Port GPIOA
#define Watchdog_Pin GPIO_PIN_5
#define Watchdog_GPIO_Port GPIOA
#define TS_activate_MUXed_Pin GPIO_PIN_7
#define TS_activate_MUXed_Pin GPIO_PIN_0
#define TS_activate_MUXed_GPIO_Port GPIOA
#define SDC_in_3V3_Pin GPIO_PIN_8
#define ASMS_Pin GPIO_PIN_1
#define ASMS_GPIO_Port GPIOA
#define INITIAL_OPEN_Pin GPIO_PIN_2
#define INITIAL_OPEN_GPIO_Port GPIOA
#define CLOSED_Pin GPIO_PIN_3
#define CLOSED_GPIO_Port GPIOA
#define REOPENED_Pin GPIO_PIN_4
#define REOPENED_GPIO_Port GPIOA
#define WD_OK_Pin GPIO_PIN_5
#define WD_OK_GPIO_Port GPIOA
#define SDC_is_ready_Pin GPIO_PIN_6
#define SDC_is_ready_GPIO_Port GPIOA
#define SDC_in_3V3_Pin GPIO_PIN_7
#define SDC_in_3V3_GPIO_Port GPIOA
#define LV_SENSE_1_Pin GPIO_PIN_0
#define LV_SENSE_1_GPIO_Port GPIOB
#define LV_SENSE_2_Pin GPIO_PIN_1
#define LV_SENSE_2_GPIO_Port GPIOB
#define AMI_EBSTEST_Pin GPIO_PIN_10
#define AMI_EBSTEST_GPIO_Port GPIOB
#define AMI_INSPECTION_Pin GPIO_PIN_11
#define AMI_INSPECTION_GPIO_Port GPIOB
#define AS_close_SDC_Pin GPIO_PIN_9
#define AS_close_SDC_GPIO_Port GPIOA
#define Watchdog_Pin GPIO_PIN_10
#define Watchdog_GPIO_Port GPIOA
#define AMC_Pin GPIO_PIN_15
#define AMC_GPIO_Port GPIOA
#define ASB_Error_Pin GPIO_PIN_4
#define ASB_Error_GPIO_Port GPIOB
#define AMI_TRACKDRIVE_Pin GPIO_PIN_5
#define AMI_TRACKDRIVE_GPIO_Port GPIOB
#define AMI_AUTOX_Pin GPIO_PIN_6
#define AMI_AUTOX_GPIO_Port GPIOB
#define AMI_SKIDPAD_Pin GPIO_PIN_7
#define AMI_SKIDPAD_GPIO_Port GPIOB
#define AMI_ACCEL_Pin GPIO_PIN_8
#define AMI_ACCEL_GPIO_Port GPIOB
#define AMI_MANUAL_Pin GPIO_PIN_9
#define AMI_MANUAL_GPIO_Port GPIOB
/* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */

View File

@ -34,7 +34,7 @@
*/
#define HAL_MODULE_ENABLED
/*#define HAL_ADC_MODULE_ENABLED */
#define HAL_ADC_MODULE_ENABLED
/*#define HAL_CRYP_MODULE_ENABLED */
#define HAL_CAN_MODULE_ENABLED
/*#define HAL_CEC_MODULE_ENABLED */

View File

@ -26,26 +26,60 @@
/* Private typedef -----------------------------------------------------------*/
/* USER CODE BEGIN PTD */
/*
* VAL_ 1040 Mission_selection
* 1 "MissionSelection_acceleration"
* 2 "MissionSelection_skidpad"
* 3 "MissionSelection_trackdrive"
* 4 "MissionSelection_braketest"
* 5 "MissionSelection_inspection"
* 6 "MissionSelection_autocross"
* 7 "MissionSelection_manual";
*/
typedef enum {
M_NONE = 0,
M_ACCEL = 1,
M_SKIDPAD = 2,
M_TRACKDRIVE = 3,
M_EBSTEST = 4,
M_INSPECTION = 5,
M_AUTOX = 6,
M_MANUAL = 7
} mission_t;
// BITFIELDS ARE LSB FIRST!
typedef union {
uint8_t raw[1];
struct {
bool as_driving_mode : 1;
bool as_close_sdc : 1;
bool watchdog : 1;
uint8_t _padding : 5;
} signals;
bool heartbeat : 1;
bool asb_error : 1;
bool as_driving_mode : 1;
mission_t as_mission : 3;
unsigned int _padding : 1;
} __attribute__((packed)) signals;
} rx_data_t;
typedef union {
uint8_t raw[1];
uint8_t raw[2];
struct {
bool sdc_in : 1;
bool asms_state : 1;
bool sdc_state_1 : 1;
bool sdc_state_2 : 1;
bool sdc_state_3 : 1;
bool heartbeat_ok : 1;
bool sdc_ready : 1;
bool ts_start : 1;
uint8_t _padding : 5;
} signals;
bool ts_start_muxed : 1;
bool sdc_in : 1;
// -- byte border
bool latch_init_open : 1;
bool latch_closed : 1;
bool latch_reopened : 1;
mission_t as_mission : 3;
unsigned int _padding : 2;
} __attribute__((packed)) signals;
} tx_data_t;
/* USER CODE END PTD */
@ -53,12 +87,10 @@ typedef union {
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
#define CAN_ID_RX 0x10
#define CAN_ID_TX 0x11
#define CAN_ID_RX 0x00F
#define CAN_ID_TX 0x010
// Wait 20ms. Needs to be less than watchdog period!
#define RX_UPDATE_PERIOD 20
// Defined in DBC. Should be multiple of RX_UPDATE_PERIOD
// Defined in DBC?
#define TX_UPDATE_PERIOD 100
/* USER CODE END PD */
@ -69,11 +101,13 @@ typedef union {
/* USER CODE END PM */
/* Private variables ---------------------------------------------------------*/
ADC_HandleTypeDef hadc1;
CAN_HandleTypeDef hcan;
/* USER CODE BEGIN PV */
rx_data_t RxData;
rx_data_t rxData;
/* USER CODE END PV */
@ -81,6 +115,7 @@ rx_data_t RxData;
void SystemClock_Config(void);
static void MX_GPIO_Init(void);
static void MX_CAN_Init(void);
static void MX_ADC1_Init(void);
/* USER CODE BEGIN PFP */
/* USER CODE END PFP */
@ -119,14 +154,16 @@ int main(void)
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_CAN_Init();
MX_ADC1_Init();
/* USER CODE BEGIN 2 */
// Init data as LOW
memset(&RxData, 0, sizeof(rx_data_t));
memset(&rxData, 0, sizeof(rx_data_t));
if (HAL_CAN_Start(&hcan) != HAL_OK)
Error_Handler();
/*
CAN_FilterTypeDef canfilterconfig;
canfilterconfig.FilterActivation = CAN_FILTER_ENABLE;
@ -143,32 +180,40 @@ int main(void)
if (HAL_CAN_ConfigFilter(&hcan, &canfilterconfig) != HAL_OK) {
Error_Handler();
}
*/
if (HAL_CAN_ActivateNotification(&hcan, CAN_IT_RX_FIFO0_MSG_PENDING) != HAL_OK)
Error_Handler();
CAN_TxHeaderTypeDef TxHeader;
uint32_t TxMailbox;
tx_data_t TxData;
CAN_TxHeaderTypeDef txHeader;
uint32_t txMailbox;
tx_data_t txData;
memset(&TxData, 0, sizeof(tx_data_t));
memset(&txData, 0, sizeof(tx_data_t));
// Prep the tx frame
TxHeader.IDE = CAN_ID_STD;
TxHeader.StdId = CAN_ID_TX;
TxHeader.RTR = CAN_RTR_DATA;
TxHeader.DLC = 1;
txHeader.IDE = CAN_ID_STD;
txHeader.StdId = CAN_ID_TX;
txHeader.RTR = CAN_RTR_DATA;
txHeader.DLC = 2;
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
uint32_t counter = 0;
//HAL_GPIO_TogglePin(AS_close_SDC_GPIO_Port, AS_close_SDC_Pin);
uint16_t mission2led[] = {ASB_Error_Pin, AMI_ACCEL_Pin, AMI_SKIDPAD_Pin, AMI_TRACKDRIVE_Pin, AMI_EBSTEST_Pin, AMI_INSPECTION_Pin, AMI_AUTOX_Pin, AMI_MANUAL_Pin};
unsigned int mission_order[] = {M_MANUAL, M_ACCEL, M_SKIDPAD, M_AUTOX, M_TRACKDRIVE, M_EBSTEST, M_INSPECTION};
unsigned int mission_idx = 0;
bool pAMC = false;
while (true) {
// Write out all values received via interrupt to the pins
/*
HAL_GPIO_WritePin(GPIOA, AS_driving_mode_Pin, RxData.signals.as_driving_mode);
HAL_GPIO_WritePin(GPIOA, AS_close_SDC_Pin, RxData.signals.as_close_sdc);
HAL_GPIO_WritePin(GPIOA, Watchdog_Pin, RxData.signals.watchdog);
@ -191,9 +236,75 @@ int main(void)
counter = 0;
}
*/
// Slow the loop
HAL_Delay(RX_UPDATE_PERIOD);
/*
* Values to read:
* [ ] TSActivateMUXed
* [ ] ASMS
* [ ] INITIAL_OPEN
* [ ] CLOSED
* [ ] REOPENED
* [ ] WD_OK
* [ ] SDC_is_ready
* [ ] SDC_in_3V3
* [ ] LV_SENSE_1
* [ ] LV_SENSE_2
* [x] AMC
*
* Values to write:
* [ ] AS_close_SDC
* [ ] (Watchdog)
* [ ] ASB_Error
* [x] AMI_<Mission>
*/
bool TS_activate_MUXed = HAL_GPIO_ReadPin(TS_activate_MUXed_GPIO_Port, TS_activate_MUXed_Pin) == GPIO_PIN_SET;
bool ASMS = HAL_GPIO_ReadPin(ASMS_GPIO_Port, ASMS_Pin) == GPIO_PIN_SET;
bool WD_OK = HAL_GPIO_ReadPin(WD_OK_GPIO_Port, WD_OK_Pin) == GPIO_PIN_SET;
bool SDC_is_ready = HAL_GPIO_ReadPin(SDC_is_ready_GPIO_Port, SDC_is_ready_Pin) == GPIO_PIN_SET;
bool SDC_in_3V3 = HAL_GPIO_ReadPin(SDC_in_3V3_GPIO_Port, SDC_in_3V3_Pin) == GPIO_PIN_SET;
bool LV_SENSE_1 = HAL_GPIO_ReadPin(LV_SENSE_1_GPIO_Port, LV_SENSE_1_Pin) == GPIO_PIN_SET;
bool LV_SENSE_2 = HAL_GPIO_ReadPin(LV_SENSE_2_GPIO_Port, LV_SENSE_2_Pin) == GPIO_PIN_SET;
bool INITIAL_OPEN = HAL_GPIO_ReadPin(INITIAL_OPEN_GPIO_Port, INITIAL_OPEN_Pin) == GPIO_PIN_SET;
bool CLOSED = HAL_GPIO_ReadPin(CLOSED_GPIO_Port, CLOSED_Pin) == GPIO_PIN_SET;
bool REOPENED = HAL_GPIO_ReadPin(REOPENED_GPIO_Port, REOPENED_Pin) == GPIO_PIN_SET;
bool AMC = HAL_GPIO_ReadPin(AMC_GPIO_Port, AMC_Pin) == GPIO_PIN_SET;
if (AMC < pAMC) {
HAL_GPIO_WritePin(GPIOB, mission2led[mission_order[mission_idx]], GPIO_PIN_RESET);
mission_idx++;
mission_idx %= 7;
}
HAL_GPIO_WritePin(GPIOB, mission2led[mission_order[mission_idx]], GPIO_PIN_SET);
tx_data_t txData = {
.signals = {
.asms_state = ASMS,
.sdc_state_1 = LV_SENSE_1,
.sdc_state_2 = LV_SENSE_2,
.sdc_state_3 = SDC_in_3V3,
.heartbeat_ok = WD_OK,
.sdc_ready = SDC_is_ready,
.sdc_in = SDC_in_3V3,
.latch_init_open = INITIAL_OPEN,
.latch_closed = CLOSED,
.latch_reopened = REOPENED,
.as_mission = mission_order[mission_idx]
}
};
if (HAL_CAN_AddTxMessage(&hcan, &txHeader, txData.raw, &txMailbox) != HAL_OK)
Error_Handler();
pAMC = AMC;
HAL_Delay(TX_UPDATE_PERIOD);
/* USER CODE END WHILE */
@ -210,6 +321,7 @@ void SystemClock_Config(void)
{
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
/** Initializes the RCC Oscillators according to the specified parameters
* in the RCC_OscInitTypeDef structure.
@ -217,11 +329,14 @@ void SystemClock_Config(void)
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL4;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
Error_Handler();
}
/** Initializes the CPU, AHB and APB buses clocks
*/
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
@ -235,6 +350,70 @@ void SystemClock_Config(void)
{
Error_Handler();
}
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC1;
PeriphClkInit.Adc1ClockSelection = RCC_ADC1PLLCLK_DIV1;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
{
Error_Handler();
}
}
/**
* @brief ADC1 Initialization Function
* @param None
* @retval None
*/
static void MX_ADC1_Init(void)
{
/* USER CODE BEGIN ADC1_Init 0 */
/* USER CODE END ADC1_Init 0 */
ADC_ChannelConfTypeDef sConfig = {0};
/* USER CODE BEGIN ADC1_Init 1 */
/* USER CODE END ADC1_Init 1 */
/** Common config
*/
hadc1.Instance = ADC1;
hadc1.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV1;
hadc1.Init.Resolution = ADC_RESOLUTION_12B;
hadc1.Init.ScanConvMode = ADC_SCAN_DISABLE;
hadc1.Init.ContinuousConvMode = DISABLE;
hadc1.Init.DiscontinuousConvMode = DISABLE;
hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE;
hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START;
hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT;
hadc1.Init.NbrOfConversion = 1;
hadc1.Init.DMAContinuousRequests = DISABLE;
hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV;
hadc1.Init.LowPowerAutoWait = DISABLE;
hadc1.Init.Overrun = ADC_OVR_DATA_OVERWRITTEN;
if (HAL_ADC_Init(&hadc1) != HAL_OK)
{
Error_Handler();
}
/** Configure Regular Channel
*/
sConfig.Channel = ADC_CHANNEL_11;
sConfig.Rank = ADC_REGULAR_RANK_1;
sConfig.SingleDiff = ADC_DIFFERENTIAL_ENDED;
sConfig.SamplingTime = ADC_SAMPLETIME_1CYCLE_5;
sConfig.OffsetNumber = ADC_OFFSET_NONE;
sConfig.Offset = 0;
if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN ADC1_Init 2 */
/* USER CODE END ADC1_Init 2 */
}
/**
@ -288,27 +467,38 @@ static void MX_GPIO_Init(void)
__HAL_RCC_GPIOB_CLK_ENABLE();
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOA, AS_close_SDC_Pin|AS_driving_mode_Pin|Watchdog_Pin, GPIO_PIN_RESET);
HAL_GPIO_WritePin(GPIOB, AMI_EBSTEST_Pin|AMI_INSPECTION_Pin|ASB_Error_Pin|AMI_TRACKDRIVE_Pin
|AMI_AUTOX_Pin|AMI_SKIDPAD_Pin|AMI_ACCEL_Pin|AMI_MANUAL_Pin, GPIO_PIN_RESET);
/*Configure GPIO pins : SDC_is_ready_Pin SDC_in_3V3_Pin */
GPIO_InitStruct.Pin = SDC_is_ready_Pin|SDC_in_3V3_Pin;
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOA, AS_close_SDC_Pin|Watchdog_Pin, GPIO_PIN_RESET);
/*Configure GPIO pins : TS_activate_MUXed_Pin ASMS_Pin INITIAL_OPEN_Pin CLOSED_Pin
REOPENED_Pin WD_OK_Pin SDC_is_ready_Pin SDC_in_3V3_Pin
AMC_Pin */
GPIO_InitStruct.Pin = TS_activate_MUXed_Pin|ASMS_Pin|INITIAL_OPEN_Pin|CLOSED_Pin
|REOPENED_Pin|WD_OK_Pin|SDC_is_ready_Pin|SDC_in_3V3_Pin
|AMC_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/*Configure GPIO pins : AS_close_SDC_Pin AS_driving_mode_Pin Watchdog_Pin */
GPIO_InitStruct.Pin = AS_close_SDC_Pin|AS_driving_mode_Pin|Watchdog_Pin;
/*Configure GPIO pins : AMI_EBSTEST_Pin AMI_INSPECTION_Pin ASB_Error_Pin AMI_TRACKDRIVE_Pin
AMI_AUTOX_Pin AMI_SKIDPAD_Pin AMI_ACCEL_Pin AMI_MANUAL_Pin */
GPIO_InitStruct.Pin = AMI_EBSTEST_Pin|AMI_INSPECTION_Pin|ASB_Error_Pin|AMI_TRACKDRIVE_Pin
|AMI_AUTOX_Pin|AMI_SKIDPAD_Pin|AMI_ACCEL_Pin|AMI_MANUAL_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
/*Configure GPIO pins : AS_close_SDC_Pin Watchdog_Pin */
GPIO_InitStruct.Pin = AS_close_SDC_Pin|Watchdog_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
/*Configure GPIO pin : TS_activate_MUXed_Pin */
GPIO_InitStruct.Pin = TS_activate_MUXed_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
HAL_GPIO_Init(TS_activate_MUXed_GPIO_Port, &GPIO_InitStruct);
}
/* USER CODE BEGIN 4 */
@ -316,16 +506,16 @@ static void MX_GPIO_Init(void)
// CAN RX interrupt handler
void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan) {
CAN_RxHeaderTypeDef RxHeader;
uint8_t RxBuffer[8];
CAN_RxHeaderTypeDef rxHeader;
uint8_t rxBuffer[8];
// Read frame from HW into buffer
if (HAL_CAN_GetRxMessage(hcan, CAN_RX_FIFO0, &RxHeader, RxBuffer) != HAL_OK)
if (HAL_CAN_GetRxMessage(hcan, CAN_RX_FIFO0, &rxHeader, rxBuffer) != HAL_OK)
Error_Handler();
// Copy into the bitfield if it's for us
if (RxHeader.StdId == CAN_ID_RX)
RxData.raw[0] = RxBuffer[0];
if (rxHeader.StdId == CAN_ID_RX)
rxData.raw[0] = rxBuffer[0];
}
@ -362,4 +552,3 @@ void assert_failed(uint8_t *file, uint32_t line)
/* USER CODE END 6 */
}
#endif /* USE_FULL_ASSERT */

View File

@ -76,6 +76,69 @@ void HAL_MspInit(void)
/* USER CODE END MspInit 1 */
}
/**
* @brief ADC MSP Initialization
* This function configures the hardware resources used in this example
* @param hadc: ADC handle pointer
* @retval None
*/
void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc)
{
GPIO_InitTypeDef GPIO_InitStruct = {0};
if(hadc->Instance==ADC1)
{
/* USER CODE BEGIN ADC1_MspInit 0 */
/* USER CODE END ADC1_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_ADC1_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
/**ADC1 GPIO Configuration
PB0 ------> ADC1_IN11
PB1 ------> ADC1_IN12
*/
GPIO_InitStruct.Pin = LV_SENSE_1_Pin|LV_SENSE_2_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
/* USER CODE BEGIN ADC1_MspInit 1 */
/* USER CODE END ADC1_MspInit 1 */
}
}
/**
* @brief ADC MSP De-Initialization
* This function freeze the hardware resources used in this example
* @param hadc: ADC handle pointer
* @retval None
*/
void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc)
{
if(hadc->Instance==ADC1)
{
/* USER CODE BEGIN ADC1_MspDeInit 0 */
/* USER CODE END ADC1_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_ADC1_CLK_DISABLE();
/**ADC1 GPIO Configuration
PB0 ------> ADC1_IN11
PB1 ------> ADC1_IN12
*/
HAL_GPIO_DeInit(GPIOB, LV_SENSE_1_Pin|LV_SENSE_2_Pin);
/* USER CODE BEGIN ADC1_MspDeInit 1 */
/* USER CODE END ADC1_MspDeInit 1 */
}
}
/**
* @brief CAN MSP Initialization
* This function configures the hardware resources used in this example
@ -149,4 +212,3 @@ void HAL_CAN_MspDeInit(CAN_HandleTypeDef* hcan)
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */

View File

@ -215,4 +215,3 @@ void USB_LP_CAN_RX0_IRQHandler(void)
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */

View File

@ -0,0 +1,273 @@
/**
******************************************************************************
* @file stm32f3xx_hal_adc.h
* @author MCD Application Team
* @brief Header file containing functions prototypes of ADC HAL library.
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F3xx_ADC_H
#define __STM32F3xx_ADC_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32f3xx_hal_def.h"
/* Include ADC HAL Extended module */
/* (include on top of file since ADC structures are defined in extended file) */
#include "stm32f3xx_hal_adc_ex.h"
/** @addtogroup STM32F3xx_HAL_Driver
* @{
*/
/** @addtogroup ADC
* @{
*/
/* Exported types ------------------------------------------------------------*/
/** @defgroup ADC_Exported_Types ADC Exported Types
* @{
*/
/**
* @brief HAL ADC state machine: ADC states definition (bitfields)
* @note ADC state machine is managed by bitfields, state must be compared
* with bit by bit.
* For example:
* " if (HAL_IS_BIT_SET(HAL_ADC_GetState(hadc1), HAL_ADC_STATE_REG_BUSY)) "
* " if (HAL_IS_BIT_SET(HAL_ADC_GetState(hadc1), HAL_ADC_STATE_AWD1) ) "
*/
/* States of ADC global scope */
#define HAL_ADC_STATE_RESET (0x00000000U) /*!< ADC not yet initialized or disabled */
#define HAL_ADC_STATE_READY (0x00000001U) /*!< ADC peripheral ready for use */
#define HAL_ADC_STATE_BUSY_INTERNAL (0x00000002U) /*!< ADC is busy to internal process (initialization, calibration) */
#define HAL_ADC_STATE_TIMEOUT (0x00000004U) /*!< TimeOut occurrence */
/* States of ADC errors */
#define HAL_ADC_STATE_ERROR_INTERNAL (0x00000010U) /*!< Internal error occurrence */
#define HAL_ADC_STATE_ERROR_CONFIG (0x00000020U) /*!< Configuration error occurrence */
#define HAL_ADC_STATE_ERROR_DMA (0x00000040U) /*!< DMA error occurrence */
/* States of ADC group regular */
#define HAL_ADC_STATE_REG_BUSY (0x00000100U) /*!< A conversion on group regular is ongoing or can occur (either by continuous mode,
external trigger, low power auto power-on, multimode ADC master control) */
#define HAL_ADC_STATE_REG_EOC (0x00000200U) /*!< Conversion data available on group regular */
#define HAL_ADC_STATE_REG_OVR (0x00000400U) /*!< Overrun occurrence */
#define HAL_ADC_STATE_REG_EOSMP (0x00000800U) /*!< End Of Sampling flag raised */
/* States of ADC group injected */
#define HAL_ADC_STATE_INJ_BUSY (0x00001000U) /*!< A conversion on group injected is ongoing or can occur (either by auto-injection mode,
external trigger, low power auto power-on, multimode ADC master control) */
#define HAL_ADC_STATE_INJ_EOC (0x00002000U) /*!< Conversion data available on group injected */
#define HAL_ADC_STATE_INJ_JQOVF (0x00004000U) /*!< Injected queue overflow occurrence */
/* States of ADC analog watchdogs */
#define HAL_ADC_STATE_AWD1 (0x00010000U) /*!< Out-of-window occurrence of analog watchdog 1 */
#define HAL_ADC_STATE_AWD2 (0x00020000U) /*!< Out-of-window occurrence of analog watchdog 2 */
#define HAL_ADC_STATE_AWD3 (0x00040000U) /*!< Out-of-window occurrence of analog watchdog 3 */
/* States of ADC multi-mode */
#define HAL_ADC_STATE_MULTIMODE_SLAVE (0x00100000U) /*!< ADC in multimode slave state, controlled by another ADC master ( */
/**
* @brief ADC handle Structure definition
*/
typedef struct __ADC_HandleTypeDef
{
ADC_TypeDef *Instance; /*!< Register base address */
ADC_InitTypeDef Init; /*!< ADC required parameters */
DMA_HandleTypeDef *DMA_Handle; /*!< Pointer DMA Handler */
HAL_LockTypeDef Lock; /*!< ADC locking object */
__IO uint32_t State; /*!< ADC communication state (bitmap of ADC states) */
__IO uint32_t ErrorCode; /*!< ADC Error code */
#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \
defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \
defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \
defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx)
ADC_InjectionConfigTypeDef InjectionConfig ; /*!< ADC injected channel configuration build-up structure */
#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */
/* STM32F302xC || STM32F303xC || STM32F358xx || */
/* STM32F303x8 || STM32F334x8 || STM32F328xx || */
/* STM32F301x8 || STM32F302x8 || STM32F318xx */
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
void (* ConvCpltCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC conversion complete callback */
void (* ConvHalfCpltCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC conversion DMA half-transfer callback */
void (* LevelOutOfWindowCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC analog watchdog 1 callback */
void (* ErrorCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC error callback */
void (* InjectedConvCpltCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC group injected conversion complete callback */ /*!< ADC end of sampling callback */
void (* MspInitCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC Msp Init callback */
void (* MspDeInitCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC Msp DeInit callback */
#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */
}ADC_HandleTypeDef;
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
/**
* @brief HAL ADC Callback ID enumeration definition
*/
typedef enum
{
HAL_ADC_CONVERSION_COMPLETE_CB_ID = 0x00U, /*!< ADC conversion complete callback ID */
HAL_ADC_CONVERSION_HALF_CB_ID = 0x01U, /*!< ADC conversion DMA half-transfer callback ID */
HAL_ADC_LEVEL_OUT_OF_WINDOW_1_CB_ID = 0x02U, /*!< ADC analog watchdog 1 callback ID */
HAL_ADC_ERROR_CB_ID = 0x03U, /*!< ADC error callback ID */
HAL_ADC_INJ_CONVERSION_COMPLETE_CB_ID = 0x04U, /*!< ADC group injected conversion complete callback ID */
HAL_ADC_MSPINIT_CB_ID = 0x09U, /*!< ADC Msp Init callback ID */
HAL_ADC_MSPDEINIT_CB_ID = 0x0AU /*!< ADC Msp DeInit callback ID */
} HAL_ADC_CallbackIDTypeDef;
/**
* @brief HAL ADC Callback pointer definition
*/
typedef void (*pADC_CallbackTypeDef)(ADC_HandleTypeDef *hadc); /*!< pointer to a ADC callback function */
#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */
/**
* @}
*/
/* Exported constants --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/** @defgroup ADC_Exported_Macro ADC Exported Macros
* @{
*/
/** @brief Reset ADC handle state
* @param __HANDLE__ ADC handle
* @retval None
*/
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
#define __HAL_ADC_RESET_HANDLE_STATE(__HANDLE__) \
do{ \
(__HANDLE__)->State = HAL_ADC_STATE_RESET; \
(__HANDLE__)->MspInitCallback = NULL; \
(__HANDLE__)->MspDeInitCallback = NULL; \
} while(0)
#else
#define __HAL_ADC_RESET_HANDLE_STATE(__HANDLE__) \
((__HANDLE__)->State = HAL_ADC_STATE_RESET)
#endif
/**
* @}
*/
/* Exported functions --------------------------------------------------------*/
/** @addtogroup ADC_Exported_Functions ADC Exported Functions
* @{
*/
/** @addtogroup ADC_Exported_Functions_Group1 Initialization and de-initialization functions
* @{
*/
/* Initialization and de-initialization functions **********************************/
HAL_StatusTypeDef HAL_ADC_Init(ADC_HandleTypeDef* hadc);
HAL_StatusTypeDef HAL_ADC_DeInit(ADC_HandleTypeDef *hadc);
void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc);
void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc);
#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1)
/* Callbacks Register/UnRegister functions ***********************************/
HAL_StatusTypeDef HAL_ADC_RegisterCallback(ADC_HandleTypeDef *hadc, HAL_ADC_CallbackIDTypeDef CallbackID, pADC_CallbackTypeDef pCallback);
HAL_StatusTypeDef HAL_ADC_UnRegisterCallback(ADC_HandleTypeDef *hadc, HAL_ADC_CallbackIDTypeDef CallbackID);
#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */
/**
* @}
*/
/** @addtogroup ADC_Exported_Functions_Group2 Input and Output operation functions
* @{
*/
/* Blocking mode: Polling */
HAL_StatusTypeDef HAL_ADC_Start(ADC_HandleTypeDef* hadc);
HAL_StatusTypeDef HAL_ADC_Stop(ADC_HandleTypeDef* hadc);
HAL_StatusTypeDef HAL_ADC_PollForConversion(ADC_HandleTypeDef* hadc, uint32_t Timeout);
HAL_StatusTypeDef HAL_ADC_PollForEvent(ADC_HandleTypeDef* hadc, uint32_t EventType, uint32_t Timeout);
/* Non-blocking mode: Interruption */
HAL_StatusTypeDef HAL_ADC_Start_IT(ADC_HandleTypeDef* hadc);
HAL_StatusTypeDef HAL_ADC_Stop_IT(ADC_HandleTypeDef* hadc);
/* Non-blocking mode: DMA */
HAL_StatusTypeDef HAL_ADC_Start_DMA(ADC_HandleTypeDef* hadc, uint32_t* pData, uint32_t Length);
HAL_StatusTypeDef HAL_ADC_Stop_DMA(ADC_HandleTypeDef* hadc);
/* ADC retrieve conversion value intended to be used with polling or interruption */
uint32_t HAL_ADC_GetValue(ADC_HandleTypeDef* hadc);
/* ADC IRQHandler and Callbacks used in non-blocking modes (Interruption and DMA) */
void HAL_ADC_IRQHandler(ADC_HandleTypeDef* hadc);
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc);
void HAL_ADC_ConvHalfCpltCallback(ADC_HandleTypeDef* hadc);
void HAL_ADC_LevelOutOfWindowCallback(ADC_HandleTypeDef* hadc);
void HAL_ADC_ErrorCallback(ADC_HandleTypeDef *hadc);
/**
* @}
*/
/** @addtogroup ADC_Exported_Functions_Group3 Peripheral Control functions
* @{
*/
/* Peripheral Control functions ***********************************************/
HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef* hadc, ADC_ChannelConfTypeDef* sConfig);
HAL_StatusTypeDef HAL_ADC_AnalogWDGConfig(ADC_HandleTypeDef* hadc, ADC_AnalogWDGConfTypeDef* AnalogWDGConfig);
/**
* @}
*/
/** @defgroup ADC_Exported_Functions_Group4 Peripheral State functions
* @brief ADC Peripheral State functions
* @{
*/
/* Peripheral State functions *************************************************/
uint32_t HAL_ADC_GetState(ADC_HandleTypeDef* hadc);
uint32_t HAL_ADC_GetError(ADC_HandleTypeDef *hadc);
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /*__STM32F3xx_ADC_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,640 @@
/**
******************************************************************************
* @file stm32f3xx_ll_cortex.h
* @author MCD Application Team
* @brief Header file of CORTEX LL module.
@verbatim
==============================================================================
##### How to use this driver #####
==============================================================================
[..]
The LL CORTEX driver contains a set of generic APIs that can be
used by user:
(+) SYSTICK configuration used by LL_mDelay and LL_Init1msTick
functions
(+) Low power mode configuration (SCB register of Cortex-MCU)
(+) MPU API to configure and enable regions
(MPU services provided only on some devices)
(+) API to access to MCU info (CPUID register)
(+) API to enable fault handler (SHCSR accesses)
@endverbatim
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F3xx_LL_CORTEX_H
#define __STM32F3xx_LL_CORTEX_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32f3xx.h"
/** @addtogroup STM32F3xx_LL_Driver
* @{
*/
/** @defgroup CORTEX_LL CORTEX
* @{
*/
/* Private types -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private constants ---------------------------------------------------------*/
/* Private macros ------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/** @defgroup CORTEX_LL_Exported_Constants CORTEX Exported Constants
* @{
*/
/** @defgroup CORTEX_LL_EC_CLKSOURCE_HCLK SYSTICK Clock Source
* @{
*/
#define LL_SYSTICK_CLKSOURCE_HCLK_DIV8 0x00000000U /*!< AHB clock divided by 8 selected as SysTick clock source.*/
#define LL_SYSTICK_CLKSOURCE_HCLK SysTick_CTRL_CLKSOURCE_Msk /*!< AHB clock selected as SysTick clock source. */
/**
* @}
*/
/** @defgroup CORTEX_LL_EC_FAULT Handler Fault type
* @{
*/
#define LL_HANDLER_FAULT_USG SCB_SHCSR_USGFAULTENA_Msk /*!< Usage fault */
#define LL_HANDLER_FAULT_BUS SCB_SHCSR_BUSFAULTENA_Msk /*!< Bus fault */
#define LL_HANDLER_FAULT_MEM SCB_SHCSR_MEMFAULTENA_Msk /*!< Memory management fault */
/**
* @}
*/
#if __MPU_PRESENT
/** @defgroup CORTEX_LL_EC_CTRL_HFNMI_PRIVDEF MPU Control
* @{
*/
#define LL_MPU_CTRL_HFNMI_PRIVDEF_NONE 0x00000000U /*!< Disable NMI and privileged SW access */
#define LL_MPU_CTRL_HARDFAULT_NMI MPU_CTRL_HFNMIENA_Msk /*!< Enables the operation of MPU during hard fault, NMI, and FAULTMASK handlers */
#define LL_MPU_CTRL_PRIVILEGED_DEFAULT MPU_CTRL_PRIVDEFENA_Msk /*!< Enable privileged software access to default memory map */
#define LL_MPU_CTRL_HFNMI_PRIVDEF (MPU_CTRL_HFNMIENA_Msk | MPU_CTRL_PRIVDEFENA_Msk) /*!< Enable NMI and privileged SW access */
/**
* @}
*/
/** @defgroup CORTEX_LL_EC_REGION MPU Region Number
* @{
*/
#define LL_MPU_REGION_NUMBER0 0x00U /*!< REGION Number 0 */
#define LL_MPU_REGION_NUMBER1 0x01U /*!< REGION Number 1 */
#define LL_MPU_REGION_NUMBER2 0x02U /*!< REGION Number 2 */
#define LL_MPU_REGION_NUMBER3 0x03U /*!< REGION Number 3 */
#define LL_MPU_REGION_NUMBER4 0x04U /*!< REGION Number 4 */
#define LL_MPU_REGION_NUMBER5 0x05U /*!< REGION Number 5 */
#define LL_MPU_REGION_NUMBER6 0x06U /*!< REGION Number 6 */
#define LL_MPU_REGION_NUMBER7 0x07U /*!< REGION Number 7 */
/**
* @}
*/
/** @defgroup CORTEX_LL_EC_REGION_SIZE MPU Region Size
* @{
*/
#define LL_MPU_REGION_SIZE_32B (0x04U << MPU_RASR_SIZE_Pos) /*!< 32B Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_64B (0x05U << MPU_RASR_SIZE_Pos) /*!< 64B Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_128B (0x06U << MPU_RASR_SIZE_Pos) /*!< 128B Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_256B (0x07U << MPU_RASR_SIZE_Pos) /*!< 256B Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_512B (0x08U << MPU_RASR_SIZE_Pos) /*!< 512B Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_1KB (0x09U << MPU_RASR_SIZE_Pos) /*!< 1KB Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_2KB (0x0AU << MPU_RASR_SIZE_Pos) /*!< 2KB Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_4KB (0x0BU << MPU_RASR_SIZE_Pos) /*!< 4KB Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_8KB (0x0CU << MPU_RASR_SIZE_Pos) /*!< 8KB Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_16KB (0x0DU << MPU_RASR_SIZE_Pos) /*!< 16KB Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_32KB (0x0EU << MPU_RASR_SIZE_Pos) /*!< 32KB Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_64KB (0x0FU << MPU_RASR_SIZE_Pos) /*!< 64KB Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_128KB (0x10U << MPU_RASR_SIZE_Pos) /*!< 128KB Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_256KB (0x11U << MPU_RASR_SIZE_Pos) /*!< 256KB Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_512KB (0x12U << MPU_RASR_SIZE_Pos) /*!< 512KB Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_1MB (0x13U << MPU_RASR_SIZE_Pos) /*!< 1MB Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_2MB (0x14U << MPU_RASR_SIZE_Pos) /*!< 2MB Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_4MB (0x15U << MPU_RASR_SIZE_Pos) /*!< 4MB Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_8MB (0x16U << MPU_RASR_SIZE_Pos) /*!< 8MB Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_16MB (0x17U << MPU_RASR_SIZE_Pos) /*!< 16MB Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_32MB (0x18U << MPU_RASR_SIZE_Pos) /*!< 32MB Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_64MB (0x19U << MPU_RASR_SIZE_Pos) /*!< 64MB Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_128MB (0x1AU << MPU_RASR_SIZE_Pos) /*!< 128MB Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_256MB (0x1BU << MPU_RASR_SIZE_Pos) /*!< 256MB Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_512MB (0x1CU << MPU_RASR_SIZE_Pos) /*!< 512MB Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_1GB (0x1DU << MPU_RASR_SIZE_Pos) /*!< 1GB Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_2GB (0x1EU << MPU_RASR_SIZE_Pos) /*!< 2GB Size of the MPU protection region */
#define LL_MPU_REGION_SIZE_4GB (0x1FU << MPU_RASR_SIZE_Pos) /*!< 4GB Size of the MPU protection region */
/**
* @}
*/
/** @defgroup CORTEX_LL_EC_REGION_PRIVILEDGES MPU Region Privileges
* @{
*/
#define LL_MPU_REGION_NO_ACCESS (0x00U << MPU_RASR_AP_Pos) /*!< No access*/
#define LL_MPU_REGION_PRIV_RW (0x01U << MPU_RASR_AP_Pos) /*!< RW privileged (privileged access only)*/
#define LL_MPU_REGION_PRIV_RW_URO (0x02U << MPU_RASR_AP_Pos) /*!< RW privileged - RO user (Write in a user program generates a fault) */
#define LL_MPU_REGION_FULL_ACCESS (0x03U << MPU_RASR_AP_Pos) /*!< RW privileged & user (Full access) */
#define LL_MPU_REGION_PRIV_RO (0x05U << MPU_RASR_AP_Pos) /*!< RO privileged (privileged read only)*/
#define LL_MPU_REGION_PRIV_RO_URO (0x06U << MPU_RASR_AP_Pos) /*!< RO privileged & user (read only) */
/**
* @}
*/
/** @defgroup CORTEX_LL_EC_TEX MPU TEX Level
* @{
*/
#define LL_MPU_TEX_LEVEL0 (0x00U << MPU_RASR_TEX_Pos) /*!< b000 for TEX bits */
#define LL_MPU_TEX_LEVEL1 (0x01U << MPU_RASR_TEX_Pos) /*!< b001 for TEX bits */
#define LL_MPU_TEX_LEVEL2 (0x02U << MPU_RASR_TEX_Pos) /*!< b010 for TEX bits */
#define LL_MPU_TEX_LEVEL4 (0x04U << MPU_RASR_TEX_Pos) /*!< b100 for TEX bits */
/**
* @}
*/
/** @defgroup CORTEX_LL_EC_INSTRUCTION_ACCESS MPU Instruction Access
* @{
*/
#define LL_MPU_INSTRUCTION_ACCESS_ENABLE 0x00U /*!< Instruction fetches enabled */
#define LL_MPU_INSTRUCTION_ACCESS_DISABLE MPU_RASR_XN_Msk /*!< Instruction fetches disabled*/
/**
* @}
*/
/** @defgroup CORTEX_LL_EC_SHAREABLE_ACCESS MPU Shareable Access
* @{
*/
#define LL_MPU_ACCESS_SHAREABLE MPU_RASR_S_Msk /*!< Shareable memory attribute */
#define LL_MPU_ACCESS_NOT_SHAREABLE 0x00U /*!< Not Shareable memory attribute */
/**
* @}
*/
/** @defgroup CORTEX_LL_EC_CACHEABLE_ACCESS MPU Cacheable Access
* @{
*/
#define LL_MPU_ACCESS_CACHEABLE MPU_RASR_C_Msk /*!< Cacheable memory attribute */
#define LL_MPU_ACCESS_NOT_CACHEABLE 0x00U /*!< Not Cacheable memory attribute */
/**
* @}
*/
/** @defgroup CORTEX_LL_EC_BUFFERABLE_ACCESS MPU Bufferable Access
* @{
*/
#define LL_MPU_ACCESS_BUFFERABLE MPU_RASR_B_Msk /*!< Bufferable memory attribute */
#define LL_MPU_ACCESS_NOT_BUFFERABLE 0x00U /*!< Not Bufferable memory attribute */
/**
* @}
*/
#endif /* __MPU_PRESENT */
/**
* @}
*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/
/** @defgroup CORTEX_LL_Exported_Functions CORTEX Exported Functions
* @{
*/
/** @defgroup CORTEX_LL_EF_SYSTICK SYSTICK
* @{
*/
/**
* @brief This function checks if the Systick counter flag is active or not.
* @note It can be used in timeout function on application side.
* @rmtoll STK_CTRL COUNTFLAG LL_SYSTICK_IsActiveCounterFlag
* @retval State of bit (1 or 0).
*/
__STATIC_INLINE uint32_t LL_SYSTICK_IsActiveCounterFlag(void)
{
return ((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == (SysTick_CTRL_COUNTFLAG_Msk));
}
/**
* @brief Configures the SysTick clock source
* @rmtoll STK_CTRL CLKSOURCE LL_SYSTICK_SetClkSource
* @param Source This parameter can be one of the following values:
* @arg @ref LL_SYSTICK_CLKSOURCE_HCLK_DIV8
* @arg @ref LL_SYSTICK_CLKSOURCE_HCLK
* @retval None
*/
__STATIC_INLINE void LL_SYSTICK_SetClkSource(uint32_t Source)
{
if (Source == LL_SYSTICK_CLKSOURCE_HCLK)
{
SET_BIT(SysTick->CTRL, LL_SYSTICK_CLKSOURCE_HCLK);
}
else
{
CLEAR_BIT(SysTick->CTRL, LL_SYSTICK_CLKSOURCE_HCLK);
}
}
/**
* @brief Get the SysTick clock source
* @rmtoll STK_CTRL CLKSOURCE LL_SYSTICK_GetClkSource
* @retval Returned value can be one of the following values:
* @arg @ref LL_SYSTICK_CLKSOURCE_HCLK_DIV8
* @arg @ref LL_SYSTICK_CLKSOURCE_HCLK
*/
__STATIC_INLINE uint32_t LL_SYSTICK_GetClkSource(void)
{
return READ_BIT(SysTick->CTRL, LL_SYSTICK_CLKSOURCE_HCLK);
}
/**
* @brief Enable SysTick exception request
* @rmtoll STK_CTRL TICKINT LL_SYSTICK_EnableIT
* @retval None
*/
__STATIC_INLINE void LL_SYSTICK_EnableIT(void)
{
SET_BIT(SysTick->CTRL, SysTick_CTRL_TICKINT_Msk);
}
/**
* @brief Disable SysTick exception request
* @rmtoll STK_CTRL TICKINT LL_SYSTICK_DisableIT
* @retval None
*/
__STATIC_INLINE void LL_SYSTICK_DisableIT(void)
{
CLEAR_BIT(SysTick->CTRL, SysTick_CTRL_TICKINT_Msk);
}
/**
* @brief Checks if the SYSTICK interrupt is enabled or disabled.
* @rmtoll STK_CTRL TICKINT LL_SYSTICK_IsEnabledIT
* @retval State of bit (1 or 0).
*/
__STATIC_INLINE uint32_t LL_SYSTICK_IsEnabledIT(void)
{
return (READ_BIT(SysTick->CTRL, SysTick_CTRL_TICKINT_Msk) == (SysTick_CTRL_TICKINT_Msk));
}
/**
* @}
*/
/** @defgroup CORTEX_LL_EF_LOW_POWER_MODE LOW POWER MODE
* @{
*/
/**
* @brief Processor uses sleep as its low power mode
* @rmtoll SCB_SCR SLEEPDEEP LL_LPM_EnableSleep
* @retval None
*/
__STATIC_INLINE void LL_LPM_EnableSleep(void)
{
/* Clear SLEEPDEEP bit of Cortex System Control Register */
CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk));
}
/**
* @brief Processor uses deep sleep as its low power mode
* @rmtoll SCB_SCR SLEEPDEEP LL_LPM_EnableDeepSleep
* @retval None
*/
__STATIC_INLINE void LL_LPM_EnableDeepSleep(void)
{
/* Set SLEEPDEEP bit of Cortex System Control Register */
SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk));
}
/**
* @brief Configures sleep-on-exit when returning from Handler mode to Thread mode.
* @note Setting this bit to 1 enables an interrupt-driven application to avoid returning to an
* empty main application.
* @rmtoll SCB_SCR SLEEPONEXIT LL_LPM_EnableSleepOnExit
* @retval None
*/
__STATIC_INLINE void LL_LPM_EnableSleepOnExit(void)
{
/* Set SLEEPONEXIT bit of Cortex System Control Register */
SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPONEXIT_Msk));
}
/**
* @brief Do not sleep when returning to Thread mode.
* @rmtoll SCB_SCR SLEEPONEXIT LL_LPM_DisableSleepOnExit
* @retval None
*/
__STATIC_INLINE void LL_LPM_DisableSleepOnExit(void)
{
/* Clear SLEEPONEXIT bit of Cortex System Control Register */
CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPONEXIT_Msk));
}
/**
* @brief Enabled events and all interrupts, including disabled interrupts, can wakeup the
* processor.
* @rmtoll SCB_SCR SEVEONPEND LL_LPM_EnableEventOnPend
* @retval None
*/
__STATIC_INLINE void LL_LPM_EnableEventOnPend(void)
{
/* Set SEVEONPEND bit of Cortex System Control Register */
SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SEVONPEND_Msk));
}
/**
* @brief Only enabled interrupts or events can wakeup the processor, disabled interrupts are
* excluded
* @rmtoll SCB_SCR SEVEONPEND LL_LPM_DisableEventOnPend
* @retval None
*/
__STATIC_INLINE void LL_LPM_DisableEventOnPend(void)
{
/* Clear SEVEONPEND bit of Cortex System Control Register */
CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SEVONPEND_Msk));
}
/**
* @}
*/
/** @defgroup CORTEX_LL_EF_HANDLER HANDLER
* @{
*/
/**
* @brief Enable a fault in System handler control register (SHCSR)
* @rmtoll SCB_SHCSR MEMFAULTENA LL_HANDLER_EnableFault
* @param Fault This parameter can be a combination of the following values:
* @arg @ref LL_HANDLER_FAULT_USG
* @arg @ref LL_HANDLER_FAULT_BUS
* @arg @ref LL_HANDLER_FAULT_MEM
* @retval None
*/
__STATIC_INLINE void LL_HANDLER_EnableFault(uint32_t Fault)
{
/* Enable the system handler fault */
SET_BIT(SCB->SHCSR, Fault);
}
/**
* @brief Disable a fault in System handler control register (SHCSR)
* @rmtoll SCB_SHCSR MEMFAULTENA LL_HANDLER_DisableFault
* @param Fault This parameter can be a combination of the following values:
* @arg @ref LL_HANDLER_FAULT_USG
* @arg @ref LL_HANDLER_FAULT_BUS
* @arg @ref LL_HANDLER_FAULT_MEM
* @retval None
*/
__STATIC_INLINE void LL_HANDLER_DisableFault(uint32_t Fault)
{
/* Disable the system handler fault */
CLEAR_BIT(SCB->SHCSR, Fault);
}
/**
* @}
*/
/** @defgroup CORTEX_LL_EF_MCU_INFO MCU INFO
* @{
*/
/**
* @brief Get Implementer code
* @rmtoll SCB_CPUID IMPLEMENTER LL_CPUID_GetImplementer
* @retval Value should be equal to 0x41 for ARM
*/
__STATIC_INLINE uint32_t LL_CPUID_GetImplementer(void)
{
return (uint32_t)(READ_BIT(SCB->CPUID, SCB_CPUID_IMPLEMENTER_Msk) >> SCB_CPUID_IMPLEMENTER_Pos);
}
/**
* @brief Get Variant number (The r value in the rnpn product revision identifier)
* @rmtoll SCB_CPUID VARIANT LL_CPUID_GetVariant
* @retval Value between 0 and 255 (0x0: revision 0)
*/
__STATIC_INLINE uint32_t LL_CPUID_GetVariant(void)
{
return (uint32_t)(READ_BIT(SCB->CPUID, SCB_CPUID_VARIANT_Msk) >> SCB_CPUID_VARIANT_Pos);
}
/**
* @brief Get Constant number
* @rmtoll SCB_CPUID ARCHITECTURE LL_CPUID_GetConstant
* @retval Value should be equal to 0xF for Cortex-M4 devices
*/
__STATIC_INLINE uint32_t LL_CPUID_GetConstant(void)
{
return (uint32_t)(READ_BIT(SCB->CPUID, SCB_CPUID_ARCHITECTURE_Msk) >> SCB_CPUID_ARCHITECTURE_Pos);
}
/**
* @brief Get Part number
* @rmtoll SCB_CPUID PARTNO LL_CPUID_GetParNo
* @retval Value should be equal to 0xC24 for Cortex-M4
*/
__STATIC_INLINE uint32_t LL_CPUID_GetParNo(void)
{
return (uint32_t)(READ_BIT(SCB->CPUID, SCB_CPUID_PARTNO_Msk) >> SCB_CPUID_PARTNO_Pos);
}
/**
* @brief Get Revision number (The p value in the rnpn product revision identifier, indicates patch release)
* @rmtoll SCB_CPUID REVISION LL_CPUID_GetRevision
* @retval Value between 0 and 255 (0x1: patch 1)
*/
__STATIC_INLINE uint32_t LL_CPUID_GetRevision(void)
{
return (uint32_t)(READ_BIT(SCB->CPUID, SCB_CPUID_REVISION_Msk) >> SCB_CPUID_REVISION_Pos);
}
/**
* @}
*/
#if __MPU_PRESENT
/** @defgroup CORTEX_LL_EF_MPU MPU
* @{
*/
/**
* @brief Enable MPU with input options
* @rmtoll MPU_CTRL ENABLE LL_MPU_Enable
* @param Options This parameter can be one of the following values:
* @arg @ref LL_MPU_CTRL_HFNMI_PRIVDEF_NONE
* @arg @ref LL_MPU_CTRL_HARDFAULT_NMI
* @arg @ref LL_MPU_CTRL_PRIVILEGED_DEFAULT
* @arg @ref LL_MPU_CTRL_HFNMI_PRIVDEF
* @retval None
*/
__STATIC_INLINE void LL_MPU_Enable(uint32_t Options)
{
/* Enable the MPU*/
WRITE_REG(MPU->CTRL, (MPU_CTRL_ENABLE_Msk | Options));
/* Ensure MPU settings take effects */
__DSB();
/* Sequence instruction fetches using update settings */
__ISB();
}
/**
* @brief Disable MPU
* @rmtoll MPU_CTRL ENABLE LL_MPU_Disable
* @retval None
*/
__STATIC_INLINE void LL_MPU_Disable(void)
{
/* Make sure outstanding transfers are done */
__DMB();
/* Disable MPU*/
WRITE_REG(MPU->CTRL, 0U);
}
/**
* @brief Check if MPU is enabled or not
* @rmtoll MPU_CTRL ENABLE LL_MPU_IsEnabled
* @retval State of bit (1 or 0).
*/
__STATIC_INLINE uint32_t LL_MPU_IsEnabled(void)
{
return (READ_BIT(MPU->CTRL, MPU_CTRL_ENABLE_Msk) == (MPU_CTRL_ENABLE_Msk));
}
/**
* @brief Enable a MPU region
* @rmtoll MPU_RASR ENABLE LL_MPU_EnableRegion
* @param Region This parameter can be one of the following values:
* @arg @ref LL_MPU_REGION_NUMBER0
* @arg @ref LL_MPU_REGION_NUMBER1
* @arg @ref LL_MPU_REGION_NUMBER2
* @arg @ref LL_MPU_REGION_NUMBER3
* @arg @ref LL_MPU_REGION_NUMBER4
* @arg @ref LL_MPU_REGION_NUMBER5
* @arg @ref LL_MPU_REGION_NUMBER6
* @arg @ref LL_MPU_REGION_NUMBER7
* @retval None
*/
__STATIC_INLINE void LL_MPU_EnableRegion(uint32_t Region)
{
/* Set Region number */
WRITE_REG(MPU->RNR, Region);
/* Enable the MPU region */
SET_BIT(MPU->RASR, MPU_RASR_ENABLE_Msk);
}
/**
* @brief Configure and enable a region
* @rmtoll MPU_RNR REGION LL_MPU_ConfigRegion\n
* MPU_RBAR REGION LL_MPU_ConfigRegion\n
* MPU_RBAR ADDR LL_MPU_ConfigRegion\n
* MPU_RASR XN LL_MPU_ConfigRegion\n
* MPU_RASR AP LL_MPU_ConfigRegion\n
* MPU_RASR S LL_MPU_ConfigRegion\n
* MPU_RASR C LL_MPU_ConfigRegion\n
* MPU_RASR B LL_MPU_ConfigRegion\n
* MPU_RASR SIZE LL_MPU_ConfigRegion
* @param Region This parameter can be one of the following values:
* @arg @ref LL_MPU_REGION_NUMBER0
* @arg @ref LL_MPU_REGION_NUMBER1
* @arg @ref LL_MPU_REGION_NUMBER2
* @arg @ref LL_MPU_REGION_NUMBER3
* @arg @ref LL_MPU_REGION_NUMBER4
* @arg @ref LL_MPU_REGION_NUMBER5
* @arg @ref LL_MPU_REGION_NUMBER6
* @arg @ref LL_MPU_REGION_NUMBER7
* @param Address Value of region base address
* @param SubRegionDisable Sub-region disable value between Min_Data = 0x00 and Max_Data = 0xFF
* @param Attributes This parameter can be a combination of the following values:
* @arg @ref LL_MPU_REGION_SIZE_32B or @ref LL_MPU_REGION_SIZE_64B or @ref LL_MPU_REGION_SIZE_128B or @ref LL_MPU_REGION_SIZE_256B or @ref LL_MPU_REGION_SIZE_512B
* or @ref LL_MPU_REGION_SIZE_1KB or @ref LL_MPU_REGION_SIZE_2KB or @ref LL_MPU_REGION_SIZE_4KB or @ref LL_MPU_REGION_SIZE_8KB or @ref LL_MPU_REGION_SIZE_16KB
* or @ref LL_MPU_REGION_SIZE_32KB or @ref LL_MPU_REGION_SIZE_64KB or @ref LL_MPU_REGION_SIZE_128KB or @ref LL_MPU_REGION_SIZE_256KB or @ref LL_MPU_REGION_SIZE_512KB
* or @ref LL_MPU_REGION_SIZE_1MB or @ref LL_MPU_REGION_SIZE_2MB or @ref LL_MPU_REGION_SIZE_4MB or @ref LL_MPU_REGION_SIZE_8MB or @ref LL_MPU_REGION_SIZE_16MB
* or @ref LL_MPU_REGION_SIZE_32MB or @ref LL_MPU_REGION_SIZE_64MB or @ref LL_MPU_REGION_SIZE_128MB or @ref LL_MPU_REGION_SIZE_256MB or @ref LL_MPU_REGION_SIZE_512MB
* or @ref LL_MPU_REGION_SIZE_1GB or @ref LL_MPU_REGION_SIZE_2GB or @ref LL_MPU_REGION_SIZE_4GB
* @arg @ref LL_MPU_REGION_NO_ACCESS or @ref LL_MPU_REGION_PRIV_RW or @ref LL_MPU_REGION_PRIV_RW_URO or @ref LL_MPU_REGION_FULL_ACCESS
* or @ref LL_MPU_REGION_PRIV_RO or @ref LL_MPU_REGION_PRIV_RO_URO
* @arg @ref LL_MPU_TEX_LEVEL0 or @ref LL_MPU_TEX_LEVEL1 or @ref LL_MPU_TEX_LEVEL2 or @ref LL_MPU_TEX_LEVEL4
* @arg @ref LL_MPU_INSTRUCTION_ACCESS_ENABLE or @ref LL_MPU_INSTRUCTION_ACCESS_DISABLE
* @arg @ref LL_MPU_ACCESS_SHAREABLE or @ref LL_MPU_ACCESS_NOT_SHAREABLE
* @arg @ref LL_MPU_ACCESS_CACHEABLE or @ref LL_MPU_ACCESS_NOT_CACHEABLE
* @arg @ref LL_MPU_ACCESS_BUFFERABLE or @ref LL_MPU_ACCESS_NOT_BUFFERABLE
* @retval None
*/
__STATIC_INLINE void LL_MPU_ConfigRegion(uint32_t Region, uint32_t SubRegionDisable, uint32_t Address, uint32_t Attributes)
{
/* Set Region number */
WRITE_REG(MPU->RNR, Region);
/* Set base address */
WRITE_REG(MPU->RBAR, (Address & 0xFFFFFFE0U));
/* Configure MPU */
WRITE_REG(MPU->RASR, (MPU_RASR_ENABLE_Msk | Attributes | SubRegionDisable << MPU_RASR_SRD_Pos));
}
/**
* @brief Disable a region
* @rmtoll MPU_RNR REGION LL_MPU_DisableRegion\n
* MPU_RASR ENABLE LL_MPU_DisableRegion
* @param Region This parameter can be one of the following values:
* @arg @ref LL_MPU_REGION_NUMBER0
* @arg @ref LL_MPU_REGION_NUMBER1
* @arg @ref LL_MPU_REGION_NUMBER2
* @arg @ref LL_MPU_REGION_NUMBER3
* @arg @ref LL_MPU_REGION_NUMBER4
* @arg @ref LL_MPU_REGION_NUMBER5
* @arg @ref LL_MPU_REGION_NUMBER6
* @arg @ref LL_MPU_REGION_NUMBER7
* @retval None
*/
__STATIC_INLINE void LL_MPU_DisableRegion(uint32_t Region)
{
/* Set Region number */
WRITE_REG(MPU->RNR, Region);
/* Disable the MPU region */
CLEAR_BIT(MPU->RASR, MPU_RASR_ENABLE_Msk);
}
/**
* @}
*/
#endif /* __MPU_PRESENT */
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* __STM32F3xx_LL_CORTEX_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,980 @@
/**
******************************************************************************
* @file stm32f3xx_ll_gpio.h
* @author MCD Application Team
* @brief Header file of GPIO LL module.
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F3xx_LL_GPIO_H
#define __STM32F3xx_LL_GPIO_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32f3xx.h"
/** @addtogroup STM32F3xx_LL_Driver
* @{
*/
#if defined (GPIOA) || defined (GPIOB) || defined (GPIOC) || defined (GPIOD) || defined (GPIOE) || defined (GPIOF) || defined (GPIOG) || defined (GPIOH)
/** @defgroup GPIO_LL GPIO
* @{
*/
/* Private types -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private constants ---------------------------------------------------------*/
/* Private macros ------------------------------------------------------------*/
#if defined(USE_FULL_LL_DRIVER)
/** @defgroup GPIO_LL_Private_Macros GPIO Private Macros
* @{
*/
/**
* @}
*/
#endif /*USE_FULL_LL_DRIVER*/
/* Exported types ------------------------------------------------------------*/
#if defined(USE_FULL_LL_DRIVER)
/** @defgroup GPIO_LL_ES_INIT GPIO Exported Init structures
* @{
*/
/**
* @brief LL GPIO Init Structure definition
*/
typedef struct
{
uint32_t Pin; /*!< Specifies the GPIO pins to be configured.
This parameter can be any value of @ref GPIO_LL_EC_PIN */
uint32_t Mode; /*!< Specifies the operating mode for the selected pins.
This parameter can be a value of @ref GPIO_LL_EC_MODE.
GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinMode().*/
uint32_t Speed; /*!< Specifies the speed for the selected pins.
This parameter can be a value of @ref GPIO_LL_EC_SPEED.
GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinSpeed().*/
uint32_t OutputType; /*!< Specifies the operating output type for the selected pins.
This parameter can be a value of @ref GPIO_LL_EC_OUTPUT.
GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinOutputType().*/
uint32_t Pull; /*!< Specifies the operating Pull-up/Pull down for the selected pins.
This parameter can be a value of @ref GPIO_LL_EC_PULL.
GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinPull().*/
uint32_t Alternate; /*!< Specifies the Peripheral to be connected to the selected pins.
This parameter can be a value of @ref GPIO_LL_EC_AF.
GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetAFPin_0_7() and LL_GPIO_SetAFPin_8_15().*/
} LL_GPIO_InitTypeDef;
/**
* @}
*/
#endif /* USE_FULL_LL_DRIVER */
/* Exported constants --------------------------------------------------------*/
/** @defgroup GPIO_LL_Exported_Constants GPIO Exported Constants
* @{
*/
/** @defgroup GPIO_LL_EC_PIN PIN
* @{
*/
#define LL_GPIO_PIN_0 GPIO_BSRR_BS_0 /*!< Select pin 0 */
#define LL_GPIO_PIN_1 GPIO_BSRR_BS_1 /*!< Select pin 1 */
#define LL_GPIO_PIN_2 GPIO_BSRR_BS_2 /*!< Select pin 2 */
#define LL_GPIO_PIN_3 GPIO_BSRR_BS_3 /*!< Select pin 3 */
#define LL_GPIO_PIN_4 GPIO_BSRR_BS_4 /*!< Select pin 4 */
#define LL_GPIO_PIN_5 GPIO_BSRR_BS_5 /*!< Select pin 5 */
#define LL_GPIO_PIN_6 GPIO_BSRR_BS_6 /*!< Select pin 6 */
#define LL_GPIO_PIN_7 GPIO_BSRR_BS_7 /*!< Select pin 7 */
#define LL_GPIO_PIN_8 GPIO_BSRR_BS_8 /*!< Select pin 8 */
#define LL_GPIO_PIN_9 GPIO_BSRR_BS_9 /*!< Select pin 9 */
#define LL_GPIO_PIN_10 GPIO_BSRR_BS_10 /*!< Select pin 10 */
#define LL_GPIO_PIN_11 GPIO_BSRR_BS_11 /*!< Select pin 11 */
#define LL_GPIO_PIN_12 GPIO_BSRR_BS_12 /*!< Select pin 12 */
#define LL_GPIO_PIN_13 GPIO_BSRR_BS_13 /*!< Select pin 13 */
#define LL_GPIO_PIN_14 GPIO_BSRR_BS_14 /*!< Select pin 14 */
#define LL_GPIO_PIN_15 GPIO_BSRR_BS_15 /*!< Select pin 15 */
#define LL_GPIO_PIN_ALL (GPIO_BSRR_BS_0 | GPIO_BSRR_BS_1 | GPIO_BSRR_BS_2 | \
GPIO_BSRR_BS_3 | GPIO_BSRR_BS_4 | GPIO_BSRR_BS_5 | \
GPIO_BSRR_BS_6 | GPIO_BSRR_BS_7 | GPIO_BSRR_BS_8 | \
GPIO_BSRR_BS_9 | GPIO_BSRR_BS_10 | GPIO_BSRR_BS_11 | \
GPIO_BSRR_BS_12 | GPIO_BSRR_BS_13 | GPIO_BSRR_BS_14 | \
GPIO_BSRR_BS_15) /*!< Select all pins */
/**
* @}
*/
/** @defgroup GPIO_LL_EC_MODE Mode
* @{
*/
#define LL_GPIO_MODE_INPUT (0x00000000U) /*!< Select input mode */
#define LL_GPIO_MODE_OUTPUT GPIO_MODER_MODER0_0 /*!< Select output mode */
#define LL_GPIO_MODE_ALTERNATE GPIO_MODER_MODER0_1 /*!< Select alternate function mode */
#define LL_GPIO_MODE_ANALOG GPIO_MODER_MODER0 /*!< Select analog mode */
/**
* @}
*/
/** @defgroup GPIO_LL_EC_OUTPUT Output Type
* @{
*/
#define LL_GPIO_OUTPUT_PUSHPULL (0x00000000U) /*!< Select push-pull as output type */
#define LL_GPIO_OUTPUT_OPENDRAIN GPIO_OTYPER_OT_0 /*!< Select open-drain as output type */
/**
* @}
*/
/** @defgroup GPIO_LL_EC_SPEED Output Speed
* @{
*/
#define LL_GPIO_SPEED_FREQ_LOW (0x00000000U) /*!< Select I/O low output speed */
#define LL_GPIO_SPEED_FREQ_MEDIUM GPIO_OSPEEDER_OSPEEDR0_0 /*!< Select I/O medium output speed */
#define LL_GPIO_SPEED_FREQ_HIGH GPIO_OSPEEDER_OSPEEDR0 /*!< Select I/O high output speed */
/**
* @}
*/
/** @defgroup GPIO_LL_EC_PULL Pull Up Pull Down
* @{
*/
#define LL_GPIO_PULL_NO (0x00000000U) /*!< Select I/O no pull */
#define LL_GPIO_PULL_UP GPIO_PUPDR_PUPDR0_0 /*!< Select I/O pull up */
#define LL_GPIO_PULL_DOWN GPIO_PUPDR_PUPDR0_1 /*!< Select I/O pull down */
/**
* @}
*/
/** @defgroup GPIO_LL_EC_AF Alternate Function
* @{
*/
#define LL_GPIO_AF_0 (0x0000000U) /*!< Select alternate function 0 */
#define LL_GPIO_AF_1 (0x0000001U) /*!< Select alternate function 1 */
#define LL_GPIO_AF_2 (0x0000002U) /*!< Select alternate function 2 */
#define LL_GPIO_AF_3 (0x0000003U) /*!< Select alternate function 3 */
#define LL_GPIO_AF_4 (0x0000004U) /*!< Select alternate function 4 */
#define LL_GPIO_AF_5 (0x0000005U) /*!< Select alternate function 5 */
#define LL_GPIO_AF_6 (0x0000006U) /*!< Select alternate function 6 */
#define LL_GPIO_AF_7 (0x0000007U) /*!< Select alternate function 7 */
#define LL_GPIO_AF_8 (0x0000008U) /*!< Select alternate function 8 */
#define LL_GPIO_AF_9 (0x0000009U) /*!< Select alternate function 9 */
#define LL_GPIO_AF_10 (0x000000AU) /*!< Select alternate function 10 */
#define LL_GPIO_AF_11 (0x000000BU) /*!< Select alternate function 11 */
#define LL_GPIO_AF_12 (0x000000CU) /*!< Select alternate function 12 */
#define LL_GPIO_AF_13 (0x000000DU) /*!< Select alternate function 13 */
#define LL_GPIO_AF_14 (0x000000EU) /*!< Select alternate function 14 */
#define LL_GPIO_AF_15 (0x000000FU) /*!< Select alternate function 15 */
/**
* @}
*/
/**
* @}
*/
/* Exported macro ------------------------------------------------------------*/
/** @defgroup GPIO_LL_Exported_Macros GPIO Exported Macros
* @{
*/
/** @defgroup GPIO_LL_EM_WRITE_READ Common Write and read registers Macros
* @{
*/
/**
* @brief Write a value in GPIO register
* @param __INSTANCE__ GPIO Instance
* @param __REG__ Register to be written
* @param __VALUE__ Value to be written in the register
* @retval None
*/
#define LL_GPIO_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
/**
* @brief Read a value in GPIO register
* @param __INSTANCE__ GPIO Instance
* @param __REG__ Register to be read
* @retval Register value
*/
#define LL_GPIO_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
/**
* @}
*/
/**
* @}
*/
/* Exported functions --------------------------------------------------------*/
/** @defgroup GPIO_LL_Exported_Functions GPIO Exported Functions
* @{
*/
/** @defgroup GPIO_LL_EF_Port_Configuration Port Configuration
* @{
*/
/**
* @brief Configure gpio mode for a dedicated pin on dedicated port.
* @note I/O mode can be Input mode, General purpose output, Alternate function mode or Analog.
* @note Warning: only one pin can be passed as parameter.
* @rmtoll MODER MODEy LL_GPIO_SetPinMode
* @param GPIOx GPIO Port
* @param Pin This parameter can be one of the following values:
* @arg @ref LL_GPIO_PIN_0
* @arg @ref LL_GPIO_PIN_1
* @arg @ref LL_GPIO_PIN_2
* @arg @ref LL_GPIO_PIN_3
* @arg @ref LL_GPIO_PIN_4
* @arg @ref LL_GPIO_PIN_5
* @arg @ref LL_GPIO_PIN_6
* @arg @ref LL_GPIO_PIN_7
* @arg @ref LL_GPIO_PIN_8
* @arg @ref LL_GPIO_PIN_9
* @arg @ref LL_GPIO_PIN_10
* @arg @ref LL_GPIO_PIN_11
* @arg @ref LL_GPIO_PIN_12
* @arg @ref LL_GPIO_PIN_13
* @arg @ref LL_GPIO_PIN_14
* @arg @ref LL_GPIO_PIN_15
* @param Mode This parameter can be one of the following values:
* @arg @ref LL_GPIO_MODE_INPUT
* @arg @ref LL_GPIO_MODE_OUTPUT
* @arg @ref LL_GPIO_MODE_ALTERNATE
* @arg @ref LL_GPIO_MODE_ANALOG
* @retval None
*/
__STATIC_INLINE void LL_GPIO_SetPinMode(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Mode)
{
MODIFY_REG(GPIOx->MODER, (GPIO_MODER_MODER0 << (POSITION_VAL(Pin) * 2U)), (Mode << (POSITION_VAL(Pin) * 2U)));
}
/**
* @brief Return gpio mode for a dedicated pin on dedicated port.
* @note I/O mode can be Input mode, General purpose output, Alternate function mode or Analog.
* @note Warning: only one pin can be passed as parameter.
* @rmtoll MODER MODEy LL_GPIO_GetPinMode
* @param GPIOx GPIO Port
* @param Pin This parameter can be one of the following values:
* @arg @ref LL_GPIO_PIN_0
* @arg @ref LL_GPIO_PIN_1
* @arg @ref LL_GPIO_PIN_2
* @arg @ref LL_GPIO_PIN_3
* @arg @ref LL_GPIO_PIN_4
* @arg @ref LL_GPIO_PIN_5
* @arg @ref LL_GPIO_PIN_6
* @arg @ref LL_GPIO_PIN_7
* @arg @ref LL_GPIO_PIN_8
* @arg @ref LL_GPIO_PIN_9
* @arg @ref LL_GPIO_PIN_10
* @arg @ref LL_GPIO_PIN_11
* @arg @ref LL_GPIO_PIN_12
* @arg @ref LL_GPIO_PIN_13
* @arg @ref LL_GPIO_PIN_14
* @arg @ref LL_GPIO_PIN_15
* @retval Returned value can be one of the following values:
* @arg @ref LL_GPIO_MODE_INPUT
* @arg @ref LL_GPIO_MODE_OUTPUT
* @arg @ref LL_GPIO_MODE_ALTERNATE
* @arg @ref LL_GPIO_MODE_ANALOG
*/
__STATIC_INLINE uint32_t LL_GPIO_GetPinMode(GPIO_TypeDef *GPIOx, uint32_t Pin)
{
return (uint32_t)(READ_BIT(GPIOx->MODER,
(GPIO_MODER_MODER0 << (POSITION_VAL(Pin) * 2U))) >> (POSITION_VAL(Pin) * 2U));
}
/**
* @brief Configure gpio output type for several pins on dedicated port.
* @note Output type as to be set when gpio pin is in output or
* alternate modes. Possible type are Push-pull or Open-drain.
* @rmtoll OTYPER OTy LL_GPIO_SetPinOutputType
* @param GPIOx GPIO Port
* @param PinMask This parameter can be a combination of the following values:
* @arg @ref LL_GPIO_PIN_0
* @arg @ref LL_GPIO_PIN_1
* @arg @ref LL_GPIO_PIN_2
* @arg @ref LL_GPIO_PIN_3
* @arg @ref LL_GPIO_PIN_4
* @arg @ref LL_GPIO_PIN_5
* @arg @ref LL_GPIO_PIN_6
* @arg @ref LL_GPIO_PIN_7
* @arg @ref LL_GPIO_PIN_8
* @arg @ref LL_GPIO_PIN_9
* @arg @ref LL_GPIO_PIN_10
* @arg @ref LL_GPIO_PIN_11
* @arg @ref LL_GPIO_PIN_12
* @arg @ref LL_GPIO_PIN_13
* @arg @ref LL_GPIO_PIN_14
* @arg @ref LL_GPIO_PIN_15
* @arg @ref LL_GPIO_PIN_ALL
* @param OutputType This parameter can be one of the following values:
* @arg @ref LL_GPIO_OUTPUT_PUSHPULL
* @arg @ref LL_GPIO_OUTPUT_OPENDRAIN
* @retval None
*/
__STATIC_INLINE void LL_GPIO_SetPinOutputType(GPIO_TypeDef *GPIOx, uint32_t PinMask, uint32_t OutputType)
{
MODIFY_REG(GPIOx->OTYPER, PinMask, (PinMask * OutputType));
}
/**
* @brief Return gpio output type for several pins on dedicated port.
* @note Output type as to be set when gpio pin is in output or
* alternate modes. Possible type are Push-pull or Open-drain.
* @note Warning: only one pin can be passed as parameter.
* @rmtoll OTYPER OTy LL_GPIO_GetPinOutputType
* @param GPIOx GPIO Port
* @param Pin This parameter can be one of the following values:
* @arg @ref LL_GPIO_PIN_0
* @arg @ref LL_GPIO_PIN_1
* @arg @ref LL_GPIO_PIN_2
* @arg @ref LL_GPIO_PIN_3
* @arg @ref LL_GPIO_PIN_4
* @arg @ref LL_GPIO_PIN_5
* @arg @ref LL_GPIO_PIN_6
* @arg @ref LL_GPIO_PIN_7
* @arg @ref LL_GPIO_PIN_8
* @arg @ref LL_GPIO_PIN_9
* @arg @ref LL_GPIO_PIN_10
* @arg @ref LL_GPIO_PIN_11
* @arg @ref LL_GPIO_PIN_12
* @arg @ref LL_GPIO_PIN_13
* @arg @ref LL_GPIO_PIN_14
* @arg @ref LL_GPIO_PIN_15
* @arg @ref LL_GPIO_PIN_ALL
* @retval Returned value can be one of the following values:
* @arg @ref LL_GPIO_OUTPUT_PUSHPULL
* @arg @ref LL_GPIO_OUTPUT_OPENDRAIN
*/
__STATIC_INLINE uint32_t LL_GPIO_GetPinOutputType(GPIO_TypeDef *GPIOx, uint32_t Pin)
{
return (uint32_t)(READ_BIT(GPIOx->OTYPER, Pin) >> POSITION_VAL(Pin));
}
/**
* @brief Configure gpio speed for a dedicated pin on dedicated port.
* @note I/O speed can be Low, Medium, Fast or High speed.
* @note Warning: only one pin can be passed as parameter.
* @note Refer to datasheet for frequency specifications and the power
* supply and load conditions for each speed.
* @rmtoll OSPEEDR OSPEEDy LL_GPIO_SetPinSpeed
* @param GPIOx GPIO Port
* @param Pin This parameter can be one of the following values:
* @arg @ref LL_GPIO_PIN_0
* @arg @ref LL_GPIO_PIN_1
* @arg @ref LL_GPIO_PIN_2
* @arg @ref LL_GPIO_PIN_3
* @arg @ref LL_GPIO_PIN_4
* @arg @ref LL_GPIO_PIN_5
* @arg @ref LL_GPIO_PIN_6
* @arg @ref LL_GPIO_PIN_7
* @arg @ref LL_GPIO_PIN_8
* @arg @ref LL_GPIO_PIN_9
* @arg @ref LL_GPIO_PIN_10
* @arg @ref LL_GPIO_PIN_11
* @arg @ref LL_GPIO_PIN_12
* @arg @ref LL_GPIO_PIN_13
* @arg @ref LL_GPIO_PIN_14
* @arg @ref LL_GPIO_PIN_15
* @param Speed This parameter can be one of the following values:
* @arg @ref LL_GPIO_SPEED_FREQ_LOW
* @arg @ref LL_GPIO_SPEED_FREQ_MEDIUM
* @arg @ref LL_GPIO_SPEED_FREQ_HIGH
* @retval None
*/
__STATIC_INLINE void LL_GPIO_SetPinSpeed(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Speed)
{
MODIFY_REG(GPIOx->OSPEEDR, (GPIO_OSPEEDER_OSPEEDR0 << (POSITION_VAL(Pin) * 2U)),
(Speed << (POSITION_VAL(Pin) * 2U)));
}
/**
* @brief Return gpio speed for a dedicated pin on dedicated port.
* @note I/O speed can be Low, Medium, Fast or High speed.
* @note Warning: only one pin can be passed as parameter.
* @note Refer to datasheet for frequency specifications and the power
* supply and load conditions for each speed.
* @rmtoll OSPEEDR OSPEEDy LL_GPIO_GetPinSpeed
* @param GPIOx GPIO Port
* @param Pin This parameter can be one of the following values:
* @arg @ref LL_GPIO_PIN_0
* @arg @ref LL_GPIO_PIN_1
* @arg @ref LL_GPIO_PIN_2
* @arg @ref LL_GPIO_PIN_3
* @arg @ref LL_GPIO_PIN_4
* @arg @ref LL_GPIO_PIN_5
* @arg @ref LL_GPIO_PIN_6
* @arg @ref LL_GPIO_PIN_7
* @arg @ref LL_GPIO_PIN_8
* @arg @ref LL_GPIO_PIN_9
* @arg @ref LL_GPIO_PIN_10
* @arg @ref LL_GPIO_PIN_11
* @arg @ref LL_GPIO_PIN_12
* @arg @ref LL_GPIO_PIN_13
* @arg @ref LL_GPIO_PIN_14
* @arg @ref LL_GPIO_PIN_15
* @retval Returned value can be one of the following values:
* @arg @ref LL_GPIO_SPEED_FREQ_LOW
* @arg @ref LL_GPIO_SPEED_FREQ_MEDIUM
* @arg @ref LL_GPIO_SPEED_FREQ_HIGH
*/
__STATIC_INLINE uint32_t LL_GPIO_GetPinSpeed(GPIO_TypeDef *GPIOx, uint32_t Pin)
{
return (uint32_t)(READ_BIT(GPIOx->OSPEEDR,
(GPIO_OSPEEDER_OSPEEDR0 << (POSITION_VAL(Pin) * 2U))) >> (POSITION_VAL(Pin) * 2U));
}
/**
* @brief Configure gpio pull-up or pull-down for a dedicated pin on a dedicated port.
* @note Warning: only one pin can be passed as parameter.
* @rmtoll PUPDR PUPDy LL_GPIO_SetPinPull
* @param GPIOx GPIO Port
* @param Pin This parameter can be one of the following values:
* @arg @ref LL_GPIO_PIN_0
* @arg @ref LL_GPIO_PIN_1
* @arg @ref LL_GPIO_PIN_2
* @arg @ref LL_GPIO_PIN_3
* @arg @ref LL_GPIO_PIN_4
* @arg @ref LL_GPIO_PIN_5
* @arg @ref LL_GPIO_PIN_6
* @arg @ref LL_GPIO_PIN_7
* @arg @ref LL_GPIO_PIN_8
* @arg @ref LL_GPIO_PIN_9
* @arg @ref LL_GPIO_PIN_10
* @arg @ref LL_GPIO_PIN_11
* @arg @ref LL_GPIO_PIN_12
* @arg @ref LL_GPIO_PIN_13
* @arg @ref LL_GPIO_PIN_14
* @arg @ref LL_GPIO_PIN_15
* @param Pull This parameter can be one of the following values:
* @arg @ref LL_GPIO_PULL_NO
* @arg @ref LL_GPIO_PULL_UP
* @arg @ref LL_GPIO_PULL_DOWN
* @retval None
*/
__STATIC_INLINE void LL_GPIO_SetPinPull(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Pull)
{
MODIFY_REG(GPIOx->PUPDR, (GPIO_PUPDR_PUPDR0 << (POSITION_VAL(Pin) * 2U)), (Pull << (POSITION_VAL(Pin) * 2U)));
}
/**
* @brief Return gpio pull-up or pull-down for a dedicated pin on a dedicated port
* @note Warning: only one pin can be passed as parameter.
* @rmtoll PUPDR PUPDy LL_GPIO_GetPinPull
* @param GPIOx GPIO Port
* @param Pin This parameter can be one of the following values:
* @arg @ref LL_GPIO_PIN_0
* @arg @ref LL_GPIO_PIN_1
* @arg @ref LL_GPIO_PIN_2
* @arg @ref LL_GPIO_PIN_3
* @arg @ref LL_GPIO_PIN_4
* @arg @ref LL_GPIO_PIN_5
* @arg @ref LL_GPIO_PIN_6
* @arg @ref LL_GPIO_PIN_7
* @arg @ref LL_GPIO_PIN_8
* @arg @ref LL_GPIO_PIN_9
* @arg @ref LL_GPIO_PIN_10
* @arg @ref LL_GPIO_PIN_11
* @arg @ref LL_GPIO_PIN_12
* @arg @ref LL_GPIO_PIN_13
* @arg @ref LL_GPIO_PIN_14
* @arg @ref LL_GPIO_PIN_15
* @retval Returned value can be one of the following values:
* @arg @ref LL_GPIO_PULL_NO
* @arg @ref LL_GPIO_PULL_UP
* @arg @ref LL_GPIO_PULL_DOWN
*/
__STATIC_INLINE uint32_t LL_GPIO_GetPinPull(GPIO_TypeDef *GPIOx, uint32_t Pin)
{
return (uint32_t)(READ_BIT(GPIOx->PUPDR,
(GPIO_PUPDR_PUPDR0 << (POSITION_VAL(Pin) * 2U))) >> (POSITION_VAL(Pin) * 2U));
}
/**
* @brief Configure gpio alternate function of a dedicated pin from 0 to 7 for a dedicated port.
* @note Possible values are from AF0 to AF15 depending on target.
* @note Warning: only one pin can be passed as parameter.
* @rmtoll AFRL AFSELy LL_GPIO_SetAFPin_0_7
* @param GPIOx GPIO Port
* @param Pin This parameter can be one of the following values:
* @arg @ref LL_GPIO_PIN_0
* @arg @ref LL_GPIO_PIN_1
* @arg @ref LL_GPIO_PIN_2
* @arg @ref LL_GPIO_PIN_3
* @arg @ref LL_GPIO_PIN_4
* @arg @ref LL_GPIO_PIN_5
* @arg @ref LL_GPIO_PIN_6
* @arg @ref LL_GPIO_PIN_7
* @param Alternate This parameter can be one of the following values:
* @arg @ref LL_GPIO_AF_0
* @arg @ref LL_GPIO_AF_1
* @arg @ref LL_GPIO_AF_2
* @arg @ref LL_GPIO_AF_3
* @arg @ref LL_GPIO_AF_4
* @arg @ref LL_GPIO_AF_5
* @arg @ref LL_GPIO_AF_6
* @arg @ref LL_GPIO_AF_7
* @arg @ref LL_GPIO_AF_8
* @arg @ref LL_GPIO_AF_9
* @arg @ref LL_GPIO_AF_10
* @arg @ref LL_GPIO_AF_11
* @arg @ref LL_GPIO_AF_12
* @arg @ref LL_GPIO_AF_13
* @arg @ref LL_GPIO_AF_14
* @arg @ref LL_GPIO_AF_15
* @retval None
*/
__STATIC_INLINE void LL_GPIO_SetAFPin_0_7(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Alternate)
{
MODIFY_REG(GPIOx->AFR[0], (GPIO_AFRL_AFRL0 << (POSITION_VAL(Pin) * 4U)),
(Alternate << (POSITION_VAL(Pin) * 4U)));
}
/**
* @brief Return gpio alternate function of a dedicated pin from 0 to 7 for a dedicated port.
* @rmtoll AFRL AFSELy LL_GPIO_GetAFPin_0_7
* @param GPIOx GPIO Port
* @param Pin This parameter can be one of the following values:
* @arg @ref LL_GPIO_PIN_0
* @arg @ref LL_GPIO_PIN_1
* @arg @ref LL_GPIO_PIN_2
* @arg @ref LL_GPIO_PIN_3
* @arg @ref LL_GPIO_PIN_4
* @arg @ref LL_GPIO_PIN_5
* @arg @ref LL_GPIO_PIN_6
* @arg @ref LL_GPIO_PIN_7
* @retval Returned value can be one of the following values:
* @arg @ref LL_GPIO_AF_0
* @arg @ref LL_GPIO_AF_1
* @arg @ref LL_GPIO_AF_2
* @arg @ref LL_GPIO_AF_3
* @arg @ref LL_GPIO_AF_4
* @arg @ref LL_GPIO_AF_5
* @arg @ref LL_GPIO_AF_6
* @arg @ref LL_GPIO_AF_7
* @arg @ref LL_GPIO_AF_8
* @arg @ref LL_GPIO_AF_9
* @arg @ref LL_GPIO_AF_10
* @arg @ref LL_GPIO_AF_11
* @arg @ref LL_GPIO_AF_12
* @arg @ref LL_GPIO_AF_13
* @arg @ref LL_GPIO_AF_14
* @arg @ref LL_GPIO_AF_15
*/
__STATIC_INLINE uint32_t LL_GPIO_GetAFPin_0_7(GPIO_TypeDef *GPIOx, uint32_t Pin)
{
return (uint32_t)(READ_BIT(GPIOx->AFR[0],
(GPIO_AFRL_AFRL0 << (POSITION_VAL(Pin) * 4U))) >> (POSITION_VAL(Pin) * 4U));
}
/**
* @brief Configure gpio alternate function of a dedicated pin from 8 to 15 for a dedicated port.
* @note Possible values are from AF0 to AF15 depending on target.
* @note Warning: only one pin can be passed as parameter.
* @rmtoll AFRH AFSELy LL_GPIO_SetAFPin_8_15
* @param GPIOx GPIO Port
* @param Pin This parameter can be one of the following values:
* @arg @ref LL_GPIO_PIN_8
* @arg @ref LL_GPIO_PIN_9
* @arg @ref LL_GPIO_PIN_10
* @arg @ref LL_GPIO_PIN_11
* @arg @ref LL_GPIO_PIN_12
* @arg @ref LL_GPIO_PIN_13
* @arg @ref LL_GPIO_PIN_14
* @arg @ref LL_GPIO_PIN_15
* @param Alternate This parameter can be one of the following values:
* @arg @ref LL_GPIO_AF_0
* @arg @ref LL_GPIO_AF_1
* @arg @ref LL_GPIO_AF_2
* @arg @ref LL_GPIO_AF_3
* @arg @ref LL_GPIO_AF_4
* @arg @ref LL_GPIO_AF_5
* @arg @ref LL_GPIO_AF_6
* @arg @ref LL_GPIO_AF_7
* @arg @ref LL_GPIO_AF_8
* @arg @ref LL_GPIO_AF_9
* @arg @ref LL_GPIO_AF_10
* @arg @ref LL_GPIO_AF_11
* @arg @ref LL_GPIO_AF_12
* @arg @ref LL_GPIO_AF_13
* @arg @ref LL_GPIO_AF_14
* @arg @ref LL_GPIO_AF_15
* @retval None
*/
__STATIC_INLINE void LL_GPIO_SetAFPin_8_15(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Alternate)
{
MODIFY_REG(GPIOx->AFR[1], (GPIO_AFRH_AFRH0 << (POSITION_VAL(Pin >> 8U) * 4U)),
(Alternate << (POSITION_VAL(Pin >> 8U) * 4U)));
}
/**
* @brief Return gpio alternate function of a dedicated pin from 8 to 15 for a dedicated port.
* @note Possible values are from AF0 to AF15 depending on target.
* @rmtoll AFRH AFSELy LL_GPIO_GetAFPin_8_15
* @param GPIOx GPIO Port
* @param Pin This parameter can be one of the following values:
* @arg @ref LL_GPIO_PIN_8
* @arg @ref LL_GPIO_PIN_9
* @arg @ref LL_GPIO_PIN_10
* @arg @ref LL_GPIO_PIN_11
* @arg @ref LL_GPIO_PIN_12
* @arg @ref LL_GPIO_PIN_13
* @arg @ref LL_GPIO_PIN_14
* @arg @ref LL_GPIO_PIN_15
* @retval Returned value can be one of the following values:
* @arg @ref LL_GPIO_AF_0
* @arg @ref LL_GPIO_AF_1
* @arg @ref LL_GPIO_AF_2
* @arg @ref LL_GPIO_AF_3
* @arg @ref LL_GPIO_AF_4
* @arg @ref LL_GPIO_AF_5
* @arg @ref LL_GPIO_AF_6
* @arg @ref LL_GPIO_AF_7
* @arg @ref LL_GPIO_AF_8
* @arg @ref LL_GPIO_AF_9
* @arg @ref LL_GPIO_AF_10
* @arg @ref LL_GPIO_AF_11
* @arg @ref LL_GPIO_AF_12
* @arg @ref LL_GPIO_AF_13
* @arg @ref LL_GPIO_AF_14
* @arg @ref LL_GPIO_AF_15
*/
__STATIC_INLINE uint32_t LL_GPIO_GetAFPin_8_15(GPIO_TypeDef *GPIOx, uint32_t Pin)
{
return (uint32_t)(READ_BIT(GPIOx->AFR[1],
(GPIO_AFRH_AFRH0 << (POSITION_VAL(Pin >> 8U) * 4U))) >> (POSITION_VAL(Pin >> 8U) * 4U));
}
/**
* @brief Lock configuration of several pins for a dedicated port.
* @note When the lock sequence has been applied on a port bit, the
* value of this port bit can no longer be modified until the
* next reset.
* @note Each lock bit freezes a specific configuration register
* (control and alternate function registers).
* @rmtoll LCKR LCKK LL_GPIO_LockPin
* @param GPIOx GPIO Port
* @param PinMask This parameter can be a combination of the following values:
* @arg @ref LL_GPIO_PIN_0
* @arg @ref LL_GPIO_PIN_1
* @arg @ref LL_GPIO_PIN_2
* @arg @ref LL_GPIO_PIN_3
* @arg @ref LL_GPIO_PIN_4
* @arg @ref LL_GPIO_PIN_5
* @arg @ref LL_GPIO_PIN_6
* @arg @ref LL_GPIO_PIN_7
* @arg @ref LL_GPIO_PIN_8
* @arg @ref LL_GPIO_PIN_9
* @arg @ref LL_GPIO_PIN_10
* @arg @ref LL_GPIO_PIN_11
* @arg @ref LL_GPIO_PIN_12
* @arg @ref LL_GPIO_PIN_13
* @arg @ref LL_GPIO_PIN_14
* @arg @ref LL_GPIO_PIN_15
* @arg @ref LL_GPIO_PIN_ALL
* @retval None
*/
__STATIC_INLINE void LL_GPIO_LockPin(GPIO_TypeDef *GPIOx, uint32_t PinMask)
{
__IO uint32_t temp;
WRITE_REG(GPIOx->LCKR, GPIO_LCKR_LCKK | PinMask);
WRITE_REG(GPIOx->LCKR, PinMask);
WRITE_REG(GPIOx->LCKR, GPIO_LCKR_LCKK | PinMask);
temp = READ_REG(GPIOx->LCKR);
(void) temp;
}
/**
* @brief Return 1 if all pins passed as parameter, of a dedicated port, are locked. else Return 0.
* @rmtoll LCKR LCKy LL_GPIO_IsPinLocked
* @param GPIOx GPIO Port
* @param PinMask This parameter can be a combination of the following values:
* @arg @ref LL_GPIO_PIN_0
* @arg @ref LL_GPIO_PIN_1
* @arg @ref LL_GPIO_PIN_2
* @arg @ref LL_GPIO_PIN_3
* @arg @ref LL_GPIO_PIN_4
* @arg @ref LL_GPIO_PIN_5
* @arg @ref LL_GPIO_PIN_6
* @arg @ref LL_GPIO_PIN_7
* @arg @ref LL_GPIO_PIN_8
* @arg @ref LL_GPIO_PIN_9
* @arg @ref LL_GPIO_PIN_10
* @arg @ref LL_GPIO_PIN_11
* @arg @ref LL_GPIO_PIN_12
* @arg @ref LL_GPIO_PIN_13
* @arg @ref LL_GPIO_PIN_14
* @arg @ref LL_GPIO_PIN_15
* @arg @ref LL_GPIO_PIN_ALL
* @retval State of bit (1 or 0).
*/
__STATIC_INLINE uint32_t LL_GPIO_IsPinLocked(GPIO_TypeDef *GPIOx, uint32_t PinMask)
{
return (READ_BIT(GPIOx->LCKR, PinMask) == (PinMask));
}
/**
* @brief Return 1 if one of the pin of a dedicated port is locked. else return 0.
* @rmtoll LCKR LCKK LL_GPIO_IsAnyPinLocked
* @param GPIOx GPIO Port
* @retval State of bit (1 or 0).
*/
__STATIC_INLINE uint32_t LL_GPIO_IsAnyPinLocked(GPIO_TypeDef *GPIOx)
{
return (READ_BIT(GPIOx->LCKR, GPIO_LCKR_LCKK) == (GPIO_LCKR_LCKK));
}
/**
* @}
*/
/** @defgroup GPIO_LL_EF_Data_Access Data Access
* @{
*/
/**
* @brief Return full input data register value for a dedicated port.
* @rmtoll IDR IDy LL_GPIO_ReadInputPort
* @param GPIOx GPIO Port
* @retval Input data register value of port
*/
__STATIC_INLINE uint32_t LL_GPIO_ReadInputPort(GPIO_TypeDef *GPIOx)
{
return (uint32_t)(READ_REG(GPIOx->IDR));
}
/**
* @brief Return if input data level for several pins of dedicated port is high or low.
* @rmtoll IDR IDy LL_GPIO_IsInputPinSet
* @param GPIOx GPIO Port
* @param PinMask This parameter can be a combination of the following values:
* @arg @ref LL_GPIO_PIN_0
* @arg @ref LL_GPIO_PIN_1
* @arg @ref LL_GPIO_PIN_2
* @arg @ref LL_GPIO_PIN_3
* @arg @ref LL_GPIO_PIN_4
* @arg @ref LL_GPIO_PIN_5
* @arg @ref LL_GPIO_PIN_6
* @arg @ref LL_GPIO_PIN_7
* @arg @ref LL_GPIO_PIN_8
* @arg @ref LL_GPIO_PIN_9
* @arg @ref LL_GPIO_PIN_10
* @arg @ref LL_GPIO_PIN_11
* @arg @ref LL_GPIO_PIN_12
* @arg @ref LL_GPIO_PIN_13
* @arg @ref LL_GPIO_PIN_14
* @arg @ref LL_GPIO_PIN_15
* @arg @ref LL_GPIO_PIN_ALL
* @retval State of bit (1 or 0).
*/
__STATIC_INLINE uint32_t LL_GPIO_IsInputPinSet(GPIO_TypeDef *GPIOx, uint32_t PinMask)
{
return (READ_BIT(GPIOx->IDR, PinMask) == (PinMask));
}
/**
* @brief Write output data register for the port.
* @rmtoll ODR ODy LL_GPIO_WriteOutputPort
* @param GPIOx GPIO Port
* @param PortValue Level value for each pin of the port
* @retval None
*/
__STATIC_INLINE void LL_GPIO_WriteOutputPort(GPIO_TypeDef *GPIOx, uint32_t PortValue)
{
WRITE_REG(GPIOx->ODR, PortValue);
}
/**
* @brief Return full output data register value for a dedicated port.
* @rmtoll ODR ODy LL_GPIO_ReadOutputPort
* @param GPIOx GPIO Port
* @retval Output data register value of port
*/
__STATIC_INLINE uint32_t LL_GPIO_ReadOutputPort(GPIO_TypeDef *GPIOx)
{
return (uint32_t)(READ_REG(GPIOx->ODR));
}
/**
* @brief Return if input data level for several pins of dedicated port is high or low.
* @rmtoll ODR ODy LL_GPIO_IsOutputPinSet
* @param GPIOx GPIO Port
* @param PinMask This parameter can be a combination of the following values:
* @arg @ref LL_GPIO_PIN_0
* @arg @ref LL_GPIO_PIN_1
* @arg @ref LL_GPIO_PIN_2
* @arg @ref LL_GPIO_PIN_3
* @arg @ref LL_GPIO_PIN_4
* @arg @ref LL_GPIO_PIN_5
* @arg @ref LL_GPIO_PIN_6
* @arg @ref LL_GPIO_PIN_7
* @arg @ref LL_GPIO_PIN_8
* @arg @ref LL_GPIO_PIN_9
* @arg @ref LL_GPIO_PIN_10
* @arg @ref LL_GPIO_PIN_11
* @arg @ref LL_GPIO_PIN_12
* @arg @ref LL_GPIO_PIN_13
* @arg @ref LL_GPIO_PIN_14
* @arg @ref LL_GPIO_PIN_15
* @arg @ref LL_GPIO_PIN_ALL
* @retval State of bit (1 or 0).
*/
__STATIC_INLINE uint32_t LL_GPIO_IsOutputPinSet(GPIO_TypeDef *GPIOx, uint32_t PinMask)
{
return (READ_BIT(GPIOx->ODR, PinMask) == (PinMask));
}
/**
* @brief Set several pins to high level on dedicated gpio port.
* @rmtoll BSRR BSy LL_GPIO_SetOutputPin
* @param GPIOx GPIO Port
* @param PinMask This parameter can be a combination of the following values:
* @arg @ref LL_GPIO_PIN_0
* @arg @ref LL_GPIO_PIN_1
* @arg @ref LL_GPIO_PIN_2
* @arg @ref LL_GPIO_PIN_3
* @arg @ref LL_GPIO_PIN_4
* @arg @ref LL_GPIO_PIN_5
* @arg @ref LL_GPIO_PIN_6
* @arg @ref LL_GPIO_PIN_7
* @arg @ref LL_GPIO_PIN_8
* @arg @ref LL_GPIO_PIN_9
* @arg @ref LL_GPIO_PIN_10
* @arg @ref LL_GPIO_PIN_11
* @arg @ref LL_GPIO_PIN_12
* @arg @ref LL_GPIO_PIN_13
* @arg @ref LL_GPIO_PIN_14
* @arg @ref LL_GPIO_PIN_15
* @arg @ref LL_GPIO_PIN_ALL
* @retval None
*/
__STATIC_INLINE void LL_GPIO_SetOutputPin(GPIO_TypeDef *GPIOx, uint32_t PinMask)
{
WRITE_REG(GPIOx->BSRR, PinMask);
}
/**
* @brief Set several pins to low level on dedicated gpio port.
* @rmtoll BRR BRy LL_GPIO_ResetOutputPin
* @param GPIOx GPIO Port
* @param PinMask This parameter can be a combination of the following values:
* @arg @ref LL_GPIO_PIN_0
* @arg @ref LL_GPIO_PIN_1
* @arg @ref LL_GPIO_PIN_2
* @arg @ref LL_GPIO_PIN_3
* @arg @ref LL_GPIO_PIN_4
* @arg @ref LL_GPIO_PIN_5
* @arg @ref LL_GPIO_PIN_6
* @arg @ref LL_GPIO_PIN_7
* @arg @ref LL_GPIO_PIN_8
* @arg @ref LL_GPIO_PIN_9
* @arg @ref LL_GPIO_PIN_10
* @arg @ref LL_GPIO_PIN_11
* @arg @ref LL_GPIO_PIN_12
* @arg @ref LL_GPIO_PIN_13
* @arg @ref LL_GPIO_PIN_14
* @arg @ref LL_GPIO_PIN_15
* @arg @ref LL_GPIO_PIN_ALL
* @retval None
*/
__STATIC_INLINE void LL_GPIO_ResetOutputPin(GPIO_TypeDef *GPIOx, uint32_t PinMask)
{
WRITE_REG(GPIOx->BRR, PinMask);
}
/**
* @brief Toggle data value for several pin of dedicated port.
* @rmtoll ODR ODy LL_GPIO_TogglePin
* @param GPIOx GPIO Port
* @param PinMask This parameter can be a combination of the following values:
* @arg @ref LL_GPIO_PIN_0
* @arg @ref LL_GPIO_PIN_1
* @arg @ref LL_GPIO_PIN_2
* @arg @ref LL_GPIO_PIN_3
* @arg @ref LL_GPIO_PIN_4
* @arg @ref LL_GPIO_PIN_5
* @arg @ref LL_GPIO_PIN_6
* @arg @ref LL_GPIO_PIN_7
* @arg @ref LL_GPIO_PIN_8
* @arg @ref LL_GPIO_PIN_9
* @arg @ref LL_GPIO_PIN_10
* @arg @ref LL_GPIO_PIN_11
* @arg @ref LL_GPIO_PIN_12
* @arg @ref LL_GPIO_PIN_13
* @arg @ref LL_GPIO_PIN_14
* @arg @ref LL_GPIO_PIN_15
* @arg @ref LL_GPIO_PIN_ALL
* @retval None
*/
__STATIC_INLINE void LL_GPIO_TogglePin(GPIO_TypeDef *GPIOx, uint32_t PinMask)
{
uint32_t odr = READ_REG(GPIOx->ODR);
WRITE_REG(GPIOx->BSRR, ((odr & PinMask) << 16u) | (~odr & PinMask));
}
/**
* @}
*/
#if defined(USE_FULL_LL_DRIVER)
/** @defgroup GPIO_LL_EF_Init Initialization and de-initialization functions
* @{
*/
ErrorStatus LL_GPIO_DeInit(GPIO_TypeDef *GPIOx);
ErrorStatus LL_GPIO_Init(GPIO_TypeDef *GPIOx, LL_GPIO_InitTypeDef *GPIO_InitStruct);
void LL_GPIO_StructInit(LL_GPIO_InitTypeDef *GPIO_InitStruct);
/**
* @}
*/
#endif /* USE_FULL_LL_DRIVER */
/**
* @}
*/
/**
* @}
*/
#endif /* defined (GPIOA) || defined (GPIOB) || defined (GPIOC) || defined (GPIOD) || defined (GPIOE) || defined (GPIOF) || defined (GPIOG) || defined (GPIOH) */
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* __STM32F3xx_LL_GPIO_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -0,0 +1,554 @@
/**
******************************************************************************
* @file stm32f3xx_ll_pwr.h
* @author MCD Application Team
* @brief Header file of PWR LL module.
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F3xx_LL_PWR_H
#define __STM32F3xx_LL_PWR_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32f3xx.h"
/** @addtogroup STM32F3xx_LL_Driver
* @{
*/
#if defined(PWR)
/** @defgroup PWR_LL PWR
* @{
*/
/* Private types -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private constants ---------------------------------------------------------*/
/* Private macros ------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/** @defgroup PWR_LL_Exported_Constants PWR Exported Constants
* @{
*/
/** @defgroup PWR_LL_EC_CLEAR_FLAG Clear Flags Defines
* @brief Flags defines which can be used with LL_PWR_WriteReg function
* @{
*/
#define LL_PWR_CR_CSBF PWR_CR_CSBF /*!< Clear standby flag */
#define LL_PWR_CR_CWUF PWR_CR_CWUF /*!< Clear wakeup flag */
/**
* @}
*/
/** @defgroup PWR_LL_EC_GET_FLAG Get Flags Defines
* @brief Flags defines which can be used with LL_PWR_ReadReg function
* @{
*/
#define LL_PWR_CSR_WUF PWR_CSR_WUF /*!< Wakeup flag */
#define LL_PWR_CSR_SBF PWR_CSR_SBF /*!< Standby flag */
#if defined(PWR_PVD_SUPPORT)
#define LL_PWR_CSR_PVDO PWR_CSR_PVDO /*!< Power voltage detector output flag */
#endif /* PWR_PVD_SUPPORT */
#if defined(PWR_CSR_VREFINTRDYF)
#define LL_PWR_CSR_VREFINTRDYF PWR_CSR_VREFINTRDYF /*!< VREFINT ready flag */
#endif /* PWR_CSR_VREFINTRDYF */
#define LL_PWR_CSR_EWUP1 PWR_CSR_EWUP1 /*!< Enable WKUP pin 1 */
#define LL_PWR_CSR_EWUP2 PWR_CSR_EWUP2 /*!< Enable WKUP pin 2 */
#if defined(PWR_CSR_EWUP3)
#define LL_PWR_CSR_EWUP3 PWR_CSR_EWUP3 /*!< Enable WKUP pin 3 */
#endif /* PWR_CSR_EWUP3 */
/**
* @}
*/
/** @defgroup PWR_LL_EC_MODE_PWR Mode Power
* @{
*/
#define LL_PWR_MODE_STOP_MAINREGU 0x00000000U /*!< Enter Stop mode when the CPU enters deepsleep */
#define LL_PWR_MODE_STOP_LPREGU (PWR_CR_LPDS) /*!< Enter Stop mode (with low power Regulator ON) when the CPU enters deepsleep */
#define LL_PWR_MODE_STANDBY (PWR_CR_PDDS) /*!< Enter Standby mode when the CPU enters deepsleep */
/**
* @}
*/
#if defined(PWR_CR_LPDS)
/** @defgroup PWR_LL_EC_REGU_MODE_DS_MODE Regulator Mode In Deep Sleep Mode
* @{
*/
#define LL_PWR_REGU_DSMODE_MAIN 0x00000000U /*!< Voltage Regulator in main mode during deepsleep mode */
#define LL_PWR_REGU_DSMODE_LOW_POWER (PWR_CR_LPDS) /*!< Voltage Regulator in low-power mode during deepsleep mode */
/**
* @}
*/
#endif /* PWR_CR_LPDS */
#if defined(PWR_PVD_SUPPORT)
/** @defgroup PWR_LL_EC_PVDLEVEL Power Voltage Detector Level
* @{
*/
#define LL_PWR_PVDLEVEL_0 (PWR_CR_PLS_LEV0) /*!< Voltage threshold detected by PVD 2.2 V */
#define LL_PWR_PVDLEVEL_1 (PWR_CR_PLS_LEV1) /*!< Voltage threshold detected by PVD 2.3 V */
#define LL_PWR_PVDLEVEL_2 (PWR_CR_PLS_LEV2) /*!< Voltage threshold detected by PVD 2.4 V */
#define LL_PWR_PVDLEVEL_3 (PWR_CR_PLS_LEV3) /*!< Voltage threshold detected by PVD 2.5 V */
#define LL_PWR_PVDLEVEL_4 (PWR_CR_PLS_LEV4) /*!< Voltage threshold detected by PVD 2.6 V */
#define LL_PWR_PVDLEVEL_5 (PWR_CR_PLS_LEV5) /*!< Voltage threshold detected by PVD 2.7 V */
#define LL_PWR_PVDLEVEL_6 (PWR_CR_PLS_LEV6) /*!< Voltage threshold detected by PVD 2.8 V */
#define LL_PWR_PVDLEVEL_7 (PWR_CR_PLS_LEV7) /*!< Voltage threshold detected by PVD 2.9 V */
/**
* @}
*/
#endif /* PWR_PVD_SUPPORT */
/** @defgroup PWR_LL_EC_WAKEUP_PIN Wakeup Pins
* @{
*/
#define LL_PWR_WAKEUP_PIN1 (PWR_CSR_EWUP1) /*!< WKUP pin 1 : PA0 */
#define LL_PWR_WAKEUP_PIN2 (PWR_CSR_EWUP2) /*!< WKUP pin 2 : PC13 */
#if defined(PWR_CSR_EWUP3)
#define LL_PWR_WAKEUP_PIN3 (PWR_CSR_EWUP3) /*!< WKUP pin 3 : PE6 or PA2 according to device */
#endif /* PWR_CSR_EWUP3 */
/**
* @}
*/
/** @defgroup PWR_LL_EC_SDADC_ANALOG_X SDADC Analogx
* @{
*/
#if defined(SDADC1)
#define LL_PWR_SDADC_ANALOG1 (PWR_CR_ENSD1) /*!< Enable SDADC1 */
#endif /* SDADC1 */
#if defined(SDADC2)
#define LL_PWR_SDADC_ANALOG2 (PWR_CR_ENSD2) /*!< Enable SDADC2 */
#endif /* SDADC2 */
#if defined(SDADC3)
#define LL_PWR_SDADC_ANALOG3 (PWR_CR_ENSD3) /*!< Enable SDADC3 */
#endif /* SDADC3 */
/**
* @}
*/
/**
* @}
*/
/* Exported macro ------------------------------------------------------------*/
/** @defgroup PWR_LL_Exported_Macros PWR Exported Macros
* @{
*/
/** @defgroup PWR_LL_EM_WRITE_READ Common write and read registers Macros
* @{
*/
/**
* @brief Write a value in PWR register
* @param __REG__ Register to be written
* @param __VALUE__ Value to be written in the register
* @retval None
*/
#define LL_PWR_WriteReg(__REG__, __VALUE__) WRITE_REG(PWR->__REG__, (__VALUE__))
/**
* @brief Read a value in PWR register
* @param __REG__ Register to be read
* @retval Register value
*/
#define LL_PWR_ReadReg(__REG__) READ_REG(PWR->__REG__)
/**
* @}
*/
/**
* @}
*/
/* Exported functions --------------------------------------------------------*/
/** @defgroup PWR_LL_Exported_Functions PWR Exported Functions
* @{
*/
/** @defgroup PWR_LL_EF_Configuration Configuration
* @{
*/
/**
* @brief Enables the SDADC peripheral functionality
* @rmtoll CR ENSD1 LL_PWR_EnableSDADC\n
* CR ENSD2 LL_PWR_EnableSDADC\n
* CR ENSD3 LL_PWR_EnableSDADC
* @param Analogx This parameter can be a combination of the following values:
* @arg @ref LL_PWR_SDADC_ANALOG1
* @arg @ref LL_PWR_SDADC_ANALOG2
* @arg @ref LL_PWR_SDADC_ANALOG3
* @retval None
*/
__STATIC_INLINE void LL_PWR_EnableSDADC(uint32_t Analogx)
{
SET_BIT(PWR->CR, Analogx);
}
/**
* @brief Disables the SDADC peripheral functionality
* @rmtoll CR ENSD1 LL_PWR_EnableSDADC\n
* CR ENSD2 LL_PWR_EnableSDADC\n
* CR ENSD3 LL_PWR_EnableSDADC
* @param Analogx This parameter can be a combination of the following values:
* @arg @ref LL_PWR_SDADC_ANALOG1
* @arg @ref LL_PWR_SDADC_ANALOG2
* @arg @ref LL_PWR_SDADC_ANALOG3
* @retval None
*/
__STATIC_INLINE void LL_PWR_DisableSDADC(uint32_t Analogx)
{
CLEAR_BIT(PWR->CR, Analogx);
}
/**
* @brief Check if SDADCx has been enabled or not
* @rmtoll CR ENSD1 LL_PWR_IsEnabledSDADC\n
* CR ENSD2 LL_PWR_IsEnabledSDADC\n
* CR ENSD3 LL_PWR_IsEnabledSDADC
* @param Analogx This parameter can be a combination of the following values:
* @arg @ref LL_PWR_SDADC_ANALOG1
* @arg @ref LL_PWR_SDADC_ANALOG2
* @arg @ref LL_PWR_SDADC_ANALOG3
* @retval None
*/
__STATIC_INLINE uint32_t LL_PWR_IsEnabledSDADC(uint32_t Analogx)
{
return (READ_BIT(PWR->CR, Analogx) == (Analogx));
}
/**
* @brief Enable access to the backup domain
* @rmtoll CR DBP LL_PWR_EnableBkUpAccess
* @retval None
*/
__STATIC_INLINE void LL_PWR_EnableBkUpAccess(void)
{
SET_BIT(PWR->CR, PWR_CR_DBP);
}
/**
* @brief Disable access to the backup domain
* @rmtoll CR DBP LL_PWR_DisableBkUpAccess
* @retval None
*/
__STATIC_INLINE void LL_PWR_DisableBkUpAccess(void)
{
CLEAR_BIT(PWR->CR, PWR_CR_DBP);
}
/**
* @brief Check if the backup domain is enabled
* @rmtoll CR DBP LL_PWR_IsEnabledBkUpAccess
* @retval State of bit (1 or 0).
*/
__STATIC_INLINE uint32_t LL_PWR_IsEnabledBkUpAccess(void)
{
return (READ_BIT(PWR->CR, PWR_CR_DBP) == (PWR_CR_DBP));
}
#if defined(PWR_CR_LPDS)
/**
* @brief Set voltage Regulator mode during deep sleep mode
* @rmtoll CR LPDS LL_PWR_SetRegulModeDS
* @param RegulMode This parameter can be one of the following values:
* @arg @ref LL_PWR_REGU_DSMODE_MAIN
* @arg @ref LL_PWR_REGU_DSMODE_LOW_POWER
* @retval None
*/
__STATIC_INLINE void LL_PWR_SetRegulModeDS(uint32_t RegulMode)
{
MODIFY_REG(PWR->CR, PWR_CR_LPDS, RegulMode);
}
/**
* @brief Get voltage Regulator mode during deep sleep mode
* @rmtoll CR LPDS LL_PWR_GetRegulModeDS
* @retval Returned value can be one of the following values:
* @arg @ref LL_PWR_REGU_DSMODE_MAIN
* @arg @ref LL_PWR_REGU_DSMODE_LOW_POWER
*/
__STATIC_INLINE uint32_t LL_PWR_GetRegulModeDS(void)
{
return (uint32_t)(READ_BIT(PWR->CR, PWR_CR_LPDS));
}
#endif /* PWR_CR_LPDS */
/**
* @brief Set Power Down mode when CPU enters deepsleep
* @rmtoll CR PDDS LL_PWR_SetPowerMode\n
* @rmtoll CR LPDS LL_PWR_SetPowerMode
* @param PDMode This parameter can be one of the following values:
* @arg @ref LL_PWR_MODE_STOP_MAINREGU
* @arg @ref LL_PWR_MODE_STOP_LPREGU
* @arg @ref LL_PWR_MODE_STANDBY
* @retval None
*/
__STATIC_INLINE void LL_PWR_SetPowerMode(uint32_t PDMode)
{
MODIFY_REG(PWR->CR, (PWR_CR_PDDS| PWR_CR_LPDS), PDMode);
}
/**
* @brief Get Power Down mode when CPU enters deepsleep
* @rmtoll CR PDDS LL_PWR_GetPowerMode\n
* @rmtoll CR LPDS LL_PWR_GetPowerMode
* @retval Returned value can be one of the following values:
* @arg @ref LL_PWR_MODE_STOP_MAINREGU
* @arg @ref LL_PWR_MODE_STOP_LPREGU
* @arg @ref LL_PWR_MODE_STANDBY
*/
__STATIC_INLINE uint32_t LL_PWR_GetPowerMode(void)
{
return (uint32_t)(READ_BIT(PWR->CR, (PWR_CR_PDDS| PWR_CR_LPDS)));
}
#if defined(PWR_PVD_SUPPORT)
/**
* @brief Configure the voltage threshold detected by the Power Voltage Detector
* @rmtoll CR PLS LL_PWR_SetPVDLevel
* @param PVDLevel This parameter can be one of the following values:
* @arg @ref LL_PWR_PVDLEVEL_0
* @arg @ref LL_PWR_PVDLEVEL_1
* @arg @ref LL_PWR_PVDLEVEL_2
* @arg @ref LL_PWR_PVDLEVEL_3
* @arg @ref LL_PWR_PVDLEVEL_4
* @arg @ref LL_PWR_PVDLEVEL_5
* @arg @ref LL_PWR_PVDLEVEL_6
* @arg @ref LL_PWR_PVDLEVEL_7
* @retval None
*/
__STATIC_INLINE void LL_PWR_SetPVDLevel(uint32_t PVDLevel)
{
MODIFY_REG(PWR->CR, PWR_CR_PLS, PVDLevel);
}
/**
* @brief Get the voltage threshold detection
* @rmtoll CR PLS LL_PWR_GetPVDLevel
* @retval Returned value can be one of the following values:
* @arg @ref LL_PWR_PVDLEVEL_0
* @arg @ref LL_PWR_PVDLEVEL_1
* @arg @ref LL_PWR_PVDLEVEL_2
* @arg @ref LL_PWR_PVDLEVEL_3
* @arg @ref LL_PWR_PVDLEVEL_4
* @arg @ref LL_PWR_PVDLEVEL_5
* @arg @ref LL_PWR_PVDLEVEL_6
* @arg @ref LL_PWR_PVDLEVEL_7
*/
__STATIC_INLINE uint32_t LL_PWR_GetPVDLevel(void)
{
return (uint32_t)(READ_BIT(PWR->CR, PWR_CR_PLS));
}
/**
* @brief Enable Power Voltage Detector
* @rmtoll CR PVDE LL_PWR_EnablePVD
* @retval None
*/
__STATIC_INLINE void LL_PWR_EnablePVD(void)
{
SET_BIT(PWR->CR, PWR_CR_PVDE);
}
/**
* @brief Disable Power Voltage Detector
* @rmtoll CR PVDE LL_PWR_DisablePVD
* @retval None
*/
__STATIC_INLINE void LL_PWR_DisablePVD(void)
{
CLEAR_BIT(PWR->CR, PWR_CR_PVDE);
}
/**
* @brief Check if Power Voltage Detector is enabled
* @rmtoll CR PVDE LL_PWR_IsEnabledPVD
* @retval State of bit (1 or 0).
*/
__STATIC_INLINE uint32_t LL_PWR_IsEnabledPVD(void)
{
return (READ_BIT(PWR->CR, PWR_CR_PVDE) == (PWR_CR_PVDE));
}
#endif /* PWR_PVD_SUPPORT */
/**
* @brief Enable the WakeUp PINx functionality
* @rmtoll CSR EWUP1 LL_PWR_EnableWakeUpPin\n
* @rmtoll CSR EWUP2 LL_PWR_EnableWakeUpPin\n
* @rmtoll CSR EWUP3 LL_PWR_EnableWakeUpPin
* @param WakeUpPin This parameter can be one of the following values:
* @arg @ref LL_PWR_WAKEUP_PIN1
* @arg @ref LL_PWR_WAKEUP_PIN2
* @arg @ref LL_PWR_WAKEUP_PIN3 (*)
*
* (*) not available on all devices
* @retval None
*/
__STATIC_INLINE void LL_PWR_EnableWakeUpPin(uint32_t WakeUpPin)
{
SET_BIT(PWR->CSR, WakeUpPin);
}
/**
* @brief Disable the WakeUp PINx functionality
* @rmtoll CSR EWUP1 LL_PWR_DisableWakeUpPin\n
* @rmtoll CSR EWUP2 LL_PWR_DisableWakeUpPin\n
* @rmtoll CSR EWUP3 LL_PWR_DisableWakeUpPin
* @param WakeUpPin This parameter can be one of the following values:
* @arg @ref LL_PWR_WAKEUP_PIN1
* @arg @ref LL_PWR_WAKEUP_PIN2
* @arg @ref LL_PWR_WAKEUP_PIN3 (*)
*
* (*) not available on all devices
* @retval None
*/
__STATIC_INLINE void LL_PWR_DisableWakeUpPin(uint32_t WakeUpPin)
{
CLEAR_BIT(PWR->CSR, WakeUpPin);
}
/**
* @brief Check if the WakeUp PINx functionality is enabled
* @rmtoll CSR EWUP1 LL_PWR_IsEnabledWakeUpPin\n
* @rmtoll CSR EWUP2 LL_PWR_IsEnabledWakeUpPin\n
* @rmtoll CSR EWUP3 LL_PWR_IsEnabledWakeUpPin
* @param WakeUpPin This parameter can be one of the following values:
* @arg @ref LL_PWR_WAKEUP_PIN1
* @arg @ref LL_PWR_WAKEUP_PIN2
* @arg @ref LL_PWR_WAKEUP_PIN3 (*)
*
* (*) not available on all devices
* @retval State of bit (1 or 0).
*/
__STATIC_INLINE uint32_t LL_PWR_IsEnabledWakeUpPin(uint32_t WakeUpPin)
{
return (READ_BIT(PWR->CSR, WakeUpPin) == (WakeUpPin));
}
/**
* @}
*/
/** @defgroup PWR_LL_EF_FLAG_Management FLAG_Management
* @{
*/
/**
* @brief Get Wake-up Flag
* @rmtoll CSR WUF LL_PWR_IsActiveFlag_WU
* @retval State of bit (1 or 0).
*/
__STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU(void)
{
return (READ_BIT(PWR->CSR, PWR_CSR_WUF) == (PWR_CSR_WUF));
}
/**
* @brief Get Standby Flag
* @rmtoll CSR SBF LL_PWR_IsActiveFlag_SB
* @retval State of bit (1 or 0).
*/
__STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_SB(void)
{
return (READ_BIT(PWR->CSR, PWR_CSR_SBF) == (PWR_CSR_SBF));
}
#if defined(PWR_PVD_SUPPORT)
/**
* @brief Indicate whether VDD voltage is below the selected PVD threshold
* @rmtoll CSR PVDO LL_PWR_IsActiveFlag_PVDO
* @retval State of bit (1 or 0).
*/
__STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_PVDO(void)
{
return (READ_BIT(PWR->CSR, PWR_CSR_PVDO) == (PWR_CSR_PVDO));
}
#endif /* PWR_PVD_SUPPORT */
#if defined(PWR_CSR_VREFINTRDYF)
/**
* @brief Get Internal Reference VrefInt Flag
* @rmtoll CSR VREFINTRDYF LL_PWR_IsActiveFlag_VREFINTRDY
* @retval State of bit (1 or 0).
*/
__STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_VREFINTRDY(void)
{
return (READ_BIT(PWR->CSR, PWR_CSR_VREFINTRDYF) == (PWR_CSR_VREFINTRDYF));
}
#endif /* PWR_CSR_VREFINTRDYF */
/**
* @brief Clear Standby Flag
* @rmtoll CR CSBF LL_PWR_ClearFlag_SB
* @retval None
*/
__STATIC_INLINE void LL_PWR_ClearFlag_SB(void)
{
SET_BIT(PWR->CR, PWR_CR_CSBF);
}
/**
* @brief Clear Wake-up Flags
* @rmtoll CR CWUF LL_PWR_ClearFlag_WU
* @retval None
*/
__STATIC_INLINE void LL_PWR_ClearFlag_WU(void)
{
SET_BIT(PWR->CR, PWR_CR_CWUF);
}
/**
* @}
*/
#if defined(USE_FULL_LL_DRIVER)
/** @defgroup PWR_LL_EF_Init De-initialization function
* @{
*/
ErrorStatus LL_PWR_DeInit(void);
/**
* @}
*/
#endif /* USE_FULL_LL_DRIVER */
/**
* @}
*/
/**
* @}
*/
#endif /* defined(PWR) */
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* __STM32F3xx_LL_PWR_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,282 @@
/**
******************************************************************************
* @file stm32f3xx_ll_utils.h
* @author MCD Application Team
* @brief Header file of UTILS LL module.
@verbatim
==============================================================================
##### How to use this driver #####
==============================================================================
[..]
The LL UTILS driver contains a set of generic APIs that can be
used by user:
(+) Device electronic signature
(+) Timing functions
(+) PLL configuration functions
@endverbatim
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F3xx_LL_UTILS_H
#define __STM32F3xx_LL_UTILS_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32f3xx.h"
/** @addtogroup STM32F3xx_LL_Driver
* @{
*/
/** @defgroup UTILS_LL UTILS
* @{
*/
/* Private types -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private constants ---------------------------------------------------------*/
/** @defgroup UTILS_LL_Private_Constants UTILS Private Constants
* @{
*/
/* Max delay can be used in LL_mDelay */
#define LL_MAX_DELAY 0xFFFFFFFFU
/**
* @brief Unique device ID register base address
*/
#define UID_BASE_ADDRESS UID_BASE
/**
* @brief Flash size data register base address
*/
#define FLASHSIZE_BASE_ADDRESS FLASHSIZE_BASE
/**
* @brief Package data register base address
*/
#define PACKAGE_BASE_ADDRESS PACKAGE_BASE
/**
* @}
*/
/* Private macros ------------------------------------------------------------*/
/** @defgroup UTILS_LL_Private_Macros UTILS Private Macros
* @{
*/
/**
* @}
*/
/* Exported types ------------------------------------------------------------*/
/** @defgroup UTILS_LL_ES_INIT UTILS Exported structures
* @{
*/
/**
* @brief UTILS PLL structure definition
*/
typedef struct
{
uint32_t PLLMul; /*!< Multiplication factor for PLL VCO input clock.
This parameter can be a value of @ref RCC_LL_EC_PLL_MUL
This feature can be modified afterwards using unitary function
@ref LL_RCC_PLL_ConfigDomain_SYS(). */
#if defined(RCC_PLLSRC_PREDIV1_SUPPORT)
uint32_t PLLDiv; /*!< Division factor for PLL VCO output clock.
This parameter can be a value of @ref RCC_LL_EC_PREDIV_DIV
This feature can be modified afterwards using unitary function
@ref LL_RCC_PLL_ConfigDomain_SYS(). */
#else
uint32_t Prediv; /*!< Division factor for HSE used as PLL clock source.
This parameter can be a value of @ref RCC_LL_EC_PREDIV_DIV
This feature can be modified afterwards using unitary function
@ref LL_RCC_PLL_ConfigDomain_SYS(). */
#endif /* RCC_PLLSRC_PREDIV1_SUPPORT */
} LL_UTILS_PLLInitTypeDef;
/**
* @brief UTILS System, AHB and APB buses clock configuration structure definition
*/
typedef struct
{
uint32_t AHBCLKDivider; /*!< The AHB clock (HCLK) divider. This clock is derived from the system clock (SYSCLK).
This parameter can be a value of @ref RCC_LL_EC_SYSCLK_DIV
This feature can be modified afterwards using unitary function
@ref LL_RCC_SetAHBPrescaler(). */
uint32_t APB1CLKDivider; /*!< The APB1 clock (PCLK1) divider. This clock is derived from the AHB clock (HCLK).
This parameter can be a value of @ref RCC_LL_EC_APB1_DIV
This feature can be modified afterwards using unitary function
@ref LL_RCC_SetAPB1Prescaler(). */
uint32_t APB2CLKDivider; /*!< The APB2 clock (PCLK2) divider. This clock is derived from the AHB clock (HCLK).
This parameter can be a value of @ref RCC_LL_EC_APB2_DIV
This feature can be modified afterwards using unitary function
@ref LL_RCC_SetAPB2Prescaler(). */
} LL_UTILS_ClkInitTypeDef;
/**
* @}
*/
/* Exported constants --------------------------------------------------------*/
/** @defgroup UTILS_LL_Exported_Constants UTILS Exported Constants
* @{
*/
/** @defgroup UTILS_EC_HSE_BYPASS HSE Bypass activation
* @{
*/
#define LL_UTILS_HSEBYPASS_OFF 0x00000000U /*!< HSE Bypass is not enabled */
#define LL_UTILS_HSEBYPASS_ON 0x00000001U /*!< HSE Bypass is enabled */
/**
* @}
*/
/**
* @}
*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/
/** @defgroup UTILS_LL_Exported_Functions UTILS Exported Functions
* @{
*/
/** @defgroup UTILS_EF_DEVICE_ELECTRONIC_SIGNATURE DEVICE ELECTRONIC SIGNATURE
* @{
*/
/**
* @brief Get Word0 of the unique device identifier (UID based on 96 bits)
* @retval UID[31:0]: X and Y coordinates on the wafer expressed in BCD format
*/
__STATIC_INLINE uint32_t LL_GetUID_Word0(void)
{
return (uint32_t)(READ_REG(*((uint32_t *)UID_BASE_ADDRESS)));
}
/**
* @brief Get Word1 of the unique device identifier (UID based on 96 bits)
* @retval UID[63:32]: Wafer number (UID[39:32]) & LOT_NUM[23:0] (UID[63:40])
*/
__STATIC_INLINE uint32_t LL_GetUID_Word1(void)
{
return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 4U))));
}
/**
* @brief Get Word2 of the unique device identifier (UID based on 96 bits)
* @retval UID[95:64]: Lot number (ASCII encoded) - LOT_NUM[55:24]
*/
__STATIC_INLINE uint32_t LL_GetUID_Word2(void)
{
return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 8U))));
}
/**
* @brief Get Flash memory size
* @note This bitfield indicates the size of the device Flash memory expressed in
* Kbytes. As an example, 0x040 corresponds to 64 Kbytes.
* @retval FLASH_SIZE[15:0]: Flash memory size
*/
__STATIC_INLINE uint32_t LL_GetFlashSize(void)
{
return (uint16_t)(READ_REG(*((uint32_t *)FLASHSIZE_BASE_ADDRESS)));
}
/**
* @}
*/
/** @defgroup UTILS_LL_EF_DELAY DELAY
* @{
*/
/**
* @brief This function configures the Cortex-M SysTick source of the time base.
* @param HCLKFrequency HCLK frequency in Hz (can be calculated thanks to RCC helper macro)
* @note When a RTOS is used, it is recommended to avoid changing the SysTick
* configuration by calling this function, for a delay use rather osDelay RTOS service.
* @param Ticks Number of ticks
* @retval None
*/
__STATIC_INLINE void LL_InitTick(uint32_t HCLKFrequency, uint32_t Ticks)
{
/* Configure the SysTick to have interrupt in 1ms time base */
SysTick->LOAD = (uint32_t)((HCLKFrequency / Ticks) - 1UL); /* set reload register */
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
SysTick_CTRL_ENABLE_Msk; /* Enable the Systick Timer */
}
void LL_Init1msTick(uint32_t HCLKFrequency);
void LL_mDelay(uint32_t Delay);
/**
* @}
*/
/** @defgroup UTILS_EF_SYSTEM SYSTEM
* @{
*/
void LL_SetSystemCoreClock(uint32_t HCLKFrequency);
#if defined(FLASH_ACR_LATENCY)
ErrorStatus LL_SetFlashLatency(uint32_t Frequency);
#endif /* FLASH_ACR_LATENCY */
ErrorStatus LL_PLL_ConfigSystemClock_HSI(LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct,
LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct);
ErrorStatus LL_PLL_ConfigSystemClock_HSE(uint32_t HSEFrequency, uint32_t HSEBypass,
LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct, LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct);
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* __STM32F3xx_LL_UTILS_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -26,19 +26,19 @@
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.enable_logging" value="false"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.enable_max_halt_delay" value="false"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.enable_shared_stlink" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.external_loader" value=""/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.external_loader" value="512W3A_STM3210E-EVAL, 0x70000000, NAND_FLASH, 512W3A_STM3210E-EVAL.stldr"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.external_loader_init" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.frequency" value="0"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.halt_all_on_reset" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.log_file" value="/home/oskar/Documents/Uni/FaSTTUBe/repos/SDCL/sdcl-firmware/Debug/st-link_gdbserver_log.txt"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.low_power_debug" value="enable"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.low_power_debug" value="none"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.max_halt_delay" value="2"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.reset_strategy" value="connect_under_reset"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_check_serial_number" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_txt_serial_number" value=""/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.watchdog_config" value="none"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkenable_rtos" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations" value="{&quot;fItems&quot;:[{&quot;fDisplayName&quot;:&quot;Reset&quot;,&quot;fIsSuppressible&quot;:false,&quot;fResetAttribute&quot;:&quot;Software system reset&quot;,&quot;fResetStrategies&quot;:[{&quot;fDisplayName&quot;:&quot;Software system reset&quot;,&quot;fLaunchAttribute&quot;:&quot;system_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;Hardware reset&quot;,&quot;fLaunchAttribute&quot;:&quot;hardware_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset hardware\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;Core reset&quot;,&quot;fLaunchAttribute&quot;:&quot;core_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset core\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;None&quot;,&quot;fLaunchAttribute&quot;:&quot;no_reset&quot;,&quot;fGdbCommands&quot;:[],&quot;fCmdOptions&quot;:[&quot;-g&quot;]}],&quot;fGdbCommandGroup&quot;:{&quot;name&quot;:&quot;Additional commands&quot;,&quot;commands&quot;:[]}}]}"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations" value="{&quot;fVersion&quot;:1,&quot;fItems&quot;:[{&quot;fDisplayName&quot;:&quot;Reset&quot;,&quot;fIsSuppressible&quot;:false,&quot;fResetAttribute&quot;:&quot;Software system reset&quot;,&quot;fResetStrategies&quot;:[{&quot;fDisplayName&quot;:&quot;Software system reset&quot;,&quot;fLaunchAttribute&quot;:&quot;system_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;Hardware reset&quot;,&quot;fLaunchAttribute&quot;:&quot;hardware_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset hardware\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;Core reset&quot;,&quot;fLaunchAttribute&quot;:&quot;core_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset core\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;None&quot;,&quot;fLaunchAttribute&quot;:&quot;no_reset&quot;,&quot;fGdbCommands&quot;:[],&quot;fCmdOptions&quot;:[&quot;-g&quot;]}],&quot;fGdbCommandGroup&quot;:{&quot;name&quot;:&quot;Additional commands&quot;,&quot;commands&quot;:[]},&quot;fStartApplication&quot;:true}]}"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.enableRtosProxy" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyCustomProperties" value=""/>
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriver" value="threadx"/>

View File

@ -63,20 +63,20 @@ Mcu.PinsNb=27
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32F302C8Tx
MxCube.Version=6.5.0
MxDb.Version=DB.6.0.50
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true
NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true
MxCube.Version=6.6.1
MxDb.Version=DB.6.0.60
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.ForceEnableDMAVector=true
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true
NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true
NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true
NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4
NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true
NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:false\:true\:true
NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:false\:true\:false
NVIC.USB_LP_CAN_RX0_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
PA0.GPIOParameters=GPIO_Label
PA0.GPIO_Label=TS_activate_MUXed
PA0.Locked=true
@ -142,11 +142,11 @@ PB1.Locked=true
PB1.Mode=IN11-Differential
PB1.Signal=ADC1_IN12
PB10.GPIOParameters=GPIO_Label
PB10.GPIO_Label=AMI5
PB10.GPIO_Label=AMI_EBSTEST
PB10.Locked=true
PB10.Signal=GPIO_Output
PB11.GPIOParameters=GPIO_Label
PB11.GPIO_Label=AMI6
PB11.GPIO_Label=AMI_INSPECTION
PB11.Locked=true
PB11.Signal=GPIO_Output
PB3.Mode=Trace_Asynchronous_SW
@ -156,23 +156,23 @@ PB4.GPIO_Label=ASB_Error
PB4.Locked=true
PB4.Signal=GPIO_Output
PB5.GPIOParameters=GPIO_Label
PB5.GPIO_Label=AMI4
PB5.GPIO_Label=AMI_TRACKDRIVE
PB5.Locked=true
PB5.Signal=GPIO_Output
PB6.GPIOParameters=GPIO_Label
PB6.GPIO_Label=AMI3
PB6.GPIO_Label=AMI_AUTOX
PB6.Locked=true
PB6.Signal=GPIO_Output
PB7.GPIOParameters=GPIO_Label
PB7.GPIO_Label=AMI2
PB7.GPIO_Label=AMI_SKIDPAD
PB7.Locked=true
PB7.Signal=GPIO_Output
PB8.GPIOParameters=GPIO_Label
PB8.GPIO_Label=AMI1
PB8.GPIO_Label=AMI_ACCEL
PB8.Locked=true
PB8.Signal=GPIO_Output
PB9.GPIOParameters=GPIO_Label
PB9.GPIO_Label=AMI0
PB9.GPIO_Label=AMI_MANUAL
PB9.Locked=true
PB9.Signal=GPIO_Output
PCC.Checker=false
@ -272,6 +272,7 @@ ProjectManager.TargetToolchain=STM32CubeIDE
ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=true
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_CAN_Init-CAN-false-HAL-true,4-MX_ADC1_Init-ADC1-false-HAL-true
RCC.ADC12outputFreq_Value=16000000
RCC.AHBFreq_Value=8000000
RCC.APB1Freq_Value=8000000
RCC.APB2Freq_Value=8000000
@ -284,18 +285,20 @@ RCC.HSI_VALUE=8000000
RCC.I2C1Freq_Value=8000000
RCC.I2C2Freq_Value=8000000
RCC.I2C3Freq_Value=8000000
RCC.IPParameters=AHBFreq_Value,APB1Freq_Value,APB2Freq_Value,CortexFreq_Value,FamilyName,HSEPLLFreq_Value,HSE_VALUE,HSIPLLFreq_Value,HSI_VALUE,I2C1Freq_Value,I2C2Freq_Value,I2C3Freq_Value,LSE_VALUE,LSI_VALUE,PLLCLKFreq_Value,PLLMCOFreq_Value,RTCFreq_Value,RTCHSEDivFreq_Value,SYSCLKFreq_VALUE,TIM2Freq_Value,USART1Freq_Value,VCOOutput2Freq_Value
RCC.IPParameters=ADC12outputFreq_Value,AHBFreq_Value,APB1Freq_Value,APB2Freq_Value,CortexFreq_Value,FamilyName,HSEPLLFreq_Value,HSE_VALUE,HSIPLLFreq_Value,HSI_VALUE,I2C1Freq_Value,I2C2Freq_Value,I2C3Freq_Value,LSE_VALUE,LSI_VALUE,PLLCLKFreq_Value,PLLMCOFreq_Value,PLLMUL,RTCFreq_Value,RTCHSEDivFreq_Value,SYSCLKFreq_VALUE,TIM2Freq_Value,USART1Freq_Value,USBFreq_Value,VCOOutput2Freq_Value
RCC.LSE_VALUE=32768
RCC.LSI_VALUE=40000
RCC.PLLCLKFreq_Value=8000000
RCC.PLLMCOFreq_Value=8000000
RCC.PLLCLKFreq_Value=16000000
RCC.PLLMCOFreq_Value=16000000
RCC.PLLMUL=RCC_PLL_MUL4
RCC.RTCFreq_Value=40000
RCC.RTCHSEDivFreq_Value=250000
RCC.SYSCLKFreq_VALUE=8000000
RCC.TIM2Freq_Value=8000000
RCC.USART1Freq_Value=8000000
RCC.USBFreq_Value=16000000
RCC.VCOOutput2Freq_Value=4000000
VP_SYS_VS_Systick.Mode=SysTick
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
board=custom
isbadioc=true
isbadioc=false

View File

@ -10447,7 +10447,7 @@
(effects (font (size 1 1) (thickness 0.15)))
(tstamp e5ccdfd6-d903-47a4-bfca-f17af477a5e4)
)
(fp_text value "0" (at 0 1.43) (layer "F.Fab")
(fp_text value "47k" (at 0 1.43) (layer "F.Fab")
(effects (font (size 1 1) (thickness 0.15)))
(tstamp 56149f3b-cfb7-40a0-b1d7-3d9a20c22204)
)
@ -10486,232 +10486,6 @@
)
)
(footprint "Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Horizontal" (layer "F.Cu")
(tstamp fc645218-9a20-4f27-ab80-763ba5b4fb06)
(at 102.375 81.35 180)
(descr "Through hole angled pin header, 1x06, 2.54mm pitch, 6mm pin length, single row")
(tags "Through hole angled pin header THT 1x06 2.54mm single row")
(property "Sheetfile" "connections.kicad_sch")
(property "Sheetname" "Connections")
(property "ki_description" "Generic connector, single row, 01x06, script generated (kicad-library-utils/schlib/autogen/connector/)")
(property "ki_keywords" "connector")
(path "/00000000-0000-0000-0000-000061bba8ea/dbe2a649-f639-40ee-a279-bcfb7f4df9e9")
(attr through_hole)
(fp_text reference "J1" (at -0.125 15.35 180) (layer "F.SilkS")
(effects (font (size 1 1) (thickness 0.15)))
(tstamp 4ca450ec-b159-4c4d-9120-5c87b58f4473)
)
(fp_text value "Debug_Connector" (at 4.385 14.97 180) (layer "F.Fab")
(effects (font (size 1 1) (thickness 0.15)))
(tstamp eb1bc302-73c7-4d81-b44b-c987784bc2d6)
)
(fp_text user "${REFERENCE}" (at 2.77 6.35 270) (layer "F.Fab")
(effects (font (size 1 1) (thickness 0.15)))
(tstamp 6c19703e-b9d9-482e-8a66-cdc7c0c85943)
)
(fp_line (start -1.27 -1.27) (end 0 -1.27)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 0b4e4b23-8a5a-47a2-a05b-6c7a8f40654a))
(fp_line (start -1.27 0) (end -1.27 -1.27)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 528301ba-421a-4b87-8eff-30e8bd814053))
(fp_line (start 1.042929 2.16) (end 1.44 2.16)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp be669cb0-1d2a-440e-9e44-ffaf68f858c5))
(fp_line (start 1.042929 2.92) (end 1.44 2.92)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp b5d61a38-dcda-4675-9b56-44a563f907f3))
(fp_line (start 1.042929 4.7) (end 1.44 4.7)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 95bded42-69d2-4e5e-9847-bd383382084a))
(fp_line (start 1.042929 5.46) (end 1.44 5.46)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp c33a228c-6560-4b37-bf5e-0e93f41e27cc))
(fp_line (start 1.042929 7.24) (end 1.44 7.24)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 5d12b77c-d762-45b3-93c0-d30dbde45939))
(fp_line (start 1.042929 8) (end 1.44 8)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 4783def8-5ffe-48b9-9b35-01e40041fcd0))
(fp_line (start 1.042929 9.78) (end 1.44 9.78)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 7b69634d-0260-4514-8eb5-e341de882359))
(fp_line (start 1.042929 10.54) (end 1.44 10.54)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 981ada7e-c64b-472b-87ea-01bd02fc1f29))
(fp_line (start 1.042929 12.32) (end 1.44 12.32)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 1d8d8258-654e-453f-bb8a-7d7dcd35e78c))
(fp_line (start 1.042929 13.08) (end 1.44 13.08)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 6a3ae8c1-19ee-4665-8f87-3b26c7deb05d))
(fp_line (start 1.11 -0.38) (end 1.44 -0.38)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 0816157d-159c-490b-a5a3-2104e200b5fe))
(fp_line (start 1.11 0.38) (end 1.44 0.38)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 29db9a7e-7c71-4cd0-b5d3-405ff6528538))
(fp_line (start 1.44 -1.33) (end 1.44 14.03)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 1c7fc705-7006-48e7-8628-9c9b4306e0d2))
(fp_line (start 1.44 1.27) (end 4.1 1.27)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 516c2362-e451-4f38-97a2-4bf265ae7b58))
(fp_line (start 1.44 3.81) (end 4.1 3.81)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 159c734d-6026-407c-9659-075f12fb9267))
(fp_line (start 1.44 6.35) (end 4.1 6.35)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 7e398307-79e9-4d12-a1c1-0bcc6ac8c3e0))
(fp_line (start 1.44 8.89) (end 4.1 8.89)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 4cfe3264-af33-4640-801f-ce6d701d1eb5))
(fp_line (start 1.44 11.43) (end 4.1 11.43)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 55c31df2-ad17-4f42-a6db-9226c9eaad74))
(fp_line (start 1.44 14.03) (end 4.1 14.03)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp fd24e15b-b765-4561-8f31-2dee5a7239a0))
(fp_line (start 4.1 -1.33) (end 1.44 -1.33)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 8fd7d9fe-1aba-423f-b634-453dee6b26a5))
(fp_line (start 4.1 -0.38) (end 10.1 -0.38)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp d9a5a6ab-93c4-4170-bb57-a69d2cbf22f7))
(fp_line (start 4.1 -0.32) (end 10.1 -0.32)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp fa435da1-4756-4282-b57d-432fc8a7b29b))
(fp_line (start 4.1 -0.2) (end 10.1 -0.2)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 5177f4fb-6d1f-45b9-af4f-f2fbf22428ec))
(fp_line (start 4.1 -0.08) (end 10.1 -0.08)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 9d0d50a4-9fff-4345-bf9c-f864395ced22))
(fp_line (start 4.1 0.04) (end 10.1 0.04)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 979f4fbe-4ff3-4815-8d1d-002ef5a80f24))
(fp_line (start 4.1 0.16) (end 10.1 0.16)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 5cbaf5c8-7f81-434e-869c-5772f232ba05))
(fp_line (start 4.1 0.28) (end 10.1 0.28)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp d39c3601-6052-454f-ab0f-aa67a344c4e3))
(fp_line (start 4.1 2.16) (end 10.1 2.16)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp bcda0d6c-f41c-4d94-90b7-d992bc35359b))
(fp_line (start 4.1 4.7) (end 10.1 4.7)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 5c15b2b9-e966-4c3a-aa35-2c1c445ad2d7))
(fp_line (start 4.1 7.24) (end 10.1 7.24)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp de7ec3c2-df7c-4d02-b2d3-c29faeb49e99))
(fp_line (start 4.1 9.78) (end 10.1 9.78)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 0110d21b-f96a-4f23-9958-d64c122365f1))
(fp_line (start 4.1 12.32) (end 10.1 12.32)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 61c5134c-93ef-4e1b-ac1a-414fd9ae660b))
(fp_line (start 4.1 14.03) (end 4.1 -1.33)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 6de83a77-2b32-47dc-9e30-b27f9e820762))
(fp_line (start 10.1 -0.38) (end 10.1 0.38)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 1e3fe709-d9ab-4b24-8530-1938336aa5f4))
(fp_line (start 10.1 0.38) (end 4.1 0.38)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp e424135d-80cb-450c-b872-b407d365db45))
(fp_line (start 10.1 2.16) (end 10.1 2.92)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 04b1dc0c-a963-4789-b3a7-4875fe69c76d))
(fp_line (start 10.1 2.92) (end 4.1 2.92)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 60739a05-a723-4924-862c-b73e8d132b47))
(fp_line (start 10.1 4.7) (end 10.1 5.46)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 843c6a9b-9526-4819-94ae-07d24045e9eb))
(fp_line (start 10.1 5.46) (end 4.1 5.46)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 99f3f535-b4ee-49ec-9af2-64febaaadcfd))
(fp_line (start 10.1 7.24) (end 10.1 8)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp f7a9ad7b-e2be-4bda-a6e2-14cc647453bd))
(fp_line (start 10.1 8) (end 4.1 8)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 7a0ed220-b1bd-42ea-bf57-d25250e9303f))
(fp_line (start 10.1 9.78) (end 10.1 10.54)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 62f18335-2a94-4b6a-8e5c-524e56887e27))
(fp_line (start 10.1 10.54) (end 4.1 10.54)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp b00eaea4-00f1-4c31-a5bc-31a82af91a0a))
(fp_line (start 10.1 12.32) (end 10.1 13.08)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 817daacc-d9f2-4e28-8a03-41a2d68b504f))
(fp_line (start 10.1 13.08) (end 4.1 13.08)
(stroke (width 0.12) (type solid)) (layer "F.SilkS") (tstamp 0ecda637-acd1-468e-9b94-b294e374b3c8))
(fp_line (start -1.8 -1.8) (end -1.8 14.5)
(stroke (width 0.05) (type solid)) (layer "F.CrtYd") (tstamp 173b2800-9f8c-4c5b-ab8e-bdcdc349ccfa))
(fp_line (start -1.8 14.5) (end 10.55 14.5)
(stroke (width 0.05) (type solid)) (layer "F.CrtYd") (tstamp ce109f4f-0a59-4499-8bf7-756a0b413f36))
(fp_line (start 10.55 -1.8) (end -1.8 -1.8)
(stroke (width 0.05) (type solid)) (layer "F.CrtYd") (tstamp 16f04134-4182-4ab7-8dc5-f9a54920baff))
(fp_line (start 10.55 14.5) (end 10.55 -1.8)
(stroke (width 0.05) (type solid)) (layer "F.CrtYd") (tstamp 61313d7c-51dd-4b88-91fd-f0b328d5309a))
(fp_line (start -0.32 -0.32) (end -0.32 0.32)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp 309521b5-ac2d-4712-92e8-da3f188baa1e))
(fp_line (start -0.32 -0.32) (end 1.5 -0.32)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp b035c9b8-4c69-48c7-aa54-9aaaf4a2c629))
(fp_line (start -0.32 0.32) (end 1.5 0.32)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp 932b5893-bd65-4630-95e9-6ec7a6d2fad7))
(fp_line (start -0.32 2.22) (end -0.32 2.86)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp e4a1a1ac-e5e1-4fb6-a050-44ce154dd594))
(fp_line (start -0.32 2.22) (end 1.5 2.22)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp aa67ad59-e1ca-49a4-a5cb-208efe398075))
(fp_line (start -0.32 2.86) (end 1.5 2.86)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp a8eef5e9-2cae-4244-b82a-3108199de740))
(fp_line (start -0.32 4.76) (end -0.32 5.4)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp d44571c7-f027-4ec8-bd68-801eeb7854df))
(fp_line (start -0.32 4.76) (end 1.5 4.76)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp e2165943-fee5-4ed9-bcdd-da3304ef5fbe))
(fp_line (start -0.32 5.4) (end 1.5 5.4)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp a5294b07-4495-4f10-89ac-09b2ab42324e))
(fp_line (start -0.32 7.3) (end -0.32 7.94)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp 60329797-abf1-4da1-b569-193b2a478a09))
(fp_line (start -0.32 7.3) (end 1.5 7.3)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp 4b2db803-0145-4266-b9cb-cac610e66166))
(fp_line (start -0.32 7.94) (end 1.5 7.94)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp 6d66a7b5-e851-42db-ae51-9a4b019307b0))
(fp_line (start -0.32 9.84) (end -0.32 10.48)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp dd921ec3-978b-461b-b614-a133a54f517c))
(fp_line (start -0.32 9.84) (end 1.5 9.84)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp 96b7692d-c789-4c5d-a021-00e166d1f70b))
(fp_line (start -0.32 10.48) (end 1.5 10.48)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp a40cd88f-add1-4668-82fa-24028be9781c))
(fp_line (start -0.32 12.38) (end -0.32 13.02)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp 01bee946-ee8a-4204-a49b-6842096def3e))
(fp_line (start -0.32 12.38) (end 1.5 12.38)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp 9eb76e48-a036-44c1-a608-92dbd1273f9e))
(fp_line (start -0.32 13.02) (end 1.5 13.02)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp b324a2bc-5427-4e08-85d9-29c388321584))
(fp_line (start 1.5 -0.635) (end 2.135 -1.27)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp ea0e8e69-edab-4053-a22a-06e6bb426526))
(fp_line (start 1.5 13.97) (end 1.5 -0.635)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp f8a0eb5e-ca2d-46c8-bcfe-69e94c436004))
(fp_line (start 2.135 -1.27) (end 4.04 -1.27)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp bb54805a-f493-474d-a7f6-29286165c847))
(fp_line (start 4.04 -1.27) (end 4.04 13.97)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp dcf54058-8190-4830-84ad-6b201e8f8722))
(fp_line (start 4.04 -0.32) (end 10.04 -0.32)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp a813d54c-5851-48fa-879b-2a3e81a7d088))
(fp_line (start 4.04 0.32) (end 10.04 0.32)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp 45031a88-2488-4617-819a-95a00013bcbe))
(fp_line (start 4.04 2.22) (end 10.04 2.22)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp 43a980cc-44d7-46d6-bd40-9a99d38a6466))
(fp_line (start 4.04 2.86) (end 10.04 2.86)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp dfbcb8d5-7772-4adf-991c-4bf80c0c61b1))
(fp_line (start 4.04 4.76) (end 10.04 4.76)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp 14e217ff-298b-4b7c-a892-bfeee12f67a9))
(fp_line (start 4.04 5.4) (end 10.04 5.4)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp ad46e93a-2f6d-4847-87b2-46f83c53a1f1))
(fp_line (start 4.04 7.3) (end 10.04 7.3)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp a1a61cdc-2e9f-407f-969c-49d583a1d509))
(fp_line (start 4.04 7.94) (end 10.04 7.94)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp f0081662-7951-409e-a191-ac17b96a907f))
(fp_line (start 4.04 9.84) (end 10.04 9.84)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp e1124cd7-3224-4a11-8575-d6308a6de93f))
(fp_line (start 4.04 10.48) (end 10.04 10.48)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp d7700a22-a35d-4eca-b5da-35ca2d95f58d))
(fp_line (start 4.04 12.38) (end 10.04 12.38)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp 60ac7ced-6580-4be0-abd4-37091882682a))
(fp_line (start 4.04 13.02) (end 10.04 13.02)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp df7bf93e-ec6a-446c-ad39-77872a8d8478))
(fp_line (start 4.04 13.97) (end 1.5 13.97)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp df5b618f-19b1-4a90-8b54-bc60410055a9))
(fp_line (start 10.04 -0.32) (end 10.04 0.32)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp 8ce2ddb9-3fbd-4cbf-8ef2-34462a8e1410))
(fp_line (start 10.04 2.22) (end 10.04 2.86)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp f9b13ba4-369e-42eb-8c96-8f918f09ec9c))
(fp_line (start 10.04 4.76) (end 10.04 5.4)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp fa53b886-6978-407a-bd7d-d9b9bc9a6e68))
(fp_line (start 10.04 7.3) (end 10.04 7.94)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp a7d400ff-35a3-4a8e-9838-b8e6c3f16578))
(fp_line (start 10.04 9.84) (end 10.04 10.48)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp 2b0f13da-8938-4bb5-9780-98c1b19bb00f))
(fp_line (start 10.04 12.38) (end 10.04 13.02)
(stroke (width 0.1) (type solid)) (layer "F.Fab") (tstamp ffcef306-7dd1-45c8-9d86-fc8fbe1e4c26))
(pad "1" thru_hole rect (at 0 0 180) (size 1.7 1.7) (drill 1) (layers "*.Cu" "*.Mask")
(net 11 "+3.3V") (pinfunction "Pin_1") (pintype "passive") (tstamp 32cbda93-1779-4329-83d6-f397d3c3725b))
(pad "2" thru_hole oval (at 0 2.54 180) (size 1.7 1.7) (drill 1) (layers "*.Cu" "*.Mask")
(net 7 "SWCLK") (pinfunction "Pin_2") (pintype "passive") (tstamp 58baa27d-d2d1-440f-8da5-61cce4eae563))
(pad "3" thru_hole oval (at 0 5.08 180) (size 1.7 1.7) (drill 1) (layers "*.Cu" "*.Mask")
(net 1 "GND") (pinfunction "Pin_3") (pintype "passive") (tstamp 6504a51d-4b7f-46e8-aad9-e9a67cfffe48))
(pad "4" thru_hole oval (at 0 7.62 180) (size 1.7 1.7) (drill 1) (layers "*.Cu" "*.Mask")
(net 6 "SWDIO") (pinfunction "Pin_4") (pintype "passive") (tstamp 5e0f20ca-cae0-4433-9daf-cdd9f1251da6))
(pad "5" thru_hole oval (at 0 10.16 180) (size 1.7 1.7) (drill 1) (layers "*.Cu" "*.Mask")
(net 2 "NRST") (pinfunction "Pin_5") (pintype "passive") (tstamp 034d5c21-e7af-4a2f-bdb9-88b992928840))
(pad "6" thru_hole oval (at 0 12.7 180) (size 1.7 1.7) (drill 1) (layers "*.Cu" "*.Mask")
(net 5 "TRACESWO") (pinfunction "Pin_6") (pintype "passive") (tstamp 13bc2d3a-09fe-4708-bff8-cfff02239ee8))
(model "${KICAD6_3DMODEL_DIR}/Connector_PinHeader_2.54mm.3dshapes/PinHeader_1x06_P2.54mm_Horizontal.step"
(offset (xyz 0 0 0))
(scale (xyz 1 1 1))
(rotate (xyz 0 0 0))
)
)
(footprint "Custom:Binder_M12-A_12P_Female" locked (layer "B.Cu")
(tstamp 00000000-0000-0000-0000-000061c02dd4)
(at 188 70 90)
@ -12346,6 +12120,78 @@
(stroke (width 0.01) (type solid)) (fill solid) (layer "B.Mask") (tstamp b0cd5341-71d4-4266-9912-79b25f20fac5))
)
(footprint "Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical" (layer "B.Cu")
(tstamp fc645218-9a20-4f27-ab80-763ba5b4fb06)
(at 102.375 81.35)
(descr "Through hole straight pin header, 1x06, 2.54mm pitch, single row")
(tags "Through hole pin header THT 1x06 2.54mm single row")
(property "Sheetfile" "connections.kicad_sch")
(property "Sheetname" "Connections")
(property "ki_description" "Generic connector, single row, 01x06, script generated (kicad-library-utils/schlib/autogen/connector/)")
(property "ki_keywords" "connector")
(path "/00000000-0000-0000-0000-000061bba8ea/dbe2a649-f639-40ee-a279-bcfb7f4df9e9")
(attr through_hole)
(fp_text reference "J1" (at 0 2.33 180) (layer "B.SilkS")
(effects (font (size 1 1) (thickness 0.15)) (justify mirror))
(tstamp fe3a8a70-7d74-447d-bebf-ef3e0cdcd178)
)
(fp_text value "Debug_Connector" (at 0 -15.03 180) (layer "B.Fab")
(effects (font (size 1 1) (thickness 0.15)) (justify mirror))
(tstamp 4363d91a-ea86-4d78-8077-ec39f3cb0f65)
)
(fp_text user "${REFERENCE}" (at 0 -6.35 270) (layer "B.Fab")
(effects (font (size 1 1) (thickness 0.15)) (justify mirror))
(tstamp 94cf1a38-5593-4a2a-95ca-da2a9b401477)
)
(fp_line (start -1.33 -14.03) (end 1.33 -14.03)
(stroke (width 0.12) (type solid)) (layer "B.SilkS") (tstamp 03b42af7-ffab-4886-98d8-40481c2e775d))
(fp_line (start -1.33 -1.27) (end -1.33 -14.03)
(stroke (width 0.12) (type solid)) (layer "B.SilkS") (tstamp 9fd094bb-ba3e-4d1e-ba79-894361752ad8))
(fp_line (start -1.33 -1.27) (end 1.33 -1.27)
(stroke (width 0.12) (type solid)) (layer "B.SilkS") (tstamp ff1f8113-b7c6-4587-996b-101f8efbbd32))
(fp_line (start -1.33 0) (end -1.33 1.33)
(stroke (width 0.12) (type solid)) (layer "B.SilkS") (tstamp 5d0358bb-2a59-479b-a5a1-a5cd1e235706))
(fp_line (start -1.33 1.33) (end 0 1.33)
(stroke (width 0.12) (type solid)) (layer "B.SilkS") (tstamp c50f2e50-0faa-452e-89d5-b9c49b29836a))
(fp_line (start 1.33 -1.27) (end 1.33 -14.03)
(stroke (width 0.12) (type solid)) (layer "B.SilkS") (tstamp 60fee5da-a574-4f5c-8af6-cef0394c056c))
(fp_line (start -1.8 -14.5) (end 1.8 -14.5)
(stroke (width 0.05) (type solid)) (layer "B.CrtYd") (tstamp 89d783b3-ad2c-4097-821e-708d9e24d34e))
(fp_line (start -1.8 1.8) (end -1.8 -14.5)
(stroke (width 0.05) (type solid)) (layer "B.CrtYd") (tstamp 3df99679-d194-4351-b964-981c0b6152c5))
(fp_line (start 1.8 -14.5) (end 1.8 1.8)
(stroke (width 0.05) (type solid)) (layer "B.CrtYd") (tstamp d8ab6eb1-be07-4c8c-98d0-aeda52913a42))
(fp_line (start 1.8 1.8) (end -1.8 1.8)
(stroke (width 0.05) (type solid)) (layer "B.CrtYd") (tstamp 9194e6db-f9b8-4e4e-8a73-8d6da2360f11))
(fp_line (start -1.27 -13.97) (end -1.27 0.635)
(stroke (width 0.1) (type solid)) (layer "B.Fab") (tstamp 965462c9-4705-4a13-bf61-56fb9ce7a628))
(fp_line (start -1.27 0.635) (end -0.635 1.27)
(stroke (width 0.1) (type solid)) (layer "B.Fab") (tstamp 739611d4-4cbd-4582-a92f-d310de522c1a))
(fp_line (start -0.635 1.27) (end 1.27 1.27)
(stroke (width 0.1) (type solid)) (layer "B.Fab") (tstamp cd770dc6-c056-4ec2-9238-7f59d35d7d89))
(fp_line (start 1.27 -13.97) (end -1.27 -13.97)
(stroke (width 0.1) (type solid)) (layer "B.Fab") (tstamp a902bd21-8417-4db9-bc83-4e618f7d4885))
(fp_line (start 1.27 1.27) (end 1.27 -13.97)
(stroke (width 0.1) (type solid)) (layer "B.Fab") (tstamp 230002d7-1b9f-4bf2-b6b2-863ebd6eeb25))
(pad "1" thru_hole rect (at 0 0) (size 1.7 1.7) (drill 1) (layers "*.Cu" "*.Mask")
(net 11 "+3.3V") (pinfunction "Pin_1") (pintype "passive") (tstamp 8fb00fe8-7af4-486f-b0f3-37207df52c39))
(pad "2" thru_hole oval (at 0 -2.54) (size 1.7 1.7) (drill 1) (layers "*.Cu" "*.Mask")
(net 7 "SWCLK") (pinfunction "Pin_2") (pintype "passive") (tstamp cd8d0ef1-6918-43da-ac64-4769a49f4ce7))
(pad "3" thru_hole oval (at 0 -5.08) (size 1.7 1.7) (drill 1) (layers "*.Cu" "*.Mask")
(net 1 "GND") (pinfunction "Pin_3") (pintype "passive") (tstamp 4714208d-eb8c-4eea-bb65-47b326e00fe9))
(pad "4" thru_hole oval (at 0 -7.62) (size 1.7 1.7) (drill 1) (layers "*.Cu" "*.Mask")
(net 6 "SWDIO") (pinfunction "Pin_4") (pintype "passive") (tstamp 3907cd01-3ac0-4aa2-887b-8f29d0b104fb))
(pad "5" thru_hole oval (at 0 -10.16) (size 1.7 1.7) (drill 1) (layers "*.Cu" "*.Mask")
(net 2 "NRST") (pinfunction "Pin_5") (pintype "passive") (tstamp 8e567ea1-139e-45c4-96ba-8f86b906f5e2))
(pad "6" thru_hole oval (at 0 -12.7) (size 1.7 1.7) (drill 1) (layers "*.Cu" "*.Mask")
(net 5 "TRACESWO") (pinfunction "Pin_6") (pintype "passive") (tstamp d534ab8f-3f2c-47e6-8131-47cb676db8c9))
(model "${KICAD7_3DMODEL_DIR}/Connector_PinHeader_2.54mm.3dshapes/PinHeader_1x06_P2.54mm_Vertical.step"
(offset (xyz 0 0 0))
(scale (xyz 1 1 1))
(rotate (xyz 0 0 0))
)
)
(gr_circle (center 184 89) (end 184 81.5)
(stroke (width 0.15) (type solid)) (fill none) (layer "F.SilkS") (tstamp 264394aa-7072-46fd-9501-f3b79ba1f186))
(gr_circle (center 195 55) (end 198 54)

View File

@ -1096,6 +1096,10 @@
(effects (font (size 1.27 1.27)) (justify left bottom))
(uuid 6c3a065a-4f38-4c80-89c4-2d4809c15b83)
)
(text "Turns out it was 5V lol" (at 81.28 71.755 0)
(effects (font (size 1.27 1.27)) (justify left bottom))
(uuid 8d4851e0-ce03-4546-ac98-f954e301c2c6)
)
(text "ESD + Transient\nprotection" (at 228.6 96.52 0)
(effects (font (size 1.27 1.27)) (justify left bottom))
(uuid a05b870a-10cb-4ae9-96a8-364bf392cd3c)
@ -1686,7 +1690,7 @@
(property "Reference" "R26" (at 115.57 64.77 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Value" "0" (at 113.03 64.77 0)
(property "Value" "47k" (at 113.03 64.77 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder" (at 114.3 67.818 90)
@ -2015,13 +2019,13 @@
(symbol (lib_id "Connector_Generic:Conn_01x06") (at 76.2 99.06 0) (unit 1)
(in_bom yes) (on_board yes) (dnp no) (fields_autoplaced)
(uuid dbe2a649-f639-40ee-a279-bcfb7f4df9e9)
(property "Reference" "J1" (at 78.74 99.0599 0)
(property "Reference" "J1" (at 78.74 99.695 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Value" "Debug_Connector" (at 78.74 101.5999 0)
(property "Value" "Debug_Connector" (at 78.74 102.235 0)
(effects (font (size 1.27 1.27)) (justify left))
)
(property "Footprint" "Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Horizontal" (at 76.2 99.06 0)
(property "Footprint" "Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical" (at 76.2 99.06 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (at 76.2 99.06 0)