#include "ch.h"
#include "hal.h"
#include "bldc.h"
#include "magnetorquer.h"
#include "chprintf.h"
#include "oresat.h"
Go to the source code of this file.
|
enum | can_msg { MSG_TYPE =0,
ARG_BYTE,
ARG_BYTE1,
ARG_BYTE2
} |
| can_msg enumeraton More...
|
|
enum | can_recv { ERROR_CODE = 0,
ACS_STATE,
LAST_EVENT,
LAST_TRAP
} |
| enumeration for the recv buffer More...
|
|
enum | can_msg_type { NOP =0,
CHG_STATE,
CALL_TRAP
} |
| enumeration for CAN message types More...
|
|
enum | acs_state {
ST_ANY =-1,
ST_OFF,
ST_INIT,
ST_RDY,
ST_RW,
ST_MTQR
} |
| enumeration for ACS states More...
|
|
enum | acs_event {
EV_ANY =-1,
EV_OFF,
EV_INIT,
EV_RDY,
EV_RW,
EV_MTQR,
EV_RW_START,
EV_RW_STOP,
EV_RW_STRETCH,
EV_RW_CONTROL,
EV_RW_SKIP,
EV_RW_SCALE,
EV_MTQR_START,
EV_MTQR_STOP,
EV_MTQR_DC,
EV_MTQR_DIR,
EV_END
} |
| enumeration for all the possible events More...
|
|
◆ CAN_BUF_SIZE
◆ CAN_NODE
◆ DEBUG_CHP
◆ DEBUG_SERIAL
◆ EXIT_FAILURE
◆ EXIT_SUCCESS
◆ WA_ACS_THD_SIZE
#define WA_ACS_THD_SIZE (1<<7) |
- Todo:
- : Thread sizes cause continual problems for managing memory if the threads are too small it breaks, if the thread working areas are too large then you run out of memory. One solution is to move to a mcu with more memory.
◆ acs_trap
◆ acs_event
enumeration for all the possible events
- Todo:
- : This is going to change in v2.0 to more accurately reflect how the ACS will operate
hexidecimal values are passed to the ACS via the bus.
Enumerator |
---|
EV_ANY | -1
|
EV_OFF | 0
|
EV_INIT | 1
|
EV_RDY | 2
|
EV_RW | 3
|
EV_MTQR | 4
|
EV_RW_START | 5
|
EV_RW_STOP | 6
|
EV_RW_STRETCH | 7
|
EV_RW_CONTROL | 8
|
EV_RW_SKIP | 9
|
EV_RW_SCALE | a
|
EV_MTQR_START | b
|
EV_MTQR_STOP | c
|
EV_MTQR_DC | d
|
EV_MTQR_DIR | e
|
EV_END | this must be the last event
|
acs_event
enumeration for all the possible events
Definition: acs.h:113
this must be the last event
Definition: acs.h:130
◆ acs_state
enumeration for ACS states
- Todo:
- : This is going to change in v2.0 to more accurately reflect how the ACS will operate
Enumerator |
---|
ST_ANY | |
ST_OFF | |
ST_INIT | |
ST_RDY | |
ST_RW | |
ST_MTQR | |
acs_state
enumeration for ACS states
Definition: acs.h:95
◆ can_msg
can_msg enumeraton
- Todo:
- : This is going to change in v2.0 once a protocol is decided for communication with the ACS
Byte Name Use 0 MSG_TYPE CHG_STATE is the only current implementation 1 ARG_BYTE used for passing arguments 2 ARG_BYTE1 used for passing arguments 3 ARG_BYTE2 used for passing arguments 4 unimplemented 5 unimplemented 6 unimplemented 7 unimplemented
Enumerator |
---|
MSG_TYPE | |
ARG_BYTE | |
ARG_BYTE1 | |
ARG_BYTE2 | |
can_msg
can_msg enumeraton
Definition: acs.h:44
◆ can_msg_type
enumeration for CAN message types
- Todo:
- : This is going to change in v2.0 once a protocol is decided for communication with the ACS
Enumerator |
---|
NOP | |
CHG_STATE | |
CALL_TRAP | |
can_msg_type
enumeration for CAN message types
Definition: acs.h:82
◆ can_recv
enumeration for the recv buffer
- Todo:
- : This is going to change in v2.0 once a protocol is decided for communication with the ACS
Byte Name Use 0 unimplemented 1 STATE current state 2 LAST_EVENT last event received 3 unimplemented 4 unimplemented 5 unimplemented 6 unimplemented 7 unimplemented
Enumerator |
---|
ERROR_CODE | |
ACS_STATE | |
LAST_EVENT | |
LAST_TRAP | |
can_recv
enumeration for the recv buffer
Definition: acs.h:68
◆ acsInit()
general ACS initialization
void mtqrInit(MTQR *mtqr)
Magnetorquer initialization function.
Definition: magnetorquer.c:9
#define EXIT_SUCCESS
Definition: acs.h:24
MTQR mtqr
Definition: acs.h:153
◆ THD_FUNCTION()
THD_FUNCTION |
( |
acsThread |
, |
|
|
acs |
|
|
) |
| |
424 chRegSetThreadName(
"acsThread");
425 chEvtRegister(&rpdo_event,&
el,0);
static int acs_statemachine(ACS *acs)
the ACS state machine
Definition: acs.c:372
ACS acs
Definition: main.c:25
event_listener_t el
Definition: acs.c:3
◆ THD_WORKING_AREA()