<commit_before>/**
 * /file V2X_drivers.h
 *
 * /brief Hardware driver functions for operating the V2X board
 *
 * Author: <NAME> (jbanks2)
 **/

#ifndef V2X_DRIVERS_H_
#define V2X_DRIVERS_H_

#include "V2X_board.h"

/**
 * @def SHIFT_REGISTER_TYPE
 * @brief shift register type, bit length determined by hardware
 */
#if V2X_REV <= REV_12
#define SHIFT_REGISTER_TYPE uint16_t
#elif V2X_REV >= REV_20
#define SHIFT_REGISTER_TYPE uint8_t
#endif

/**
 * @def shift_register_state
 * @brief variable that holds the current power state.
 */
volatile SHIFT_REGISTER_TYPE power_control_state;

/**
 * @def STATE_DEFAULT_VALUE
 * @brief default power state. enables 3v3 only
 */
#if V2X_REV <= REV_12
#define POWER_CONTROL_DEFAULT_VALUE (1<<ENABLE_3V3)|        \
									(0<<ENABLE_3V3B)|       \
									(0<<ENABLE_3V3C)|       \
									(0<<ENABLE_3V3D)|       \
									(0<<ENABLE_4V1)|        \
									(0<<ENABLE_5V0)|        \
									(0<<ENABLE_5V0B)|       \
									(0<<ENABLE_SIM_WAKE)|   \
									(1<<ENABLE_HUB)|        \
									(0<<ENABLE_CAN_SLEEP)|  \
									(0<<ENABLE_CAN_RESET)|  \
									(0<<ENABLE_SIM_PWR_ON)| \
									(0<<ENABLE_SIM_RESET)|  \
									(0<<ENABLE_SIM_RF_OFF)| \
									(0<<ENABLE_SIM_VBUS)|   \
									(0<<ENABLE_FTDI_RESET)
#elif V2X_REV >= REV_20
#define POWER_CONTROL_DEFAULT_VALUE (0<<ENABLE_4V1)|        \
									(0<<ENABLE_5V0)|        \
									(0<<ENABLE_5V0B)|       \
									(0<<ENABLE_CAN_SLEEP)|  \
									(0<<ENABLE_CAN_RESET)|  \
									(0<<ENABLE_SIM_PWR_ON)| \
									(0<<ENABLE_SIM_RESET)|  \
									(0<<ENABLE_SIM_WAKE)
#endif
/**
 * @def shift_register_init
 * @brief	Resets the shift register, then sets to default values
 *			this turns on power supplies to maintain the atmel and other circuits
 *			not very specific yet, all function just turn on.
 **/
void PWR_init(void);

/**
 * @def shift_register_latch
 * @brief	causes the serial data just shifted into the shift register to latch to the outputs
 **/
void PWR_latch(void);

/**
 * @def shift_register_clear
 * @brief Causes the register to latch all outputs to low
 **/
void PWR_clear(void);<commit_msg>Enable 4v for gsm and atmel normal operation<commit_after>/**
 * /file V2X_drivers.h
 *
 * /brief Hardware driver functions for operating the V2X board
 *
 * Author: <NAME> (jbanks2)
 **/

#ifndef V2X_DRIVERS_H_
#define V2X_DRIVERS_H_

#include "V2X_board.h"

/**
 * @def SHIFT_REGISTER_TYPE
 * @brief shift register type, bit length determined by hardware
 */
#if V2X_REV <= REV_12
#define SHIFT_REGISTER_TYPE uint16_t
#elif V2X_REV >= REV_20
#define SHIFT_REGISTER_TYPE uint8_t
#endif

/**
 * @def shift_register_state
 * @brief variable that holds the current power state.
 */
volatile SHIFT_REGISTER_TYPE power_control_state;

/**
 * @def STATE_DEFAULT_VALUE
 * @brief default power state. enables 3v3 only
 */
#if V2X_REV <= REV_12
#define POWER_CONTROL_DEFAULT_VALUE (1<<ENABLE_3V3)|        \
									(0<<ENABLE_3V3B)|       \
									(0<<ENABLE_3V3C)|       \
									(0<<ENABLE_3V3D)|       \
									(0<<ENABLE_4V1)|        \
									(0<<ENABLE_5V0)|        \
									(0<<ENABLE_5V0B)|       \
									(0<<ENABLE_SIM_WAKE)|   \
									(1<<ENABLE_HUB)|        \
									(0<<ENABLE_CAN_SLEEP)|  \
									(0<<ENABLE_CAN_RESET)|  \
									(0<<ENABLE_SIM_PWR_ON)| \
									(0<<ENABLE_SIM_RESET)|  \
									(0<<ENABLE_SIM_RF_OFF)| \
									(0<<ENABLE_SIM_VBUS)|   \
									(0<<ENABLE_FTDI_RESET)
#elif V2X_REV >= REV_20
#define POWER_CONTROL_DEFAULT_VALUE (1<<ENABLE_4V1)|        \
									(0<<ENABLE_5V0)|        \
									(0<<ENABLE_5V0B)|       \
									(0<<ENABLE_CAN_SLEEP)|  \
									(0<<ENABLE_CAN_RESET)|  \
									(0<<ENABLE_SIM_PWR_ON)| \
									(0<<ENABLE_SIM_RESET)|  \
									(0<<ENABLE_SIM_WAKE)
#endif
/**
 * @def shift_register_init
 * @brief	Resets the shift register, then sets to default values
 *			this turns on power supplies to maintain the atmel and other circuits
 *			not very specific yet, all function just turn on.
 **/
void PWR_init(void);

/**
 * @def shift_register_latch
 * @brief	causes the serial data just shifted into the shift register to latch to the outputs
 **/
void PWR_latch(void);

/**
 * @def shift_register_clear
 * @brief Causes the register to latch all outputs to low
 **/
void PWR_clear(void);
{'fraction_non_alphanumeric': 0.12058212058212059, 'fraction_numerical': 0.031185031185031187, 'mean_word_length': 2.6570945945945947, 'pattern_counts': {'":': 0, '<': 105, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '905290', 'n_tokens_mistral': 1972, 'n_tokens_neox': 1572, 'n_words': 348}