armapi
v1.0
bĂȘta
|
Typedefs | |
typedef enum armError_e | armError_t |
Constant to define the errors. More... | |
typedef enum armBaudrate_e | armBaudrate_t |
Constant to define the baudrate value. More... | |
typedef enum armLed_e | armLed_t |
Constant to define the comportment of the LED. More... | |
typedef enum armMode_e | armMode_t |
Constant to define the working mode. More... | |
typedef enum armType_e | armType_t |
Type of ARM. More... | |
Functions | |
armError_t | armInit (arm_t *arm, void *port) |
Initialize the structure, port and ARM. More... | |
armError_t | armDeInit (arm_t *arm) |
De-initialize the port. More... | |
armError_t | armReboot (arm_t *arm) |
Reboot the ARM. More... | |
armError_t | armInfo (arm_t *arm, armType_t *armType, uint8_t *rev, uint64_t *sn, uint16_t *rfFreq, uint8_t *rfPower) |
Get information about the ARM. More... | |
armError_t | armSetMode (arm_t *arm, armMode_t mode) |
Set the mode. More... | |
armMode_t | armGetMode (arm_t *arm) |
Get the mode. More... | |
armError_t | armSetSerial (arm_t *arm, armPortBaudrate_t baud, armPortDatabits_t databits, armPortParity_t parity, armPortStopbit_t stopbit) |
Setup serial port configuration. More... | |
void | armGetSerial (arm_t *arm, armPortBaudrate_t *baud, armPortDatabits_t *databits, armPortParity_t *parity, armPortStopbit_t *stopbit) |
Get the serial port configuration. More... | |
armError_t | armEnableWakeUpUart (arm_t *arm, bool enable) |
Enable/Disable the Wake Up Uart. More... | |
bool | armIsEnableWakeUpUart (arm_t *arm) |
Get if Wake Up Uart is enable. More... | |
void | armSleep (arm_t *arm, bool sleep) |
Enable/Disable sleep with pin. More... | |
void | armSetLed (arm_t *arm, armLed_t led) |
Set the LED behavior. More... | |
armLed_t | armGetLed (arm_t *arm) |
Get the LED behavior. More... | |
armError_t | armUpdateConfig (arm_t *arm) |
Update the configuration in ARM. More... | |
int | armSend (arm_t *arm, const void *buf, size_t nbyte) |
Send data to ARM. More... | |
int | armReceive (arm_t *arm, void *buf, size_t nbyte, int timeout) |
Receive data from ARM. More... | |
typedef enum armBaudrate_e armBaudrate_t |
Constant to define the baudrate value.
typedef enum armError_e armError_t |
Constant to define the errors.
Constant to define the comportment of the LED.
Constant to define the working mode.
enum armBaudrate_e |
Constant to define the baudrate value.
enum armError_e |
Constant to define the errors.
Enumerator | |
---|---|
ARM_ERR_NONE |
No error. |
ARM_ERR_NO_SUPPORTED |
Functionality no supported by theARM. |
ARM_ERR_PORT_OPEN |
Port Error, at the port opening. |
ARM_ERR_PORT_CONFIG |
Port Error, at the port configuring. |
ARM_ERR_PORT_READ |
Port Error, at the port reading. |
ARM_ERR_PORT_WRITE |
Port Error, at the port writing. |
ARM_ERR_PORT_WRITE_READ |
Port Error, at the port reading/writing. |
ARM_ERR_PORT_CLOSE |
Port Error, at the port closing. |
ARM_ERR_PARAM_OUT_OF_RANGE |
Error, one or more of parameters is out of range. |
ARM_ERR_PARAM_INCOMPATIBLE |
Error, the parameters is incompatible between them. |
ARM_ERR_ADDRESSING_NOT_ENABLE |
Error, the addressing is not enable.
|
ARM_ERR_WOR_ENABLE |
Error, the WOR mode is enable.
|
ARM_ERR_ARM_GO_AT |
ARM commend Error, can't switch to AT commend. |
ARM_ERR_ARM_BACK_AT |
ARM commend Error, can't quit AT commend. |
ARM_ERR_ARM_CMD |
ARM commend Error, from AT commend. |
ARM_ERR_ARM_GET_REG |
ARM commend Error, from get register. |
ARM_ERR_ARM_SET_REG |
ARM commend Error, from set register. |
enum armLed_e |
Constant to define the comportment of the LED.
Enumerator | |
---|---|
ARM_LED_OFF |
The LED is 'off' all the time. |
ARM_LED_OFF_RF |
The LED is 'off' on RF activity and 'on' other time. |
ARM_LED_ON_RF |
The LED is 'on' on RF activity and 'off' other time. |
enum armMode_e |
Constant to define the working mode.
Enumerator | |
---|---|
ARM_MODE_FSK |
Mode for Fsk (local) radio. |
ARM_MODE_SFX |
Mode for Sigfox network. |
ARM_MODE_LORAWAN |
Mode for Lora network (LoRaWan). |
enum armType_e |
Type of ARM.
armError_t armDeInit | ( | arm_t * | arm | ) |
De-initialize the port.
arm | Pointer to your ARM structure. |
armError_t armEnableWakeUpUart | ( | arm_t * | arm, |
bool | enable | ||
) |
Enable/Disable the Wake Up Uart.
This function is supported by:
arm | Pointer to your ARM structure. |
enable | true to enable Wake Up Uart false to disable. |
enable
= false) and the ARMPORT_WITH_nSLEEP is not define and the WOR is enable in ARM_FSK_WOR_CS or ARM_FSK_WOR_PQT.armLed_t armGetLed | ( | arm_t * | arm | ) |
Get the LED behavior.
This function is supported by:
arm | Pointer to your ARM structure. |
armMode_t armGetMode | ( | arm_t * | arm | ) |
Get the mode.
arm | Pointer to your ARM structure. |
void armGetSerial | ( | arm_t * | arm, |
armPortBaudrate_t * | baud, | ||
armPortDatabits_t * | databits, | ||
armPortParity_t * | parity, | ||
armPortStopbit_t * | stopbit | ||
) |
Get the serial port configuration.
This function is supported by:
arm | Pointer to your ARM structure. |
baud | If the pointer is valid, the baud is set. If ARMPORT_BAUDRATE_NONE is set, there is probably a error. |
databits | If the pointer is valid, the databits is set. |
parity | If the pointer is valid, the parity is set. |
stopbit | If the pointer is valid, the stopbit is set. |
armError_t armInfo | ( | arm_t * | arm, |
armType_t * | armType, | ||
uint8_t * | rev, | ||
uint64_t * | sn, | ||
uint16_t * | rfFreq, | ||
uint8_t * | rfPower | ||
) |
Get information about the ARM.
arm | Pointer to your ARM structure. |
armType | If the pointer is valid, The ARM type is set. The possible values is:
|
rev | If the pointer is valid, the firmware version is copied. This parameter must be a string buffer capacity equal or more of 16 bytes. |
sn | If the pointer is valid, the serial number is set. This parameter is the ID Sigfox in the case where the ARM support the Sigfox Network. |
rfFreq | If the pointer is valid, the work frequency of your ARM is set. |
rfPower | If the pointer is valid, the max power supported by your ARM is set. |
armError_t armInit | ( | arm_t * | arm, |
void * | port | ||
) |
Initialize the structure, port and ARM.
This function must be call before call other function depend of the arm_t structure.
arm | Pointer to your ARM structure. |
port | Pointer to something which mean you serial port. |
bool armIsEnableWakeUpUart | ( | arm_t * | arm | ) |
Get if Wake Up Uart is enable.
This function is supported by:
arm | Pointer to your ARM structure. |
armError_t armReboot | ( | arm_t * | arm | ) |
Reboot the ARM.
arm | Pointer to your ARM structure. |
int armReceive | ( | arm_t * | arm, |
void * | buf, | ||
size_t | nbyte, | ||
int | timeout | ||
) |
Receive data from ARM.
This function is exit when the timeout is achieved from the last receive data or if the nbyte
is achieved.
arm | Pointer to your ARM structure. |
buf | The buffer. |
nbyte | The size of buffer. |
timeout | The timeout. |
int armSend | ( | arm_t * | arm, |
const void * | buf, | ||
size_t | nbyte | ||
) |
Send data to ARM.
arm | Pointer to your ARM structure. |
buf | The buffer. |
nbyte | The number of data to send. |
void armSetLed | ( | arm_t * | arm, |
armLed_t | led | ||
) |
Set the LED behavior.
This function is supported by:
arm | Pointer to your ARM structure. |
led | The behavior of the LED:
|
armError_t armSetMode | ( | arm_t * | arm, |
armMode_t | mode | ||
) |
Set the mode.
arm | Pointer to your ARM structure. |
mode | The mode, the possible value:
|
armError_t armSetSerial | ( | arm_t * | arm, |
armPortBaudrate_t | baud, | ||
armPortDatabits_t | databits, | ||
armPortParity_t | parity, | ||
armPortStopbit_t | stopbit | ||
) |
Setup serial port configuration.
This function is supported by:
arm | Pointer to your ARM structure. |
baud | The serial baudrate.
|
databits | The number of data bits:
|
parity | The type of parity:
|
stopbit | The number of stop bits:
|
void armSleep | ( | arm_t * | arm, |
bool | sleep | ||
) |
Enable/Disable sleep with pin.
This function is supported by:
arm | Pointer to your ARM structure. |
sleep | true to enable sleep false to disable. |
armError_t armUpdateConfig | ( | arm_t * | arm | ) |
Update the configuration in ARM.
None of parameters/modes previously configured, is no set in your ARM. This function send/set the necessary registers to apply the previously configuration and reconfigure the port if necessary.
arm | Pointer to your ARM structure. |